]> andersk Git - gssapi-openssh.git/blobdiff - openssh/loginrec.c
Add server-side GSSAPIDelegateCredentials option, enabled for use with
[gssapi-openssh.git] / openssh / loginrec.c
index 1805f3ee836ec1f67f543c5687fda0cd801b6364..87c336df082200b7fbdee95c88529858528617b9 100644 (file)
@@ -701,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;
@@ -712,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
@@ -942,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
This page took 0.035526 seconds and 4 git commands to generate.