]> granicus.if.org Git - sudo/log
sudo
14 years agoSet errorfile to the sudoers path if we set parse_error manually.
Todd C. Miller [Wed, 14 Apr 2010 10:24:42 +0000 (06:24 -0400)]
Set errorfile to the sudoers path if we set parse_error manually.
This prevents a NULL dereference in printf() when checking a sudoers
file in strict mode when alias errors are present.

14 years agoMain sudo no longer print "unable to execute" on exec failure so do it here.
Todd C. Miller [Wed, 14 Apr 2010 09:51:11 +0000 (05:51 -0400)]
Main sudo no longer print "unable to execute" on exec failure so do it here.

14 years agoUse a pipe to pass back errno to the parent if execve() fails.
Todd C. Miller [Tue, 13 Apr 2010 23:40:32 +0000 (19:40 -0400)]
Use a pipe to pass back errno to the parent if execve() fails.
If we get an error in script_child(), kill the command and exit.

14 years agoHandle plugin's open function returning -2 (usage error).
Todd C. Miller [Tue, 13 Apr 2010 13:36:43 +0000 (09:36 -0400)]
Handle plugin's open function returning -2 (usage error).

14 years agoIf execve() fails, leave it to the plugin to print an error string.
Todd C. Miller [Tue, 13 Apr 2010 11:39:06 +0000 (07:39 -0400)]
If execve() fails, leave it to the plugin to print an error string.

14 years agoIf execve fails in logging mode, pass the errno directly to the grandparent
Todd C. Miller [Tue, 13 Apr 2010 10:31:55 +0000 (06:31 -0400)]
If execve fails in logging mode, pass the errno directly to the grandparent
on the backchannel and exit.  The immediate parent will get SIGCHLD and
try to report that status but its parent will no longer be listening.
It would probably be cleaner to pass this over a pipe in script_child().

14 years agoDon't override rval with results of check_user() unless it failed.
Todd C. Miller [Tue, 13 Apr 2010 09:53:03 +0000 (05:53 -0400)]
Don't override rval with results of check_user() unless it failed.

14 years agoFix typo
Todd C. Miller [Mon, 12 Apr 2010 15:29:40 +0000 (11:29 -0400)]
Fix typo

14 years agoNULL-terminate env_add
Todd C. Miller [Mon, 12 Apr 2010 11:56:32 +0000 (07:56 -0400)]
NULL-terminate env_add

14 years agoCall the I/O log open function before the I/O version function.
Todd C. Miller [Sun, 11 Apr 2010 21:13:11 +0000 (17:13 -0400)]
Call the I/O log open function before the I/O version function.

14 years agoRemove io_conv and just use sudo_conv
Todd C. Miller [Sun, 11 Apr 2010 21:12:12 +0000 (17:12 -0400)]
Remove io_conv and just use sudo_conv

14 years agoFix set/restore perms for systems w/o setresuid
Todd C. Miller [Sun, 11 Apr 2010 20:38:42 +0000 (16:38 -0400)]
Fix set/restore perms for systems w/o setresuid

14 years agoPrimitive set/restore permissions. Will be replaced by a push/pop
Todd C. Miller [Sat, 10 Apr 2010 14:34:37 +0000 (10:34 -0400)]
Primitive set/restore permissions.  Will be replaced by a push/pop
model.

14 years agoOnly need to take action on SIGCHLD in parent if no I/O logger.
Todd C. Miller [Sat, 10 Apr 2010 14:31:47 +0000 (10:31 -0400)]
Only need to take action on SIGCHLD in parent if no I/O logger.
If there is an I/O logger we will receive ECONNRESET or EPIPE when
we try to read from the socketpair.

14 years agoMerge fb4d571495fa from the 1.7 branch to trunk.
Todd C. Miller [Fri, 9 Apr 2010 10:18:43 +0000 (06:18 -0400)]
Merge fb4d571495fa from the 1.7 branch to trunk.

14 years agoQualify the command even if it is in the current working directory,
Todd C. Miller [Fri, 9 Apr 2010 10:10:07 +0000 (06:10 -0400)]
Qualify the command even if it is in the current working directory,
e.g. "./foo" instead of just returning "foo".  This removes an ambiguity
between real commands and possible pseudo-commands in command matching.

