Commit Graph

4863 Commits

Author SHA1 Message Date
Todd C. Miller
dc72c27b1b Use print_error() when displaying ldap config info in debugging mode. 2010-05-03 18:02:19 -04:00
Todd C. Miller
9166c156e6 No longer need strdup() or strndup() replacements. 2010-05-03 17:56:06 -04:00
Todd C. Miller
13966481c7 Add print_error() function that uses the conversation function to
print a variable number of error strings and use it in log_error().
2010-05-03 16:53:05 -04:00
Todd C. Miller
0eda64b235 Do not need the opost flag to term_copy() now that we use pipes for
stdout/stderr when they are not a tty.
2010-05-03 10:41:26 -04:00
Todd C. Miller
dd256f25ca Use pipes to the sudo process if stdout or stderr is not a tty.
Still needs some polishing and a decision as to whether it is
desirable to add additonal entry points for logging stdout/stderr/stdin
when they are not ttys.  That would allow a replay program to keep
things separate and to know whether the terminal needs to be in raw
mode at replay time.
2010-05-03 10:12:54 -04:00
Todd C. Miller
5475020561 Move audit sources into the sudoers plugin dir; the driver does not use them. 2010-04-30 15:38:33 -04:00
Todd C. Miller
d346e50903 Use angle brackets when including headers that can only be found when
an -I flag is specified.  The files in the compat dir could get away
with double quotes here but I've converted all the source files
to use angle brackets for consistency.
2010-04-30 15:13:47 -04:00
Todd C. Miller
1438664047 Add missing -I$(top_srcdir) to CPPFLAGS so includes in the compat dir
can be found when building outside the source tree.
2010-04-30 15:13:15 -04:00
Todd C. Miller
1473d78637 Clean up links in distclean 2010-04-30 13:57:27 -04:00
Todd C. Miller
8cfde4f9db Hack around VPATH semantic differences by symlinking files we need from
../../src into the current directory and build those.  A better fix would
be to either make a .a or .la file with those files in it or simply
use a single, flat, Makefile instead of per-subdirs Makefiles.
2010-04-30 13:53:33 -04:00
Todd C. Miller
23f9bb59ec fmt_string is used by the sudoers plugin too so do not include sudo.h
(which is not really needed here anyway)
2010-04-30 13:40:57 -04:00
Todd C. Miller
5e9ec6a365 Fix building with non-BSD versions of make such as GNU make.
Requires VPATH support, which should be in any non-neolithic make.
2010-04-30 12:18:06 -04:00
Todd C. Miller
f42cf76d8a Re-enable bsm audit. Currently auditing is done within the sudoers
plugin itself.  If possible, this should really be done in the main
driver but we don't presently have the needed data to do that.  This
will be re-evaluated when Linux audit support is added.
2010-04-30 12:01:15 -04:00
Todd C. Miller
0c7e3235f6 Remove extraneous $srcdir and use more .c.lo and .c.o rules instead
of explicit rules in the dependency.
2010-04-30 11:14:31 -04:00
Todd C. Miller
8b832576e4 Fix mismerge; alias_remove_recursive() now returns int 2010-04-30 10:50:56 -04:00
Todd C. Miller
d26d942c22 Fix a crash when checking a sudoers file that has aliases that reference
themselves.  Based on a diff from David Wood.
2010-04-29 18:51:04 -04:00
Todd C. Miller
8fc1ebd4f4 Print signal info after restoring the tty mode, not before. 2010-04-29 16:52:50 -04:00
Todd C. Miller
f45b1e82ed Defer call to alarm() until after we fork the child.
Pass correct pid to terminate_child()
If the command exits due to signal, set alive to false like we do when it
    exits normally.
Add missing check for errpipe[0] != -1 before using it in FD_ISSET
2010-04-29 16:47:27 -04:00
Todd C. Miller
2ee651df79 Use 1/0 instead of TRUE/FALSE so we don't need sudoers.h 2010-04-28 09:56:50 -04:00
Todd C. Miller
935aef4983 Simplify dependencies by using .c.o and .c.lo rules. 2010-04-27 12:06:41 -04:00
Todd C. Miller
1c67169b9d Substitute in @PROGS@ into src/Makefile to add sesh 2010-04-27 11:56:51 -04:00
Todd C. Miller
b0b6b4cf54 Add back calls to log_denial() if sudoers does not allow the command. 2010-04-26 22:10:34 -04:00
Todd C. Miller
e1a9e5aec0 Pass in correct pwflag for list and validate. 2010-04-26 21:53:59 -04:00
Todd C. Miller
ac06e777fa Add missing check for NULL in validate_env_vars 2010-04-26 21:38:43 -04:00
Todd C. Miller
c8733dbc6e Add sudo_noexec.la to "all" target, otherwise it only gets built
at install time.
2010-04-26 21:30:41 -04:00
Todd C. Miller
1abb3b7f57 Only set sudo_user.env_vars if the env_add list is empty. 2010-04-26 21:28:58 -04:00
Todd C. Miller
90f8bf3482 Set sudo_user.env_vars so that environment variables specified on
the command line get logged correctly.
2010-04-26 20:41:28 -04:00
Todd C. Miller
b041c91caf Re-enable environment files and setting environment variables on the
command line.
2010-04-26 17:14:11 -04:00
Todd C. Miller
af092dc406 Fix typo in last commit (ifndef vs ifdef)
Make sure we pass ctime() a pointer to time_t as tv_sec in struct
timeval may be long.
2010-04-24 19:22:52 -04:00
Todd C. Miller
17220f44d6 Don't stash ctime in on-disk tty ticket info for now; on many (most?)
systems the ctime is updated when the tty is written to.  Once I
have a better idea of what systems do not update ctime on ttys (and
have a way to test for this) the ctime stash will be conditionally
re-enabled.
2010-04-24 19:05:11 -04:00
Todd C. Miller
1b6f3fda25 Add back "dist" target, this time using a MANIFEST file 2010-04-23 23:15:31 -04:00
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