]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
su: Fix su - regression
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 30 Dec 2024 14:12:32 +0000 (15:12 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 31 Dec 2024 18:06:00 +0000 (19:06 +0100)
Launch a login shell again if requested through "su -" or "su -l".

Fixes: d9923431eb38 ("src/: Use xasprintf() instead of its pattern")
Closes: <https://github.com/shadow-maint/shadow/issues/1160>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
src/su.c

index b90b6f40053bde17084f116ba1ca84088d6c0b56..7b3c9b04ace51495ebea4c2abf1383f7406be973 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -1212,6 +1212,7 @@ int main (int argc, char **argv)
                }
 
                xasprintf(&arg0, "-%s", cp);
+               cp = arg0;
        } else {
                cp = Basename (shellstr);
        }