Todd C. Miller
ecfc813757
PERM_RUNAS -> PERM_FULL_RUNAS
2004-01-16 23:07:03 +00:00
Todd C. Miller
230a54ebb9
Make format_env() varargs
...
Add noexec support for Darwin, MacOS X, Irix, and Tru64
2004-01-09 05:38:58 +00:00
Todd C. Miller
8e421c95b8
update copyright year
2004-01-05 17:15:32 +00:00
Todd C. Miller
626e2cd209
Add _PATH_SUDO_NOEXEC and corresponding --with-noexec configure option.
...
The default value of noexec_file is set to this.
2004-01-05 03:58:39 +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
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
684f62dd0f
Fix an off by one error when reallocating the environment; Kevin Pye
2003-05-06 04:31:24 +00:00
Todd C. Miller
c6c8c99515
add DARPA credit on affected files
2003-04-16 00:42:09 +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
b18a141ae9
Cast [ug]ids to unsigned long and printf with %lu
2003-03-15 20:19:58 +00:00
Todd C. Miller
7e05ae7a3b
fix indentation
2003-03-15 17:51:45 +00:00
Todd C. Miller
eebc763bd3
Use strlc{at,py} for paranoia's sake and exit on overflow. In all
...
cases the strings were either pre-allocated to the correct size of
length checks were done before the copy but a little paranoia can
go a long way.
2003-03-13 20:00:45 +00:00
Todd C. Miller
7ce95c61c8
Use erealloc3()
2003-03-13 17:03:23 +00:00
Todd C. Miller
466216fe8e
Remove DYLD_ from the environment for MacOS X; from bbraun
2003-03-04 02:47:24 +00:00
Todd C. Miller
f3ddf66e07
typo in comment
2002-05-17 17:20:57 +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
3f7d801880
Don't try to pre-compute the size of the new envp, just allocate
...
space up front and realloc as needed. Changes to the new env pointer
must all be made through insert_env() which now keeps track of
spaced used and allocates as needed.
2002-05-02 19:40:25 +00:00
Todd C. Miller
a576207620
Use easprintf instead of emalloc + sprintf for some things.
2002-04-18 15:38:52 +00:00
Todd C. Miller
ea24bef19c
The SHELL environment variable was preserved from the user's
...
environment instead of being reset based on the passwd database
when the "env_reset" option was used. Now it is reset as it should be.
2002-01-15 23:43:59 +00:00
Todd C. Miller
1b6d4ad876
Add 'continue' statements to optimize the switch statement. From Solar.
2002-01-15 01:45:40 +00:00
Todd C. Miller
705c4c7515
Fix off by one error in number of bytes allocated via malloc (does not
...
affected any released version of sudo).
2001-12-31 05:53:23 +00:00
Todd C. Miller
087f5a7d56
Fix setting of $USER and $LOGNAME in the non-reset_env case.
...
Also allow HOME, SHELL, LOGNAME, and USER to be specified in keep_env
2001-12-18 17:42:37 +00:00
Todd C. Miller
46dd419cd9
o Reorder some headers and use STDC_HEADERS define properly
...
o Update copyright year
2001-12-14 19:52:47 +00:00
Todd C. Miller
2e677e1023
Remove "secure_path" Defaults option since it cannot work with the
...
existing parser.
2001-12-14 06:40:03 +00:00
Todd C. Miller
2cbd965d63
o Remove assumption that PATH and TERM are not listed in env_keep
...
o If no PATH is in the environment use a default value
o If TERM is not set in the non-reset case also give it a default
value.
2001-12-14 06:24:26 +00:00
Todd C. Miller
199a17436d
o Convert environment handling to use lists instead of strings.
...
This greatly simplifies routines that need to do "foreach" type
operations.
o Add new init_envtables() function to set env_check and env_delete
defaults based on initial_badenv_table and initial_checkenv_table
(formerly sudo_badenv_table).
2001-12-11 23:02:51 +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
65302649f5
Add support for '*' in env_keep when not resetting the environment
...
(ie: the normal case).
2001-11-12 04:51:57 +00:00
Todd C. Miller
ab020c056b
Add env_delete variable that lets the user replace/add to the bad_env_table.
...
Allow '*' wildcard in env_keep entries.
2001-11-12 04:47:22 +00:00
Todd C. Miller
aeb8cefc42
glibc uses the LANGUAGE env var so clear that too; Solar Designer
2001-01-07 18:57:23 +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
1875e47474
Make env_keep override badenv_table as documented
...
Fix traversal of badenv_table (broken in last commit)
2000-12-30 21:22:08 +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