Commit Graph

157 Commits

Author SHA1 Message Date
Todd C. Miller
3c2a9b9948 Don't redefine opterr, optind, optopt, optarg in getopt_long.c.
Add a check for optreset which is a BSD extension and provide a
definition in getopt_long.c if it is not present.
2013-08-16 13:50:48 -06:00
Todd C. Miller
99352d6738 Rename error.h -> fatal.h now that there is no error() function. 2013-08-15 14:24:29 -06:00
Todd C. Miller
e5f0e1f752 Quiet a gcc "used uninitialized in this function" false positive. 2013-08-15 10:49:06 -06:00
Todd C. Miller
39cbfcd406 Use private version of atoid() to avoid a dependency on libcommon.a
(since that already depends on libreplace.a).
2013-08-07 16:52:50 -06:00
Todd C. Miller
dde7331a0f Use atoid() in more places. 2013-08-07 15:49:03 -06:00
Todd C. Miller
2c6e68df0e Avoid a crash on Mac OS X 10.8 (at least) when we close libdispatch's
fds out from under it before executing the command.  Switch to just
setting the close on exec flag instead.
2013-08-07 15:04:58 -06:00
Todd C. Miller
1f3ea50afd Implement memset_s() and use it instead of zero_bytes().
A new constant, SUDO_CONV_REPL_MAX, is defined by the plugin
API as the max conversation reply length.  This constant can be
used as a max value for memset_s() when clearing passwords
filled in by the conversation function.
2013-08-03 08:30:06 -06:00
Todd C. Miller
deb3844959 Add make rules for building getopt_long.c 2013-07-18 10:07:41 -06:00
Todd C. Miller
9309c9eab7 Use getopt_long() so we can make the -h flag take an optional argument.
Includes a version for those without it.
2013-07-17 17:00:55 -06:00
Todd C. Miller
f9c4fb69de Add missing $(PIE_LDFLAGS) $(SSP_LDFLAGS) for test programs 2013-05-22 17:04:25 -04:00
Todd C. Miller
c5971524f1 Solaris maps negative gids to GID_NOBODY. 2013-04-24 15:24:24 -04:00
Todd C. Miller
d6282d154a Update copyright years. 2013-04-24 09:35:02 -04:00
Todd C. Miller
5d75798165 Fix check for _BIG_ENDIAN and _LITTLE_ENDIAN (Solaris) and
__BIG_ENDIAN__ and __LITTLE_ENDIAN__ (HP-UX)
2013-04-17 16:23:49 -04:00
Todd C. Miller
89759fa36c For big endian architectures just use memcpy() instead of BE macros
in a loop.
2013-04-15 11:05:52 -04:00
Todd C. Miller
e3b61c11f1 Support %lld and %llu 2013-04-10 11:17:41 -04:00
Todd C. Miller
b9bb50ff5b Use free() not efree() since we don't include alloc.h here 2013-04-02 11:23:31 -04:00
Todd C. Miller
afc95dd118 Update guard to take __progname into account 2013-04-01 10:23:36 -04:00
Todd C. Miller
d7ea8fead5 Some older systems have inttypes.h but not stdint.h 2013-04-01 10:23:18 -04:00
Todd C. Miller
98ffa51545 Add guards in compat source files. Not really needed since we only
include them in the Makefile if they are needed but should not hurt
either.
2013-04-01 10:19:26 -04:00
Todd C. Miller
837cda0c54 regen depends 2013-03-25 13:54:25 -04:00
Todd C. Miller
c078614b43 Fix regress tests on non-OpenBSD platforms. 2013-03-19 14:08:11 -04:00
Todd C. Miller
7109e46deb Pass BIND_VERBOSE to shl_load() 2013-03-18 15:15:13 -04:00
Todd C. Miller
a43318959a Update copyright year. 2013-03-02 14:01:30 -05:00
Todd C. Miller
f524c515e5 Use pst_highestfd from pstat_getproc() on HP-UX. 2013-03-01 13:01:37 -05:00
Todd C. Miller
0fdb89e3b3 regen depends for to add compat/nss_dbdefs.h for getgrouplist.lo 2013-01-22 15:48:52 -05:00
Todd C. Miller
e1859cac14 Fix typo that breaks the build on HP-UX. 2013-01-22 15:48:16 -05:00
Todd C. Miller
6bc3d4aed5 Use nss_search() to implement getgrouplist() where available. Tested
on Solaris and HP-UX.  We need to include a compatibility header
for HP-UX which uses the Solaris nsswitch implementation but doesn't
ship nss_dbdefs.h.
2013-01-22 15:41:15 -05:00
Todd C. Miller
a06a14838f Use _getgroupsbymember() on Solaris to get the groups list. Fixes
performance problems with the getgroupslist() compat on Solaris
systems with network-based group databases.
2013-01-18 14:58:12 -05:00
Todd C. Miller
6e560f2bab Break out stack smashing protector options into SSP_CFLAGS and
SSP_LDFLAGS so we can use it everywhere (unlike LT_LDFLAGS).
2013-01-03 14:20:49 -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
a3a1574cdf Explicitly mark main() as public in executables to avoid an HP-UX
ld warning.
2012-10-02 15:08:02 -04:00
Todd C. Miller
4017e63b9c Add missing signame dependency 2012-08-29 16:08:02 -04:00
Todd C. Miller
ab7dda035a Replace strsigname() with sig2str(), emulating it as needed. 2012-08-29 14:25:09 -04:00
Todd C. Miller
f44afdc423 Detect sys_sigabbrev[] and use it in place of sys_signame[] if
present.  For some reason glibc does not declare sys_sigabbrev so
we must add an extern definition of our own.
2012-08-28 10:11:38 -04:00
Todd C. Miller
af4f02d3e2 Handle NULL entries in sys_siglist and sys_signame. 2012-08-28 09:40:56 -04:00
Todd C. Miller
24991069f6 Convert my_sys_sig{list,name} -> sudo_sys_sig{list,name} 2012-08-28 09:28:25 -04:00
Todd C. Miller
537dc94b9e Use strsigname() to print signal names in the debug output.
If the system has no strsigname(), use our own.
2012-08-26 20:12:51 -04:00
Todd C. Miller
2cdd315a08 Don't echo the awk command when building siglist.in 2012-08-17 15:58:45 -04:00
Todd C. Miller
7d255e42cb Fix some warnings from clang checker-267 2012-08-07 11:01:28 -04:00
Todd C. Miller
f8f0021710 Add configure check for building PIE executables instead of doing
it in mkpkg.
2012-07-02 10:12:41 -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
aa7ac09faa Implement RTLD_NEXT and fix RTLD_DEFAULT for HP-UX. 2012-05-09 09:46:38 -04:00
Todd C. Miller
6467b7b813 Emulate RTLD_DEFAULT and RTLD_SELF w/ shl_findsym() using NULL
and PROG_HANDLE.
2012-05-08 16:36:39 -04:00
Todd C. Miller
0d108287b9 Do not use GLOB_BRACE or GLOB_TILDE flags to glob()--we want the
glob() and fnmatch() results to be consistent.
2012-04-08 18:00:31 -04:00
Todd C. Miller
e05576607f cast ctype(3) function/macro arguments from char to unsigned char
to avoid potential negative subscripting.
2012-03-28 13:07:54 -04:00
Todd C. Miller
f587fa1535 Quiet a gcc "used uninitialized in this function" false positive. 2012-03-15 08:56:12 -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
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
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
da6fe1230f Use AC_HEADER_STDBOOL instead of checking for stdbool.h ourselves. 2012-01-30 09:28:11 -05:00