]> andersk Git - gssapi-openssh.git/blobdiff - openssh/loginrec.c
update patch version
[gssapi-openssh.git] / openssh / loginrec.c
index 0c4ceddc1d9e40831cc485872337f267bd1e67f8..87c336df082200b7fbdee95c88529858528617b9 100644 (file)
@@ -564,11 +564,6 @@ line_abbrevname(char *dst, const char *src, int dstsize)
        if (strncmp(src, "/dev/", 5) == 0)
                src += 5;
 
-#ifdef WITH_ABBREV_NO_TTY
-       if (strncmp(src, "tty", 3) == 0)
-               src += 3;
-#endif
-
        len = strlen(src);
 
        if (len > 0) {
@@ -622,13 +617,13 @@ construct_utmp(struct logininfo *li,
        switch (li->type) {
        case LTYPE_LOGIN:
                ut->ut_type = USER_PROCESS;
-#ifdef _UNICOS
+#ifdef _CRAY
                cray_set_tmpdir(ut);
 #endif
                break;
        case LTYPE_LOGOUT:
                ut->ut_type = DEAD_PROCESS;
-#ifdef _UNICOS
+#ifdef _CRAY
                cray_retain_utmp(ut, li->pid);
 #endif
                break;
@@ -706,8 +701,6 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
        line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line));
        set_utmpx_time(li, utx);
        utx->ut_pid = li->pid;
-       /* strncpy(): Don't necessarily want null termination */
-       strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
 
        if (li->type == LTYPE_LOGOUT)
                return;
@@ -717,6 +710,8 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
         * for logouts.
         */
 
+       /* strncpy(): Don't necessarily want null termination */
+       strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
 # ifdef HAVE_HOST_IN_UTMPX
        strncpy(utx->ut_host, li->hostname, MIN_SIZEOF(utx->ut_host, li->hostname));
 # endif
@@ -947,7 +942,9 @@ utmpx_perform_logout(struct logininfo *li)
 {
        struct utmpx utx;
 
-       construct_utmpx(li, &utx);
+       memset(&utx, '\0', sizeof(utx));
+       set_utmpx_time(li, &utx);
+       line_stripname(utx.ut_line, li->line, sizeof(utx.ut_line));
 # ifdef HAVE_ID_IN_UTMPX
        line_abbrevname(utx.ut_id, li->line, sizeof(utx.ut_id));
 # endif
@@ -1249,7 +1246,7 @@ wtmpx_get_entry(struct logininfo *li)
        }
        if (fstat(fd, &st) != 0) {
                log("wtmpx_get_entry: couldn't stat %s: %s",
-                   WTMPX_FILE, strerror(errno));
+                   WTMP_FILE, strerror(errno));
                close(fd);
                return 0;
        }
@@ -1271,7 +1268,6 @@ wtmpx_get_entry(struct logininfo *li)
                /* Logouts are recorded as a blank username on a particular line.
                 * So, we just need to find the username in struct utmpx */
                if ( wtmpx_islogin(li, &utx) ) {
-                       found = 1;
 # ifdef HAVE_TV_IN_UTMPX
                        li->tv_sec = utx.ut_tv.tv_sec;
 # else
This page took 0.038978 seconds and 4 git commands to generate.