]> andersk Git - openssh.git/blobdiff - login.c
- Fix from Andre Lucas <andre.lucas@dial.pipex.com>
[openssh.git] / login.c
diff --git a/login.c b/login.c
index b2a2ef83717965eae0bca77f39437c9f4157a3fa..bae82c4f45b4be840f38cb0619766ff608fffaf7 100644 (file)
--- a/login.c
+++ b/login.c
@@ -87,6 +87,7 @@ get_last_login_time(uid_t uid, const char *logname,
        return ll.ll_time;
 
 #else /* defined(_PATH_LASTLOG) && !defined(DISABLE_LASTLOG) */
+# ifdef HAVE_TYPE_IN_UTMP
        /* Look in wtmp for the last login */
        struct utmp  wt;
        char        *wt_file = _PATH_WTMP;
@@ -111,14 +112,14 @@ get_last_login_time(uid_t uid, const char *logname,
                if ( wt.ut_type == USER_PROCESS) {
                        if ( !strncmp(logname, wt.ut_user, 8) ) {
                                t = (unsigned long) wt.ut_time;
-#ifdef HAVE_HOST_IN_UTMP
+# ifdef HAVE_HOST_IN_UTMP
                                if (bufsize > sizeof(wt.ut_host) + 1)
                                bufsize = sizeof(wt.ut_host) + 1;
                                strncpy(buf, wt.ut_host, bufsize - 1);
                                buf[bufsize - 1] = 0;
-#else /* HAVE_HOST_IN_UTMP */
+# else /* HAVE_HOST_IN_UTMP */
                                buf[0] = 0;
-#endif /* HAVE_HOST_IN_UTMP */
+# endif /* HAVE_HOST_IN_UTMP */
                        }
                }
 
@@ -127,6 +128,9 @@ get_last_login_time(uid_t uid, const char *logname,
        } while (t == 0);
 
        return t;
+# else
+       return 0;
+# endif /* HAVE_TYPE_IN_UTMP */
 #endif /* defined(_PATH_LASTLOG) && !defined(DISABLE_LASTLOG) */
 }
 
This page took 0.035441 seconds and 4 git commands to generate.