Commit Graph

234 Commits

Author SHA1 Message Date
Todd C. Miller
62b89f9dfc Update copyright years. 2009-05-25 12:02:42 +00:00
Todd C. Miller
f54b69b0cc Replace version.h with PACKAGE_VERSION set via AC_INIT in configure. 2009-05-19 21:24:05 +00:00
Todd C. Miller
3be603aa47 Implement #includedir directive. Files in an includedir are not edited
by visudo unless they contain a syntax error.
2009-04-18 23:25:08 +00:00
Todd C. Miller
68ab808acb Rewind stream if we fdopen sudoers since it may not be at the beginning.
Set the keepopen flag on already-open files too so the lexer doesn't
close them out from under us.
2009-04-16 12:22:04 +00:00
Todd C. Miller
c7c8554cf3 Print the proper file name when there is a parse error in an include
file.
2009-04-16 12:18:10 +00:00
Todd C. Miller
d9708f9c27 Store aliases that we remove during check_aliases in a freelist and
free them at the end so we don't leak memory.
2009-04-05 16:25:04 +00:00
Todd C. Miller
9703224b8e Check aliases in -c mode too. 2009-03-28 13:30:15 +00:00
Todd C. Miller
7bf7af9414 Make alias_remove return the alias struct instead of freeing it directly.
Fixes a use after free in alias_remove_recursive, the only consumer.
2009-03-28 13:09:51 +00:00
Todd C. Miller
0656629980 Rename find_alias -> alias_find for consistency. 2009-03-28 13:07:17 +00:00
Todd C. Miller
b65831d4b8 When checking for unused aliases, recurse if the alias points to
another alias.
2009-03-27 23:29:06 +00:00
Todd C. Miller
0d7f771778 Implement %h escape in sudoers include filenames. 2009-02-21 21:49:19 +00:00
Todd C. Miller
c1a62bf88c When checking for alias use, also check defaults bindings. 2008-11-22 15:12:26 +00:00
Todd C. Miller
4ed7837195 malloc options in devel mode for visudo too 2008-11-19 12:37:05 +00:00
Todd C. Miller
d27ceff8ea fix check_aliases 2008-11-18 15:50:53 +00:00
Todd C. Miller
235dc7ad0e check sudoers owner and mode in strict mode 2008-11-09 20:19:19 +00:00
Todd C. Miller
840acbd3ac Update copyright years. 2008-11-09 14:13:13 +00:00
Todd C. Miller
f201db90f3 Move update_defaults into defaults.c and call it properly from
visudo and testsudoers.
2008-11-02 19:06:37 +00:00
Todd C. Miller
4afceb8e92 Zero out sigaction_t before use in case it has non-standard entries. 2008-11-02 14:45:31 +00:00
Todd C. Miller
8ba6fa2ae3 Defer setting runas defaults until after runaspw/gr is setup. 2008-11-01 13:20:01 +00:00
Todd C. Miller
5756ddfbeb Change how the mailer is waited for. Instead of having a SIGCHLD
handler, use the double fork trick to orphan the child that opens
the pipe to sendmail.  Fixes a problem running su on some Linux distros.
2008-06-21 00:34:47 +00:00
Todd C. Miller
4590132478 use warningx instead of fprintf(stderr, ...) 2008-03-06 17:43:30 +00:00
Todd C. Miller
6c1ef6839c g/c set_runaspw stub 2008-01-15 14:17:31 +00:00
Todd C. Miller
3008bb494a move update_defaults() to parse.c 2007-12-31 12:54:47 +00:00
Todd C. Miller
f9f4aca556 Add support for runas groups. This allows the user to run a command
with a different effective group.  If the -g option is specified
without -u the command will be run as the current user (only the
group will change).  the -g and -u options may be used together.
TODO: implement runas group for ldap
      improve runas group documentation
      add testsudoers support
