1
0
forked from bip/bip

Merge jj's patch (debian bug 481488)

This commit is contained in:
Arnaud Cornet 2008-05-31 12:31:30 +02:00
parent d92ffeea09
commit 604eb26ec6
2 changed files with 6 additions and 6 deletions

View File

@ -848,7 +848,9 @@ static int validate_config(bip_t *bip)
}
}
if (strstr(conf_log_format, "%u") == NULL)
hash_it_init(&bip->users, &it);
hash_it_next(&it);
if (hash_it_item(&it) && !strstr(conf_log_format, "%u"))
mylog(LOG_WARN, "log_format does not contain %%u, all users'"
" logs will be mixed !");
return r;

View File

@ -2121,8 +2121,7 @@ void oidentd_dump(bip_t *bip)
char tag_written = 0;
if (stat(bip->oidentdpath, &stats) == -1) {
if (errno == ENOENT) {
f = fopen(bip->oidentdpath, "w+");
if (errno == ENOENT && (f = fopen(bip->oidentdpath, "w+")))
fchmod(fileno(f), 0644);
} else {
mylog(LOG_WARN, "Can't open/create %s",
@ -2130,6 +2129,7 @@ void oidentd_dump(bip_t *bip)
return;
}
} else {
/* strip previously autogenerated content */
char *content;
f = fopen(bip->oidentdpath, "r+");
@ -2141,10 +2141,8 @@ void oidentd_dump(bip_t *bip)
content = (char *)malloc(stats.st_size + 1);
if (content == NULL){
if (content == NULL)
fatal("out of memory");
return;
}
if (fread(content, 1, stats.st_size, f) !=
(size_t)stats.st_size) {