[hackers] [ubase][PATCH 1/4] su: simplify logic

2024-02-12 Thread neeshy
Inline dologin, and simplify common code --- su.c | 69 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/su.c b/su.c index 329238f..bc7a94f 100644 --- a/su.c +++ b/su.c @@ -18,28 +18,6 @@ extern char **environ; static int

[hackers] [ubase][PATCH 2/4] su: fix setting argv0

2024-02-12 Thread neeshy
argv0 was being set to the user's login shell even when -p was specified. Only populate newargv once the shell is properly determined. --- su.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/su.c b/su.c index bc7a94f..812aa43 100644 --- a/su.c +++ b/su.c @@ -76,9 +7

[hackers] [ubase][PATCH 4/4] su: don't set $PATH

2024-02-12 Thread neeshy
Just /bin is too restrictive, and login shells set the path anyway via the default profile. Also, carrying the path over for non-login shells conforms to the behavior of util-linux's su. --- config.def.h | 1 - su.c | 5 - 2 files changed, 6 deletions(-) diff --git a/config.def.h b/co

[hackers] [ubase][PATCH 3/4] su: check $SHELL for validity

2024-02-12 Thread neeshy
If $SHELL isn't defined in the environment, the call to execve will fail when -p is specified. Fallback to the user's login shell if $SHELL is invalid. --- su.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/su.c b/su.c index 812aa43..4fc3c04 100644 --- a/su.c +++ b/su.c

[hackers] [ubase][PATCH 1/4] su: simplify logic

2024-02-12 Thread neeshy
Inline dologin, and simplify common code --- su.c | 69 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/su.c b/su.c index 329238f..bc7a94f 100644 --- a/su.c +++ b/su.c @@ -18,28 +18,6 @@ extern char **environ; static int

[hackers] [ubase][PATCH 3/4] su: check $SHELL for validity

2024-02-12 Thread neeshy
If $SHELL isn't defined in the environment, the call to execve will fail when -p is specified. Fallback to the user's login shell if $SHELL is invalid. --- su.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/su.c b/su.c index 812aa43..4fc3c04 100644 --- a/su.c +++ b/su.c