2007-11-21 20:12:00 +00:00
Todd C. Miller
87dc0bb2ea Add missing sudo_setpwent() and sudo_setgrent() calls. Also
use sudo_getpwuid() instead of getpwuid().
2007-11-21 16:02:30 +00:00
Todd C. Miller
a0f80d6581 rename lh_ -> tq_ 2007-09-11 19:42:48 +00:00
Todd C. Miller
dee39f572f If -f flag given use the permissions of the original file as a template 2007-09-01 13:34:41 +00:00
Todd C. Miller
19fa259480 Remove support for compilers that don't support void * 2007-08-31 23:30:07 +00:00
Todd C. Miller
d72778832c Move list manipulation macros to list.h and create C versions of
the more complex ones in list.c.  The names have been down-cased
so they appear more like normal functions.
2007-08-31 23:13:26 +00:00
Todd C. Miller
d1dbe2ecee Change list head macros to take a pointer, not a struct. 2007-08-31 01:12:50 +00:00
Todd C. Miller
8cdea0b941 Use a list head struct when storing the semi-circular lists and
convert to tail queues in the process.  This will allow us to
reverse foreach loops more easily and it makes it clearer which
functions expect a list as opposed to a single member.

Add macros for manipulating lists.  Some of these should become functions.

When freeing up a list, just pop off the last item in the queue instead
of going from head to tail.  This is simpler since we don't have to
stash a pointer to the next member, we always just use the last one
in the queue until the queue is empty.

Rename match functions that take a list to have list in the name.
Break cmnd_matches() into cmnd_matches() and cmndlist_matches.
2007-08-30 17:26:35 +00:00
Todd C. Miller
5cd49e1e00 Sort SYNOPSIS and sync usage. From Igor Sobrado. 2007-07-22 19:20:42 +00:00
Todd C. Miller
db084676e5 Remove an duplicate lock_file() call and add a comment. 2007-06-16 11:31:56 +00:00
Todd C. Miller
2d282cd226 cleanup() now takes an int as an arg so it can be used as a signal
handler too.
2005-11-18 01:39:59 +00:00
Todd C. Miller
0b3b32ab9a Close all fd's before executing editor. 2005-11-11 22:19:53 +00:00
Todd C. Miller
2566e6b7d8 Move declatation of struct timespec to its own include files for
systems without it since it needs time_t defined.
2005-06-23 03:04:35 +00:00
Todd C. Miller
304dc46d7f Add efree() for consistency with emalloc() et al. Allows us to rely
on C89 behavior (free(NULL) is valid) even on K&R.
2005-03-29 14:29:47 +00:00
Todd C. Miller
d4b7457596 make print_unused static like proto says 2005-03-10 14:57:17 +00:00
Todd C. Miller
778d587063 Update copyright years. 2005-02-12 22:56:07 +00:00
Todd C. Miller
3b8b88407f Add __unused to rcsids 2005-01-27 15:42:30 +00:00
Todd C. Miller
0ab0ad2441 Remove sudo_*{pw,gr}* stubs and add sudo_setspent/sudo_endspent stubs instead.
We can now just use the caching sudo_*{pw,gr}* functions in pwutil.c
Add comment about wanting to call sudo_endpwent/sudo_endgrent in cleanup()
2005-01-05 19:46:39 +00:00
Todd C. Miller
a5d9296d25 Adapt to pwutil.c 2005-01-05 01:10:16 +00:00
Todd C. Miller
a58012cfff Only check group vector in usergr_matches() if we are matching the
invoking or list user.  Always check the group members, even if
there was a group vector.
2005-01-01 17:41:21 +00:00
Todd C. Miller
7d488657f0 Use TIME_WITH_SYS_TIME 2004-12-03 18:52:28 +00:00
Todd C. Miller
33db4b2edb Add check for 2-argument form of timespecsub (FreeBSD and BSD/OS) and
fix a typo in the gettimeofday check.
2004-11-25 17:09:31 +00:00
Todd C. Miller
fe869025c4 Add support for command-specific Defaults entries. E.g.
Defaults!/usr/bin/vi noexec
2004-11-19 21:35:12 +00:00
Todd C. Miller
2c2daa8eca Use: #include <config.h>
Not: #include "config.h"
That way we get the correct config.h when build dir != src dir
2004-11-19 18:39:14 +00:00
Todd C. Miller
6a78b91949 Make arg splitting in visudo and sudoedit consistent. 2004-11-19 17:55:14 +00:00
Todd C. Miller
3f9ee04fbb quit() should not be __noreturn__ as it is non-void on some platforms. 2004-11-19 17:30:22 +00:00
Todd C. Miller
75ad6b81a2 Add support for VISUAL and EDITOR containing command line args.
If env_editor is not set any args in VISUAL and EDITOR are ignored.
Arguments are also now supported in def_editor.
2004-11-18 20:28:53 +00:00