]> granicus.if.org Git - sudo/log
sudo
14 years agoDon't use run_as_superuser=false on HP-UX
Todd C. Miller [Mon, 11 Oct 2010 20:15:01 +0000 (16:15 -0400)]
Don't use run_as_superuser=false on HP-UX

14 years agoUse memset() instead of zero_bytes() since we don't include sudoers.h
Todd C. Miller [Mon, 11 Oct 2010 19:51:21 +0000 (15:51 -0400)]
Use memset() instead of zero_bytes() since we don't include sudoers.h

14 years agoFix pasto; AF_INET not AF_INET6
Todd C. Miller [Mon, 11 Oct 2010 19:43:59 +0000 (15:43 -0400)]
Fix pasto; AF_INET not AF_INET6

14 years agoActually call shl_load()
Todd C. Miller [Mon, 11 Oct 2010 19:19:00 +0000 (15:19 -0400)]
Actually call shl_load()

14 years agoUpdate from git repo.
Todd C. Miller [Mon, 11 Oct 2010 18:24:10 +0000 (14:24 -0400)]
Update from git repo.
Debian: version numbers now compliant with policy section 5.6.12
HP-UX: minimal changes needed to work on HP-UX 10.20

14 years agoFix dlopen() detection for systems where dlopen() is in a separate library.
Todd C. Miller [Mon, 11 Oct 2010 13:21:56 +0000 (09:21 -0400)]
Fix dlopen() detection for systems where dlopen() is in a separate library.

14 years agoIf pam_acct_mgmt() returns PAM_AUTH_ERR print a (hopefully) more useful
Todd C. Miller [Mon, 11 Oct 2010 13:12:23 +0000 (09:12 -0400)]
If pam_acct_mgmt() returns PAM_AUTH_ERR print a (hopefully) more useful
message and return AUTH_FATAL so sudo does not keep trying to validate
the user.

14 years agosudo_preload_table is an array
Todd C. Miller [Mon, 11 Oct 2010 13:12:07 +0000 (09:12 -0400)]
sudo_preload_table is an array

14 years agoQuiet a compiler warning and fix sudo_preload_table external definition.
Todd C. Miller [Mon, 11 Oct 2010 13:11:46 +0000 (09:11 -0400)]
Quiet a compiler warning and fix sudo_preload_table external definition.

14 years agoFix multiple inclusion guard in dlfcn.h and fix dlerror() prototype.
Todd C. Miller [Mon, 11 Oct 2010 13:11:20 +0000 (09:11 -0400)]
Fix multiple inclusion guard in dlfcn.h and fix dlerror() prototype.

14 years agoMake this compile correctly when no dlopen is available.
Todd C. Miller [Mon, 11 Oct 2010 13:10:10 +0000 (09:10 -0400)]
Make this compile correctly when no dlopen is available.

14 years agoHaving a timestamp file defined is no longer indicative of tty tickets
Todd C. Miller [Thu, 7 Oct 2010 18:12:17 +0000 (14:12 -0400)]
Having a timestamp file defined is no longer indicative of tty tickets
being enabled.  Check def_tty_tickets directly.

14 years agoFix TCGETWINSZ compat.
Todd C. Miller [Thu, 7 Oct 2010 18:11:10 +0000 (14:11 -0400)]
Fix TCGETWINSZ compat.

14 years agoPrefer newer TIOCGWINSZ ioctl to old TIOCGSIZE
Todd C. Miller [Sat, 2 Oct 2010 21:11:07 +0000 (17:11 -0400)]
Prefer newer TIOCGWINSZ ioctl to old TIOCGSIZE

14 years agoMove set_project() from sudoers module into sudo proper.
Todd C. Miller [Fri, 1 Oct 2010 17:52:42 +0000 (13:52 -0400)]
Move set_project() from sudoers module into sudo proper.

14 years agoFix typo and regenerate
Todd C. Miller [Fri, 1 Oct 2010 16:20:32 +0000 (12:20 -0400)]
Fix typo and regenerate

14 years agoWhen iterating over returned LDAP entries, keep looking at remaining
Todd C. Miller [Fri, 1 Oct 2010 16:17:01 +0000 (12:17 -0400)]
When iterating over returned LDAP entries, keep looking at remaining
matches even if we have a positive match.  This catches negative
matches that may exist in other entries and more closely match the
sudoers file behavior.

