View | Details | Raw Unified | Return to bug 41842 | Differences between
and this patch

Collapse All | Expand All

(-)a/branches/ucs-4.1/ucs-4.1-3/management/univention-directory-listener/src/change.c (+3 lines)
 Lines 126-131   static int change_init_module(univention_ldap_parameters_t *lp, Handler *handler Link Here 
126
126
127
	univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_INFO,
127
	univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_INFO,
128
			"module %s for relating objects", handler->name);
128
			"module %s for relating objects", handler->name);
129
	rv = LDAP_SUCCESS;
129
	for (f = handler->filters; !abort_init && f != NULL && *f != NULL; f++) {
130
	for (f = handler->filters; !abort_init && f != NULL && *f != NULL; f++) {
130
		/* When initializing a module, only search for the DNs. If the
131
		/* When initializing a module, only search for the DNs. If the
131
		   entry for a DN is already in our cache, we use that one,
132
		   entry for a DN is already in our cache, we use that one,
 Lines 240-245   int change_new_modules(univention_ldap_parameters_t *lp) Link Here 
240
				handler->state |= HANDLER_INITIALIZED;
240
				handler->state |= HANDLER_INITIALIZED;
241
			else
241
			else
242
				handler->state ^= HANDLER_READY;
242
				handler->state ^= HANDLER_READY;
243
244
			handler_write_state(handler);
243
		}
245
		}
244
	}
246
	}
245
	INIT_ONLY = old_init_only;
247
	INIT_ONLY = old_init_only;
(-)a/branches/ucs-4.1/ucs-4.1-3/management/univention-directory-listener/src/handlers.c (-9 / +15 lines)
 Lines 535-553   static int handlers_load_all_paths(void) Link Here 
535
}
535
}
536
536
537
537
538
/* Free one handler. */
538
void handler_write_state(Handler *handler) {
539
int handler_free(Handler *handler)
540
{
541
	char **a;
542
	struct filter **f;
543
	char state_filename[PATH_MAX];
539
	char state_filename[PATH_MAX];
544
	FILE *state_fp;
540
	FILE *state_fp;
545
	int rv;
541
	int rv;
546
542
547
	if ( handler == NULL || handler->name == NULL ) {
548
		return 0;
549
	}
550
551
	/* write handler state */
543
	/* write handler state */
552
	/* XXX: can be removed, once we use a database for this */
544
	/* XXX: can be removed, once we use a database for this */
553
	rv = snprintf(state_filename, PATH_MAX, "%s/handlers/%s", cache_dir, handler->name);
545
	rv = snprintf(state_filename, PATH_MAX, "%s/handlers/%s", cache_dir, handler->name);
 Lines 560-565   int handler_free(Handler *handler) Link Here 
560
		fprintf(state_fp, "%d", handler->state);
552
		fprintf(state_fp, "%d", handler->state);
561
		fclose(state_fp);
553
		fclose(state_fp);
562
	}
554
	}
555
}
556
557
558
/* Free one handler. */
559
int handler_free(Handler *handler)
560
{
561
	char **a;
562
	struct filter **f;
563
564
	if ( handler == NULL || handler->name == NULL ) {
565
		return 0;
566
	}
567
568
	handler_write_state(handler);
563
569
564
	/* free list node */
570
	/* free list node */
565
	free(handler->name);
571
	free(handler->name);
(-)a/branches/ucs-4.1/ucs-4.1-3/management/univention-directory-listener/src/handlers.h (+1 lines)
 Lines 78-83   struct _Handler { Link Here 
78
78
79
int	handlers_init			(void);
79
int	handlers_init			(void);
80
int	handlers_free_all		(void);
80
int	handlers_free_all		(void);
81
void handler_write_state(Handler *handler);
81
int	handlers_load_path		(char		*filename);
82
int	handlers_load_path		(char		*filename);
82
int	handlers_reload_all_paths	(void);
83
int	handlers_reload_all_paths	(void);
83
int	handlers_update			(const char		*dn,
84
int	handlers_update			(const char		*dn,

Return to bug 41842