su: Fix su - regression

Launch a login shell again if requested through "su -" or "su -l".

Fixes: d9923431eb ("src/: Use xasprintf() instead of its pattern")
Closes: <https://github.com/shadow-maint/shadow/issues/1160>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
This commit is contained in:
Tobias Stoeckmann
2024-12-30 15:12:32 +01:00
committed by Alejandro Colomar
parent e2512d5741
commit e3d051e4a8

View File

@@ -1212,6 +1212,7 @@ int main (int argc, char **argv)
}
xasprintf(&arg0, "-%s", cp);
cp = arg0;
} else {
cp = Basename (shellstr);
}