Todd C. Miller
d979898e71
Remove use of non-standard sigaction_t
2017-05-12 10:02:18 -06:00
Todd C. Miller
e453c97976
Restore the error message for sudo_ev_add() failure.
2017-05-12 10:02:17 -06:00
Todd C. Miller
0244f931dd
Only display string version of errno if sudo_ev_add() fails for now
2017-05-10 09:22:07 -06:00
Todd C. Miller
4e67ac56bd
In check_input() when switch()ing on the return value of read(),
...
use the default label instead of 1 for the success case. It is
only reading a single byte so the two are equivalent but it reads
better using default.
2017-05-04 12:25:51 -06:00
Todd C. Miller
1a047b156d
Check sudo_ev_add() return value. Coverity CID 168362
2017-05-04 11:10:42 -06:00
Todd C. Miller
cb1f044017
Allow stdin and ttyin to be displayed too. The only one that is
...
really useful in sudoreplay is stdin when input is from a pipe.
2016-11-30 13:38:01 -07:00
Todd C. Miller
1aea3f6e3e
Just use malloc_options "S" on OpenBSD instead of "AFGJPR".
2016-11-25 09:04:00 -07:00
Todd C. Miller
9b886f6b2c
The flush parameter of sudo_term_restore() is bool, not int.
2016-10-17 08:57:17 -06:00
Todd C. Miller
3f022419ae
Be consistent with the naming of the variable used to store the
...
function return value. Previously, some code used "rval", some
used "ret". This standardizes on "ret" and uses "rc" for temporary
return codes.
2016-09-08 16:38:08 -06:00
Todd C. Miller
398ddd0467
In replay_session() free iov at the end of the function (if needed)
...
instead of after processing each line from the timing file.
Coverity CID 104843.
2016-05-09 14:54:26 -06:00
Todd C. Miller
e528cad795
Add io_log_read() and io_log_gets() to hide differences between
...
gzread/fread and gzgets/fgets. Check for premature EOF and error
from io_log_read(). Also sanity check the index in the timing file.
Coverity CID 104630.
2016-05-09 14:27:33 -06:00
Todd C. Miller
b84b2e6805
Free the events and event base before returning from replay_session().
...
Coverity CID 104116, 104117.
2016-05-07 05:16:03 -06:00
Todd C. Miller
bf734419bf
In parse_expr(), move the "bad" label after the "default" case in
...
the switch(), not before it. This seemed to confuse Covertity,
resulting in a false positive, CID 104095.
2016-05-04 16:48:02 -06:00
Todd C. Miller
67183d74f4
Remove include/compat/timespec.h. Systems old enough to lack struct
...
timespec are too old to build a modern sudo.
2015-09-09 11:13:22 -06:00
Todd C. Miller
0c70df5de9
Implement suspend/resume callbacks for the conversation function.
...
If suspended, close the timestamp file (dropping all locks). On
resume, lock the record before reading the password.
For this to work properly we need to be able to run th callback
when tsetattr() suspends us, not just when the user does. To
accomplish this the term_* functions now return EINTR if SIGTTOU
would be generated. The caller now has to restart the term_*
function (and send itself SIGTTOU) instead of it being done
automatically.
2015-09-07 06:06:08 -06:00
Todd C. Miller
445e6f2e9a
Check sudo_conf_read() return value and exit on fatal error (a
...
warning was already printed by sudo_conf_read()).
2015-07-07 13:17:50 -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
aedaac8cca
Silence clang analyzer warning on glibc systems where the first
...
argument to qsort() is marked as non-NULL.
2015-06-23 16:37:01 -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
e2328479dd
Use strtok_r() instead of strtok()
2015-06-19 12:35:51 -06:00
Todd C. Miller
4f9cabd005
Remove obsolete memory.h include.
2015-06-18 21:02:57 -06:00
Todd C. Miller
d004b02fc6
Use non-exiting allocatings in the sudoers plugin.
2015-06-17 06:49:59 -06:00
Todd C. Miller
8bb5897091
All modern systems should have LINE_MAX.
2015-02-19 09:59:25 -07:00
Todd C. Miller
a3435e7d12
Require POSIX regular expression support for sudoreplay.
2015-02-05 11:16:06 -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
97469c243c
Avoid setting the tty to non-blocking mode so "sudoreplay | cat"
...
(for example) works as expected. We only read a single byte from
the keyboard and only when interactive anyway so this should be fine.
2015-01-30 13:07:21 -07:00
Todd C. Miller
0ac881ba4b
Avoid a cppcheck warning about undefined behavior (using the address
...
of a stack buffer - 1) and fix a memory leak of the iov when
doing nl->crnl conversion.
2015-01-30 10:45:15 -07:00
Todd C. Miller
770e6ca190
Fix handling of partial writes from writev() which can occur with
...
large output buffers.
2015-01-30 09:23:30 -07:00
Todd C. Miller
6b1b734ffa
Add a flag argument to sudo_conf_read() so we can decide which
...
bits get parsed. This lets us parse Debug statements first and
init the debug subsystem early.
2014-10-26 08:33:08 -06:00
Todd C. Miller
fe9e035ccf
Set debug instance for standalone programs.
2014-10-23 09:40:36 -06:00
Todd C. Miller
866cfc4fc3
Add support for multiple Debug lines per program. Callers may
...
register arbitrary debug facilities or use built-in defaults. We
now use separate Debug statements for plugins and programs.
2014-10-22 13:23:05 -06:00
Todd C. Miller
47835ff289
Rename missing.h -> sudo_compat.h
2014-07-22 14:25:16 -06:00
Todd C. Miller
127ba1354b
Rename gettext.h -> sudo_gettext.h
2014-07-21 14:49:43 -06:00
Todd C. Miller
3687b665cb
Rename fatal.h -> sudo_fatal.h
2014-07-21 14:40:18 -06:00
Todd C. Miller
b45727cefa
Rename queue.h -> sudo_queue.h to avoid collisions with the system
...
version.
2014-07-21 14:37:27 -06:00
Todd C. Miller
36a5767e3e
efree -> sudo_efree for consistency
2014-07-10 15:35:04 -06:00
Todd C. Miller
2d61d38c23
Add sudo_ prefix to alloc.c functions and rename alloc.h -> sudo_alloc.h
2014-06-27 10:48:31 -06:00
Todd C. Miller
aecef4aa1d
Rename warning/fatal -> sudo_warn/sudo_fatal to avoid namespace
...
pollution in libsudo_util.so.
2014-06-27 09:30:52 -06:00
Todd C. Miller
d36846a699
Reduce name space pollution in libsudo_util.so
2014-06-26 16:21:19 -06:00
Todd C. Miller
088edcb6f5
Add exported libsudo_util functions to util.exp and mark in headers
...
using __dso_public.
2014-06-26 15:51:15 -06:00
Todd C. Miller
134b2a4228
Rename emalloc2() -> emallocarray() and erealloc3() -> ereallocarray().
2014-04-22 16:02:28 -06:00
Todd C. Miller
12a1b672c0
We must include gettext.h before missing.h as it includes system
...
headers. Also add missing DEFAULT_TEXT_DOMAIN defines in sudoers
audit code that does not include sudoers.h.
2014-02-11 09:40:59 -07:00
Todd C. Miller
b813c4de48
Use sudo_timeval macros and remove compat macros from missing.h
2014-01-30 15:51:59 -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
aa93ef78a7
Quiet a few innocuous cppcheck warnings.
2014-01-08 17:01:03 -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