Todd C. Miller [Thu, 7 Mar 2013 20:41:34 +0000 (15:41 -0500)]
Convert efree() to a macro that just casts to void * and does free().
If the system free() can't handle free(NULL) this may crash but C89
was a long time ago.
Todd C. Miller [Wed, 6 Mar 2013 22:08:10 +0000 (17:08 -0500)]
Always install plugins with a .so extension regardless of what
extension the system uses for shared libraries. That way the
group_plugin sudoers setting can be shared between heterogenous
systems.
Todd C. Miller [Tue, 5 Mar 2013 19:06:51 +0000 (14:06 -0500)]
Make sure groupname_len is at least 32 just to be on the safe side.
It is better to allocate a little extra and not need it than to
have to reallocate and start over.
Todd C. Miller [Tue, 5 Mar 2013 15:18:32 +0000 (10:18 -0500)]
Add __malloc_like macro to apply __malloc__ attribute to emalloc,
ecalloc and estrdup. It cannot be applied to realloc since that
may return the same pointer.
Todd C. Miller [Tue, 5 Mar 2013 11:56:57 +0000 (06:56 -0500)]
When running the command in a pty, defer the call to exec_setup()
until just before we exec the command. This is consistent with the
non-pty path. As a side effect, the monitor process runs as root
and not the runas user.
Todd C. Miller [Sun, 24 Feb 2013 18:20:56 +0000 (13:20 -0500)]
Document that close and version be NULL for plugin API >= 1.3 and
that sudo may execute the command directly if there is no close,
or pty or timeout needed.
Todd C. Miller [Sun, 24 Feb 2013 10:54:57 +0000 (05:54 -0500)]
Dummy out close function if there is no end_session for the auth
method and the front-end can handle a NULL close function. Avoids
the extra sudo process when we don't actually need it.
Todd C. Miller [Sat, 23 Feb 2013 19:19:07 +0000 (14:19 -0500)]
If the policy plugin does not provide a close function, there is
no command timeout and no pty is required, skip the event loop and
just exec the command directly.
Todd C. Miller [Sat, 23 Feb 2013 18:53:48 +0000 (13:53 -0500)]
Do not crash if the plugin close and version functions are not
defined. If there is no policy close function, simply print a
warning that the command was not found.
Todd C. Miller [Thu, 21 Feb 2013 12:01:53 +0000 (07:01 -0500)]
Avoid calling realloc3() with a zero size parameter when all retrieved
sssd rules fail. Otherwise we'll get a run-time error due to
malloc(0) checking.
Todd C. Miller [Wed, 20 Feb 2013 20:09:21 +0000 (15:09 -0500)]
Make sudoers file long list output better match the format used by
ldap sudoers. Tags are now converted to options and there is a
single command per line.
Todd C. Miller [Tue, 19 Feb 2013 21:29:17 +0000 (16:29 -0500)]
For "sudo -l" and "sudo -ll" only print the runas info for subsequent
commands in a list if the runas info has changed. If we have new
runas info, print out the tags again so as to be less confusing to
the user. For "sudo -ll" set the line continuation indent to 8.
Todd C. Miller [Fri, 15 Feb 2013 17:31:49 +0000 (12:31 -0500)]
Always display the I/O plugin version as long as its open functions
doesn't return an error. Previously it was only displayed if the
plugin open returned 1.
Todd C. Miller [Wed, 6 Feb 2013 19:06:51 +0000 (14:06 -0500)]
Sudo now stores its libexec files in a "sudo" subdirectory instead
of in libexec itself. For backwards compatibility, if the plugin
is not found in the default plugin directory, sudo will check the
parent directory default directory ends in "/sudo".
Todd C. Miller [Thu, 31 Jan 2013 16:05:56 +0000 (11:05 -0500)]
Remove ttyname() fall back code on systems where we can query the
kernel for the tty device via /proc or sysctl(). If there is no
controlling tty, it is better to just treat the tty as unknown
rather than to blindly use what is hooked up to std{in,out,err}.
Todd C. Miller [Sun, 27 Jan 2013 18:53:11 +0000 (13:53 -0500)]
Add group_source setting in sudo.conf to allow the admin to specify
how a user's groups are looked up. Legal values are static (just
the kernel list from getgroups), dynamic (whatever the group database
includes) and adaptive (only use group db if kernel group list is
full).