--HG--
branch : 1.7

14 years agoDon't set SA_RESTART when registering SIGALRM handler.
Todd C. Miller [Fri, 9 Apr 2010 00:17:26 +0000 (20:17 -0400)]
Don't set SA_RESTART when registering SIGALRM handler.
Do set SA_RESTART when registering SIGWINCH handler.

14 years agoAdd dev targets for *.man.in and *.cat that don't specfify the $(srcdir)
Todd C. Miller [Fri, 9 Apr 2010 00:08:30 +0000 (20:08 -0400)]
Add dev targets for *.man.in and *.cat that don't specfify the $(srcdir)
prefix.

14 years agoIf log_input or log_output returns false, terminate the command.
Todd C. Miller [Thu, 8 Apr 2010 13:40:27 +0000 (09:40 -0400)]
If log_input or log_output returns false, terminate the command.

14 years agoBetter signal handling.
Todd C. Miller [Thu, 8 Apr 2010 11:40:04 +0000 (07:40 -0400)]
Better signal handling.
Instead of using a single variable to store the received signal, use
an array so we can't lose a signal when multiple are sent.
Fix process termination by SIGALRM in non-I/O logger mode.
Fix relaying terminal signals to the child in non-I/O logger mode.

14 years agoFix a race between when we get the child pid in the parent and when
Todd C. Miller [Thu, 8 Apr 2010 10:12:47 +0000 (06:12 -0400)]
Fix a race between when we get the child pid in the parent and when
the child process exits.  The problem exhibited as a hang after a
short-lived process, e.g. "sudo id" when no IO logger was enabled.

14 years agoAdd a note about the security implications of the fast_glob option.
Todd C. Miller [Wed, 7 Apr 2010 14:09:31 +0000 (10:09 -0400)]
Add a note about the security implications of the fast_glob option.

14 years agoAdd a note about the security implications of the fast_glob option.
Todd C. Miller [Wed, 7 Apr 2010 13:34:41 +0000 (09:34 -0400)]
Add a note about the security implications of the fast_glob option.

--HG--
branch : 1.7

14 years agoRemove duplicate includes
Todd C. Miller [Wed, 7 Apr 2010 10:39:35 +0000 (06:39 -0400)]
Remove duplicate includes

--HG--
branch : 1.7

14 years agoFix up some AC_DEFINE descriptions and regen config.h.in
Todd C. Miller [Tue, 6 Apr 2010 08:53:42 +0000 (04:53 -0400)]
Fix up some AC_DEFINE descriptions and regen config.h.in

14 years agoNo longer check for strdup or strndup for LIBOBJ replacement.
Todd C. Miller [Mon, 5 Apr 2010 23:47:49 +0000 (19:47 -0400)]
No longer check for strdup or strndup for LIBOBJ replacement.

14 years agoAvoid installing signal handlers that are io-logger specific. Fixes
Todd C. Miller [Mon, 5 Apr 2010 20:27:30 +0000 (16:27 -0400)]
Avoid installing signal handlers that are io-logger specific.  Fixes
job control when no io logger is enabled.

14 years agoOnly regen man pages from pod when configured with --with-devel
Todd C. Miller [Mon, 5 Apr 2010 16:24:12 +0000 (12:24 -0400)]
Only regen man pages from pod when configured with --with-devel

14 years agoTop-level Makefile.in. Nothing is currently substituted but this
Todd C. Miller [Mon, 5 Apr 2010 00:05:02 +0000 (20:05 -0400)]
Top-level Makefile.in.  Nothing is currently substituted but this
is needed for separate build dirs.

14 years agoFix out-of-tree builds
Todd C. Miller [Sun, 4 Apr 2010 18:01:21 +0000 (14:01 -0400)]
Fix out-of-tree builds

14 years agoMerge
Todd C. Miller [Sun, 4 Apr 2010 16:47:57 +0000 (12:47 -0400)]
Merge

14 years agoWe always install sudoreplay in 1.8
Todd C. Miller [Sun, 4 Apr 2010 16:31:57 +0000 (12:31 -0400)]
We always install sudoreplay in 1.8

