]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su-common.c: prefer ENV_SUPATH over ENV_ROOTPATH
authorStanislav Brabec <sbrabec@suse.cz>
Thu, 10 Jan 2019 00:28:54 +0000 (01:28 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 10 Jan 2019 11:26:38 +0000 (12:26 +0100)
ENV_SUPATH and ENV_ROOTPATH are equivalent and ENV_ROOTPATH takes
precedence in both login and su. It makes no sense. More logical would be
precedence of ENV_SUPATH in su and ENV_ROOTPATH in login.

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

index cb8addec3e477f47bd97b821af3fae32925d5e6e..b73eae147eb7927e5d171cada15dcde289b8c7f4 100644 (file)
@@ -282,7 +282,7 @@ a regular user logs in.  The default value is
 (string)
 .RS 4
 If set, it will be used to define the PATH environment variable when
-the superuser logs in.  The default value is
+the superuser logs in.  ENV_ROOTPATH takes precedence.  The default value is
 .I /usr\:/local\:/sbin:\:/usr\:/local\:/bin:\:/sbin:\:/bin:\:/usr\:/sbin:\:/usr\:/bin
 .RE
 .SH FILES
index bf0d02471a5ab71653b9c3ac331997b575b41868..2216722005804dbeaa4f5f9b41a42e9ac9c85b4d 100644 (file)
@@ -183,7 +183,7 @@ default value is
 .B ENV_SUPATH
 (string)
 .RS 4
-Defines the PATH environment variable for root. The default value is
+Defines the PATH environment variable for root.  ENV_SUPATH takes precedence.  The default value is
 .IR /usr/local/sbin:\:/usr/local/bin:\:/sbin:\:/bin:\:/usr/sbin:\:/usr/bin .
 .RE
 .PP
index 19074247ce09090c491d110a983b104d8a4b0490..0e44eb87cbd662e3f68db2fdfcb426561b4cc32e 100644 (file)
@@ -989,8 +989,8 @@ static void setenv_path(const struct passwd *pw)
        if (pw->pw_uid)
                rc = logindefs_setenv("PATH", "ENV_PATH", _PATH_DEFPATH);
 
-       else if ((rc = logindefs_setenv("PATH", "ENV_ROOTPATH", NULL)) != 0)
-               rc = logindefs_setenv("PATH", "ENV_SUPATH", _PATH_DEFPATH_ROOT);
+       else if ((rc = logindefs_setenv("PATH", "ENV_SUPATH", NULL)) != 0)
+               rc = logindefs_setenv("PATH", "ENV_ROOTPATH", _PATH_DEFPATH_ROOT);
 
        if (rc)
                err(EXIT_FAILURE, _("failed to set the PATH environment variable"));
index d6a064fd2d06f259dbbf8a07448d72f2115e359c..5ae6d6b2dc48ac5a425a9df2992fc0716f7645fb 100644 (file)
@@ -209,7 +209,7 @@ default value is
 .B ENV_SUPATH
 (string)
 .RS 4
-Defines the PATH environment variable for root.  The default value is
+Defines the PATH environment variable for root.  ENV_SUPATH takes precedence.  The default value is
 .IR /usr/local/sbin:\:/usr/local/bin:\:/sbin:\:/bin:\:/usr/sbin:\:/usr/bin .
 .RE
 .PP