1
0
forked from bip/bip

Handle no defined users

This commit is contained in:
Pierre-Louis Bonicoli 2017-03-01 14:14:35 +01:00 committed by Pierre-Louis Bonicoli
parent 903a88e589
commit dbe19d9387
Signed by untrusted user: pilou
GPG Key ID: ADC2651DDACD3538

View File

@ -881,11 +881,18 @@ static int validate_config(bip_t *bip)
}
}
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 !");
if (!strstr(conf_log_format, "%u")) {
hash_it_init(&bip->users, &it);
if (hash_it_item(&it)) {
// hash contains at least one element
hash_it_next(&it);
if (hash_it_item(&it)) {
// hash contains at least two elements
mylog(LOG_WARN, "log_format does not contain %%u, all users'"
" logs will be mixed !");
}
}
}
return r;
}