Todd C. Miller [Sun, 2 Nov 2008 14:28:03 +0000 (14:28 +0000)]
Short circuit glob() checks if basename(pattern) != basename(command).
Refactor code that checks for a command in a directory and use it in the
glob case if the resolved pattern ends in a '/'.
Todd C. Miller [Wed, 29 Oct 2008 17:26:42 +0000 (17:26 +0000)]
Use MAXHOSTNAMELEN+1 when allocating host/domain name since some
systems do not include space for the NUL in the size. Also manually
NUL-terminate buffer from gethostname() since POSIX is wishy-washy on this.
Todd C. Miller [Sun, 26 Oct 2008 21:13:03 +0000 (21:13 +0000)]
When setting the umask, use the union of the user's umask and the
default value set in sudoers so that we never lower the user's umask
when running a command.
Todd C. Miller [Sun, 26 Oct 2008 20:43:59 +0000 (20:43 +0000)]
Don't try to read from a zero-length sudoers file. Remove the bogus
Solaris work-around for EAGAIN. Since we now use fgetc() it should
not be a problem.
Todd C. Miller [Thu, 23 Oct 2008 16:06:23 +0000 (16:06 +0000)]
Newer heimdal has 2-argument krb5_get_init_creds_opt_free() like MIT krb5.
Really old heimdal has no krb5_get_init_creds_opt_alloc() at all. Add
configure tests to handle all the cases.
Todd C. Miller [Fri, 3 Oct 2008 13:19:31 +0000 (13:19 +0000)]
Fix AIX limit setting. getuserattr() returns values in disk blocks rather
than bytes. The default hard stack size in newer AIX is RLIM_SAVED_MAX.
From Dale King.
Todd C. Miller [Sun, 14 Sep 2008 20:07:49 +0000 (20:07 +0000)]
Check EDITOR/VISUAL to make sure sudoedit is not re-invoking itself or sudo.
This allows one to set EDITOR to sudoedit without getting into an infinite
loop of sudoedit running itself until the path gets too big.
Todd C. Miller [Sat, 21 Jun 2008 00:34:47 +0000 (00:34 +0000)]
Change how the mailer is waited for. Instead of having a SIGCHLD
handler, use the double fork trick to orphan the child that opens
the pipe to sendmail. Fixes a problem running su on some Linux distros.
Todd C. Miller [Wed, 11 Jun 2008 01:13:39 +0000 (01:13 +0000)]
Ignore SIGPIPE instead of blocking it when piping to the mailer. If we
only block the signal it may be delivered later when we unblock.
Also, there is no need to block SIGCHLD since we no longer do the
double fork. The normal SIGCHLD handler is sufficient.
Todd C. Miller [Thu, 8 May 2008 16:49:12 +0000 (16:49 +0000)]
Initialize tags to UNSPEC instead of def_* in "sudo -l" mode.
This fixes a problem where the tag value printed was influenced
by defaults set in the first pass through the parser.
Todd C. Miller [Wed, 26 Mar 2008 17:11:53 +0000 (17:11 +0000)]
It turns out the logic for getting AIX limits is more convoluted
than I realized and differs depending on whether the soft and/or
hard limits are defined.
Todd C. Miller [Sun, 23 Mar 2008 14:18:56 +0000 (14:18 +0000)]
Back out AIX-specific change to set the sudo_noexec path to the .a
file, we do really want to use the .so file. Since libtool doesn't
do that correctly, just install the .so file ourselves in the Makefile.
Todd C. Miller [Tue, 18 Mar 2008 20:08:46 +0000 (20:08 +0000)]
parse_args() cleanup:
Sort command line options in the getopt() switch
The -U option requires a parameter
Normalize a few ISSET calls
Split mode into mode and flags and retire the now-obsolete excl variable
Todd C. Miller [Wed, 12 Mar 2008 23:42:32 +0000 (23:42 +0000)]
Use getopt() to parse the command line. We need to be able to
intersperse env variables and options yet still honor "--""
which complicates things slightly.