]> git.pld-linux.org Git - packages/util-linux.git/blobdiff - util-linux-login.patch
- as-needed fix: link with both -lncurses -ltinfo
[packages/util-linux.git] / util-linux-login.patch
index 455852bb2193c5d4810ec1dafb1009010282ba1a..5f2810b81f0ba99440124baab14c6d16a7091562 100644 (file)
@@ -1,17 +1,7 @@
---- util-linux-2.10l/lib/pathnames.h.wiget     Wed Apr 26 20:17:29 2000
-+++ util-linux-2.10l/lib/pathnames.h   Wed Apr 26 20:17:29 2000
-@@ -105,7 +105,7 @@
- #define SECURETTY             "/etc/securetty"
- #define _PATH_UTMP            "/var/run/utmpx"
- #define _PATH_WTMP            LOGDIR "/wtmpx"
--#define _PATH_WTMPLOCK                "/var/log/wtmpxlock"
-+#define _PATH_WTMPLOCK                "/var/lock/wtmpxlock"
- /* no more . in DEFPATH */
- #define       _PATH_DEFPATH           "/usr/local/bin:/bin:/usr/bin"
---- util-linux-2.10l/login-utils/login.c.wiget Tue Mar 21 00:18:38 2000
-+++ util-linux-2.10l/login-utils/login.c       Wed Apr 26 20:22:32 2000
-@@ -154,7 +154,7 @@
+diff -urN util-linux-2.11d.org/login-utils/login.c util-linux-2.11d/login-utils/login.c
+--- util-linux-2.11d.org/login-utils/login.c   Sun May 20 22:27:44 2001
++++ util-linux-2.11d/login-utils/login.c       Sun Jun  3 21:49:55 2001
+@@ -156,7 +156,7 @@
  
  #define SLEEP_EXIT_TIMEOUT 5
  
  #define DO_PS_FIDDLING
  #endif
  
-@@ -300,6 +300,40 @@
-     return 0;
- }
-+#if USE_PAM
-+#define       _PATH_BTMPX     "/var/log/btmpx"
-+static void logbtmp(const char *line, const char *username, const char *hostname)
-+{
-+      struct utmp ut;
-+
-+      memset(&ut, 0, sizeof(ut));
-+
-+      strncpy(ut.ut_user, username, sizeof(ut.ut_user));
-+
-+      strncpy(ut.ut_id, line + 3, sizeof(ut.ut_id));
-+      strncpy(ut.ut_line, line, sizeof(ut.ut_line));
-+      ut.ut_line[sizeof(ut.ut_line)-1] = 0;
-+
-+#if defined(_HAVE_UT_TV)
-+      gettimeofday(&ut.ut_tv, NULL);
-+#else
-+      time(&t) ;
-+      ut.ut_time = t;         /* ut_time is not always a time_t */
-+#endif
-+
-+      ut.ut_type = LOGIN_PROCESS;     /* XXX doesn't matter */
-+      ut.ut_pid = getpid();
-+      if (hostname) {
-+          strncpy(ut.ut_host, hostname, sizeof(ut.ut_host));
-+          ut.ut_host[sizeof(ut.ut_host)-1] = 0;
-+          if (hostaddress.h_addr_list)
-+            memcpy(&ut.ut_addr, hostaddress.h_addr_list[0],
-+                   sizeof(ut.ut_addr));
-+      }
-+      
-+      updwtmp(_PATH_BTMPX, &ut);
-+}
-+#endif        /* USE_PAM */
- int
- main(int argc, char **argv)
-@@ -485,8 +519,6 @@
-     else
-       tty = ttyn;
+@@ -515,8 +515,6 @@
+       tcsetattr(0,TCSAFLUSH,&tt);
+     }
  
 -    openlog("login", LOG_ODELAY, LOG_AUTHPRIV);
 -
  #if 0
      /* other than iso-8859-1 */
      printf("\033(K");
-@@ -555,7 +587,8 @@
-              (retcode == PAM_AUTHINFO_UNAVAIL))) {
-           pam_get_item(pamh, PAM_USER, (const void **) &username);
-           syslog(LOG_NOTICE,_("FAILED LOGIN %d FROM %s FOR %s, %s"),
--          failcount, hostname, username, pam_strerror(pamh, retcode));
-+              failcount, hostname, username, pam_strerror(pamh, retcode));
-+          logbtmp(ttyn + 5, username, hostname);
-           fprintf(stderr,_("Login incorrect\n\n"));
-           pam_set_item(pamh,PAM_USER,NULL);
-           retcode = pam_authenticate(pamh, 0);
-@@ -564,13 +597,16 @@
-       if (retcode != PAM_SUCCESS) {
-           pam_get_item(pamh, PAM_USER, (const void **) &username);
--          if (retcode == PAM_MAXTRIES) 
-+          if (retcode == PAM_MAXTRIES) {
-               syslog(LOG_NOTICE,_("TOO MANY LOGIN TRIES (%d) FROM %s FOR "
-                       "%s, %s"), failcount, hostname, username,
-                        pam_strerror(pamh, retcode));
--          else
-+              logbtmp(ttyn + 5, username, hostname);
-+          } else {
-               syslog(LOG_NOTICE,_("FAILED LOGIN SESSION FROM %s FOR %s, %s"),
-                       hostname, username, pam_strerror(pamh, retcode));
-+              logbtmp(ttyn + 5, username, hostname);
-+          }
-           fprintf(stderr,_("\nLogin incorrect\n"));
-           pam_end(pamh, retcode);
-@@ -600,8 +636,12 @@
-     retcode = pam_open_session(pamh, 0);
+@@ -646,8 +644,12 @@
+     retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED);
      PAM_FAIL_CHECK;
  
 +    openlog("login", LOG_ODELAY, LOG_AUTHPRIV);
      for (cnt = 0;; ask = 1) {
  #  ifndef __linux__
        ioctlval = 0;
-@@ -880,7 +920,9 @@
+@@ -866,7 +868,9 @@
        /* If we can't find a pre-existing entry by pid, try by line.
           BSD network daemons may rely on this. (anonymous) */
        if (utp == NULL) {
 +          setutent();
 +          memset(&ut, 0, sizeof(ut));
             ut.ut_type = LOGIN_PROCESS;
-            strncpy(ut.ut_id, ttyn + 8, sizeof(ut.ut_id));
-            strncpy(ut.ut_line, ttyn + 5, sizeof(ut.ut_line));
-@@ -1127,6 +1169,8 @@
+            strncpy(ut.ut_id, tty_number, sizeof(ut.ut_id));
+            strncpy(ut.ut_line, tty_name, sizeof(ut.ut_line));
+@@ -1103,6 +1107,8 @@
  #endif
      signal(SIGINT, SIG_DFL);
      
This page took 0.056449 seconds and 4 git commands to generate.