log_assert(cfg);
/* daemonize last to be able to print error to user */
- if(cfg->directory && cfg->directory[0])
+ if(cfg->directory && cfg->directory[0]) {
if(chdir(cfg->directory)) {
fatal_exit("Could not chdir to %s: %s",
cfg->directory, strerror(errno));
}
+ verbose(VERB_DETAIL, "chdir to %s", cfg->directory);
+ }
if(cfg->username && cfg->username[0]) {
struct passwd *pwd;
if((pwd = getpwnam(cfg->username)) == NULL)
if(setuid(pwd->pw_uid) != 0)
fatal_exit("unable to set user id: %s", strerror(errno));
endpwent();
+ verbose(VERB_DETAIL, "drop user privileges, run as %s",
+ cfg->username);
}
- if(cfg->chrootdir && cfg->chrootdir[0])
+ if(cfg->chrootdir && cfg->chrootdir[0]) {
if(chroot(cfg->chrootdir))
fatal_exit("unable to chroot to %s: %s",
cfg->chrootdir, strerror(errno));
+ verbose(VERB_DETAIL, "chroot to %s", cfg->chrootdir);
+ }
/* check old pid file before forking */
if(cfg->pidfile && cfg->pidfile[0]) {
checkoldpid(cfg);
dealloc during deinit.
- Fixup of chroot call. Happens after privileges are dropped, so
that checking the passwd entry still works.
+ - minor touch up of clear() hashtable function.
+ - VERB_DETAIL prints out what chdir, username, chroot is being done.
31 October 2007: Wouter
- cache-max-ttl config option.
lruhash_clear(struct lruhash* table)
{
size_t i;
- log_assert(fptr_whitelist_hash_delkeyfunc(table->delkeyfunc));
- log_assert(fptr_whitelist_hash_deldatafunc(table->deldatafunc));
if(!table)
return;
+ log_assert(fptr_whitelist_hash_delkeyfunc(table->delkeyfunc));
+ log_assert(fptr_whitelist_hash_deldatafunc(table->deldatafunc));
lock_quick_lock(&table->lock);
for(i=0; i<table->size; i++) {
* If is_locked is not set, then this item is not locked. This allows the
* routine to perform operations within the critical region of the lock
* of the key. The critical region has been locked before the delete happened.
+ * The RRset type has to revoke its ID number inside the critical region.
* This function is called: func(key, userarg, is_locked) */
typedef void (*lruhash_delkeyfunc_t)(void*, void*, int);