Todd C. Miller
854c084956
Fix utmp setup broken by commit be0ca60facf8
2015-07-06 13:56:39 -06:00
Todd C. Miller
d77941c2be
We require POSIX so no need to conditionally include dirent.h.
...
Add a check for d_namlen and use the result in the NAMLEN macro.
2015-07-02 09:24:48 -06:00
Todd C. Miller
0b241088b3
There's no need to conditionalize the #include <unistd.h>, we require
...
a POSIX system.
2015-07-02 09:08:28 -06:00
Todd C. Miller
a76b93e23a
Use our own bitmap macros instead of borrowing the ones from select.
2015-06-23 16:37:00 -06:00
Todd C. Miller
7b086b6842
Quiet clang analyzer false positive.
2015-06-23 12:58:02 -06:00
Todd C. Miller
2aeeb54f3f
Fix uninitialized variables warnings in error case when src file
...
cannot be opened. At least one of these is a false positive.
2015-06-23 12:57:47 -06:00
Todd C. Miller
4a07b472f0
Only include stddef.h where it is needed.
2015-06-20 05:34:35 -06:00
Todd C. Miller
c36415417f
Add function name to "unable to allocate memory" warnings.
2015-06-19 14:51:17 -06:00
Todd C. Miller
dc883f2454
We require ANSI C so stop using the obsolete STDC_HEADERS.
2015-06-19 14:29:27 -06:00
Todd C. Miller
4f9cabd005
Remove obsolete memory.h include.
2015-06-18 21:02:57 -06:00
Todd C. Miller
a50555faa2
Remove support for the obsolete malloc.h header.
2015-06-18 20:30:59 -06:00
Todd C. Miller
ea744042ed
Allow "make LIBTOOL=/path/to/libtool" to work properly.
2015-06-18 13:06:15 -06:00
Todd C. Miller
a38253b101
Replace use of OSDEFS with config.h defines.
...
Rename DEFS in Makefile.in to CPPDEFS and include in CPPFLAGS.
Bring back _BSD_SOURCE as a config.h define.
Remove obsolescent _REENTRANT define.
2015-06-18 09:33:05 -06:00
Todd C. Miller
cb63ca701c
Avoid using exiting allocators in the front end.
2015-06-17 17:00:54 -06:00
Todd C. Miller
25917e435c
We need to unlimit RLIMIT_NPROC in sudoers as well as the sudo front
...
end since set_perms() and restore_perms change the read uid and may
fail with EAGAIN on Linux kernels prior to 3.1.
2015-06-12 15:30:06 -06:00
Todd C. Miller
7107ce4d1d
Remove support for converting plugin.so -> plugin.sl on HP-UX when
...
plugin.so can not be found. This was a temporary hack for using
an older (pre 1.8.7) sudoers plugin with a newer sudo front-end.
2015-06-08 13:57:14 -06:00
Todd C. Miller
4131449ffb
Add a few missing sudo_new_key_val() return value checks.
...
Also use non-exiting allocators for consistency.
2015-05-27 09:42:51 -06:00
Todd C. Miller
05a01d4c5d
Avoid using a leading underbar in defines as they are reserved in
...
ISO C.
2015-05-21 11:13:20 -06:00
Todd C. Miller
1298ea9107
Add target for "make splint". A few files need extra guards to avoid
...
errors on systems where they would not otherwise be compiled.
No warnings from splint.
2015-05-21 11:07:13 -06:00
Todd C. Miller
a40cf3e288
There should be no need to check for tzset() as it is POSIX.
2015-05-18 13:42:06 -06:00
Todd C. Miller
0b1e027b12
Force flat namespace on darwin to make the getenv() hooking work
...
as it does on ELF.
2015-05-15 15:48:24 -06:00
Todd C. Miller
8bc70a635c
Instead of trying to make weak functions work on all platforms,
...
just use a registration function for a plugin-specific setlocale
function. The sudoers version just wraps sudoers_setlocale().
2015-05-11 14:51:32 -06:00
Todd C. Miller
fc7143760b
Fix indentation of -a flag help line.
2015-05-11 13:34:41 -06:00
Todd C. Miller
166ee6879b
Sync tty_present() with sudoers version.
2015-05-07 11:20:49 -06:00
Todd C. Miller
253008e62b
sudo_check_plugin() returns bool.
2015-05-07 11:05:05 -06:00
Todd C. Miller
caf5d45e0f
Previously, debug_return_bool was the same as debug_return_int
...
except that it logged true/false for 1/0. However, this appears
to trigger a bug in some compilers. To avoid this, debug_return_bool
now uses bool, not int. Callers that were passing it an int have
been converted to use debug_return_int instead.
2015-05-07 10:33:23 -06:00
Todd C. Miller
9c9ff3dc4b
get_pty() should return bool
2015-05-07 09:43:19 -06:00
Todd C. Miller
d2624ffa96
Make tty_present static to tgetpass.c
2015-05-07 09:42:48 -06:00
Todd C. Miller
3715ab57dd
Don't use dlsym() to find the libc getenv() since this may allocate
...
memory on some systems (glibc) which leads to a hang if malloc()
calls getenv() (jemalloc).
2015-04-22 13:38:02 -06:00
Todd C. Miller
41f3666a12
Defer conversation initialization until right before plugins
...
are initialized.
2015-04-22 13:30:58 -06:00
Todd C. Miller
6f8af4d26d
Split variable declaration out of debug_decl into debug_decl_vars()
...
so we can use it in main() when we know sudo_debug_enter() cannot
succeed.
2015-04-22 13:30:58 -06:00
Todd C. Miller
fa3552fa76
Create template tmpfiles.d/sudo.conf for installation instead of
...
creating one via echo commands in the Makefile.
Add --enable-tmpfiles.d configure option to enable/disable use of
tmpfiles.d and override the default directory.
Use --disable-tmpfiles.d in mkpkg so we no longer need to ignore
tmpfiles.d/sudo.conf in sudo.pp.
2015-04-07 15:35:01 -06:00
Todd C. Miller
f63896e7d8
Install /usr/lib/tmpfiles.d/sudo.conf on systems with systemd but
...
do not package it. For packages we create /usr/lib/tmpfiles.d/sudo.conf
as needed in the postinstall script.
2015-04-06 15:08:37 -06:00
Todd C. Miller
15037d3b7e
Make libsudo_util depend on libintl instead of requiring users of
...
libsudo_util to link with libintl directly. Bug #690
2015-03-22 08:16:22 -06:00
Todd C. Miller
2dd0540ad6
Use SSP_LDFLAGS when linking sudo_noexec.la
2015-03-05 10:10:29 -07:00
Todd C. Miller
ee72cba937
Use futimens() and utimensat() instead of futimes() and utimes().
2015-03-02 13:58:50 -07:00
Todd C. Miller
b78a985bf0
Fix cut & pasto that prevented the SIGPIPE handler from being
...
restored before returning from tgetpass(). From mancha
2015-03-02 08:49:04 -07:00
Todd C. Miller
f25cf99679
Our utimes() emulation support futime() too.
2015-02-28 15:13:19 -07:00
Todd C. Miller
973286c7ac
Check the return value of gettimeofday(), even though it should
...
never fail.
2015-02-25 07:10:25 -07:00
Todd C. Miller
be8dbeb22e
Avoid using HOST_NAME_MAX directly and use sysconf(_SC_HOST_NAME_MAX)
...
instead.
2015-02-19 20:28:02 -07:00
Todd C. Miller
96eddddc12
Almost no systems actually define OPEN_MAX since it is dynamic on
...
modern OSes. If sysconf(_SC_OPEN_MAX) ever fails, fall back on
_POSIX_OPEN_MAX instead. We can assume modern systems have sysconf().
Also remove checks for strrchr() and strtoll() for which the HAVE_*
defines are no longer used.
2015-02-19 09:59:25 -07:00
Todd C. Miller
166db8eeb4
Use weak symbols for sudo_warn_gettext() and sudo_warn_strerror()
...
so distros using "-Wl,--no-undefined" in LDFLAGS don't run into
problems.
2015-02-17 06:42:10 -07:00
Todd C. Miller
0008747bef
Bail with usage() early if argc <= 0.
2015-02-06 09:17:39 -07:00
Todd C. Miller
67eba7e534
Don't assume argv[0] is set without first checking argc.
2015-02-05 11:17:25 -07:00
Todd C. Miller
59ab26dbcc
Go back to a 2 args debug_decl and just use the "default" instance,
...
now renamed "active".
2015-02-01 08:24:49 -07:00
Todd C. Miller
acea28b9a5
Document why we need sys/param.h.
2015-01-14 11:01:41 -07:00
Todd C. Miller
29039859b7
Defer registration of the SIGCHLD handler until just before we exec
...
the command. Fixes a problem where pam_gnome_keyring installs its
own SIGCHLD handler and may not restore the original one. As a
result, we now have to explicitly wait for the askpass helper to
finish. Bug #657
2014-11-18 14:05:51 -07:00
Todd C. Miller
bc6269e58b
Prevent cppcheck from getting confused by our compat definition of
...
the va_copy macro for pre-C99.
2014-11-15 06:32:39 -07:00
Todd C. Miller
1c96c5ec39
Fix typo in hook return value check.
2014-11-14 14:56:29 -07:00
Todd C. Miller
ae00eb719e
Do not call sudo_warnx() on invalid value from the env hook functions
...
as the printf() family may call getenv() for locale reasons.
2014-11-11 15:31:16 -07:00