Todd C. Miller
5b3d150932
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.
2010-04-08 07:40:04 -04:00
Todd C. Miller
a3f4278388
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.
2010-04-08 06:12:47 -04:00
Todd C. Miller
2634cf08cc
Avoid installing signal handlers that are io-logger specific. Fixes
...
job control when no io logger is enabled.
2010-04-05 16:27:30 -04:00
Todd C. Miller
43b6359df3
Fix out-of-tree builds
2010-04-04 14:01:21 -04:00
Todd C. Miller
8c91f0a30c
Create our own sys_siglist for systems without it for use by strsignal()
2010-04-02 07:47:19 -04:00
Todd C. Miller
44341c9c15
Main sudo should not block signals; the plugin should do this in
...
check_policy.
2010-04-01 06:35:19 -04:00
Todd C. Miller
ca2eee07b5
Fix a sizeof(ptr) vs. sizeof(*ptr)
2010-03-31 20:30:34 -04:00
Todd C. Miller
c3e87c2db3
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.
2010-03-31 12:43:26 -04:00
Todd C. Miller
6c71d6afa4
Load the sudoers I/O plugin by default too now that it is hooked up.
2010-03-31 05:42:58 -04:00
Todd C. Miller
5d6f19671c
It looks like AIX doesn't need to push STREAMS modules for ptys.
2010-03-30 12:06:27 -04:00
Todd C. Miller
e17f1e5cbd
Delay calling the I/O plugin open function until the policy plugin
...
returns success.
2010-03-28 08:41:06 -04:00
Todd C. Miller
43ea59f64f
Fix iteration over runas_groups list.
2010-03-22 18:08:17 -04:00
Todd C. Miller
7af5cdfaf4
Fix setting of groups list
2010-03-22 08:26:05 -04:00
Todd C. Miller
4b36657781
Pass in preserve_groups when the -P flag is specified as per the design
2010-03-22 08:11:06 -04:00
Todd C. Miller
74ce00482f
term.c does not needto include sudo.h
2010-03-21 12:57:00 -04:00
Todd C. Miller
6b180d24da
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.
2010-03-21 08:54:06 -04:00
Todd C. Miller
2e27226a0d
Bring back SUDOERS_PLUGIN but add .dylib -> .so conversion for
...
Darwin where libraries end in .dylib but modules end in .so
2010-03-19 20:01:00 -04:00
Todd C. Miller
eec5235d19
Rewrite compat/getprogname.c and add setprogname().
...
The progname is now passed to the plugin via the settings array.
2010-03-19 07:52:31 -04:00
Todd C. Miller
6f771f39b3
Add support for embedded newlines.
2010-03-19 06:59:02 -04:00
Todd C. Miller
5be1b80169
Hard-code sudoers.so instead of using SUDOERS_PLUGIN since libtool
...
appears to always install a shared object with the .so suffix.
2010-03-18 12:02:05 -04:00
Todd C. Miller
ba9d2f5bb6
Play more nicely with libtool and let it build libreplace (was libmissing)
...
for us.
2010-03-18 11:42:12 -04:00
Todd C. Miller
b4f4afdf69
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.
2010-03-18 06:42:17 -04:00
Todd C. Miller
038ec569de
Use number of tty columns that is passed in user_info instead of
...
getting it directly in the lbuf code.
2010-03-17 21:25:32 -04:00
Todd C. Miller
5a2a2d193f
Set the sudoers plugin name in configure so we get the extension right.
2010-03-17 18:48:19 -04:00
Todd C. Miller
96a98bed4b
Add tty size to user info
2010-03-17 10:36:02 -04:00
Todd C. Miller
f08479f19a
Use TIOCGSIZE/TIOCSSIZE instead of TIOCGWINSZ/TIOCSWINSZ
2010-03-17 08:36:17 -04:00
Todd C. Miller
ee223889c1
Wire up invalidate and validate methods for sudoers
2010-03-15 20:24:55 -04:00
Todd C. Miller
36701e1233
Allow -k to be specified with a command.
2010-03-15 19:40:15 -04:00
Todd C. Miller
b883670a32
Build libmissing in two flavors (one PIC one non-PIC) and link with the
...
appropriate one.
2010-03-14 18:01:17 -04:00
Todd C. Miller
6b4d97ebc3
Add strdup and strndup to compat
2010-03-12 17:11:11 -05:00
Todd C. Miller
0795ef846c
Require either termios or termio, no more sgtty.
2010-03-12 11:45:57 -05:00
Todd C. Miller
5775026a51
Change SUDO_LDFLAGS to SUDOERS_LDFLAGS and add SUDOERS_OBJS.
...
We now use SUDO_OBJS for the main driver as part of OBJS.
2010-03-11 17:21:34 -05:00
Todd C. Miller
f211213dcb
conversation function no longer puts a newline at the end of info
...
or error messages.
2010-03-09 19:20:01 -05:00
Todd C. Miller
c8c4d6a13b
Use parent process group id instead of parent process id when checking
...
foreground status and suspending parent. Fixes an issue when running
commands under /usr/bin/time and others.
2010-03-07 07:45:17 -05:00
Todd C. Miller
4e938c0074
Wire up SIGALRM handler
...
Set close on exec flag for child side of the socketpair
Fix signal handling when not doing I/O logging
2010-03-06 14:34:23 -05:00
Todd C. Miller
d73f580f5a
g/c unused SIGCHLD handler
2010-03-06 14:29:32 -05:00
Todd C. Miller
cc23068c2a
Don't use emalloc() in fmt_string(); we want to be able to use it from
...
a plugin.
2010-03-06 14:29:04 -05:00
Todd C. Miller
5ff6832e16
Simplify conversion of command line args to name=value pairs.
2010-03-05 17:14:19 -05:00
Todd C. Miller
a1b7526e33
Fix a mismatch between sudo_settings and settings_pairs that causes
...
some settings to get the wrong values.
2010-03-05 14:38:42 -05:00
Todd C. Miller
c857c74e3a
Convert to ANSI C
2010-03-04 20:18:22 -05:00
Todd C. Miller
6470a057e1
Fix strlcpy() return value check.
2010-03-04 12:06:42 -05:00
Todd C. Miller
19b17c7502
Add fallback to /bin/sh when execve() fails with ENOEXEC.
2010-02-28 15:10:18 -05:00
Todd C. Miller
76c90bc301
Add estrndup()
2010-02-28 15:09:50 -05:00
Todd C. Miller
f145264ee0
Refactor script_execve() a bit so that it can be used in non-script
...
mode. Needs more cleanup.
2010-02-27 16:53:56 -05:00
Todd C. Miller
157b7805cf
Ignore empty entries in command_info list
2010-02-27 13:36:30 -05:00
Todd C. Miller
25d3b4e51c
Add tq_remove
2010-02-27 13:17:58 -05:00
Todd C. Miller
289dc98d96
Pass timeout to tgetpass()
2010-02-27 12:39:18 -05:00
Todd C. Miller
7ec040b541
Convert to ANSI C
2010-02-27 09:29:59 -05:00
Todd C. Miller
9e5ff964ad
Make user_details extern so tgetpass can get at the uid and gid.
...
Set uid/gid to user before executing askpass program.
Check environment for SUDO_ASKPASS and use that if set.
TODO: a way for the policy to set the askpass program itself
2010-02-24 19:53:45 -05:00
Todd C. Miller
f3b2c9ac1d
No longer need sudo_usage.h in sudo.c
2010-02-24 07:49:16 -05:00