Commit Graph

528 Commits

Author SHA1 Message Date
Todd C. Miller
f32e054fe5 Make login class support work on BSD/OS 2000-03-24 20:13:12 +00:00
Todd C. Miller
fed49d49eb set_loginclass() should be static like the proto says 2000-03-24 00:16:41 +00:00
Todd C. Miller
78b6514e58 Add support for set_logname run-time default 2000-03-23 00:20:56 +00:00
Todd C. Miller
5684831592 User can always specify a login class if he/she is already root. 2000-03-07 19:26:02 +00:00
Todd C. Miller
935a51e76a FreeBSD login class (login.conf) support. 2000-03-07 04:29:46 +00:00
Todd C. Miller
24f8ee8807 Stash coredumpsize resource limit and retsore it before the exec()
Otherwise the child ends up with a coredumpsize of 0.
2000-02-28 23:58:17 +00:00
Todd C. Miller
f1c2ba6aa2 fix usage string 2000-02-27 03:54:20 +00:00
Todd C. Miller
54fbe08545 Added -S flag (read passwd from stdin) and tgetpass_flags global
that holds flags to be passed in to tgetpass().  Change echo_off
param to tgetpass() into a flags field.  There are currently 2
possible flags for tgetpass(): TGP_ECHO and TGP_STDIN.  In tgetpass(),
abstract the echo set/clear via macros and if (flags & TGP_ECHO)
but echo is not set on the terminal, but sure to set it.
2000-02-27 03:49:07 +00:00
Todd C. Miller
09b23e7b41 Add rootpw, runaspw, and targetpw options. 2000-02-18 17:56:28 +00:00
Todd C. Miller
fc08d7004c Move user_is_exempt prototype into sudo.h 2000-02-15 23:36:04 +00:00
Todd C. Miller
9e0bae9fc6 update copyright year on changed files 2000-01-17 23:46:26 +00:00
Todd C. Miller
217cae528a When using rlimit check for RLIM_INFINITY
When computing the value of maxfd, use min(getdtablesize(), RLIMIT_NOFILE)
2000-01-17 22:46:32 +00:00
Todd C. Miller
ccb808da31 Add 'shell_noargs' runtime option back in. We have to defer checking
until after the sudoers file has been parsed but since there are now
other options that operate that way this one can too.  Based on a patch
from bguillory@email.com.
2000-01-17 17:25:10 +00:00
Todd C. Miller
f68cc2f628 Add "listpw" and "verifypw" options. 2000-01-17 04:05:18 +00:00
Todd C. Miller
038dea2d3d 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.
2000-01-03 04:53:35 +00:00
Todd C. Miller
625e3e46d0 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.
2000-01-03 04:43:33 +00:00
Todd C. Miller
ac67ced558 Add check for initgroups() since old SYSV lacks this. 1999-12-09 04:04:47 +00:00
Todd C. Miller
12f5216097 Don't kill the user's tickets until after sudoers has been parsed
since tty_tickets and ticket_dir could be set in sudoers.
1999-12-05 02:54:20 +00:00
Todd C. Miller
449f67f776 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.
1999-12-02 20:31:25 +00:00
Todd C. Miller
6713b85dc6 Make the -s flag be exclusive too. Also reorder the flags in
the exclusive usage message so they are alphabetical.
1999-11-24 03:52:34 +00:00
Todd C. Miller
1976aec18c need sys/time.h if HAVE_SETRLIMIT 1999-11-16 06:09:23 +00:00
Todd C. Miller
d00a8de2f0 get rid of references to sudo-bugs. Now mention the web site or the sudo@ alias 1999-11-16 05:42:28 +00:00
Todd C. Miller
59666aca78 o Now use getrlimit to find the highest fd when closing all non-std fd's
o Turn off core dumps via setrlimit for the sake of paranoia
1999-11-04 19:01:11 +00:00
Todd C. Miller
e08f3f3937 For the sudo_root option, check against user_uid, not getuid() since
at this point, ruid == euid == 0.
1999-11-01 15:43:12 +00:00
Todd C. Miller
3acdd5b02f New krb5 code from Frank Cusack <fcusack@iconnet.net>. 1999-10-13 02:34:55 +00:00
Todd C. Miller
7f5c248933 in set_perms(), always call setuid(0) before changing the ruid/euid
so we always know it will succeed.
1999-10-11 23:42:57 +00:00
Todd C. Miller
2c4fefde5a o Add requiretty option
o Move O_NOCTTY to compat.h
1999-10-08 01:12:50 +00:00
Todd C. Miller
7769bf6a32 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
1999-10-07 21:21:08 +00:00
Todd C. Miller
13bf42675d 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.
1999-09-08 08:06:28 +00:00
Todd C. Miller
61bd59c733 Only block SIGINT, SIGQUIT, SIGTSTP (which can be generated from
the keyboard).  Since we run with ruid/euid == 0 the user can't
really signal us in nasty ways.
1999-08-27 21:02:24 +00:00
Todd C. Miller
79faf00e5d fix --enable-noargs-shell 1999-08-27 15:53:29 +00:00
Todd C. Miller
b13e8006ec Add check for LONG_IS_QUAD
#undef MAXINT before including hpsecurity.h to silence an HP-UX warning
Check for U?LONG_LONG_MAX in snprintf.c and use LONG_IS_QUAD
1999-08-22 09:59:28 +00:00
Todd C. Miller
275c2fc980 Run most of the code as root, not the invoking user. It doesn't really
gain us anything to run as the user since an attacker can just have
an setuid(0) in their egg.  Running as root solves potential problems
wrt signalling.
1999-08-20 20:37:16 +00:00
Todd C. Miller
b9746389ce Don't wait for child to finish in log_error(), let the signal handler
get it if we are still running, else let init reap it for us.  The extra
time it takes to wait lets the user know that mail is being sent.

