[hackers] [ubase] If we are preserving the environment use SHELL instead of pw->pw_shell || sin

From: <git_AT_suckless.org>
Date: Fri, 18 Oct 2013 17:23:27 +0200

commit bfb4b38cffed5cebe1617386befae7a5980df87c
Author: sin <sin_AT_2f30.org>
Date: Fri Oct 18 16:22:24 2013 +0100

    If we are preserving the environment use SHELL instead of pw->pw_shell

diff --git a/su.c b/su.c
index 1218a13..94ead18 100644
--- a/su.c
+++ b/su.c
_AT_@ -112,7 +112,8 @@ main(int argc, char **argv)
                                 setenv("LOGNAME", pw->pw_name, 1);
                         }
                 }
- execve(pw->pw_shell, newargv, environ);
+ execve(pflag ? getenv("SHELL") : pw->pw_shell,
+ newargv, environ);
         }
         return (errno == ENOENT) ? 127 : 126;
 }
Received on Fri Oct 18 2013 - 17:23:27 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 18 2013 - 17:24:15 CEST