]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su-common.c: prefer /etc/default/su over login.defs
authorStanislav Brabec <sbrabec@suse.cz>
Thu, 10 Jan 2019 00:28:53 +0000 (01:28 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 10 Jan 2019 11:26:38 +0000 (12:26 +0100)
su(1) documentation says:
       /etc/default/su  command specific logindef config file
       /etc/login.defs  global logindef config file

It indirectly indicates that /etc/default/su should take precedence
over /etc/login.defs.

But the reverse is true. It is not possible to define ENV_PATH in
/etc/login.defs and then make su specific customization in
/etc/default/su. We need to change read order to match the documented
behavior.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
login-utils/su-common.c

index e0604e246d8f4a7ca72415ee2275b602f08f2d27..19074247ce09090c491d110a983b104d8a4b0490 100644 (file)
@@ -1229,8 +1229,8 @@ static void load_config(void *data)
        struct su_context *su = (struct su_context *) data;
 
        DBG(MISC, ul_debug("loading logindefs"));
-       logindefs_load_file(su->runuser ? _PATH_LOGINDEFS_RUNUSER : _PATH_LOGINDEFS_SU);
        logindefs_load_file(_PATH_LOGINDEFS);
+       logindefs_load_file(su->runuser ? _PATH_LOGINDEFS_RUNUSER : _PATH_LOGINDEFS_SU);
 }
 
 /*