Commit Graph

1767 Commits

Author SHA1 Message Date
Todd C. Miller
db3b776277 When listing a user's privileges, always prompt the user for their
own password, regardless of the value of target_pw, root_pw or
runas_pw.
2014-01-29 15:19:45 -07:00
Todd C. Miller
aaecd326e4 Use inet_aton() instead of inet_addr() as it allows us to distinguish
between the address (or mask 255.255.255.255) and an error.  In the
future we may consider switching to inet_pton() for IPv4 too.
2014-01-26 13:23:09 -07:00
Todd C. Miller
f6542e90f0 Fix typo in the AIX case. 2014-01-24 09:43:10 -07:00
Todd C. Miller
7e88cc27bf Size pointer for sudo_parseln() should be size_t not ssize_t.
This was already correct for the nsswitch.conf case.
2014-01-24 09:39:11 -07:00
Todd C. Miller
4c9650f78f If inet_addr() returns INADDR_NONE, return false instead of iterating
through the interfaces looking for a match that will never happen.
2014-01-22 20:48:49 -07:00
Todd C. Miller
ae6fb933f0 Do not assume localtime(), gmtime() and ctime() always return non-NULL. 2014-01-21 16:32:00 -07:00
Todd C. Miller
5a6db565c1 Update copyright years 2014-01-15 06:19:34 -07:00
Todd C. Miller
5f88e95bc9 Eliminate dead store found by clang checker. 2014-01-15 06:13:23 -07:00
Todd C. Miller
bec5786e5e Remove dead store; found by cppcheck 2014-01-13 09:52:41 -07:00
Todd C. Miller
aa93ef78a7 Quiet a few innocuous cppcheck warnings. 2014-01-08 17:01:03 -07:00
Todd C. Miller
57113a536f Handle in_res being NULL for sudo_debug_printf() in sudo_sss_filter_result(). 2014-01-08 16:48:27 -07:00
Todd C. Miller
12fc51060e When writing length to timing file, use %u not %d as it is unsigned. 2014-01-08 16:45:06 -07:00
Todd C. Miller
4b5ad37b47 Close export_fp in the error path too, but do not close stdout. 2014-01-08 16:29:18 -07:00
Todd C. Miller
7ace435d44 Move right brace outside #ifdef HAVE_DISPCRYPT; found by cppcheck. 2014-01-08 16:23:06 -07:00
Todd C. Miller
b75bb6991f Do not leak old istack if realloc fails; found by cppcheck.
Also modify yyless() to avoid a harmless cppcheck warning every
time it is used.
2014-01-13 09:52:41 -07:00
Todd C. Miller
78355e618f Add cppcheck target to run cppcheck on all source files. 2014-01-13 09:50:39 -07:00
Todd C. Miller
27598bc0ab Update copyright year. 2014-01-07 10:43:31 -07:00
Todd C. Miller
f57beb1afa Go back to making the bit fields in struct cmndtag explicitly signed.
This fixes a problem on gcc 4.8 (at least) which appears to be
treating the value as unsigned by default.
2014-01-07 10:35:56 -07:00
Todd C. Miller
0e1d726aac Handle a sequence file with no trailing newline. 2014-01-04 12:42:34 -07:00
Todd C. Miller
391bc02e25 Truncate io log and timing files on open when recycling them.
Only an issue when the sequence number wraps around.
2014-01-03 18:28:07 -07:00
Todd C. Miller
6fe419423a Repair reading of the iolog sequence number that got broken when
adding stricter strtoul() checks.
2014-01-03 18:11:27 -07:00
Todd C. Miller
929d8a38ea sync with translationproject.org 2013-12-31 16:23:44 -07:00
Todd C. Miller
1943396d75 Make user_cwd and user_tty dynamically allocated even for the
"unknown" case.
2013-12-31 15:58:52 -07:00
Todd C. Miller
42dbe7f4bd sync with translationproject.org 2013-12-29 09:12:23 -07:00
Todd C. Miller
72cd57dea3 sync with translationproject.org 2013-12-28 18:40:15 -07:00
Todd C. Miller
a6e1766dd6 Fix typo; we want setlocale(LC_ALL, "") since we are setting the
locale for the first time.
2013-12-28 07:59:45 -07:00
Todd C. Miller
91db1efe91 Use sudoers_initlocale() in main() startup, not sudoers_setlocal()
as the latter assumes we are already in the user's locale which may
not be the case.  For sudoreplay, we can just use setlocale()
directly as there is no sudoers locale.
2013-12-27 06:50:06 -07:00
Todd C. Miller
76544011ed Fix install-plugin when sudoers is compiled statically. 2013-12-24 14:50:28 -07:00
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