Commit Graph

1221 Commits

Author SHA1 Message Date
Todd C. Miller
388ad69f09 regen 2013-12-19 16:44:05 -07:00
Todd C. Miller
eb44a5ba5c No need to use __signed. 2013-12-17 16:08:18 -07:00
Todd C. Miller
a0204080ee Need limits.h here too. 2013-12-17 16:02:32 -07:00
Todd C. Miller
0cfe027b5f regen 2013-12-17 10:48:20 -07:00
Todd C. Miller
65012dd661 Use a switch to map digest type to name instead of an array of
strings.
2013-12-16 17:00:17 -07:00
Todd C. Miller
68f6e23b07 Change visudo -x to take a file name argument, which may be '-' to
write the exported sudoers file to stdout.
2013-12-16 14:32:42 -07:00
Todd C. Miller
b2c456341a Move symbol extern defs into sudoers.h 2013-12-16 14:18:42 -07:00
Todd C. Miller
624f4fdb13 Add missing sudo_util.h 2013-12-16 14:14:36 -07:00
Todd C. Miller
cf47b156fc Warn if the time stamp in the I/O log file does not fit in time_t.
Warn if the info line is not well-formed instead of silently ignoring
it.
2013-12-14 08:30:37 -07:00
Todd C. Miller
62b559db15 Rename libcommon libsudo_util 2013-12-13 07:46:05 -07:00
Todd C. Miller
3e2d818ed9 Move prototypes for functions provided by libcommon that don't have
their own header files into sudo_util.h.
2013-12-12 18:29:07 -07:00
Todd C. Miller
ef2cff1d33 Now that we have proper number parsing functions we should store
T_UINT defaults values as unsigned int, not int.
2013-12-11 14:43:04 -07:00
Todd C. Miller
3e4f5c5848 Don't use int where we really mean enum def_tuple. When this code
was written it was assumed that we may have multiple tuple types.
However, that hasn't happened and probably never will.
2013-12-11 14:31:50 -07:00
Todd C. Miller
03b013ab26 Regen after string parsing changes. 2013-12-11 13:55:12 -07:00
Todd C. Miller
cbf41b8b96 The OpenBSD strtonum() uses very short error strings that can't
be translated usefully.  Convert them to longer strings on error.
Also use the longer strings for atomode() and atoid().
2013-12-11 13:43:10 -07:00
Todd C. Miller
d83bfb9fe6 Add atomode() function for parsing a file mode. 2013-12-10 16:56:54 -07:00
Todd C. Miller
8f9ce7249a Use strtonum() instead of atoi(), strtol() or strtoul() where possible. 2013-12-10 16:23:21 -07:00
Todd C. Miller
b7c647a4fe check_symbols needs to link with SUDO_LIBS in order to get -lpthread
on HP-UX for libldap (which uses threads).  It would be better to
have a separate variable for the pthread library but this is no
worse than it used to be.
2013-12-09 14:00:55 -07:00
Todd C. Miller
8bdf3d9a27 When checking whether a user may change the login class, just check
pw_uid of the runas user, which was passed in to set_loginclass().
2013-12-07 09:17:54 -07:00
Todd C. Miller
acdff2d998 Use atoid() when parsing user/group IDs and print them as unsigned int. 2013-12-06 14:10:03 -07:00
Todd C. Miller
e964aa4d8c Correctly parse 64-bit times in I/O log files. 2013-12-05 16:19:50 -07:00
Todd C. Miller
e1ac1a2ff3 Use atoid() not atoi() when parsing uids/gids. 2013-12-05 15:51:56 -07:00
Todd C. Miller
2508da6f68 Better match debugging.
Sprinkle const in match functions.
2013-12-05 14:34:56 -07:00
Todd C. Miller
9e964a8c0e sudo_sss_filter_user_netgroup(): fix comment typos, break out of loop
early if we match ALL or netgroup.
2013-12-03 15:47:45 -07:00
Todd C. Miller
302d3273a8 When filtering netgroups, use the passwd struct stashed in the handle,
not user_name since we may be listing another users privileges.
2013-12-03 15:39:12 -07:00
Todd C. Miller
f477b343fe Avoid passing NULL domainname to sudo_debug_printf(). 2013-12-03 15:15:12 -07:00
Todd C. Miller
878ddb1788 Use atoid() instead of atoi() when parsing uids/gids so we get
proper range checking.
2013-12-03 14:33:26 -07:00
Todd C. Miller
f56eca8051 Add user netgroup filtering for SSSD. Previously, rules for a
netgroup were applied to all even when they did not belong to the
specified netgroup.  RedHat Bugzilla 880150.
2013-12-03 14:19:37 -07:00
Todd C. Miller
543d3b701e Fix several issues found by the clang static analyzer; Daniel Kopecek 2013-12-03 14:10:11 -07:00
Todd C. Miller
0d81263e26 Instead of setprogname(), add initprogname() which gets the program
name for getprogname() using /proc or pstat() if possible.
2013-12-01 19:12:21 -07:00
Todd C. Miller
fdf56ee940 Sync with translationproject.org 2013-11-30 15:19:19 -07:00
Todd C. Miller
188e921560 Add missing newline in help message after export option. 2013-11-28 06:08:08 -07:00
Todd C. Miller
4247c1741b Do not add LIBDL to SUDO_LIBS or SUDOERS_LIBS in configure, do it
in Makefile.in so we can make it last.  Fixes a linking problem on
Ubuntu precise.
2013-11-26 07:15:55 -07:00
Todd C. Miller
58a0540b96 Regen for sudo 1.8.9b1 2013-11-24 16:37:32 -07:00
Todd C. Miller
12f3bdf60e Add wrapper functions for dlopen() et al so that we can support
statically compiling in the sudoers plugin but still allow other
plugins to be loaded.  The new --enable-static-sudoers configure
option will cause the sudoers plugin to be compiled statically into
the sudo binary.  This does not prevent other plugins from being
loaded as per sudo.conf.
2013-11-22 16:35:15 -07:00
Todd C. Miller
0fb17059a6 Handle non-unix groups correctly. Get rid of runasuser and runasgroup
types and use username and usergroup instead.  The fact that the user
or group is inside a Runas_List doesn't affect its underlying type.
2013-11-21 09:45:55 -07:00
Todd C. Miller
bf700fdd58 Simplify Defaults list option object. The name and value strings
are superfluous.
2013-11-20 14:35:35 -07:00
Todd C. Miller
ba40be9dd2 Define RTLD_GLOBAL for older systems without it. Bug #621 2013-11-20 07:22:10 -07:00
Todd C. Miller
054a94e6c9 Add definition of U_ for --disable-nsl
Don't define warning_gettext if --disable-nsl
Bug #621; from Daniel Richard G.
2013-11-19 09:45:13 -07:00
Todd C. Miller
0a7ebf8b23 When merging Defaults entries we need to check the type of the
next entry and not just assume it is the same as the previous one.
2013-11-18 16:59:02 -07:00
Todd C. Miller
f16ce9714d runasgroups not runasgroup in the Cmnd_Spec. 2013-11-18 16:28:10 -07:00
Todd C. Miller
a1b1c80b26 Fix some syntax errors and change how lists are handled. 2013-11-18 12:00:44 -07:00
Todd C. Miller
96eb2c4f8f Add warning_gettext() wrapper function that changes to the user locale,
then calls gettext().
Add U_ macro that calls warning_gettext() instead of gettext().
Rename warning2()/error2() back to warning_nodebug()/error_nodebug().
2013-11-18 08:59:57 -07:00
Todd C. Miller
99b7351de0 Fix some #if vs. #ifdef and remove an extraneous semicolon.
Bug #624; from Daniel Richard G.
2013-11-17 16:15:36 -07:00
Todd C. Miller
6c71ad5c15 Add debug_return_const_str and debug_return_const_ptr for returning
a const string or pointer.  Using const for the normal versions
produces warnings with the Tru64 compiler.
2013-11-17 16:11:39 -07:00
Todd C. Miller
7017c904c1 log_{fatal,warning} now logs to the debug file itself.
log_{fatal,warning} now calls warningx2() after setting the
locale itself instead of using the wrapper macros.
This removes the only use of warningx(ngettext(...)).
2013-11-16 09:21:43 -07:00
Todd C. Miller
6d8b078e2b Add support to visudo to export sudoers in JSON format. 2013-11-15 15:11:55 -07:00
Todd C. Miller
bba91c008b Remove unused digest field from struct cmndspec, the digest really
lives in struct sudo_command.
2013-11-13 16:17:16 -07:00
Todd C. Miller
69f7ed79c2 Add regress test for bug #623 2013-11-12 09:50:36 -07:00
Todd C. Miller
a3aa40b0fe Cope with a comment on the last line of the file with no newline.
Bug #623
2013-11-12 09:36:39 -07:00