diff options
author | Jan Kara <jack@suse.cz> | 2019-08-15 11:19:20 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2019-08-15 11:23:55 +0200 |
commit | 6e631074330aa6ea210b05dae3a2dcf5223b311f (patch) | |
tree | 1caa5f2bf35429aba031f52b513a05f3971b6612 /common.c | |
parent | 1ae10f8692981285ad52af9e9ae3e5f16201b187 (diff) | |
download | linuxquota-6e631074330aa6ea210b05dae3a2dcf5223b311f.tar.gz |
warnquota: Do not ignore errors in config file
Currently warnquota ignores unknown variables, or lines we cannot parse
in the config file. This is potentially dangerous as that may result
in errors being missed and warnquota operating differently than
administrator intended. Change warnquota to abort on errors in config
file and provide -I option for ignoring errors for backward
compatibility.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'common.c')
-rw-r--r-- | common.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -61,17 +61,22 @@ void die(int ret, char *fmtstr, ...) exit(ret); } -void errstr(char *fmtstr, ...) +void errstrv(char *fmtstr, va_list args) { - va_list args; - - va_start(args, fmtstr); if (enable_syslog) do_syslog(LOG_ERR, fmtstr, args); else { fprintf(stderr, "%s: ", progname); vfprintf(stderr, fmtstr, args); } +} + +void errstr(char *fmtstr, ...) +{ + va_list args; + + va_start(args, fmtstr); + errstrv(fmtstr, args); va_end(args); } |