Todd C. Miller
e343e07543
Use #include <foo.h> instead of #include "foo.h" in most cases.
...
We rely on the include path to find many of these headers. It
especially doesn't make sense to use #include "foo.h" for headers
in the top-level include directory.
2023-09-25 10:13:28 -06:00
Todd C. Miller
75209e2718
Rename check.h -> timestamp.h and add remaining timestamp.c prototypes.
2023-08-29 11:16:23 -06:00
Todd C. Miller
a38b714667
sudoers plugin: silence most -Wconversion warnings.
2023-07-07 15:07:04 -06:00
Todd C. Miller
a72bc5e6bf
get_starttime: add support for GNU Hurd using the mach task_info call.
...
This is currently Hurd-specific but could be made Mach-generic as
long as the equivalent of pid2task() is available.
2023-02-19 07:18:37 -07:00
Todd C. Miller
9ddae66818
Add support for the struct kinfo_proc on Dragonfly BSD.
2023-01-19 13:22:32 -07:00
Todd C. Miller
92c88d4105
Quiet a few harmless cppcheck warnings.
2021-01-06 13:01:10 -07:00
Todd C. Miller
88dcdcd11d
Fix -Wshadow warnings.
2020-09-25 15:09:45 -06:00
Todd C. Miller
84e6e6ccf9
Update copyright year on some files where it was out of date.
2020-08-31 14:09:36 -06:00
Todd C. Miller
446ae3f507
Include string.h unconditionally and only use strings.h for strn?casecmp()
...
In the pre-POSIX days BSD had strings.h, not string.h.
Now strings.h is only used for non-ANSI string functions.
2020-05-18 07:59:24 -06:00
Todd C. Miller
8b571c59a5
Fix a typo; HAVE_KINFO_PROC2_NETBSD not HAVE_KINFO_PROC2_NETBSD2
2019-12-25 11:12:21 -07:00
Todd C. Miller
486ee2b71f
debug_decl and debug_decl_vars now require a semicolon at the end.
2019-12-22 08:48:16 -07:00
Todd C. Miller
f57e2d04a3
Older FreeBSD needs sys/param.h included before sys/user.h.
...
From Darren Tucker
2019-10-20 19:18:27 -06:00
Todd C. Miller
1e1ef61902
Add SPDX-License-Identifier to files.
2019-04-29 07:21:51 -06:00
Todd C. Miller
0766e0c647
Better comment about EOVERFLOW and pstat_getproc().
...
Also remove some useless casts.
2019-03-06 20:15:11 -07:00
Todd C. Miller
985600e7f0
Minor snprintf() usage tweaks:
...
1) don't assume snprintf() returns -1 on error, check for <0
2) when comparing return value of sizeof(foo), cast the sizeof, not the len
3) cast return value to void in cases where snprintf cannot fail
2019-01-20 07:49:48 -07:00
Todd C. Miller
6c3d20cb41
Convert PVS-Studio comment to ANSI C.
2018-10-26 08:39:09 -06:00
Todd C. Miller
64e5d34c57
Add comments in .c files so PVS-Studio will check them.
2018-10-21 08:46:05 -06:00
Todd C. Miller
92975ee7c7
Fix get_starttime() on HP-UX.
2018-08-17 15:58:17 -06:00
Todd C. Miller
ec2dae8104
Fix conversion of usec to nsec; from Scott Cheloha
2018-06-04 20:00:41 -06:00
Todd C. Miller
f984de1ba9
Use correct defines when checking for sysctl kinfo_proc support.
2018-03-06 12:05:07 -07:00
Todd C. Miller
217e0a9b4b
Less confusing sysctl checks for kinfo_proc.
2018-03-05 17:35:02 -07:00
Todd C. Miller
de2f455d3e
Support start time on macOS and 4.4BSD
2017-12-17 07:40:21 -07:00
Todd C. Miller
b78296197d
Fix compilation error on FreeBSD
2017-12-16 20:46:58 -07:00
Todd C. Miller
79caf1e68d
Fix debug_decl(), it should be SUDOERS_DEBUG_UTIL
...
Add debugging for the successful case
For Linux, don't NUL out *ep before parsing with strtoull().
* * *
Add missing debug info for the System V /proc version.
2017-12-16 14:50:14 -07:00
Todd C. Miller
1709dc7f77
In the timestamp record, include the start time of the terminal
...
session leader for tty-based timestamps or the start time of the
parent process for ppid-based timestamps. Idea from Duncan Overbruck.
2017-12-16 05:53:05 -07:00