14 years agoFree str after using it in the version method. Use sudo_conv, not
Todd C. Miller [Sun, 4 Apr 2010 12:40:23 +0000 (08:40 -0400)]
Free str after using it in the version method.  Use sudo_conv, not
io_conv since we don't have the IO conversation function pointer
in the I/O version method anymore now that io_open is delayed.

14 years agoSIGPOLL is sometimes the same as SIGIO (like on HP-UX)
Todd C. Miller [Sat, 3 Apr 2010 13:44:32 +0000 (09:44 -0400)]
SIGPOLL is sometimes the same as SIGIO (like on HP-UX)

14 years agoNo need to provide strdup() or strndup(), sudo uses estrdup() and estrndup()
Todd C. Miller [Fri, 2 Apr 2010 18:46:00 +0000 (14:46 -0400)]
No need to provide strdup() or strndup(), sudo uses estrdup() and estrndup()

14 years agoAdd license to mksiglist.c and note that the bits from pdksh are public domain
Todd C. Miller [Fri, 2 Apr 2010 15:18:57 +0000 (11:18 -0400)]
Add license to mksiglist.c and note that the bits from pdksh are public domain

14 years agoFix LIBOBJDIR vs. srcdir wrt the siglist bits
Todd C. Miller [Fri, 2 Apr 2010 13:49:21 +0000 (09:49 -0400)]
Fix LIBOBJDIR vs. srcdir wrt the siglist bits

14 years agoAdd sudoreplay testsudoers and visudo to clean target
Todd C. Miller [Fri, 2 Apr 2010 11:49:29 +0000 (07:49 -0400)]
Add sudoreplay testsudoers and visudo to clean target

14 years agoCreate our own sys_siglist for systems without it for use by strsignal()
Todd C. Miller [Fri, 2 Apr 2010 11:47:19 +0000 (07:47 -0400)]
Create our own sys_siglist for systems without it for use by strsignal()

14 years agoRemove duplicate $(LIBOBJDIR)
Todd C. Miller [Fri, 2 Apr 2010 11:15:02 +0000 (07:15 -0400)]
Remove duplicate $(LIBOBJDIR)

14 years agoMain sudo should not block signals; the plugin should do this in
Todd C. Miller [Thu, 1 Apr 2010 10:35:19 +0000 (06:35 -0400)]
Main sudo should not block signals; the plugin should do this in
check_policy.

14 years agoFix a sizeof(ptr) vs. sizeof(*ptr)
Todd C. Miller [Thu, 1 Apr 2010 00:30:34 +0000 (20:30 -0400)]
Fix a sizeof(ptr) vs. sizeof(*ptr)

14 years agoUnlike most operating systems, HP-UX select() is not interrupted
Todd C. Miller [Wed, 31 Mar 2010 16:43:26 +0000 (12:43 -0400)]
Unlike most operating systems, HP-UX select() is not interrupted
by SIGCHLD when the signal is registered with SA_RESTART.  If
we clear SA_RESTART when calling sigaction() for SIGCHLD we get
the expected behavior and the code in the select() loops already
handles EINTR correctly.

14 years agoprogname should be const
Todd C. Miller [Wed, 31 Mar 2010 14:36:39 +0000 (10:36 -0400)]
progname should be const

14 years agoMove --tag=disable-static to when we link sudoers.la, not when
Todd C. Miller [Wed, 31 Mar 2010 09:44:17 +0000 (05:44 -0400)]
Move --tag=disable-static to when we link sudoers.la, not when
we install.

14 years agoLoad the sudoers I/O plugin by default too now that it is hooked up.
Todd C. Miller [Wed, 31 Mar 2010 09:42:58 +0000 (05:42 -0400)]
Load the sudoers I/O plugin by default too now that it is hooked up.

14 years agoIt looks like AIX doesn't need to push STREAMS modules for ptys.
Todd C. Miller [Tue, 30 Mar 2010 16:06:27 +0000 (12:06 -0400)]
It looks like AIX doesn't need to push STREAMS modules for ptys.

14 years agoDelay calling the I/O plugin open function until the policy plugin
Todd C. Miller [Sun, 28 Mar 2010 12:41:06 +0000 (08:41 -0400)]
Delay calling the I/O plugin open function until the policy plugin
returns success.

