Commit Graph

18 Commits

Author SHA1 Message Date
Todd C. Miller
798867ed27 Refactor code to update output and timing files. 2009-09-18 00:32:32 +00:00
Todd C. Miller
74844b1787 When flushing remaining output, also update timing file. 2009-09-17 10:14:01 +00:00
Todd C. Miller
88a063b047 Create session dir earlier now that we update the seq number early. 2009-09-17 09:54:33 +00:00
Todd C. Miller
a418f78117 Log the cwd in the script log file.
Add sudo_getln() to read arbitrarily long lines.
2009-09-16 11:49:40 +00:00
Todd C. Miller
10fa87dfa8 Remove vhangup as it was hanging up the wrong tty. Should really
vhangup in the child after it as set its tty.
2009-09-07 15:07:48 +00:00
Todd C. Miller
c1fe4492f4 Sanity check sessid before using it. 2009-09-03 23:27:24 +00:00
Todd C. Miller
568c99b099 Actually. qsort is fine since most versions fal back to a cheaper
sort when the number of elements to sort is small (like in our case).
2009-09-03 13:21:43 +00:00
Todd C. Miller
2935e2a5ba Check for dup2 and use dup instead if we don't have it. 2009-09-03 11:28:07 +00:00
Todd C. Miller
c57b8bb7b3 Move the code to dup2 the script fds to low numbered descriptors into
script_duplow() and fix the fd sorting.
2009-09-03 10:36:02 +00:00
Todd C. Miller
ad9ab8dab2 Move script_setup() back to immediately before we drop privs and
call the new script_nextid() in its place, which will set
sudo_user.sessid for the logging functions.
2009-09-03 10:21:18 +00:00
Todd C. Miller
6184eb9461 Log the session ID, if there is one. Currently logs ID=XXXXXX, perhaps
should be SESSIONID or SESSID.
2009-08-30 15:18:50 +00:00
Todd C. Miller
b9f38b2aca Use base36 number for the ID and store script files with paths like
/var/log/sudo-session/00/00/00{,.tim,.scr}.
This gives us 36^6 (2,176,782,336) unique IDs.
2009-08-30 11:22:53 +00:00
Todd C. Miller
946ea4c970 Fix wait() usage and use correct wait status. 2009-08-08 20:00:17 +00:00
Todd C. Miller
40a21a6c75 Fix detection of the child process exiting. Since the child is in
its own session we should only ever get SIGCHLD for that process but
better safe than sorry.
2009-08-08 12:55:43 +00:00
Todd C. Miller
c3c6c299e3 Add UNIX98 pty support. 2009-08-08 00:26:13 +00:00
Todd C. Miller
ee20527bf0 On Linux, the openpty proto libes in pty.h 2009-08-07 13:23:07 +00:00
Todd C. Miller
51793254ed Call vhangup on exit if the system has it
Use setpgrp() if no setsid()
2009-08-07 13:09:09 +00:00
Todd C. Miller
ee45ce4db5 Session logging guts that got forgotten in the previous commit. 2009-08-06 15:51:12 +00:00