Skip to content

Commit 7ade92d

Browse files
committed
clients/authconf.c: handle_authconf_args(): revise logging of parsed lines, especially malfirmed ones [#3329]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 87f8a4c commit 7ade92d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

clients/authconf.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,19 @@ static void handle_authconf_args(size_t numargs, char **arg, int global_scope)
836836
* they were not variable names - and so were not called that. */
837837
var = arg[0];
838838
if (numargs >= 3 && !strcmp(arg[1], "=")) {
839+
upsdebugx(6, "%s: handling line with directive '%s' = '%s'",
840+
__func__, NUT_STRARG(arg[0]), NUT_STRARG(arg[2]));
839841
val = arg[2];
840842
} else if (numargs == 1) {
841843
/* Flag property? */
844+
upsdebugx(5, "%s: line with only directive '%s' did not contain '= ...', "
845+
"assuming this is a numeric flag set to \"1\".",
846+
__func__, NUT_STRARG(arg[0]));
842847
val = "1";
848+
} else {
849+
upslogx(LOG_WARNING, "Malformed line starting with directive '%s' and %"
850+
PRIuSIZE " tokens overall, assuming NULL value assignment",
851+
NUT_STRARG(arg[0]), numargs);
843852
}
844853

845854
if (current_section) {

0 commit comments

Comments
 (0)