]> git.ipfire.org Git - thirdparty/shadow.git/commit
getdef: avoid spurious error messages about unknown configuration options
authorSerge Hallyn <serge@hallyn.com>
Wed, 20 Mar 2024 22:39:46 +0000 (17:39 -0500)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Thu, 21 Mar 2024 05:51:33 +0000 (11:21 +0530)
commitead55e9ba8958504e23e29545f90c4dd925c7462
treec7c10b673cb385acd091a74673519770fa815937
parent000619344ddb01aa2e9aa746583f7c5a52ce56fe
getdef: avoid spurious error messages about unknown configuration options

def_find can return NULL for unset, not just unknown, config options.  So
move the decision of whether to log an error message about an unknown config
option back into def_find, which knows the difference.  Only putdef_str()
will pass a char* srcfile to def_find, so only calls from putdef_str will
cause the message, which was the original intent of fa68441bc4be8.

closes #967

fixes: fa68441bc4be8 ("Improve the login.defs unknown item error message")
Signed-off-by: Serge Hallyn <serge@hallyn.com>
lib/getdef.c