14 years agoAdd back io logging (transcript) support. Currently, the open function
Todd C. Miller [Sun, 28 Mar 2010 00:19:40 +0000 (20:19 -0400)]
Add back io logging (transcript) support.  Currently, the open function
runs too early and it is not possible to use the io module independently
of the policy module.

14 years agoComment out dead code; will be removed when set_perms is rewritten.
Todd C. Miller [Sat, 27 Mar 2010 13:12:48 +0000 (09:12 -0400)]
Comment out dead code; will be removed when set_perms is rewritten.

14 years agoFix off by one error when allocating user_groups.
Todd C. Miller [Tue, 23 Mar 2010 09:21:38 +0000 (05:21 -0400)]
Fix off by one error when allocating user_groups.

14 years agoAdd REPLAY_LIBS for sudoreplay and add -lrt to it on Solaris.
Todd C. Miller [Mon, 22 Mar 2010 23:55:49 +0000 (19:55 -0400)]
Add REPLAY_LIBS for sudoreplay and add -lrt to it on Solaris.

14 years agoFix typo in preserve groups case
Todd C. Miller [Mon, 22 Mar 2010 23:39:02 +0000 (19:39 -0400)]
Fix typo in preserve groups case

14 years agoIn command_info it is "runas_groups" not "groups".
Todd C. Miller [Mon, 22 Mar 2010 23:27:02 +0000 (19:27 -0400)]
In command_info it is "runas_groups" not "groups".

14 years agoFix iteration over runas_groups list.
Todd C. Miller [Mon, 22 Mar 2010 22:08:17 +0000 (18:08 -0400)]
Fix iteration over runas_groups list.

14 years agoMerge 5177a284b9ff 549f8f7c2463 88f3181692fe from 1.7 branch.
Todd C. Miller [Mon, 22 Mar 2010 14:19:07 +0000 (10:19 -0400)]
Merge 5177a284b9ff 549f8f7c2463 88f3181692fe from 1.7 branch.

14 years agogetgrouplist(3) for those without it
Todd C. Miller [Mon, 22 Mar 2010 13:54:10 +0000 (09:54 -0400)]
getgrouplist(3) for those without it

14 years agoFix installation of sudoers.ldap in "make install" when --with-ldap
Todd C. Miller [Mon, 22 Mar 2010 13:50:06 +0000 (09:50 -0400)]
Fix installation of sudoers.ldap in "make install" when --with-ldap
was specified without a directory.  From Prof. Dr. Andreas Mueller

--HG--
branch : 1.7

14 years agoSet preserve_groups or groups list in command_info
Todd C. Miller [Mon, 22 Mar 2010 12:28:11 +0000 (08:28 -0400)]
Set preserve_groups or groups list in command_info

14 years agoFix setting of groups list
Todd C. Miller [Mon, 22 Mar 2010 12:26:05 +0000 (08:26 -0400)]
Fix setting of groups list

14 years agoAdd checks for getgrset and getgrouplist and use replacement getgrouplist
Todd C. Miller [Mon, 22 Mar 2010 12:25:30 +0000 (08:25 -0400)]
Add checks for getgrset and getgrouplist and use replacement getgrouplist
if the system doesn't support it.

14 years agoPass in preserve_groups when the -P flag is specified as per the design
Todd C. Miller [Mon, 22 Mar 2010 12:11:06 +0000 (08:11 -0400)]
Pass in preserve_groups when the -P flag is specified as per the design

14 years agoCheck preserve_groups and ignore_ticket args with atobool instead
Todd C. Miller [Mon, 22 Mar 2010 12:09:50 +0000 (08:09 -0400)]
Check preserve_groups and ignore_ticket args with atobool instead
of assuming they are true if present.

14 years agoRename plugin-specific error.c to plugin_error.c
Todd C. Miller [Sun, 21 Mar 2010 16:58:14 +0000 (12:58 -0400)]
Rename plugin-specific error.c to plugin_error.c
Wire up visudo, sudoreplay and testsudoers in the build

14 years agoterm.c does not needto include sudo.h
Todd C. Miller [Sun, 21 Mar 2010 16:57:00 +0000 (12:57 -0400)]
term.c does not needto include sudo.h

