Commit Graph

4461 Commits

Author SHA1 Message Date
Todd C. Miller
c8fc35b0a6 Add timeradd and timersub for those without them 2009-09-03 23:53:06 +00:00
Todd C. Miller
c1fe4492f4 Sanity check sessid before using it. 2009-09-03 23:27:24 +00:00
Todd C. Miller
f80fa34e74 Only set the session id if we are running a command or editing a file. 2009-09-03 23:26:05 +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
9329149032 Install sudoreplay 2009-09-01 20:03:07 +00:00
Todd C. Miller
f798228a7f remove unused variable 2009-09-01 19:53:41 +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
5181d496c4 Add sudoreplay docs 2009-08-30 14:56:18 +00:00
Todd C. Miller
7ae1dae376 add -V (version) flag 2009-08-30 14:50:51 +00:00
Todd C. Miller
5dd8fe2fee Hook up max_wait. 2009-08-30 14:11:04 +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
6ae9dae82a Add check for regcomp 2009-08-23 23:52:23 +00:00
Todd C. Miller
9efd18b1bb Add support for selecting by pattern and tty when listing. 2009-08-23 13:33:26 +00:00
Todd C. Miller
30cfb7160e The beginnings of a list mode. 2009-08-17 14:17:08 +00:00
Todd C. Miller
051eab7507 fix pasto 2009-08-16 15:16:04 +00:00
Todd C. Miller
7a00c5257c Add scaffolding for building sudoreplay 2009-08-16 15:13:31 +00:00
Todd C. Miller
20ad41f4d8 include error.h
first arg to nanotime is const
2009-08-16 15:12:16 +00:00
Todd C. Miller
e4be175113 Initial cut at sudoreplay; replay a sudo session. 2009-08-16 14:58:13 +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
0ab5c31ee0 Add protos for term_* to sudo.h 2009-08-08 12:56:02 +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
834e817fa4 Add UNIX98 pty support. 2009-08-08 00:29:30 +00:00
Todd C. Miller
c3c6c299e3 Add UNIX98 pty support. 2009-08-08 00:26:13 +00:00
Todd C. Miller
92dcfa8963 For raw mode, don't bother clearing BRKINT or PARMRK and clear IUCLC
if it is defined.
2009-08-07 21:06:54 +00:00
Todd C. Miller
3bc3a2e85a Set PAM_RUSER and PAM_RHOST early so they can be used during authentication.
Based on a patch from Jamie Beverly.
2009-08-07 14:21:51 +00:00
Todd C. Miller
fde79c46fb Close dir before returning if strlcpy() reports overflow.
From Martynas Venckus.
2009-08-07 13:25:22 +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
b3458ec09c Add checks for revoke and vhangup if we don't have openpty 2009-08-06 15:53:21 +00:00
Todd C. Miller
ee45ce4db5 Session logging guts that got forgotten in the previous commit. 2009-08-06 15:51:12 +00:00
Todd C. Miller
3bfce30a85 First cut at session logging for sudo. Still need to write get_pty()
for Unix 98 and old-style BSD ptys.  Also needs documentation and
general cleanup.
2009-08-06 00:04:14 +00:00
Todd C. Miller
334c19a405 Fix a bug introduced with def_closefrom. The value of def_closefrom
already includes the +1.
2009-08-05 23:59:21 +00:00
Todd C. Miller
477f895ecf Generate sudo distributions with pax in ustar mode. No longer need
to use a temp file or have the source dir name match the version.
2009-07-29 22:16:44 +00:00
Todd C. Miller
b8ca82fee6 Fix expansion of %h in #include names. Fixes bugzilla 363 2009-07-18 13:55:37 +00:00
Todd C. Miller
51e292a474 If no arg assume def_data.in 2009-07-12 21:17:13 +00:00
Todd C. Miller
2b80daae94 Update for 1.7.2 2009-07-12 01:27:03 +00:00
Todd C. Miller
dd52fff169 sync 2009-07-12 01:12:29 +00:00
Todd C. Miller
0d73e19242 Add missing single quotes around a colon in Runas_Spec definition.
From Elias Benali.
2009-06-30 12:41:09 +00:00
Todd C. Miller
29ca853907 regen 2009-06-29 13:36:42 +00:00
Todd C. Miller
02dd5d998d In rbrepair, re-color the root or the first non-block node we find to
be black.  Re-coloring the root is probably not needed but won't hurt.
2009-06-29 13:36:20 +00:00
Todd C. Miller
4764730f79 regen 2009-06-29 13:35:21 +00:00
Todd C. Miller
ca2e911263 When repairing the tree, don't touch the root node. 2009-06-26 20:40:17 +00:00
Todd C. Miller
4e0200a33a Protect call to setegid in runas_setup with #ifdef HAVE_SETEUID.
Reported by Josef Schmid.
2009-06-25 12:44:33 +00:00
Todd C. Miller
b2189fede3 Document that we accept env_pam-style environment files 2009-06-23 18:29:02 +00:00
Todd C. Miller
0c669eda2e Adapt to accept pam_env-style /etc/environment which allows shell-style
lines such as: export EDITOR="/usr/bin/vi"
2009-06-23 18:24:42 +00:00
Todd C. Miller
8f16434679 Make it clear that env_delete only works when !env_reset.
From Loïc Minier
2009-06-23 16:22:48 +00:00
Todd C. Miller
d2efb0a55a Add non-unix group bits, adapted from Quest 2009-06-15 21:19:47 +00:00