14 years agoAdd support for multiple package instances on Solaris.
Todd C. Miller [Fri, 1 Oct 2010 16:08:02 +0000 (12:08 -0400)]
Add support for multiple package instances on Solaris.

14 years agoAdd missing signal_pipe[0] to fdsr for the non-pty case.
Todd C. Miller [Fri, 1 Oct 2010 16:03:47 +0000 (12:03 -0400)]
Add missing signal_pipe[0] to fdsr for the non-pty case.

14 years agoAdd --with-project for Solaris
Todd C. Miller [Fri, 1 Oct 2010 15:36:14 +0000 (11:36 -0400)]
Add --with-project for Solaris

14 years agoNeed ar and ranlib too
Todd C. Miller [Fri, 1 Oct 2010 13:39:11 +0000 (09:39 -0400)]
Need ar and ranlib too

14 years agoPreserve ODMDIR environment variable by default on AIX.
Todd C. Miller [Mon, 27 Sep 2010 18:08:54 +0000 (14:08 -0400)]
Preserve ODMDIR environment variable by default on AIX.

14 years agoAdd dlopen() emulation for systems without it.
Todd C. Miller [Sun, 26 Sep 2010 21:41:35 +0000 (17:41 -0400)]
Add dlopen() emulation for systems without it.
For HP-UX 10, emulate using shl_load().
For others, link sudoers plugin statically and use a lookup
table to emulate dlsym().

14 years agoWhen including compat headers, use the compat dir as part of the path
Todd C. Miller [Fri, 24 Sep 2010 21:01:17 +0000 (17:01 -0400)]
When including compat headers, use the compat dir as part of the path
so we are sure to get the correct header.

14 years agoIgnore ECONNREFUSED from audit_log_user_command() which will
Todd C. Miller [Tue, 21 Sep 2010 11:56:16 +0000 (07:56 -0400)]
Ignore ECONNREFUSED from audit_log_user_command() which will
occur if auditd is not running.

14 years agoSync with git version
Todd C. Miller [Fri, 17 Sep 2010 16:14:12 +0000 (12:14 -0400)]
Sync with git version

14 years agoCast isblank argument to unsigned char.
Todd C. Miller [Thu, 16 Sep 2010 14:39:08 +0000 (10:39 -0400)]
Cast isblank argument to unsigned char.

14 years agoImplement --with-umask-override configure flag.
Todd C. Miller [Tue, 14 Sep 2010 21:18:55 +0000 (17:18 -0400)]
Implement --with-umask-override configure flag.

14 years agoTake MODE_LOGIN_SHELL into account when initially setting reset_home
Todd C. Miller [Tue, 14 Sep 2010 15:44:33 +0000 (11:44 -0400)]
Take MODE_LOGIN_SHELL into account when initially setting reset_home
instead of special-casing it later.

14 years agoIn login mode, make a copy of the runas user's pw_shell for NewArgv[0]
Todd C. Miller [Tue, 14 Sep 2010 15:30:28 +0000 (11:30 -0400)]
In login mode, make a copy of the runas user's pw_shell for NewArgv[0]
because 1) we modify it and 2) it will runas_pw gets freed before exec.

14 years agoReset HOME for "sudo -i" even if HOME was listed in env_keep.
Todd C. Miller [Tue, 14 Sep 2010 15:28:40 +0000 (11:28 -0400)]
Reset HOME for "sudo -i" even if HOME was listed in env_keep.

14 years agoUse SIG_SETMASK when resetting signal mask instead of SIG_UNBLOCK.
Todd C. Miller [Tue, 14 Sep 2010 13:25:52 +0000 (09:25 -0400)]
Use SIG_SETMASK when resetting signal mask instead of SIG_UNBLOCK.

14 years agoReset signal mask at sudo startup time; we need to be able to rely on
Todd C. Miller [Tue, 14 Sep 2010 13:23:19 +0000 (09:23 -0400)]
Reset signal mask at sudo startup time; we need to be able to rely on
normal signal delivery to control the child process.

14 years agoUse sed instead of expr to split a flag from its argument.
Todd C. Miller [Mon, 13 Sep 2010 20:34:38 +0000 (16:34 -0400)]
Use sed instead of expr to split a flag from its argument.
Fixes a problem with expr interpreting its arguments as a flag
when they start with a dash.