14 years agoDocument the -2 return in the check_policy section too
Todd C. Miller [Sun, 21 Mar 2010 12:58:13 +0000 (08:58 -0400)]
Document the -2 return in the check_policy section too

14 years agoFix the -s and -i flags and add support for the "implied_shell"
Todd C. Miller [Sun, 21 Mar 2010 12:54:06 +0000 (08:54 -0400)]
Fix the -s and -i flags and add support for the "implied_shell"
option.  If the user does not specify a command, sudo will now pass
in the path to the user's shell and set impied_shell=true.  The
plugin can them either check the command normally or return -2 to
cause sudo to print a usage message and exit.

14 years agoBring back SUDOERS_PLUGIN but add .dylib -> .so conversion for
Todd C. Miller [Sat, 20 Mar 2010 00:01:00 +0000 (20:01 -0400)]
Bring back SUDOERS_PLUGIN but add .dylib -> .so conversion for
Darwin where libraries end in .dylib but modules end in .so

14 years agoBetter prefix determination now that we can't rely on len==0 to
Todd C. Miller [Fri, 19 Mar 2010 12:17:58 +0000 (08:17 -0400)]
Better prefix determination now that we can't rely on len==0 to
tell the beginning on an entry.

14 years agodisplay_bound_defaults() stub should return 0, not 1 since it is a count,
Todd C. Miller [Fri, 19 Mar 2010 12:17:09 +0000 (08:17 -0400)]
display_bound_defaults() stub should return 0, not 1 since it is a count,
not a boolean.

14 years agoDocument progname in settings
Todd C. Miller [Fri, 19 Mar 2010 11:56:06 +0000 (07:56 -0400)]
Document progname in settings

14 years agoRewrite compat/getprogname.c and add setprogname().
Todd C. Miller [Fri, 19 Mar 2010 11:52:31 +0000 (07:52 -0400)]
Rewrite compat/getprogname.c and add setprogname().
The progname is now passed to the plugin via the settings array.

14 years agoFix --with-ldap
Todd C. Miller [Fri, 19 Mar 2010 11:32:14 +0000 (07:32 -0400)]
Fix --with-ldap

14 years agoAdd missing whitespace for Runas and Command-specific defaults
Todd C. Miller [Fri, 19 Mar 2010 11:31:42 +0000 (07:31 -0400)]
Add missing whitespace for Runas and Command-specific defaults

14 years agoUse embedded newlines in lbuf instead of multiple calls to lbuf_print.
Todd C. Miller [Fri, 19 Mar 2010 11:04:34 +0000 (07:04 -0400)]
Use embedded newlines in lbuf instead of multiple calls to lbuf_print.

14 years agoAdd support for embedded newlines.
Todd C. Miller [Fri, 19 Mar 2010 10:59:02 +0000 (06:59 -0400)]
Add support for embedded newlines.

14 years agoIf system doesn't support getprogname or __programe and we are
Todd C. Miller [Thu, 18 Mar 2010 17:53:12 +0000 (13:53 -0400)]
If system doesn't support getprogname or __programe and we are
building a shared object don't bother with Argc/Argv, just
return "sudo"

14 years agoHard-code sudoers.so instead of using SUDOERS_PLUGIN since libtool
Todd C. Miller [Thu, 18 Mar 2010 16:02:05 +0000 (12:02 -0400)]
Hard-code sudoers.so instead of using SUDOERS_PLUGIN since libtool
appears to always install a shared object with the .so suffix.

14 years agoPlay more nicely with libtool and let it build libreplace (was libmissing)
Todd C. Miller [Thu, 18 Mar 2010 15:42:12 +0000 (11:42 -0400)]
Play more nicely with libtool and let it build libreplace (was libmissing)
for us.

14 years agoInclude stdarg.h for va_list rather than requiring all consumers of
Todd C. Miller [Thu, 18 Mar 2010 12:58:31 +0000 (08:58 -0400)]
Include stdarg.h for va_list rather than requiring all consumers of
missing.h to include stdarg.h themselves.

14 years agoPass in output function to lbuf_init() instead of writing to stdout.
Todd C. Miller [Thu, 18 Mar 2010 10:42:17 +0000 (06:42 -0400)]
Pass in output function to lbuf_init() instead of writing to stdout.
A side effect is that the usage info can now go to stderr as it should.

