summary refs log tree commit diff
diff options
context:
space:
mode:
authorLain Iwakura <lain@iwakurahome.ru>2025-10-15 14:53:55 +0300
committerLain Iwakura <lain@iwakurahome.ru>2025-10-15 14:53:55 +0300
commit5d8b53f2201bb69b66d67041cdf87c0e95d74c0a (patch)
tree78a9890d00c6be0eae42ed50f785cea37106be6f
parentmeow (diff)
downloadno_login-5d8b53f2201bb69b66d67041cdf87c0e95d74c0a.tar.gz
no_login-5d8b53f2201bb69b66d67041cdf87c0e95d74c0a.zip
little patch HEAD master
-rw-r--r--no_shell.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/no_shell.c b/no_shell.c
index a06c10a..a4c2052 100644
--- a/no_shell.c
+++ b/no_shell.c
@@ -21,13 +21,24 @@ int main(void) {
     char choice = 0;
     scanf(" %c", &choice);
 
-    openlog("no_shell", LOG_PID | LOG_NDELAY, LOG_AUTH);
+    openlog("no_shell", LOG_PID | LOG_NDELAY, LOG_AUTHPRIV);
     syslog(LOG_NOTICE, "login attempt for %s", username);
     closelog();
 
     if (choice == 'y' || choice == 'Y') {
         printf("\nStarting password change for %s...\n\n", username);
         fflush(stdout);
+        setenv("PATH", "/usr/bin:/bin", 1);
+        unsetenv("IFS");
+        unsetenv("LD_PRELOAD");
+        unsetenv("LD_LIBRARY_PATH");
+        unsetenv("LD_AUDIT");
+        unsetenv("LD_DEBUG");
+        unsetenv("LD_ORIGIN_PATH");
+        unsetenv("LD_PROFILE");
+        unsetenv("LD_USE_LOAD_BIAS");
+        unsetenv("DYLD_INSERT_LIBRARIES");
+        unsetenv("DYLD_LIBRARY_PATH");
         execl("/usr/bin/passwd", "passwd", username, (char *)NULL);
         perror("execl");
         exit(1);