]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/session.c
Add set and reset options to control environment variables for scripts.
[ppp.git] / pppd / session.c
index 491d3bfaac11c79791f5fd3eba2628aa89397a4a..32901a24546f5913b67cdced816f002de9edc6e3 100644 (file)
@@ -73,7 +73,9 @@
 #include <string.h>
 #include <pwd.h>
 #include <crypt.h>
+#ifdef HAS_SHADOW
 #include <shadow.h>
+#endif
 #include <time.h>
 #include <utmp.h>
 #include <fcntl.h>
@@ -372,11 +374,13 @@ session_start(flags, user, passwd, ttyName, msg)
        if (pw != NULL) {
             struct lastlog ll;
             int fd;
+           time_t tnow;
 
             if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) {
                 (void)lseek(fd, (off_t)(pw->pw_uid * sizeof(ll)), SEEK_SET);
                 memset((void *)&ll, 0, sizeof(ll));
-                (void)time(&ll.ll_time);
+               (void)time(&tnow);
+                ll.ll_time = tnow;
                 (void)strncpy(ll.ll_line, ttyName, sizeof(ll.ll_line));
                 (void)strncpy(ll.ll_host, ifname, sizeof(ll.ll_host));
                 (void)write(fd, (char *)&ll, sizeof(ll));