14 years agoUse number of tty columns that is passed in user_info instead of
Todd C. Miller [Thu, 18 Mar 2010 01:25:32 +0000 (21:25 -0400)]
Use number of tty columns that is passed in user_info instead of
getting it directly in the lbuf code.

14 years agoKill __P in sudoers
Todd C. Miller [Wed, 17 Mar 2010 23:56:27 +0000 (19:56 -0400)]
Kill __P in sudoers

14 years agoSet the sudoers plugin name in configure so we get the extension right.
Todd C. Miller [Wed, 17 Mar 2010 22:48:19 +0000 (18:48 -0400)]
Set the sudoers plugin name in configure so we get the extension right.

14 years agoDocument lines/cols in user_info
Todd C. Miller [Wed, 17 Mar 2010 14:44:16 +0000 (10:44 -0400)]
Document lines/cols in user_info

14 years agoAdd tty size to user info
Todd C. Miller [Wed, 17 Mar 2010 14:36:02 +0000 (10:36 -0400)]
Add tty size to user info

14 years agoUse TIOCGSIZE/TIOCSSIZE instead of TIOCGWINSZ/TIOCSWINSZ
Todd C. Miller [Wed, 17 Mar 2010 12:36:17 +0000 (08:36 -0400)]
Use TIOCGSIZE/TIOCSSIZE instead of TIOCGWINSZ/TIOCSWINSZ

14 years agoKill dead code
Todd C. Miller [Tue, 16 Mar 2010 12:50:03 +0000 (08:50 -0400)]
Kill dead code
Add missing sigsetjmp in sudo_policy_invalidate
Error out if we fail to lookup the user's name that is passed in

14 years agoPass the error value back via siglongjmp.
Todd C. Miller [Tue, 16 Mar 2010 12:41:36 +0000 (08:41 -0400)]
Pass the error value back via siglongjmp.

14 years agoUse conversation function for lecture.
Todd C. Miller [Tue, 16 Mar 2010 11:41:41 +0000 (07:41 -0400)]
Use conversation function for lecture.

14 years agoDon't update ticket file if verify_user returns FALSE.
Todd C. Miller [Tue, 16 Mar 2010 11:13:57 +0000 (07:13 -0400)]
Don't update ticket file if verify_user returns FALSE.

14 years agoWire up invalidate and validate methods for sudoers
Todd C. Miller [Tue, 16 Mar 2010 00:24:55 +0000 (20:24 -0400)]
Wire up invalidate and validate methods for sudoers

14 years agoAdd support for -k flag with a command.
Todd C. Miller [Mon, 15 Mar 2010 23:41:15 +0000 (19:41 -0400)]
Add support for -k flag with a command.

14 years agoAllow -k to be specified with a command.
Todd C. Miller [Mon, 15 Mar 2010 23:40:15 +0000 (19:40 -0400)]
Allow -k to be specified with a command.

14 years agoWire up policy_list
Todd C. Miller [Mon, 15 Mar 2010 22:13:58 +0000 (18:13 -0400)]
Wire up policy_list

14 years agoAdd newline at the end of message and space after the colon in warning message
Todd C. Miller [Mon, 15 Mar 2010 22:13:31 +0000 (18:13 -0400)]
Add newline at the end of message and space after the colon in warning message

14 years agoAdd missing newline after pass password warning
Todd C. Miller [Mon, 15 Mar 2010 22:13:06 +0000 (18:13 -0400)]
Add missing newline after pass password warning

14 years agoSet user_groups and user_ngroups based on user_info
Todd C. Miller [Mon, 15 Mar 2010 21:07:10 +0000 (17:07 -0400)]
Set user_groups and user_ngroups based on user_info

14 years agoMake this compile
Todd C. Miller [Mon, 15 Mar 2010 17:42:40 +0000 (13:42 -0400)]
Make this compile

14 years agoMake _warning in error.c use the conversation function and remove
Todd C. Miller [Mon, 15 Mar 2010 11:14:45 +0000 (07:14 -0400)]
Make _warning in error.c use the conversation function and remove
commented out warning/warningx in sudoers.c.