Commit Graph

5482 Commits

Author SHA1 Message Date
Todd C. Miller
6b63751082 Remove Makefile in distclean target 2010-04-23 22:57:03 -04:00
Todd C. Miller
03536ca93e Update clean and cleandir targets 2010-04-23 22:55:34 -04:00
Todd C. Miller
4b04e875ed Move fileops.c defines and prototypes to filesops.h 2010-04-23 06:02:39 -04:00
Todd C. Miller
f7f9def5ef Lock the tty timestamp when writing. We shouldn't have to lock when
reading since the file is updated via a single write system call.
2010-04-23 05:56:24 -04:00
Todd C. Miller
05ae3ea6cb Convert to ANSI C function declarations 2010-04-22 18:09:53 -04:00
Todd C. Miller
c17d3e061d Remove extraneous bits and classify by source file. 2010-04-22 17:40:01 -04:00
Todd C. Miller
2bc52eb394 Add timercmp macro for systems without it 2010-04-22 10:37:20 -04:00
Todd C. Miller
6a27866c30 get_boottime() now fills in a timeval struct 2010-04-22 10:33:16 -04:00
Todd C. Miller
7d6941a820 Store info from stat(2)ing the tty in the tty ticket when tty tickets
are in use.  On most systems, this closes the loophole whereby a user
can log out of a tty, log back in and still have the timestamp be valid.
2010-04-22 10:16:18 -04:00
Todd C. Miller
f19ffcc6b7 Add timespec2timeval and use it when getting ctime/mtime 2010-04-22 09:52:26 -04:00
Todd C. Miller
1bb9f62143 Convert perm setting to push/pop model; still needs some work
Use the stashed runas groups instead of using getgrouplist()
Reset perms to the initial value on error
2010-04-20 17:00:31 -04:00
Todd C. Miller
ab00ce995b fix ctim_get and mtim_get macros 2010-04-20 16:57:07 -04:00
Todd C. Miller
b4a26b7691 Use timeval directly instead of converting to timespec when dealing
with file times and time of day.
2010-04-20 16:44:02 -04:00
Todd C. Miller
0a3a849ef4 Don't like sudoreplay with libsudoers.la due to a yacc symbol conflict. 2010-04-20 16:37:41 -04:00
Todd C. Miller
c47ab0273a Darwin >= 9.x has real setreuid(2) 2010-04-18 12:42:52 -04:00
Todd C. Miller
257133328d Ansify env.c 2010-04-17 13:28:36 -04:00
Todd C. Miller
0df204052f Remove remaining references to the environ pointer. 2010-04-17 13:26:03 -04:00
Todd C. Miller
b71844daf7 Don't change the environ directly in the sudoers plugin 2010-04-16 07:56:16 -04:00
Todd C. Miller
9f0b8f7aae Fix typo 2010-04-15 06:29:31 -04:00
Todd C. Miller
399aa0d5c7 Fix use after free in error message when a duplicate alias exists. 2010-04-15 06:14:41 -04:00
Todd C. Miller
bc813db528 Add a "noninteractive" boolean to the settings passed in to the plugin's
open function that is set when the user specifies the -n flag.
2010-04-14 08:41:53 -04:00
Todd C. Miller
fb87c040cc Add workaround for the lack of the environ pointer on Mac OS X
in dlopen()ed modules.  Use of environ in the sudoers plugin should
ultimately be removed but this will do for the moment.
2010-04-14 06:38:32 -04:00
Todd C. Miller
2b7f0ca955 Set errorfile to the sudoers path if we set parse_error manually.
This prevents a NULL dereference in printf() when checking a sudoers
file in strict mode when alias errors are present.
2010-04-14 06:24:42 -04:00
Todd C. Miller
6aecf3fb15 Main sudo no longer print "unable to execute" on exec failure so do it here. 2010-04-14 05:51:11 -04:00
Todd C. Miller
ea523b17a4 Use a pipe to pass back errno to the parent if execve() fails.
If we get an error in script_child(), kill the command and exit.
2010-04-13 19:40:32 -04:00
Todd C. Miller
f19be6da31 Handle plugin's open function returning -2 (usage error). 2010-04-13 09:36:43 -04:00
Todd C. Miller
40533f381e If execve() fails, leave it to the plugin to print an error string. 2010-04-13 07:39:06 -04:00
Todd C. Miller
e472e4ae01 If execve fails in logging mode, pass the errno directly to the grandparent
on the backchannel and exit.  The immediate parent will get SIGCHLD and
try to report that status but its parent will no longer be listening.
It would probably be cleaner to pass this over a pipe in script_child().
2010-04-13 06:31:55 -04:00
Todd C. Miller
f321a85815 Don't override rval with results of check_user() unless it failed. 2010-04-13 05:53:03 -04:00
Todd C. Miller
fa2f5f53d7 Fix typo 2010-04-12 11:29:40 -04:00
Todd C. Miller
7ce802792e NULL-terminate env_add 2010-04-12 07:56:32 -04:00
Todd C. Miller
0494774f30 Call the I/O log open function before the I/O version function. 2010-04-11 17:13:11 -04:00
Todd C. Miller
7c344181da Remove io_conv and just use sudo_conv 2010-04-11 17:12:12 -04:00
Todd C. Miller
0d2524e68e Fix set/restore perms for systems w/o setresuid 2010-04-11 16:38:42 -04:00
Todd C. Miller
744eae82e7 Primitive set/restore permissions. Will be replaced by a push/pop
model.
2010-04-10 10:34:37 -04:00
Todd C. Miller
711b8d1c04 Only need to take action on SIGCHLD in parent if no I/O logger.
If there is an I/O logger we will receive ECONNRESET or EPIPE when
we try to read from the socketpair.
2010-04-10 10:31:47 -04:00
Todd C. Miller
32672c1f1a Merge fb4d571495fa from the 1.7 branch to trunk. 2010-04-09 06:18:43 -04:00
Todd C. Miller
96fdf201f0 Qualify the command even if it is in the current working directory,
e.g. "./foo" instead of just returning "foo".  This removes an ambiguity
between real commands and possible pseudo-commands in command matching.

