Commit Graph

13 Commits

Author SHA1 Message Date
Todd C. Miller
0f056c0d5f Use timespec throughout. 2004-09-08 15:48:23 +00:00
Todd C. Miller
c0bfcc95c3 Add checks for st_mtim and st_mtimespec and add macros for pulling
the mtime sec and nsec out of struct stat.  These are used in sudo_edit()
to better tell whether or not the file has changed.
2004-09-07 19:57:00 +00:00
Todd C. Miller
7f772c822f Add an extra param to touch() for nsec 2004-09-07 19:55:37 +00:00
Todd C. Miller
707c3c2cb9 Call mkstemp() as the in invoking user so we don't have to chown the file later.
Only touch() the temp file if we can do it via the file descriptor.
Don't check for modification of the temp file if we lack fstat().
Catch errors read()ing the temp file.
2004-09-07 18:06:33 +00:00
Todd C. Miller
47d25da64b closefrom() is overkill, the only extra fds are the ones we opened so
just close those in the child.
2004-09-07 17:31:54 +00:00
Todd C. Miller
1c20ff1a6d Use utimes() and futimes() instead of utime() in touch(), emulating as needed.
Not all systems are able to support setting the times of an fd so touch()
takes both an fd and a file name as arguments.
2004-09-07 17:14:52 +00:00
Todd C. Miller
b701107b4e Keep the temp file open instead of re-opening after the editor has exited. 2004-09-06 16:11:42 +00:00
Todd C. Miller
6acae1b3be Better warning message when sudoedit is unable to write to the
destination file.
2004-08-17 19:11:47 +00:00
Todd C. Miller
21e3ca9cf8 More to a less restrictive, ISC-style license. 2004-02-13 21:36:43 +00:00
Todd C. Miller
4716ea9880 Do not require _PATH_USRTMP to be set. 2004-01-30 00:50:41 +00:00
Todd C. Miller
2af994ada6 Add a comment describing why we need to be notified about our child
stopping.
2004-01-23 00:22:28 +00:00
Todd C. Miller
5ccddf8176 Fix suspending the editor in -e mode. Because we do a fork() first
we need to be notified when the child has been stopped and then send
that same signal to ourself so the shell can do its job control thing.
2004-01-22 02:57:01 +00:00
Todd C. Miller
4dc5700a6d Add a new flag, -e, that makes it possible to give users the ability
to edit files with the editor of their choice as the invoking user,
not the runas user.  Temporary files are used for the actual edit
and the temp file is copied over the original after the editor is done.
2004-01-21 22:25:10 +00:00