summaryrefslogtreecommitdiff
path: root/libmisc/utmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmisc/utmp.c')
-rw-r--r--libmisc/utmp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libmisc/utmp.c b/libmisc/utmp.c
index 437c3d5..43bac47 100644
--- a/libmisc/utmp.c
+++ b/libmisc/utmp.c
@@ -45,7 +45,7 @@
#include <netdb.h>
#include <stdio.h>
-#ident "$Id: utmp.c 3064 2009-09-07 19:50:00Z nekral-guest $"
+#ident "$Id: utmp.c 3720 2012-05-18 17:57:52Z nekral-guest $"
/*
@@ -129,6 +129,7 @@ static bool is_my_tty (const char *tty)
return ret;
}
+#ifndef USE_PAM
/*
* Some systems already have updwtmp() and possibly updwtmpx(). Others
* don't, so we re-implement these functions if necessary.
@@ -160,6 +161,7 @@ static void updwtmpx (const char *filename, const struct utmpx *utx)
}
#endif /* ! HAVE_UPDWTMPX */
#endif /* ! USE_UTMPX */
+#endif /* ! USE_PAM */
/*
@@ -313,7 +315,10 @@ int setutmp (struct utmp *ut)
}
endutent ();
+#ifndef USE_PAM
+ /* This is done by pam_lastlog */
updwtmp (_WTMP_FILE, ut);
+#endif /* ! USE_PAM */
return err;
}
@@ -446,7 +451,10 @@ int setutmpx (struct utmpx *utx)
}
endutxent ();
+#ifndef USE_PAM
+ /* This is done by pam_lastlog */
updwtmpx (_WTMP_FILE "x", utx);
+#endif /* ! USE_PAM */
return err;
}