Merge jj's patch (debian bug 481488)
This commit is contained in:
parent
d92ffeea09
commit
604eb26ec6
@ -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'"
|
mylog(LOG_WARN, "log_format does not contain %%u, all users'"
|
||||||
" logs will be mixed !");
|
" logs will be mixed !");
|
||||||
return r;
|
return r;
|
||||||
|
@ -2121,8 +2121,7 @@ void oidentd_dump(bip_t *bip)
|
|||||||
char tag_written = 0;
|
char tag_written = 0;
|
||||||
|
|
||||||
if (stat(bip->oidentdpath, &stats) == -1) {
|
if (stat(bip->oidentdpath, &stats) == -1) {
|
||||||
if (errno == ENOENT) {
|
if (errno == ENOENT && (f = fopen(bip->oidentdpath, "w+")))
|
||||||
f = fopen(bip->oidentdpath, "w+");
|
|
||||||
fchmod(fileno(f), 0644);
|
fchmod(fileno(f), 0644);
|
||||||
} else {
|
} else {
|
||||||
mylog(LOG_WARN, "Can't open/create %s",
|
mylog(LOG_WARN, "Can't open/create %s",
|
||||||
@ -2130,6 +2129,7 @@ void oidentd_dump(bip_t *bip)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
/* strip previously autogenerated content */
|
||||||
char *content;
|
char *content;
|
||||||
f = fopen(bip->oidentdpath, "r+");
|
f = fopen(bip->oidentdpath, "r+");
|
||||||
|
|
||||||
@ -2141,10 +2141,8 @@ void oidentd_dump(bip_t *bip)
|
|||||||
|
|
||||||
content = (char *)malloc(stats.st_size + 1);
|
content = (char *)malloc(stats.st_size + 1);
|
||||||
|
|
||||||
if (content == NULL){
|
if (content == NULL)
|
||||||
fatal("out of memory");
|
fatal("out of memory");
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fread(content, 1, stats.st_size, f) !=
|
if (fread(content, 1, stats.st_size, f) !=
|
||||||
(size_t)stats.st_size) {
|
(size_t)stats.st_size) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user