Commit Graph

268 Commits

Author SHA1 Message Date
Todd C. Miller
48cdd1dec3 Kill use of POSIX saved uids; they aren't worth bothering with. 2004-10-13 16:46:19 +00:00
Todd C. Miller
3c8145a923 No longer call it tracing, it is now "monitoring" which should be more
a obvious name to non-hackers.
2004-10-04 16:07:19 +00:00
Todd C. Miller
cbcb60b184 Add keepopen arg to open_sudoers that open_sudoers can use to
indicate to the caller that the fd should not be closed when it
is done with it.  To be used by visudo to keep locked fds from
being closed prematurely (and thus losing the lock).
2004-09-29 18:36:33 +00:00
Todd C. Miller
7cf26298a2 Rename check_sudoers() open_sudoers() and make it return a FILE * 2004-09-27 16:01:54 +00:00
Todd C. Miller
aa8d212e3c Call systrace_attach() if FLAG_TRACE is set. 2004-09-24 17:17:29 +00:00
Todd C. Miller
e3391d597b Add trace Defaults option and TRACE/NOTRACE tags and set FLAG_TRACE 2004-09-24 17:15:51 +00:00
Todd C. Miller
0f056c0d5f Use timespec throughout. 2004-09-08 15:48:23 +00:00
Todd C. Miller
7f772c822f Add an extra param to touch() for nsec 2004-09-07 19:55:37 +00:00
Todd C. Miller
1c20ff1a6d Use utimes() and futimes() instead of utime() in touch(), emulating as needed.
Not all systems are able to support setting the times of an fd so touch()
takes both an fd and a file name as arguments.
2004-09-07 17:14:52 +00:00
Todd C. Miller
f30ab72c44 Add cmnd_base to struct sudo_user and set it in init_vars().
Add cmnd_stat to struct sudo_user and set it in sudo_goodpath().
No longer use gross statics in command_matches().
Also rename some variables for improved clarity.
2004-08-24 18:01:14 +00:00
Todd C. Miller
a99f53e2fa Add NOMATCH and UNSPEC defines (-1 and -2 respectively) and use
these in parse.yacc.  Also in parse.yacc initialize the *_matches
vars to UNSPEC and add two macros, SETMATCH and SETNMATCH for use
when setting *_matches to a value that may be NOMATCH/UNSPEC/TRUE/FALSE.
2004-06-05 17:42:04 +00:00
Todd C. Miller
03d1a9ed49 Add prototype for sudo_ldap_list_matches 2004-06-01 20:56:03 +00:00
Todd C. Miller
d33ad95208 Use PATH_MAX, not MAXPATHLEN since the former is standardized. 2004-06-01 01:22:27 +00:00
Todd C. Miller
21e3ca9cf8 More to a less restrictive, ISC-style license. 2004-02-13 21:36:43 +00:00
Aaron Spangler
b0226e939b Merged in LDAP Support 2004-02-13 02:08:27 +00:00
Todd C. Miller
d80d2e29ad Only do "extern int errno" if errno is not a macro. 2004-02-08 20:53:55 +00:00
Todd C. Miller
c7d74402f3 Add a new flag, -e, that makes it possible to give users the ability
to edit files with the editor of their choice as the invoking user,
not the runas user.  Temporary files are used for the actual edit
and the temp file is copied over the original after the editor is done.
2004-01-21 23:00:43 +00:00
Todd C. Miller
1ca6264df1 o Add -i that acts similar to "su -", based on patches from David J. MacKenzie
o Sort the flags in the usage message
2004-01-18 22:55:32 +00:00
Todd C. Miller
18027fa589 Update sudo_getepw() proto and add one for set_runaspw() 2004-01-16 23:12:03 +00:00
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
d55c3f63c7 Use closefrom() instead of doing the equivalent inline. 2004-01-12 19:03:54 +00:00
Todd C. Miller
8e421c95b8 update copyright year 2004-01-05 17:15:32 +00:00
Todd C. Miller
7536a781f0 Add support for preloading a shared object containing a dummy execve()
function that just sets error and returns -1.  This adds a
"noexec_file" option to load the filename as well as a "noexec" flag
to enable it unconditionally.  There is also a NOEXEC tag that can
be attached to specific commands and an EXEC tag to disable it.
2004-01-05 02:48:09 +00:00
Todd C. Miller
b2550741c1 Add a zero_bytes() function to do the equivalent of bzero in such a
way that will heopfully not be optimized away by sneaky compilers.
2003-12-31 22:46:08 +00:00
Todd C. Miller
02f37dc2da Add support for tuples in def_data.in; these are implemented as an
enum type.  Currently there is only a single tuple enum but in the
future we may have one tuple enum per T_TUPLE entry in def_data.in.
Currently listpw, verifypw and lecture are tuples.  This avoids the
need to have two entries (one ival, one str) for pwflags and syslog
values.

lecture is now a tuple with the following values: never, once, always

We no longer use both an int and string entry for syslog facilities
and priorities.  Instead, there are logfac2str() and logpri2str()
functions that get used when we need to print the string values.
2003-12-30 22:31:30 +00:00
Todd C. Miller
f13528b0b1 add DARPA credit on affected files 2003-04-16 00:42:10 +00:00
Todd C. Miller
dcf1a5acce Use warn/err and getprogname() throughout. The main exception is
openlog().  Since the admin may be filtering logs based on the
program name in the log files, hard code this to "sudo".
2003-04-02 18:25:30 +00:00
Todd C. Miller
48229cbac6 update copyright year 2003-03-15 20:31:02 +00:00
Todd C. Miller
a54c8e66fa Add strlc{at,py} protos 2003-03-13 17:54:04 +00:00
Todd C. Miller
838ec0a2ca Add erealloc3(), a realloc() version of emalloc2(). 2003-03-12 21:51:39 +00:00
Todd C. Miller
8b4248529e Add emalloc2() -- like calloc() but w/o the bzero and with error/oflow
checking.
2003-03-12 21:41:22 +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
0f60107a1c No need for dump_badenv() now that dump_defaults() knows how to dump lists. 2002-05-05 19:58:29 +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
fec1b63caa Bring back PERM_FULL_USER 2002-01-16 21:27:09 +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
47dff37185 o Update copyright year 2001-12-14 19:54:56 +00:00
Todd C. Miller
e63182a25b Prototype init_envtables() 2001-12-11 23:03:24 +00:00
Todd C. Miller
63ae9ec2ad Dump default bad env table when 'sudo -V' is run by root. 2001-11-12 18:08:30 +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
9745a31948 sudo_setenv() now exits on memory alloc failure instead of returning -1. 2000-09-14 20:48:58 +00:00
Todd C. Miller
fc15c3dbd1 Update proto for evasprintf and easprintf 2000-05-10 05:11:36 +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
935a51e76a FreeBSD login class (login.conf) support. 2000-03-07 04:29:46 +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