Commit Graph

247 Commits

Author SHA1 Message Date
Todd C. Miller
998631b73a New Defaults options:
o stay_setuid - sudo will remain setuid if system has saved uids or setreuid(2)
 o env_reset - reset the environment to a sane default
 o env_keep - preserve environment variables that would otherwise be cleared

No longer use getenv/putenv/setenv functions--do environment munging by hand.
Potentially dangerous environment variables can be cleared only if they
contain '/' pr '%' characters to protect buggy programs.
Moved environment routines into env.c (new file)
2000-12-30 03:29:47 +00:00
Todd C. Miller
192b2ae6c3 If the targetpw flag is set, use target username as part of the timestamp path.
If tty tickets are in effect cat the tty and the target username with a
':' as the separator.
2000-05-10 04:56:28 +00:00
Todd C. Miller
165bd7fafb Fix root, runas, and target authentication for non-passwd file auth
methods.
2000-05-09 15:42:38 +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
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
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
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
2386dc1b45 o Add a "pedentic" flag to the parser. This makes sudo warn in cases
where an alias may be used before it is defined.  Only turned on for visudo
and testsudoers.
o Add --disable-authentication option that makes sudo not require
authentication by default.  The PASSWD tag can be used to require
authentication for an entry.  We no longer overload --without-passwd.
1999-08-12 14:37:27 +00:00
Todd C. Miller
76148d5316 o Move lock_file() and touch() into fileops.c so visudo can use them
o Visudo now locks the sudoers temp file instead of bailing when
the temp file already exists.  This fixes the problem of stale
temp files but it does *require* that you not try to put the
temp file in a world-writable directory.  This shoud not be
an issue as the temp file should live in the same dir as sudoers.
o Visudo now only installs the temp file as sudoers if it changed.
1999-08-07 09:59:43 +00:00
Todd C. Miller
7c53b74961 o Kill *_MESSAGE and replace with NO_LECTURE
o Add more things to root sudo -V config reporting
1999-08-05 21:38:19 +00:00
Todd C. Miller
9283524123 Don't need version.c 1999-08-05 10:49:24 +00:00
Todd C. Miller
ca8eb6f2aa add 4th term to license similar to term 5 in the apache license 1999-07-31 16:19:45 +00:00
Todd C. Miller
794f537eef there was a 1995 release too 1999-07-31 16:02:13 +00:00
Todd C. Miller
0804f1786b Use dirs instead of files for timestamp. This allows tty and non-tty
schemes to coexist reasonably.  Note, however, that when you update
a tty ticket, the mtime on the user dir gets updated as well.
1999-07-28 09:21:00 +00:00
Todd C. Miller
ccc7369371 Rewrote all the old sudo 1.1/1.2 code. Timestamp handling is now
done more reasonably--better sanity checks and tty-based stamps are
now done as files in a directory with the same name as the invoking
user, eg. /var/run/sudo/millert/ttyp1.  It is not currently possible
to mix tty and non-tty based ticket schemes but this may change in
the future (it requires sudo to use a directory instead of a file
in the non-tty case).  Also, ``sudo -k'' now sets the ticket back
to the epoch and ``sudo -K'' really deletes the file.  That way you
don't get the lecture again just because you killed your ticket in
.logout.  BSD-style copyright now.
1999-07-22 12:19:11 +00:00
Todd C. Miller
69a00325ec New (correct) PAM code
Tgetpass now takes an echo flag for use with PAM_PROMPT_ECHO_ON
Block SIGINT and SIGTSTP during auth
remove a useless umask setting
Change error from BAD_ALLOCATION -> BAD_AUTH_INIT (for use with sia/PAM)
Some cosmetic changes to auth.c for consistency
1999-07-05 20:14:21 +00:00
Todd C. Miller
406056d7e5 move authentication code to auth.c 1999-06-03 15:51:07 +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
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
Todd C. Miller
ecb8d08e2e buf should be prompt; Michael Robokoff <mrobo@networkcs.com> 1999-04-06 17:20:39 +00:00
Todd C. Miller
e6deacb6c4 Crank version to 1.6 and combine copyright statements 1999-04-05 20:57:25 +00:00
Todd C. Miller
79c46d1c81 ++version 1999-03-29 04:05:15 +00:00
Todd C. Miller
382ef75493 Use emalloc/erealloc/estrdup 1999-03-29 02:59:34 +00:00
Todd C. Miller
bd76c13333 Simplify PAM code and fix a PAM-related warning on Linux 1999-03-28 18:50:25 +00:00
Todd C. Miller
c38c66b2b2 new pam code that works on solaris, should work on linux too; aelberg@home.com 1999-03-26 18:09:09 +00:00
Todd C. Miller
a3029dedd8 If the user enters an empty password and really has no password, accept
the empty password they entered.  Perviously, they could enter anything
*but* an empty password.  Also, add GETPASS macro that calls either
tgetpass() or getpass() depending on how sudo was configured.
Problem noted by jdg@maths.qmw.ac.uk
1999-02-07 00:43:24 +00:00
Todd C. Miller
52916f16ac add explicate copyright 1999-02-03 04:32:19 +00:00
Todd C. Miller
cefcc04d60 FWTK 'authsrv' support from Kevin Kadow <kadow@MSG.NET> 1999-01-19 02:04:41 +00:00
Todd C. Miller
826fe213f2 add sudo tags 1999-01-17 23:16:20 +00:00
Todd C. Miller
d3aaf52283 crank version and regen files 1999-01-17 22:40:55 +00:00
Todd C. Miller
3983a7a651 kerb5 support from fcusack@iconnet.net 1999-01-17 22:08:55 +00:00
Todd C. Miller
9daf68bb7e fix tty tickets in remove_timestamp (didn't use ':') 1998-12-11 17:16:26 +00:00
Todd C. Miller
62dba8f4d1 more -Wall 1998-11-18 04:16:13 +00:00
Todd C. Miller
c253188f55 -Wall 1998-11-18 03:51:10 +00:00
Todd C. Miller
b831104e1a when using tty tickets make it user:tty not user.tty as a username
could have a '.' in it
1998-11-13 19:10:21 +00:00
Todd C. Miller
0b9e318b75 Only one space after a colon, not two, in printf's 1998-11-08 18:51:58 +00:00
Todd C. Miller
91af18b71a fix bugs with prompt expansion 1998-11-05 03:24:40 +00:00
Todd C. Miller
de21acbb37 kill perror("malloc") since we already have a good error messages
pw_ent -> pw for brevity
1998-11-04 01:39:18 +00:00
Todd C. Miller
dad5b02579 we now expand any %h or %u in the prompt before passing to tgetpass 1998-11-03 20:02:04 +00:00
Todd C. Miller
7137565644 move local includes after system ones 1998-10-25 03:52:18 +00:00
Todd C. Miller
261cdb5d87 add pass_warn() which prints out INCORRECT_PASSWORD or an insult to stderr 1998-10-24 23:28:04 +00:00
Todd C. Miller
7ffee3b997 getprpwuid is broken in HP-UX 10.20 at least (it sleeps for 2 minutes if the
shadow files don't exist).
1998-10-21 23:50:10 +00:00
Todd C. Miller
1c8dc54a3f add back security/pam_misc.h 1998-10-20 05:24:12 +00:00
Todd C. Miller
1dffdd17c3 add SIA support 1998-10-19 00:22:38 +00:00
Todd C. Miller
a20f23f791 moved SecureWare stuff into secureware.c 1998-10-17 22:08:29 +00:00
Todd C. Miller
5bfb481ca7 no more options.h 1998-10-15 05:41:26 +00:00
Todd C. Miller
f459719223 remove_timestamp() if timestamp is preposterous 1998-10-15 03:52:33 +00:00
Todd C. Miller
4c0e6f8828 time.h, not sys/time.h 1998-09-24 15:36:24 +00:00