shadow-maint / shadow

Upstream shadow tree
Other
290 stars 228 forks source link

shadow 4.15.0 complains about unknown configuration option #967

Closed jubalh closed 4 months ago

jubalh commented 4 months ago

Running useradd we get the following logged:

usermod[2998]: shadow: unknown configuration item 'MOTD_FILE' in '/usr/etc/login.defs'                     
usermod[2998]: shadow: unknown configuration item 'ENV_ROOTPATH' in '/usr/etc/login.defs'                  
usermod[2998]: shadow: unknown configuration item 'ALWAYS_SET_PATH' in '/usr/etc/login.defs'
usermod[2998]: shadow: unknown configuration item 'LOGIN_KEEP_USERNAME' in '/usr/etc   

With 4.14.6 this doesn't happen. Might be related to https://github.com/shadow-maint/shadow/pull/814 / https://github.com/shadow-maint/shadow/commit/fa68441bc4be8edeaad8d104344e987b31ed44e6?

openQA Test.

DimStar77 commented 4 months ago

https://github.com/shadow-maint/shadow/blob/26deef6945a8bd2a36d7fb9d281ee2188cec99c5/lib/getdef.c#L429

This sounds weird in this context

i.e if the entry to be checked is in knowndef_table (combination of PAMDEFS and FOREIGNDEFS) we jump to 'out - then return NULL

putdef_str though takes NULL as 'not found in the table'

        d = def_find (name);
        if (NULL == d) {
                if (NULL != srcfile)
                        SYSLOG ((LOG_CRIT, "shadow: unknown configuration item '%s' in '%s'", name, srcfile));
                return -1;
        }

find_def should likely rather return ptr instead of NULL?

DimStar77 commented 4 months ago

originally introduced here https://github.com/shadow-maint/shadow/commit/71c6165dcd6b808fc1bf11e0dfb3692beb06221c

i.e we already had a log function for (partially) unknown / external util entries.

alejandro-colomar commented 4 months ago

Might be related to #814 / fa68441?

Maybe @hallyn knows.

ikerexxe commented 4 months ago

This issue has also been reported for Fedora. I put it here for the sake of it .

hallyn commented 4 months ago

Hm, the only nuisance I see here is:

useradd: failed to reset the lastlog entry of UID 1003: Success

Still trying to make sense of the unknown configuration message...

hallyn commented 4 months ago

Oh, @DimStar77 , thank you - yes, that's the problem here. That fix was undone. (That's the passive way of saying - I undid it :)