]> git.ipfire.org Git - thirdparty/shadow.git/commit
getdef: avoid spurious error messages about unknown configuration options 2024-03-20/fix-logindefs-unknown-error 976/head
authorSerge Hallyn <serge@hallyn.com>
Wed, 20 Mar 2024 22:39:46 +0000 (17:39 -0500)
committerSerge Hallyn <serge@hallyn.com>
Wed, 20 Mar 2024 22:39:46 +0000 (17:39 -0500)
commit47b7e5eea7d16b50838a8901cee2b16219834adf
treecef7908399a81f1f3d14066f20a5ec50179d81d5
parent51a0d94a08920a2d3edc52919692cdbd25f07d6d
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