14 years agoDo not need sys/time.h after all
Todd C. Miller [Mon, 13 Sep 2010 17:20:35 +0000 (13:20 -0400)]
Do not need sys/time.h after all

14 years agoInclude sys/time.h for utimes() and struct timeval.
Todd C. Miller [Mon, 13 Sep 2010 17:17:26 +0000 (13:17 -0400)]
Include sys/time.h for utimes() and struct timeval.
No longer need ioctl.h or termios.h

14 years agoQuiet bogus compiler warnings.
Todd C. Miller [Mon, 13 Sep 2010 16:18:51 +0000 (12:18 -0400)]
Quiet bogus compiler warnings.

14 years agoDeclare innetgr() for HP-UX which is missing a declaration.
Todd C. Miller [Mon, 13 Sep 2010 15:52:46 +0000 (11:52 -0400)]
Declare innetgr() for HP-UX which is missing a declaration.
Declare domainname() for HP-UX and Solaris which are missing a declaration.

14 years agoUse __sun for consistency with the rest of the sources.
Todd C. Miller [Mon, 13 Sep 2010 15:49:10 +0000 (11:49 -0400)]
Use __sun for consistency with the rest of the sources.

14 years agoQuiet a bogus compiler warning.
Todd C. Miller [Mon, 13 Sep 2010 15:37:29 +0000 (11:37 -0400)]
Quiet a bogus compiler warning.

14 years agoDon't try to delref a NULL group.
Todd C. Miller [Mon, 13 Sep 2010 15:08:04 +0000 (11:08 -0400)]
Don't try to delref a NULL group.

14 years agoInclude memory.h on systems that need it.
Todd C. Miller [Mon, 13 Sep 2010 14:40:53 +0000 (10:40 -0400)]
Include memory.h on systems that need it.

14 years agoQuiet gcc warnings on glibc systems that use warn_unused_result for
Todd C. Miller [Sat, 11 Sep 2010 13:26:09 +0000 (09:26 -0400)]
Quiet gcc warnings on glibc systems that use warn_unused_result for
write(2).

14 years agosudo_plugin is in section 8; from Ted Percival
Todd C. Miller [Sat, 11 Sep 2010 13:07:53 +0000 (09:07 -0400)]
sudo_plugin is in section 8; from Ted Percival

14 years agotestsudoers depends on libsudoers.la, not sudoreplay
Todd C. Miller [Sat, 11 Sep 2010 13:00:06 +0000 (09:00 -0400)]
testsudoers depends on libsudoers.la, not sudoreplay

14 years agoRead as many signals on the signal pipe as we can before returning.
Todd C. Miller [Fri, 10 Sep 2010 15:27:20 +0000 (11:27 -0400)]
Read as many signals on the signal pipe as we can before returning.

14 years agoInstead of using a array to store received signals, open a pipe and
Todd C. Miller [Fri, 10 Sep 2010 15:20:32 +0000 (11:20 -0400)]
Instead of using a array to store received signals, open a pipe and
have the signal handler write the signal number to one end and
select() on the other end.  This makes it possible to handle signals
similar to I/O without race conditions.

14 years agoMake "visudo -c -f -" check the standard input.
Todd C. Miller [Thu, 9 Sep 2010 21:10:23 +0000 (17:10 -0400)]
Make "visudo -c -f -" check the standard input.

14 years agoset_home and always_set_home have an effect if HOME is present in
Todd C. Miller [Thu, 9 Sep 2010 20:22:26 +0000 (16:22 -0400)]
set_home and always_set_home have an effect if HOME is present in
the env_keep list.

14 years agoMake -H flag work when HOME is listed in env_keep. Also makes
Todd C. Miller [Thu, 9 Sep 2010 20:16:39 +0000 (16:16 -0400)]
Make -H flag work when HOME is listed in env_keep.  Also makes
"set_home" and "always_set_home" override override HOME in env_keep.

14 years agoConvert sudoers plugin to use interface list passed in settings.
Todd C. Miller [Wed, 8 Sep 2010 19:07:40 +0000 (15:07 -0400)]
Convert sudoers plugin to use interface list passed in settings.