Install SIGCHLD handler in main() and for POSIX signals, block everything
*except* SIGCHLD.
1999-08-19 17:45:36 +00:00
Todd C. Miller
0598093e2c sudoers_lookup() now returns a bitmap instead of an int. This makes it
possible to express things like "failed to validate because user not listed
for this host".  Some thigns that were previously VALIDATE_FOO are now
FLAG_FOO.  This may change later on.

Reorganized code in log_auth() and sudo.c to deal with above changes.

Safer versions of push/pushcp with in the do { ... } while (0) style

parse.yacc now saves info on the stack to allow parse.c to determine
if a user was listed, but not for the host he/she tried to run on.

Added --with-mail-if-no-host option
1999-08-19 16:30:09 +00:00
Todd C. Miller
d7ebfe06d1 o Digital UNIX needs to check for *snprintf() before -ldb is added to LIBS
since -ldb includes a bogus snprintf().
o Add forward refs for struct mbuf and struct rtentry for Digital UNIX.
o Reorder some functions in snprintf.c to fix -Wall
o Add missing includes to fix more -Wall
1999-08-12 16:24:10 +00:00
Todd C. Miller
145992dce2 o /etc/stmp -> /etc/sudoers.tmp since solaris uses stmp as shadow temp file
o _PATH_SUDO_SUDOERS -> _PATH_SUDOERS and _PATH_SUDO_STMP -> _PATH_SUDOERS_TMP
1999-08-06 09:37:03 +00:00
Todd C. Miller
27d6f353e2 o new defines for syslog facility and priority
o use new print_version() functino for -V mode
1999-08-05 10:51:02 +00:00
Todd C. Miller
014bd22934 -u flag was being ignored 1999-08-04 07:53:04 +00:00
Todd C. Miller
6b3909c780 rename validate() to the more descriptive sudoers_lookup() 1999-08-01 15:42:12 +00:00
Todd C. Miller
5a51e05e63 Sudo, not CU Sudo 1999-07-31 16:31:27 +00:00
Todd C. Miller
0d732401f4 add 4th term to license similar to term 5 in the apache license 1999-07-31 16:19:50 +00:00
Todd C. Miller
794f537eef there was a 1995 release too 1999-07-31 16:02:13 +00:00
Todd C. Miller
7fe99a8caa o no longer contains sudo 1.1/1.2 code
o BSD copyright
o use new logging routines
o simplified flow of control
o BIND resolver additions to badenv_table
1999-07-22 12:55:17 +00:00
Todd C. Miller
20002b5fe2 Some -Wall and kill some trailing spaces 1999-07-05 20:11:50 +00:00
Todd C. Miller
b3cd9b1f96 mention why DONT_LEAK_PATH_INFO is not the default 1999-06-14 23:47:56 +00:00
Todd C. Miller
80287c981c Move interface-related defines to interfaces.h so we don't have to include
<netinet/in.h> everywhere.
1999-05-17 01:36:30 +00:00
Todd C. Miller
850a52aa6f o Replace _PASSWD_LEN braindeath with our own SUDO_MAX_PASS.
It turns out the old DES crypt does the right thing with passwords
   longert than 8 characters.
 o Fix common typo (necesary -> necessary)
 o Update TODO list
1999-05-14 16:30:14 +00:00
Todd C. Miller
6b91a87a9f set $LOGNAME when we set $USER 1999-05-03 16:00:32 +00:00
Todd C. Miller
06e586ee7b Function names should be flush with the start of the line so they can be found trivially in an editor and with grep 1999-04-10 04:49:03 +00:00