Todd C. Miller [Fri, 14 Jan 2000 17:29:35 +0000 (17:29 +0000)]
In struct sudo_defs_types, move the union to the end and don't initialize
the union member since that only works with an ANSI compiler. We set
the value of the union by hand in init_defaults() anyway. This allows
sudo to compile on a K&R compiler again.
Todd C. Miller [Mon, 3 Jan 2000 04:53:35 +0000 (04:53 +0000)]
Update statbuf.st_mode based on SUDOERS_MODE when we are chaning from
0400 to whatever SUDOERS_MODE is (converting from the old sudoers mode).
Assumes that SUDOERS_MODE is less restrictive than 0400 which should
always be the case.
Todd C. Miller [Mon, 3 Jan 2000 04:43:33 +0000 (04:43 +0000)]
Make treatment of -l and -v sane wrt NOPASSWD flags. Now allow -l w/o a passwd
if there is *any* entry for the user on the host with a NOPASSWD flag.
For -v, only allow w/o a passwd if *all* entries for the user on the host
w/ the specified runas user have the NOPASSWD flag set.
Todd C. Miller [Sun, 5 Dec 1999 19:06:09 +0000 (19:06 +0000)]
fix parsing of runas lists:
o oprunasuser and runaslist now return a value
o in a runasspec, if a runaslist does not return TRUE, set runas_matches to
FALSE. Normally, a runaslist only returns FALSE for explicitly denied
users.
o since runaslist does not modify the stack there is no need for a push/pop
in runasalias.
Todd C. Miller [Thu, 2 Dec 1999 20:31:25 +0000 (20:31 +0000)]
o Kill shell_noargs option, it cannot work since the command needs to
be set before sudoers is parsed.
o Fix the "set_home" sudoers option (only worked at compile time).
o Fix "fqdn" sudoers option. We now set host/shost via set_fqdn which
gets called when the "fqdn" option is set in sudoers.
o Move the openlog() to store_syslogfac() so this gets overridden
correctly from the sudoers file.
Todd C. Miller [Tue, 9 Nov 1999 20:06:53 +0000 (20:06 +0000)]
Don't need YY_FLUSH_BUFFER after all
Move yyrestart() into visudo.c since it might not get called in yywrap
if we get a parse error (and we only reread the file on error anyway).
Todd C. Miller [Tue, 9 Nov 1999 19:32:41 +0000 (19:32 +0000)]
Call YY_FLUSH_BUFFER macro in yywrap() to clean up any buffers that
might still exist.
Call yyrestart() instead of using the deprecated YY_NEW_FILE macro.
Todd C. Miller [Mon, 1 Nov 1999 04:14:09 +0000 (04:14 +0000)]
Fix compilation problem when --with-logging=file was specified. This
means that syslog is now required to build sudo but that should not
be a problem. If it is it can be fixed trivially with a configure
check for syslog() or syslog.h.
Todd C. Miller [Mon, 1 Nov 1999 04:00:57 +0000 (04:00 +0000)]
Make this work again for things like "sudo echo hi | more" where the tty
gets put into character at a time mode. We read until we read end of
line or we run out of space (similar to fgets(3)).
Todd C. Miller [Sat, 16 Oct 1999 17:56:31 +0000 (17:56 +0000)]
Error out if syslog parameters are given without a value. For Ultrix or
4.2BSD "syslog" is allowed without a value since there are no facilities
in the 4.2BSD syslog.
Todd C. Miller [Sun, 10 Oct 1999 17:56:02 +0000 (17:56 +0000)]
o Add T_PATH flag to allow simple sanity checks for default values that
are supposed to be pathnames.
o Fix a duplicate free when visudo finds an error.
Todd C. Miller [Thu, 7 Oct 1999 21:21:08 +0000 (21:21 +0000)]
o Change defaults stuff to put the value right in the struct.
o Implement mailer_flags
o Store syslog stuff both in int and string form. Setting the string
form magically updates the int version.
o Add boolean attribute to strings where it makes sense to say !foo
Todd C. Miller [Wed, 8 Sep 1999 08:06:28 +0000 (08:06 +0000)]
Add support for "Defaults" line in sudoers to make configuration variables
changable at runtime (and on a global, per-host and per-user basis).
Both the names and the internal representation are still subject to change.
It was necessary to make sudo_user.runas but a char ** instead of a
char * since this value can be changed by a Defaults line. There is a
similar (but more complicated) issue with sudo_user.prompt but it
is handled differently at the moment.
Add a "-L" flag to list the name of options with their descriptions. This
may only be temporary.
Move some prototypes to parse.h
Be much less restrictive on what is allowed for a username.