14 years agoQuery local network interfaces in the main sudo driver and pass to
Todd C. Miller [Wed, 8 Sep 2010 18:20:11 +0000 (14:20 -0400)]
Query local network interfaces in the main sudo driver and pass to
the plugin as "network_addrs" in the settings list.

14 years agoSolaris BSM audit return EINVAL when auditing is not enabled, whereas
Todd C. Miller [Wed, 8 Sep 2010 13:47:00 +0000 (09:47 -0400)]
Solaris BSM audit return EINVAL when auditing is not enabled, whereas
OpenBSM returns ENOSYS.

14 years agomissing.h should come before most local includes
Todd C. Miller [Tue, 7 Sep 2010 23:14:22 +0000 (19:14 -0400)]
missing.h should come before most local includes

14 years agomissing.h should come before most local includes
Todd C. Miller [Tue, 7 Sep 2010 22:28:55 +0000 (18:28 -0400)]
missing.h should come before most local includes

14 years agoMake local includes consistent; use double quotes for local includes
Todd C. Miller [Tue, 7 Sep 2010 22:28:22 +0000 (18:28 -0400)]
Make local includes consistent; use double quotes for local includes
except for generated ones where we use angle brackets.

14 years agoAlways fill in NewArgv for audit code.
Todd C. Miller [Tue, 7 Sep 2010 21:59:10 +0000 (17:59 -0400)]
Always fill in NewArgv for audit code.

14 years agoAdd missing LOG_INPUT/LOG_OUTPUT support in the lexer.
Todd C. Miller [Tue, 7 Sep 2010 21:16:05 +0000 (17:16 -0400)]
Add missing LOG_INPUT/LOG_OUTPUT support in the lexer.

14 years agoMake local includes consistent; use double quotes for local includes
Todd C. Miller [Tue, 7 Sep 2010 20:45:19 +0000 (16:45 -0400)]
Make local includes consistent; use double quotes for local includes
except for generated ones where we use angle brackets.
Also g/c unused compat.h.

14 years agoWhen matching the runas user and runas group (-u and -g command
Todd C. Miller [Mon, 6 Sep 2010 11:56:15 +0000 (07:56 -0400)]
When matching the runas user and runas group (-u and -g command
line options), keep track of runas group and runas user matches
separately.  Only return a positive match if we have a match for
both runas user and runas group (if specified).

14 years agoAdd support for multiple URI lines by joining the contents and passing
Todd C. Miller [Sun, 5 Sep 2010 00:43:51 +0000 (20:43 -0400)]
Add support for multiple URI lines by joining the contents and passing
the result to ldap_initialize.

14 years agoDo not return -1 on error from the display functions; the caller
Todd C. Miller [Sat, 4 Sep 2010 12:42:08 +0000 (08:42 -0400)]
Do not return -1 on error from the display functions; the caller
expects a return value >= 0.

14 years agoDo not set both MODE_EDIT and MODE_RUN
Todd C. Miller [Sat, 4 Sep 2010 12:41:42 +0000 (08:41 -0400)]
Do not set both MODE_EDIT and MODE_RUN

14 years agoMove includes to the top of the file.
Todd C. Miller [Fri, 3 Sep 2010 23:28:42 +0000 (19:28 -0400)]
Move includes to the top of the file.

14 years agoAdd missing definition of timedir
Todd C. Miller [Mon, 30 Aug 2010 13:47:52 +0000 (09:47 -0400)]
Add missing definition of timedir

14 years agoAdd #include of sys/types.h for .c files that include missing.h to
Todd C. Miller [Mon, 30 Aug 2010 13:14:41 +0000 (09:14 -0400)]
Add #include of sys/types.h for .c files that include missing.h to
be sure that size_t and ssize_t are defined.

14 years agoInstall sudoers file from the build dir not hte src dir.
Todd C. Miller [Mon, 30 Aug 2010 13:06:25 +0000 (09:06 -0400)]
Install sudoers file from the build dir not hte src dir.

14 years agoIf runas_pw changes, reset the stashed runas aux group vector.
Todd C. Miller [Thu, 26 Aug 2010 15:40:04 +0000 (11:40 -0400)]
If runas_pw changes, reset the stashed runas aux group vector.
Otherwise, if runas_default is set in a per-command Defaults statement,
the command runs with root's aux group vector (i.e. the one that
was used when locating the command).

