if (timestamp_uid != 0)
set_perms(PERM_TIMESTAMP);
- if (touch(-1, timestampfile ? timestampfile : timestampdir, now) == -1) {
+ if (touch(-1, timestampfile ? timestampfile : timestampdir, now, 0) == -1) {
if (timestampfile) {
int fd = open(timestampfile, O_WRONLY|O_CREAT|O_TRUNC, 0600);
remove = FALSE;
}
}
- if (!remove && touch(-1, ts, 0) == -1)
+ if (!remove && touch(-1, ts, 0, 0) == -1)
err(1, "can't reset %s to Epoch", ts);
}
* Update the access and modify times on an fd or file.
*/
int
-touch(fd, path, when)
+touch(fd, path, sec, nsec)
int fd;
char *path;
- time_t when;
+ time_t sec;
+ long nsec;
{
struct timeval times[2];
- times[0].tv_sec = times[1].tv_sec = when;
- times[0].tv_usec = times[1].tv_usec = 0;
+ times[0].tv_sec = times[1].tv_sec = sec;
+ times[0].tv_usec = times[1].tv_usec = nsec;
#if defined(HAVE_FUTIME) || defined(HAVE_FUTIMES)
if (fd != -1)
void dump_auth_methods __P((void));
void init_envtables __P((void));
int lock_file __P((int, int));
-int touch __P((int, char *, time_t));
+int touch __P((int, char *, time_t, long));
int user_is_exempt __P((void));
void set_fqdn __P((void));
int set_runaspw __P((char *));
* file's mtime. It is better than nothing and we only use the info
* to determine whether or not a file has been modified.
*/
- if (touch(tf[i].tfd, NULL, tf[i].omtime) == -1) {
+ if (touch(tf[i].tfd, NULL, tf[i].omtime, 0) == -1) {
if (fstat(tf[i].tfd, &sb) == 0)
tf[i].omtime = sb.st_mtime;
}
write(stmp_fd, buf, 1);
}
- (void) touch(stmp_fd, stmp, sudoers_sb.st_mtime);
+ (void) touch(stmp_fd, stmp, sudoers_sb.st_mtime, 0);
(void) close(stmp_fd);
/* Parse sudoers to pull in editor and env_editor conf values. */