Apply patchs:

ubuntu/sulogin-fallback-static-sh.patch
 Description: Add support for /bin/static-sh as fallback if the regular shell fails to execute
 Author: Michael Vogt <michael.vogt@ubuntu.com>
ubuntu/sulogin-lockedpwd.patch
 Description: Make sure file systems can be fixed on machines with locked root accounts (as Ubuntu does by default). Don't require --force for sulogin.
 Author: Martin Pitt <martin.pitt@ubuntu.com>
This commit is contained in:
su-fang 2023-02-17 15:17:10 +08:00
parent bf0879f473
commit 580580aaf1
2 changed files with 13 additions and 1 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
util-linux (2.38.1-ok2) yangtze; urgency=medium
* Apply patchs.
-- sufang <sufang@kylinos.cn> Fri, 17 Feb 2023 15:16:15 +0800
util-linux (2.38.1-ok1) yangtze; urgency=medium
* Update upstream version.

View File

@ -866,6 +866,11 @@ static void sushell(struct passwd *pwd)
xsetenv("SHELL", "/bin/sh", 1);
execl("/bin/sh", profile ? "-sh" : "sh", (char *)NULL);
warn(_("failed to execute %s"), "/bin/sh");
/* Fall back to static shell */
setenv("SHELL", "/bin/static-sh", 1);
execl("/bin/static-sh", profile ? "-sh" : "sh", (char *)NULL);
warn(_("failed to execute %s"), "/bin/static-sh");
}
static void usage(void)
@ -1052,7 +1057,8 @@ int main(int argc, char **argv)
const char *passwd = pwd->pw_passwd;
char *answer;
int doshell = 0;
int deny = !opt_e && locked_account_password(pwd->pw_passwd);
/* Ubuntu's root account is locked by default allow access without --force */
int deny = 0;
doprompt(passwd, con, deny);