14 years agoAdd target to generate sudoers file
Todd C. Miller [Thu, 26 Aug 2010 15:06:12 +0000 (11:06 -0400)]
Add target to generate sudoers file
Remove generated sudoers file as part of distclean

14 years agoWhen not logging I/O install a handler for SIGCONT and deliver it
Todd C. Miller [Tue, 24 Aug 2010 12:42:47 +0000 (08:42 -0400)]
When not logging I/O install a handler for SIGCONT and deliver it
to the command upon resume.  Fixes bugzilla #431

14 years agog/c unused auth_pw extern definition
Todd C. Miller [Sat, 21 Aug 2010 14:02:50 +0000 (10:02 -0400)]
g/c unused auth_pw extern definition

14 years agoMove get_auth() into check.c where it is actually used.
Todd C. Miller [Sat, 21 Aug 2010 12:48:35 +0000 (08:48 -0400)]
Move get_auth() into check.c where it is actually used.

14 years agoConvert a remaining puts() and putchar() to use the output function.
Todd C. Miller [Fri, 20 Aug 2010 20:53:21 +0000 (16:53 -0400)]
Convert a remaining puts() and putchar() to use the output function.

14 years agoPlug memory leak
Todd C. Miller [Fri, 20 Aug 2010 18:24:07 +0000 (14:24 -0400)]
Plug memory leak

14 years agoSet dupcheck to TRUE when setting new HOME value if !env_reset but
Todd C. Miller [Wed, 18 Aug 2010 19:26:26 +0000 (15:26 -0400)]
Set dupcheck to TRUE when setting new HOME value if !env_reset but
always_set_home is true.  Prevents a duplicate HOME in the environment
(old value plus the new one) introduced in f421f8827340.

14 years agoSubstitute sysconfdir in the installed sudoers file to get the
Todd C. Miller [Wed, 18 Aug 2010 12:09:10 +0000 (08:09 -0400)]
Substitute sysconfdir in the installed sudoers file to get the
correct path for sudoers.d.

14 years agoFix typo that prevented compilation on Irix; Friedrich Haubensak
Todd C. Miller [Tue, 17 Aug 2010 13:51:12 +0000 (09:51 -0400)]
Fix typo that prevented compilation on Irix; Friedrich Haubensak

14 years agoMerge compat.h and missing.h into missing.h
Todd C. Miller [Mon, 16 Aug 2010 18:05:44 +0000 (14:05 -0400)]
Merge compat.h and missing.h into missing.h

14 years agoIf the user hits ^C while a password is being read, error out before
Todd C. Miller [Sat, 14 Aug 2010 14:18:49 +0000 (10:18 -0400)]
If the user hits ^C while a password is being read, error out before
reading any further passwords in the pam conversation function.
Otherwise, if multiple PAM auth methods are required, the user will
have to hit ^C for each one.

14 years agoUpdate comment
Todd C. Miller [Thu, 12 Aug 2010 15:55:56 +0000 (11:55 -0400)]
Update comment

14 years agoDocument sudo_conv_t function and sudo_printf_t return values.
Todd C. Miller [Thu, 12 Aug 2010 14:29:43 +0000 (10:29 -0400)]
Document sudo_conv_t function and sudo_printf_t return values.

14 years agoMake _sudo_printf return the number of characters printed on success
Todd C. Miller [Thu, 12 Aug 2010 14:27:56 +0000 (10:27 -0400)]
Make _sudo_printf return the number of characters printed on success
like printf(3).

14 years agosudoers.h includes sudo_plugin.h for us
Todd C. Miller [Tue, 10 Aug 2010 20:36:54 +0000 (16:36 -0400)]
sudoers.h includes sudo_plugin.h for us

14 years agoUse gettimeofday() directly instead of via the gettime() wrapper.
Todd C. Miller [Tue, 10 Aug 2010 17:50:40 +0000 (13:50 -0400)]
Use gettimeofday() directly instead of via the gettime() wrapper.

14 years agoRemove some obsolete configure tests, ancient Unix systems are no
Todd C. Miller [Tue, 10 Aug 2010 17:44:05 +0000 (13:44 -0400)]
Remove some obsolete configure tests, ancient Unix systems are no
longer supported.

