Todd C. Miller [Sun, 2 Dec 2007 17:13:48 +0000 (17:13 +0000)]
Add passprompt_override flag to sudoers that will cause the prompt
to be overridden in all cases. This flag is also set when the
user specifies the -p flag.
Todd C. Miller [Sat, 1 Dec 2007 16:22:25 +0000 (16:22 +0000)]
Add basic support for looking up the string "Password: " in the PAM
localized text db. This allows us to determine whether the PAM
prompt is the default "Password: " one even if it has been localized.
TODO: concatenate non-std PAM prompts and user-specified sudo prompts.
Todd C. Miller [Sun, 25 Nov 2007 13:07:21 +0000 (13:07 +0000)]
Set aux group vector for PERM_RUNAS and restore group vector for
PERM_ROOT if we previously changed it. Stash the runas group vector
so we don't have to call initgroups more than once. Also add no-op
check to check_perms.
Todd C. Miller [Wed, 21 Nov 2007 20:12:00 +0000 (20:12 +0000)]
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
Todd C. Miller [Wed, 17 Oct 2007 15:37:30 +0000 (15:37 +0000)]
Instead of defining a macro to call the appropriate method for
turning on/off echo, just define tc[gs]etattr() and the related
defines that use the correct terminal ioctls if needed.
Also go back to using TCSAFLUSH instead of TCSADRAIN on all but QNX.
Todd C. Miller [Mon, 8 Oct 2007 12:41:08 +0000 (12:41 +0000)]
Avoid printing the prompt if we are already backgrounded.
E.g. if the user runs "sudo foo &" from the shell. In this
case, the call to tcsetattr() will cause SIGTTOU to be delivered.
Todd C. Miller [Sat, 15 Sep 2007 11:24:54 +0000 (11:24 +0000)]
Add a sequence number in the aliases for loop detection. If we find
an alias with the seqno already set to the current (global) value we
know we've visited it before so ignore it.
Todd C. Miller [Mon, 10 Sep 2007 21:32:53 +0000 (21:32 +0000)]
pull in inttypes.h for SIZE_MAX; we avoid stdint.h since inttypes.h predates the final C99 spec and the standard specifies that it shall include stdint.h anyway
Todd C. Miller [Fri, 31 Aug 2007 23:13:26 +0000 (23:13 +0000)]
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.
Todd C. Miller [Fri, 31 Aug 2007 01:21:26 +0000 (01:21 +0000)]
Use LH_FOREACH_REV when checking permission and short-circuit on
the first non-UNSPEC hit we get for the command. This means that
instead of cycling through the all the parsed sudoers entries we
start at the end and work backwards and quit after the first positive
or negative match.
Todd C. Miller [Thu, 30 Aug 2007 17:26:35 +0000 (17:26 +0000)]
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.