Commit Graph

299 Commits

Author SHA1 Message Date
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
9497df293a Don't run regress tests or sudoers sanity check (using the newly-built
visudo) when cross compiling.  Bug #560
2012-06-20 13:38:17 -04:00
Todd C. Miller
c74d406313 Older versions of Solaris lack ngettext() 2012-06-18 14:29:06 -04:00
Todd C. Miller
2ef0cc73fc Sudo defines HAVE_SETLOCALE not HAVE_LOCALE_H 2012-06-18 14:03:39 -04:00
Todd C. Miller
5ac272c03e Fix gcc 2.x variant macro support. 2012-06-18 14:03:11 -04:00
Todd C. Miller
60a3019483 Add support for controlling symbol visibility using the HP and
Solaris C compilers.
2012-06-15 14:18:23 -04:00
Todd C. Miller
1fe3f9f40f The visibility attribute was actually added in gcc 3.3.x, not 4.0.
Just assume that if -fvisibility=hidden works that the attribute
is usable.
2012-06-13 16:57:49 -04:00
Todd C. Miller
6f6b0dec6c Use gcc's visibility attribute to specify when symbols are visible
or hidden, if available.  If not available, use an ELF version
script if it is supported.  If all else fails, fall back to using
libtool's -export-symbols.
2012-06-13 14:01:16 -04:00
Todd C. Miller
c131cb36f5 Make installed file modes consistent with the file modes in the
sudo package.
2012-06-11 10:17:19 -04:00
Todd C. Miller
4e0ffceacb Add offsetof macro for those without it. 2012-05-10 10:01:26 -04:00
Todd C. Miller
c8ce3a0a85 Log the process id in the debug file output. Since we don't want
to keep calling getpid(), stash the value at init time and when we
fork().
2012-04-06 15:20:16 -04:00
Todd C. Miller
abdff25703 Always pass __func__, __FILE__ and __LINE__ in sudo_debug_printf()
and use a new flag, SUDO_DEBUG_FILENO to specify when to use it.
This allows consumers of sudo_debug_printf() to log that data without
having to specify it manually.
2012-04-05 13:04:00 -04:00
Todd C. Miller
2c84bd4d08 Log warning() at SUDO_DEBUG_WARN not SUDO_DEBUG_ERROR.
Log the function, file and line number in the debug log for warning()
and error().
2012-04-05 12:37:15 -04:00
Todd C. Miller
2fe41248ac Add SUDO_DEBUG_ERRNO flag to debug functions so we can log errno.
Use this flag when wrapping error() and warning() so the debug
output includes the error string.
2012-04-04 16:59:31 -04:00
Todd C. Miller
1e7afbd53f g/c __unused which is no longer used 2012-03-28 17:07:29 -04:00
Todd C. Miller
dbbb48c45f Add ecalloc() and commented out recalloc().
Use inline strnlen() instead of strlen() in estrndup().
2012-03-19 11:23:25 -04:00
Todd C. Miller
96f046c1ce Rename plugin "args" to "options" 2012-03-15 12:32:31 -04:00
Todd C. Miller
6d10909949 Pass a pointer to user_env in to the init_session policy plugin
function so session setup can modify the user environment as needed.
For PAM authentication, merge the PAM environment with the user
environment at init_session time.  We no longer need to swap in the
user_env for environ during session init, nor do we need to disable
the env hooks at init_session time.
2012-03-15 09:18:36 -04:00
Todd C. Miller
7e11069932 Use sudo_hook_fn_t in struct sudo_hook. 2012-03-13 17:32:50 -04:00
Todd C. Miller
37770ecf1e Initial cut at a hooks implementation. The plugin can register
hooks for getenv, putenv, setenv and unsetenv.  This makes it
possible for the plugin to trap changes to the environment made by
authentication methods such as PAM or BSD auth so that such changes
are reflected in the environment passed back to sudo for execve().
2012-03-07 16:35:42 -05:00
Todd C. Miller
a16dee915b Add support for plugin args at the end of a Plugin line in sudo.conf.
Bump the minor number accordingly and update the documentation.  A
plugin must check the sudo front end's version before using the
plugin_args parameter since it is only supported for API version
1.2 and higher.
2012-03-02 11:04:09 -05:00
Todd C. Miller
8d05f0d1b0 Add type param to sudo_secure_path() and add sudo_secure_file()
and sudo_secure_dir() wrappers which get by #includedir in sudoers.
2012-02-29 15:50:48 -05:00
Todd C. Miller
28db1fbbed We need sysconfdir in compat/Makfile to get the proper sudo.conf
path.  Add standard prefix and foodir expansion in all Makefiles
to avoid this problem in the future.
2012-02-27 13:28:15 -05:00
Todd C. Miller
415454ff59 Relax the user/group/mode checks on sudoers files. As long as the
file is owned by the right user, not world-writable and not writable
by a group other than the one specified at configure time (gid 0
by default), the file is considered OK.  Note that visudo will still
set the mode to the value specified at configure time.
2012-02-22 13:04:03 -05:00
Todd C. Miller
cb66fc6f10 Use -m not -M for install-sh for everything except setuid.
Install locale .mo files mode 0444, not 0644.
If timedir parent doesn't exist, use default dir mode, not 0700.
2012-02-09 11:11:58 -05:00
Todd C. Miller
8c1d8a7b15 Make a copy of the struct passwd in exec_setup() to make sure nothing
in the policy init modifies it.
2012-02-06 10:56:39 -05:00
Todd C. Miller
e16ae617e4 g/c now-unused debug subsystems 2012-02-05 10:17:26 -05:00
Todd C. Miller
c970d464cb Normally, sudo disables core dumps while it is running. This
behavior can now be modified at run time with a line in sudo.conf
like "Set disable_coredumps false"
2012-02-03 14:57:03 -05:00
Todd C. Miller
fa1f781a0e Separate sudo.conf parsing from plugin loading and move the parse
functions into the common lib so that visudo, etc. can use them.
2011-12-20 08:55:13 -05:00
Todd C. Miller
1cec1f4777 No need for install target to depend explicitly on install-dirs,
the install-foo targets all depend on it.
2011-12-07 14:33:25 -05: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
a64f1eaea8 Do not close error pipe or debug fd via closefrom() as we need them
to report an exec error should one occur.
2011-11-29 19:51:24 -05:00
Todd C. Miller
3ee9cef0da Fold SUDO_DEBUG_PROGERR and SUDO_DEBUG_SYSERR into SUDO_DEBUG_ERROR 2011-11-07 16:33:49 -05:00
Todd C. Miller
9923464d96 Wrap error/errorx and warning/warningx functions with debug statements.
Disable wrapping for standalone sudoers programs as well as memory
allocation functions (to avoid infinite recursion).
2011-10-22 14:28:33 -04:00
Todd C. Miller
53e3ad11b5 New debug framework for sudo and plugins using /etc/sudo.conf that
also supports function call tracing.
2011-10-22 14:00:52 -04:00
Todd C. Miller
47af0fc2b8 Add configure test for missing errno declaration and only
declare it ourselves if it is missing.
2011-08-30 10:05:30 -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
e66169b3ed Move nls targets to the top level Makefile so the paths in
the pot file are saner
2011-06-04 18:27:13 -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
bf7e7b5752 Add gettext.h convenience header. This is similar to but distinct from
the one included with the gettext package.
2011-05-20 11:48:17 -04:00
Todd C. Miller
f4a4cbeabd Add __printflike 2011-05-19 16:21:41 -04:00
Todd C. Miller
3164f58143 Add scaffolding to update .po files and install .mo files. 2011-05-19 15:25:29 -04:00
Todd C. Miller
44c763c728 If there is an existing sudoers file, only install if it passes a
syntax check.
2011-03-29 15:20:32 -04:00
Todd C. Miller
53da5e8cdf Update copyright years. 2011-03-11 15:34:35 -05:00
Todd C. Miller
e558b79e85 Move struct generic_plugin to sudo_plugin_int.h 2011-02-23 15:12:04 -05:00
Todd C. Miller
435e44808d add localstatedir; closes bug 471 2011-02-19 08:29:21 -05:00
Todd C. Miller
f7f8b6867e Update copyright year to 2011 2011-01-20 16:46:56 -05:00
Todd C. Miller
1defd7b456 Add regression tests for iolog_path() 2011-01-06 11:05:28 -05:00
Todd C. Miller
f8de3f6327 Add support for "make Makefile" to regenerate Makefile from Makefile.in 2011-01-06 10:44:28 -05:00
Todd C. Miller
5cf56a77ec Provide mkdtemp() for systems without it. 2010-12-27 13:49:49 -05:00