14 years agoSet pp_kit_version and strip off patch level
Todd C. Miller [Sat, 7 Aug 2010 18:29:09 +0000 (14:29 -0400)]
Set pp_kit_version and strip off patch level

14 years agoBetter handling of versions with a patchlevel. For rpm and deb, use
Todd C. Miller [Sat, 7 Aug 2010 15:08:32 +0000 (11:08 -0400)]
Better handling of versions with a patchlevel.  For rpm and deb, use
the patchlevel+1 as the release.  For AIX, use the patchlevel as the
4th version number.  For the rest, just leave the patchlevel in the
version string.

14 years agoFor non-standalone auth methods, stop reading the password if the
Todd C. Miller [Fri, 6 Aug 2010 21:16:57 +0000 (17:16 -0400)]
For non-standalone auth methods, stop reading the password if the
user enters ^C at the prompt.

14 years agoNo need to look up shadow password unless we are doing password-style
Todd C. Miller [Fri, 6 Aug 2010 17:55:33 +0000 (13:55 -0400)]
No need to look up shadow password unless we are doing password-style
authentication.  This moves the shadow password lookup to the auth
functions that need it.

14 years agoRetain final passwd/group refs until the policy close() function.
Todd C. Miller [Fri, 6 Aug 2010 17:54:35 +0000 (13:54 -0400)]
Retain final passwd/group refs until the policy close() function.
Note that this doesn't get called in all cases so putting
this in a cleanup function is probably better.

14 years agoFix mismerge
Todd C. Miller [Fri, 6 Aug 2010 17:53:17 +0000 (13:53 -0400)]
Fix mismerge

14 years agoWhen removing/resetting the timestamp file ignore the tty ticket contents.
Todd C. Miller [Fri, 6 Aug 2010 16:07:21 +0000 (12:07 -0400)]
When removing/resetting the timestamp file ignore the tty ticket contents.

14 years agodelref sudo_user.pw, runas_pw and runas_gr immediately before we return.
Todd C. Miller [Fri, 6 Aug 2010 16:07:03 +0000 (12:07 -0400)]
delref sudo_user.pw, runas_pw and runas_gr immediately before we return.

14 years agoReference count cached passwd and group structs. The cache holds
Todd C. Miller [Wed, 4 Aug 2010 13:58:50 +0000 (09:58 -0400)]
Reference count cached passwd and group structs.  The cache holds
one reference itself and another is added by sudo_getgr{gid,nam}
and sudo_getpw{uid,nam}.  The final ref on the runas and user passwd
and group structs are persistent for now.

14 years agofix typo
Todd C. Miller [Wed, 4 Aug 2010 12:42:05 +0000 (08:42 -0400)]
fix typo

14 years agoDo not produce a warning for "sudo -k" if the ticket file does not
Todd C. Miller [Tue, 3 Aug 2010 19:16:57 +0000 (15:16 -0400)]
Do not produce a warning for "sudo -k" if the ticket file does not
exist.

14 years agoInstead of caching struct passwd and struct group in the red-black
Todd C. Miller [Tue, 3 Aug 2010 19:15:45 +0000 (15:15 -0400)]
Instead of caching struct passwd and struct group in the red-black
tree, store a struct cache_item which includes both the key and
datum.  This allows us to user the actual name that was looked up
as the key instead of the contents of struct passwd or struct group.
This matters because the name in the database may not match what
we looked up, due either to case folding or truncation (historically
at 8 characters).  Also mark the disabled calls to sudo_freepwcache()
and sudo_freegrcache() as broken since we use cached data for things
like set_perms() and the logging functions.  Fixing this would
require making a copy of the structs for user and runas or adding
a reference count (better).

14 years agoFix path to mkinstalldirs
Todd C. Miller [Tue, 3 Aug 2010 19:10:56 +0000 (15:10 -0400)]
Fix path to mkinstalldirs

14 years agoQuiet gcc warnings on glibc systems that use warn_unused_result for
Todd C. Miller [Tue, 3 Aug 2010 15:17:56 +0000 (11:17 -0400)]
Quiet gcc warnings on glibc systems that use warn_unused_result for
write(2) and others.

14 years agoAdd %option noinput
Todd C. Miller [Mon, 2 Aug 2010 22:17:51 +0000 (18:17 -0400)]
Add %option noinput