|
|
| version 1.1.1.2, 2012/05/29 12:26:49 | version 1.1.1.3, 2012/10/09 09:29:52 |
|---|---|
| Line 53 | Line 53 |
| # include <ttyent.h> | # include <ttyent.h> |
| #endif | #endif |
| #include <fcntl.h> | #include <fcntl.h> |
| #include <signal.h> | |
| #include "sudo.h" | #include "sudo.h" |
| #include "sudo_exec.h" | #include "sudo_exec.h" |
| Line 327 utmp_login(const char *from_line, const char *to_line, | Line 328 utmp_login(const char *from_line, const char *to_line, |
| } | } |
| } | } |
| utmp_fill(to_line, user, ut_old, &utbuf); | utmp_fill(to_line, user, ut_old, &utbuf); |
| #ifdef HAVE_FSEEKO | |
| if (fseeko(fp, slot * (off_t)sizeof(utbuf), SEEK_SET) == 0) { | |
| #else | |
| if (fseek(fp, slot * (long)sizeof(utbuf), SEEK_SET) == 0) { | if (fseek(fp, slot * (long)sizeof(utbuf), SEEK_SET) == 0) { |
| #endif | |
| if (fwrite(&utbuf, sizeof(utbuf), 1, fp) == 1) | if (fwrite(&utbuf, sizeof(utbuf), 1, fp) == 1) |
| rval = true; | rval = true; |
| } | } |
| Line 360 utmp_logout(const char *line, int status) | Line 365 utmp_logout(const char *line, int status) |
| # endif | # endif |
| utmp_settime(&utbuf); | utmp_settime(&utbuf); |
| /* Back up and overwrite record. */ | /* Back up and overwrite record. */ |
| #ifdef HAVE_FSEEKO | |
| if (fseeko(fp, (off_t)0 - (off_t)sizeof(utbuf), SEEK_CUR) == 0) { | |
| #else | |
| if (fseek(fp, 0L - (long)sizeof(utbuf), SEEK_CUR) == 0) { | if (fseek(fp, 0L - (long)sizeof(utbuf), SEEK_CUR) == 0) { |
| #endif | |
| if (fwrite(&utbuf, sizeof(utbuf), 1, fp) == 1) | if (fwrite(&utbuf, sizeof(utbuf), 1, fp) == 1) |
| rval = true; | rval = true; |
| } | } |