Commit Graph

33 Commits

Author SHA1 Message Date
Todd C. Miller
d6282d154a Update copyright years. 2013-04-24 09:35:02 -04:00
Todd C. Miller
064cb0ceda For "sudo -l" start a new line if the runas list changes to make
the output easier to read.
2013-02-20 10:47:31 -05:00
Todd C. Miller
d00ad3bbe2 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.
2013-02-19 16:29:17 -05:00
Todd C. Miller
7aae6bd6e3 Add line continuation support to sudo_parseln() and make it use
getline() instead of fgets() internally.
2013-02-07 10:56:01 -05:00
Todd C. Miller
1d7072fe09 Don't include <sys/param.h>. We only needed it for MAXPATHLEN,
MAXHOSTNAMELEN and the MIN/MAX macros.  We now use PATH_MAX and
HOST_NAME_MAX throughout without falling back on MAXPATHLEN or
MAXHOSTNAMELEN and define our own MIN/MAX macros as needed.
2012-12-04 10:40:47 -05:00
Todd C. Miller
68376c1380 Allow sudo to be build with sss support without also including ldap
support.  From Stephane Graber.
2012-10-26 10:27:56 -04:00
Todd C. Miller
3af7a0daf5 Disable word wrap in list mode when stdout is a pipe to make "sudo
-l | grep ..." more useful.  Adapted from a diff by Daniel Kopecek.
2012-09-04 10:44:34 -04:00
Todd C. Miller
d787df3c1d Add support for [SUCCESS=return] in nsswitch.conf; from Daniel Kopecek 2012-09-04 09:22:10 -04:00
Todd C. Miller
d89b1a6be2 Support for using SSSD (http://fedorahosted.org/sssd/) as a sudoers
data source.  From Daniel Kopecek and Pavel Brezina.
2012-08-10 11:59:26 -04:00
Todd C. Miller
54cfac04d1 If there are no privs to print, write the message to the lbuf instead
of printing it directly.
2012-06-01 16:27:17 -04:00
Todd C. Miller
21a2f95821 Use stdbool.h instead of rolling our own TRUE/FALSE macros. 2011-12-02 11:27:33 -05:00
Todd C. Miller
839919566e Add debug_decl/debug_return (almost) everywhere.
Remove old sudo_debug() and convert users to sudo_debug_printf().
2011-10-22 14:40:21 -04:00
Todd C. Miller
b124635b04 Instead of keeping separate groups and gids arrays, create struct
group_info and use it to store both, along with a count for each.
Cache group info on a per-user basis using getgrouplist() to get
the groups.  We no longer need special to special case the user or
list user for user_in_group() and thus no longer need to reset the
groups list when listing another user.
2011-07-20 11:58:45 -04:00
Todd C. Miller
56321ec778 Resolve the list of gids passed in from the sudo frontend (the
result of getgroups()) to names and store both the group names and
ids in the sudo_user struct.  When matching groups in the sudoers
file, match based on the names in the groups list first and
only do a gid-based match when we absolutely have to.  By matching
on the group name (as it is listed in sudoers) instead of id
(which we would have to resolve) we save a lot of group lookups
for sudoers files with a lot of groups in them.
2011-07-01 14:13:47 -04:00
Todd C. Miller
bd36d4f2ab Add primitive format string support to the lbuf code to make translations
simpler.
2011-05-20 15:25:03 -04:00
Todd C. Miller
67cc4ff025 Translate help / usage strings. 2011-05-19 16:07:14 -04:00
Todd C. Miller
6f8cd91928 can't -> "unable to" in warning/error messages 2011-05-18 12:36:26 -04:00
Todd C. Miller
b643b190a7 Prepare sudoers module messages for translation. 2011-05-16 16:32:05 -04:00
Todd C. Miller
8ee8a0d87a Fix exit value of "sudo -l command" in sudoers module. 2011-03-03 09:38:15 -05:00
Todd C. Miller
c3d795ff95 Avoid printing empty "Runas and Command-specific defaults for user"
line.
2011-02-14 11:29:20 -05:00
Todd C. Miller
ae2f7638f5 standardize on "return foo;" rather than "return(foo);" or "return (foo);" 2011-01-24 15:15:18 -05:00
Todd C. Miller
fbbd0603da For "sudo -U user -l" if user is not authorized on the host, say so. 2011-01-21 10:10:26 -05:00
Todd C. Miller
f7f8b6867e Update copyright year to 2011 2011-01-20 16:46:56 -05:00
Todd C. Miller
96767abfe4 When listing, use separate lbufs for the defaults and the privileges and
only print something if the number of privileges is non-zero.  Fixes
extraneous Defaults output for "sudo -U unauthorized_user -l".
2011-01-20 16:19:42 -05:00
Todd C. Miller
165dcfa37f Check initgroups() return value. 2011-01-20 16:15:34 -05:00
Todd C. Miller
30fe4a067c Set usrinfo for AIX
Set adminstrative domain for the process when looking up user's
    password or group info and when preparing for execve().
Include strings.h even if string.h exists since they may define
    different things.  Fixes warnings on AIX and others.
2010-06-29 13:08:05 -04:00
Todd C. Miller
05ae3ea6cb Convert to ANSI C function declarations 2010-04-22 18:09:53 -04:00
Todd C. Miller
71baab8acc Add missing whitespace for Runas and Command-specific defaults 2010-03-19 07:31:42 -04:00
Todd C. Miller
38937dca5e Use embedded newlines in lbuf instead of multiple calls to lbuf_print. 2010-03-19 07:04:34 -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
9b0205846b Initial bits of sudoers plugin; still needs work. 2010-03-14 19:58:47 -04:00
Todd C. Miller
e90fa482f9 Rework source layout in preparation for modular sudo. 2010-02-20 09:14:01 -05:00