--HG--
branch : 1.7
2010-04-09 06:10:07 -04:00
Todd C. Miller
93126eb5ab Don't set SA_RESTART when registering SIGALRM handler.
Do set SA_RESTART when registering SIGWINCH handler.
2010-04-08 20:17:26 -04:00
Todd C. Miller
7ebcbf1027 Add dev targets for *.man.in and *.cat that don't specfify the $(srcdir)
prefix.
2010-04-08 20:08:30 -04:00
Todd C. Miller
b457f13718 If log_input or log_output returns false, terminate the command. 2010-04-08 09:40:27 -04:00
Todd C. Miller
5b3d150932 Better signal handling.
Instead of using a single variable to store the received signal, use
an array so we can't lose a signal when multiple are sent.
Fix process termination by SIGALRM in non-I/O logger mode.
Fix relaying terminal signals to the child in non-I/O logger mode.
2010-04-08 07:40:04 -04:00
Todd C. Miller
a3f4278388 Fix a race between when we get the child pid in the parent and when
the child process exits.  The problem exhibited as a hang after a
short-lived process, e.g. "sudo id" when no IO logger was enabled.
2010-04-08 06:12:47 -04:00
Todd C. Miller
29f22dba2d Add a note about the security implications of the fast_glob option. 2010-04-07 10:09:31 -04:00
Todd C. Miller
99f3be056a Add a note about the security implications of the fast_glob option.
--HG--
branch : 1.7
2010-04-07 09:34:41 -04:00
Todd C. Miller
348fb62191 Remove duplicate includes
--HG--
branch : 1.7
2010-04-07 06:39:35 -04:00
Todd C. Miller
6a5ea5be01 Fix up some AC_DEFINE descriptions and regen config.h.in 2010-04-06 04:53:42 -04:00
Todd C. Miller
5770391ec4 No longer check for strdup or strndup for LIBOBJ replacement. 2010-04-05 19:47:49 -04:00
Todd C. Miller
2634cf08cc Avoid installing signal handlers that are io-logger specific. Fixes
job control when no io logger is enabled.
2010-04-05 16:27:30 -04:00
Todd C. Miller
81819d0c09 Only regen man pages from pod when configured with --with-devel 2010-04-05 12:24:12 -04:00