Commit Graph

24 Commits

Author SHA1 Message Date
Todd C. Miller
ceb3653d71 Rename PERM_RUNAS -> PERM_FULL_RUNAS and add a PERM_RUNAS that just
changes the euid.
2004-01-16 23:05:47 +00:00
Todd C. Miller
6ad252765b Create def_* macros for each defaults value so we no longer need
the def_{flag,ival,str,list,mode} macros (which have been removed).
This is a step toward more flexible data types in def_data.in.
2003-12-30 22:20:21 +00:00
Todd C. Miller
8cd9f4f1ec Add explicit declaration of printerr variable in function header
(was defaulting to int which is OK but oh so K&R :-).  From Theo.
2003-06-21 16:50:56 +00:00
Todd C. Miller
69ac0e56c2 add DARPA credit on affected files 2003-04-16 00:42:10 +00:00
Todd C. Miller
48229cbac6 update copyright year 2003-03-15 20:31:02 +00:00
Todd C. Miller
2aec2bd724 Fix typo; check pw_uid, not pw_gid after setusercontext() failure. 2003-03-15 00:48:34 +00:00
Todd C. Miller
e27e963f2b Fix pasto/thinko in setresgid()/setregid() usage.
Want to set effective gid, not real gid, when reading sudoers.
2002-12-15 16:24:24 +00:00
Todd C. Miller
1996179bf2 don't compile set_perms_posix if we have setreuid or setresuid 2002-12-15 16:08:32 +00:00
Todd C. Miller
b152da4cdb Revamp set_perms. We now use a version based on setresuid() or setreuid()
when possible since that allows us to support the stay_setuid option and
we always know exactly what the semantics will be (various Linux kernels
have broken POSIX saved uid support).
2002-11-22 19:09:49 +00:00
Todd C. Miller
d497949e68 Error out if setusercontext() fails and the runas user is not root. 2002-07-20 12:30:45 +00:00
Todd C. Miller
c289159953 g/c second arg to set_perms--it is no longer used 2002-05-05 00:43:38 +00:00
Todd C. Miller
a30951d34c Add support for non-root timestamp dirs. This allows the timestamp
dir to be shared via NFS (though this is not recommended).
2002-05-03 22:48:17 +00:00
Todd C. Miller
bf0aa0ae71 fatal() now takes an argument that determines whether or not to call
perror().
2002-01-22 02:00:25 +00:00
Todd C. Miller
fec1b63caa Bring back PERM_FULL_USER 2002-01-16 21:27:09 +00:00
Todd C. Miller
f039427253 Add a configure option to turn off use of POSIX saved IDs 2002-01-15 22:47:29 +00:00
Todd C. Miller
26f2a96558 Remove PERM_FULL_USER (which is no longer used) and add PERM_FULL_ROOT
(used when exec'ing the mailer).
2002-01-13 18:28:09 +00:00
Todd C. Miller
a55e6898e1 o Add pam_prep_user function to call pam_setcred() for the target user;
on Linux this often sets resource limits.
2001-12-31 17:18:05 +00:00
Todd C. Miller
761b119e2e Add new sudoers option "preserve_groups". Previously sudo would not
call initgroups() if the target user was root.  Now it always calls
initgroups() unless the -P command line option or the "preserve_groups"
sudoers option is set.  Idea from TJ Saunders.
2001-12-15 00:24:27 +00:00
Todd C. Miller
65fad4df35 o Reorder some headers and use STDC_HEADERS define properly
o Update copyright year
2001-12-14 19:52:54 +00:00
Todd C. Miller
d956d77528 Move defaults info into its own files from which we generate
.h and .c files.  This makes adding or rearranging variables
much simpler.
2000-12-31 01:38:37 +00:00
Todd C. Miller
572b4cf39a Don't try and build saved uid version of set_perms on systems w/o them.
Rename set_perms_saved_uid() -> set_perms_posix()
Make set_perms_setreuid simply be set_perms_fallback() and simply include
  the appropriate function at compile time (setreuid() vs. setuid()).
2000-12-30 03:59:40 +00:00
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
744917ed67 Add missing #ifdef HAVE_LOGIN_CAP_H; ayamura@ayamura.org 2000-12-13 17:23:07 +00:00
Todd C. Miller
7ea65e54bd Move set_perms() to its own file and use POSIX saved uid or setreuid()
if available.

Added stay_setuid option for systems that have libraries that perform
extra paranoia checks in system libraries for setuid programs (ie:
anything with issetugid(2)).
2000-11-03 05:37:44 +00:00