[Pkg-shadow-commits] r2742 - in upstream/trunk: . src
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Wed Apr 22 20:03:26 UTC 2009
Author: nekral-guest
Date: 2009-04-22 20:03:26 +0000 (Wed, 22 Apr 2009)
New Revision: 2742
Modified:
upstream/trunk/ChangeLog
upstream/trunk/src/login.c
Log:
* src/login.c: Removed temp_shell. No more used.
* src/login.c: lastlog is only used #ifndef USE_PAM
* src/login.c: Rename lastlog to ll to avoid name clash with the
lastlog type.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2009-04-22 19:58:39 UTC (rev 2741)
+++ upstream/trunk/ChangeLog 2009-04-22 20:03:26 UTC (rev 2742)
@@ -1,5 +1,12 @@
2009-04-22 Nicolas François <nicolas.francois at centraliens.net>
+ * src/login.c: Removed temp_shell. No more used.
+ * src/login.c: lastlog is only used #ifndef USE_PAM
+ * src/login.c: Rename lastlog to ll to avoid name clash with the
+ lastlog type.
+
+2009-04-22 Nicolas François <nicolas.francois at centraliens.net>
+
* src/login.c: Added update_utmp() to group the prepare_utmp and
setutmp (and the utmpx versions).
Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c 2009-04-22 19:58:39 UTC (rev 2741)
+++ upstream/trunk/src/login.c 2009-04-22 20:03:26 UTC (rev 2742)
@@ -36,7 +36,9 @@
#include <errno.h>
#include <grp.h>
+#ifndef USE_PAM
#include <lastlog.h>
+#endif /* !USE_PAM */
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
@@ -66,12 +68,14 @@
#endif /* USE_PAM */
+#ifndef USE_PAM
/*
* Needed for MkLinux DR1/2/2.1 - J.
*/
#ifndef LASTLOG_FILE
#define LASTLOG_FILE "/var/log/lastlog"
#endif
+#endif /* !USE_PAM */
/*
* Global variables
@@ -82,7 +86,9 @@
static char *username = NULL;
static int reason = PW_LOGIN;
-struct lastlog lastlog;
+#ifndef USE_PAM
+static struct lastlog ll;
+#endif /* !USE_PAM */
static bool pflg = false;
static bool fflg = false;
@@ -509,9 +515,6 @@
char fromhost[512];
struct passwd *pwd = NULL;
char **envp = environ;
-#ifndef USE_PAM
- static char temp_shell[] = "/bin/sh";
-#endif
const char *failent_user;
struct utmp *utent;
@@ -1113,7 +1116,7 @@
#ifndef USE_PAM /* pam_lastlog handles this */
if (getdef_bool ("LASTLOG_ENAB")) { /* give last login and log this one */
- dolastlog (&lastlog, pwd, tty, hostname);
+ dolastlog (&ll, pwd, tty, hostname);
}
#endif
@@ -1242,24 +1245,23 @@
}
}
if ( getdef_bool ("LASTLOG_ENAB")
- && (lastlog.ll_time != 0)) {
- time_t ll_time = lastlog.ll_time;
+ && (ll.ll_time != 0)) {
+ time_t ll_time = ll.ll_time;
#ifdef HAVE_STRFTIME
strftime (ptime, sizeof (ptime),
"%a %b %e %H:%M:%S %z %Y",
localtime (&ll_time));
printf (_("Last login: %s on %s"),
- ptime, lastlog.ll_line);
+ ptime, ll.ll_line);
#else
printf (_("Last login: %.19s on %s"),
- ctime (&ll_time), lastlog.ll_line);
+ ctime (&ll_time), ll.ll_line);
#endif
#ifdef HAVE_LL_HOST /* __linux__ || SUN4 */
- if ('\0' != lastlog.ll_host[0]) {
+ if ('\0' != ll.ll_host[0]) {
printf (_(" from %.*s"),
- (int) sizeof lastlog.
- ll_host, lastlog.ll_host);
+ (int) sizeof ll.ll_host, ll.ll_host);
}
#endif
printf (".\n");
More information about the Pkg-shadow-commits
mailing list