]> andersk Git - openssh.git/blobdiff - loginrec.c
[configure.ac] Make sure -lcrypto is before -lsocket for sco3. ok mouring@
[openssh.git] / loginrec.c
index 8e45de7fa11536b4a190226fa30a40913ab62161..d975443f000c33960c856233b0eaca29b94e935c 100644 (file)
@@ -442,7 +442,7 @@ login_write (struct logininfo *li)
 int
 login_utmp_only(struct logininfo *li)
 {
-       li->type = LTYPE_LOGIN; 
+       li->type = LTYPE_LOGIN;
        login_set_current_time(li);
 # ifdef USE_UTMP
        utmp_write_entry(li);
@@ -837,7 +837,7 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
                }
 
                (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
-               if (atomicio(write, fd, ut, sizeof(*ut)) != sizeof(*ut))
+               if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut))
                        logit("utmp_write_direct: error writing %s: %s",
                            UTMP_FILE, strerror(errno));
 
@@ -1026,7 +1026,7 @@ wtmp_write(struct logininfo *li, struct utmp *ut)
                return 0;
        }
        if (fstat(fd, &buf) == 0)
-               if (atomicio(write, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
+               if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
                        ftruncate(fd, buf.st_size);
                        logit("wtmp_write: problem writing %s: %s",
                            WTMP_FILE, strerror(errno));
@@ -1183,6 +1183,7 @@ wtmp_get_entry(struct logininfo *li)
 static int
 wtmpx_write(struct logininfo *li, struct utmpx *utx)
 {
+#ifndef HAVE_UPDWTMPX
        struct stat buf;
        int fd, ret = 1;
 
@@ -1193,7 +1194,7 @@ wtmpx_write(struct logininfo *li, struct utmpx *utx)
        }
 
        if (fstat(fd, &buf) == 0)
-               if (atomicio(write, fd, utx, sizeof(*utx)) != sizeof(*utx)) {
+               if (atomicio(vwrite, fd, utx, sizeof(*utx)) != sizeof(*utx)) {
                        ftruncate(fd, buf.st_size);
                        logit("wtmpx_write: problem writing %s: %s",
                            WTMPX_FILE, strerror(errno));
@@ -1202,6 +1203,10 @@ wtmpx_write(struct logininfo *li, struct utmpx *utx)
        (void)close(fd);
 
        return ret;
+#else
+       updwtmpx(WTMPX_FILE, utx);
+       return 1;
+#endif
 }
 
 
@@ -1482,7 +1487,7 @@ lastlog_perform_login(struct logininfo *li)
                return(0);
 
        /* write the entry */
-       if (atomicio(write, fd, &last, sizeof(last)) != sizeof(last)) {
+       if (atomicio(vwrite, fd, &last, sizeof(last)) != sizeof(last)) {
                close(fd);
                logit("lastlog_write_filemode: Error writing to %s: %s",
                    LASTLOG_FILE, strerror(errno));
@@ -1534,7 +1539,7 @@ lastlog_get_entry(struct logininfo *li)
                lastlog_populate_entry(li, &last);
                return (1);
        case -1:
-               error("%s: Error reading from %s: %s", __func__, 
+               error("%s: Error reading from %s: %s", __func__,
                    LASTLOG_FILE, strerror(errno));
                return (0);
        default:
This page took 0.03667 seconds and 4 git commands to generate.