Change /bin/nologin to /sbin/nologin
Tested:
root@romulus:~# ls /sbin/nologin
/sbin/nologin
root@romulus:~# ls /bin/nologin
ls: /bin/nologin: No such file or directory
Signed-off-by: Tang Yiwei <tangyiwei.2022@bytedance.com>
Change-Id: Ic1f74d32230436f9e7e530779357e67b8d7a3464
diff --git a/user_mgr.cpp b/user_mgr.cpp
index 90631ee..aa2fd15 100644
--- a/user_mgr.cpp
+++ b/user_mgr.cpp
@@ -1320,7 +1320,7 @@
// set EXPIRE_DATE to 0 to disable user, PAM takes 0 as expire on
// 1970-01-01, that's an implementation-defined behavior
executeCmd("/usr/sbin/useradd", userName, "-G", groups, "-m", "-N", "-s",
- (sshRequested ? "/bin/sh" : "/bin/nologin"), "-e",
+ (sshRequested ? "/bin/sh" : "/sbin/nologin"), "-e",
(enabled ? "" : "1970-01-01"));
}
@@ -1341,7 +1341,7 @@
bool sshRequested)
{
executeCmd("/usr/sbin/usermod", userName, "-G", newGroups, "-s",
- (sshRequested ? "/bin/sh" : "/bin/nologin"));
+ (sshRequested ? "/bin/sh" : "/sbin/nologin"));
}
void UserMgr::executeUserModifyUserEnable(const char* userName, bool enabled)