Commit Graph

12322 Commits

Author SHA1 Message Date
Todd C. Miller
2845ceafb0 Handle "locale -a" returning both C.UTF-8 and C.utf8.
It is possible to have mutiple matches from the output of "locale
-a".  Just take the first one.  Fixes GitHub issue #241.
2023-02-15 13:49:04 -07:00
Todd C. Miller
4f50692acc Add some missing files to the clean and distclean targets. 2023-02-15 10:22:42 -07:00
Todd C. Miller
a845039de5 Merge pull request #240 from thesamesam/c23
sudo_fatal: Fix build where compiler recognises [[noreturn]] attribut…
2023-02-15 07:59:52 -07:00
Sam James
66359c2bc9 sudo_fatal: Fix build where compiler recognises [[noreturn]] attribute (C23)
If the compiler supports [[noreturn]] as a attribute as in C23,
then we define sudo_noreturn to be it. When that's the case, we must place
it at the beginning of the declaration, before any other *extension*
attributes (__attribute(...)).

A bug has been filed with GCC regarding rejecting/accepting mixed
attribute styles.

sudo_dso_public is always an extension attribute, while sudo_noreturn only
might be, so put it first.

This only shows up with GCC 13 so far (see the linked GCC bug for a bit more
exploration). Clang 16 does support the attribute but doesn't let you use it
for earlier language versions (need to pass explicit -std=c2x, unlike with GCC here).

This is essentially a followup to e707ffe58b.

Tested with GCC 13.0.1 20230212 (unreleased), GCC 12.2.1 20230211,
Clang 16.0.0_rc2, and Clang 15.0.7.

Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796
Closes: https://github.com/sudo-project/sudo/issues/239
Fixes: e707ffe58b
Fixes: 16ae61dcd7
2023-02-15 04:06:15 +00:00
Todd C. Miller
defec5d46e Add missing '[' to AS_IF() call.
Fixes GitHub issue #238.
2023-02-14 14:24:28 -07:00
Todd C. Miller
a80dcc6aca Add compiled version of the sudoers Georgian translation. 2023-02-14 09:52:06 -07:00
Todd C. Miller
5eed6adb6f Do not ignore .mo files.
Otherwise we are likely to miss uncommitted changes in them.
2023-02-14 09:51:34 -07:00
Todd C. Miller
f1b07aed47 Regenerate .mo files. 2023-02-14 09:44:59 -07:00
Todd C. Miller
bdef2ad6d2 No longer need to define sudoers_recovery here. 2023-02-09 16:39:25 -07:00
Todd C. Miller
0008d1f719 Mention that a missing include file is no longer fatal. 2023-02-09 15:37:12 -07:00
Todd C. Miller
26385b45cf Recover from missing include file unless error_recovery is disabled.
It is still treated as an error from a logging perspective, and
mail is still sent.
2023-02-09 15:33:58 -07:00
Todd C. Miller
8960f50961 Updated translations from translationproject.org 2023-02-03 10:26:24 -07:00
Todd C. Miller
b333d16878 Add eventlog_mail() to send a log message via mail.
This is used by mail_parse_errors() to send multi-line messages.
Previously, the newlines would be escaped as control characters.
2023-02-09 11:09:24 -07:00
Todd C. Miller
b6caacfe4e send_mail: pass a single string instead of using varargs
These days we only ever pass in a const string.
2023-02-09 11:09:03 -07:00
Todd C. Miller
2e1a73502e Use AS_IF instead of if; then where possible. 2023-02-05 08:06:02 -07:00
Todd C. Miller
cfa1fee622 Mention the fix for GitHub #237. 2023-02-03 10:35:34 -07:00
Todd C. Miller
f160e5e6c6 Display error in error message if we can't restore the terminal. 2023-02-03 07:19:19 -07:00
Todd C. Miller
15b4cde692 Display an error message if unable to restore terminal settings. 2023-02-02 20:10:03 -07:00
Todd C. Miller
1758c49d3e Get rid of sudoersdir and just use sysconfdir.
There is no need for sudoersdir when it is always just set to sysconfdir.
2023-02-02 19:29:26 -07:00
Todd C. Miller
678d6664a9 pty_finish: only restore the terminal if sudo is the foreground process 2023-02-02 14:02:51 -07:00
Todd C. Miller
7cb23c85a1 Better background job detection when running a command in a pty.
If sudo is not the process group leader and stdin is not a tty, we
may be running as a background job via a shell script.  Start the
command in the background to avoid changing the terminal mode from
a background process.  GitHub issue #237
2023-02-02 13:55:18 -07:00
Todd C. Miller
4fb9855634 suspend_sudo_pty: stop the process group even if sudo is not the leader.
When sudo is not the process group leader, we still need to stop
sudo's process group and not just the sudo process itself.  If we
only send the signal to sudo itself, the shell will not notice if
it is not in monitor mode.  This can happen when sudo is run from
a shell script, for example.  In this case we need to signal the
shell itself.  If the process group leader is no longer present,
we must kill the command since there will be no one to resume us.
2023-02-02 13:31:16 -07:00
Todd C. Miller
e63eeee7b4 Add debug tracing to tcsetattr_nobg(). 2023-02-02 09:31:25 -07:00
Todd C. Miller
3c9c8668c1 Avoid compilation errors if getaddrinfo() or freeaddrinfo() are macros.
If this is the case we probably can't stub out the functions but
at least the fuzzer will compile.
2023-01-31 13:33:59 -07:00
Todd C. Miller
7c5f0d3052 Initialize the integer result parameter passed to SIOCGIFANUM.
It appears that passing in a non-zero value causes the ioctl() to
fail.  From Tim Rice.
2023-01-31 12:35:49 -07:00
Todd C. Miller
0b2e662b2e Protect use of AF_INET6 with HAVE_STRUCT_IN6_ADDR guards.
From Tim Rice.
2023-01-31 12:22:47 -07:00
Todd C. Miller
ffb09be49d Add configure test for NSIG, _NSIG or __NSIG.
This is better than just defining NSIG in sudo_compat.h if it is
not defined since signal.h may not have been included.
2023-01-31 11:30:45 -07:00
Todd C. Miller
49df977c2f Avoid DNS lookups when fuzzing. 2023-01-31 08:59:50 -07:00
Todd C. Miller
23237bb006 No longer need to treat Rocky or Alma Linux specially.
We now treat them the same as RHEL.
2023-01-30 07:32:05 -07:00
Todd C. Miller
6d945448ef Merge pull request #230 from trackers-lover/main
Return value does not match
2023-01-29 07:12:25 -07:00
bianguangze@uniontech.com
8797f0ceb9 Modify return value parameter 2023-01-29 11:08:38 +08:00
Todd C. Miller
b257df55da Store conf hash in vm_servers instead of vmid.
Add a shutdown command fallback to the conf file.
2023-01-27 14:47:32 -07:00
Todd C. Miller
179ad08c86 Updated translations from translationproject.org 2023-01-27 14:46:52 -07:00
Todd C. Miller
ab9b20be9e New Georgian translation from translationproject.org 2023-01-26 13:29:31 -07:00
Todd C. Miller
b4325e64c8 Mention the recent intercept/log_subcmds fix. 2023-01-27 14:44:45 -07:00
Todd C. Miller
53389b5743 Recognize Alma Linux and Rocky Linux (Open Source RHEL clones) 2023-01-27 14:44:45 -07:00
Todd C. Miller
fd0021ee5c Regen with latest autoconf git. 2023-01-27 14:44:45 -07:00
Todd C. Miller
1977f98d21 Fix a typo. 2023-01-27 14:44:45 -07:00
Todd C. Miller
94eafd2f08 Fix determination of the number of CPU cores on Linux. 2023-01-27 10:31:12 -07:00
Todd C. Miller
3b3089e4f5 Merge pull request #235 from kernelmethod/apparmor_dependencies
Replace the Debian libselinux1 dependency with libapparmor1
2023-01-26 13:12:47 -07:00
kernelmethod
8c9a8933b2 Replace the Debian libselinux1 dependency with libapparmor1
Debian >= 10 uses AppArmor by default instead of SELinux, so
SELinux-related sudo features are typically going to be unusable in
Debian installs. This changes the dependency on libselinux1 to be a
dependency on libapparmor1 for .deb packages built with `make package`.
2023-01-26 19:42:52 +00:00
Todd C. Miller
fe001b6ffe get_execve_info: defer setting pathname until argbuf is finalized
If we reallocate the buffer (via growbuf()) in ptrace_read_vec(),
the address of argbuf may change.  If so, the value stored in
pathname will no longer be valid.  GitHub issue #194.
2023-01-25 11:55:29 -07:00
Todd C. Miller
a32a54dced Correct error message when command doesn't exist in intercept mode.
Previously, we would always use EACCES, even when ENOENT was
appropriate.  This also affected log_subcmds.
2023-01-25 10:31:49 -07:00
Todd C. Miller
de021b60db Update .pot files for 1.9.13 2023-01-24 13:11:47 -07:00
Todd C. Miller
b9dc472bba Update for 1.9.13. 2023-01-23 14:01:34 -07:00
Todd C. Miller
d3afffec75 Include elf.h, not linux/elf.h but define NT_ARM_SYSTEM_CALL if missing.
Older kernel headers are missing the definition of EM_ARM in linux/elf.h.
GitHub issue #232
2023-01-23 13:55:23 -07:00
Todd C. Miller
e11bb93e26 Add tests for escaped digits. 2023-01-23 08:48:21 -07:00
Todd C. Miller
f6340068d1 check_pattern: handle escaped digits since GNU libc accepts them. 2023-01-23 08:02:25 -07:00
Todd C. Miller
2d9c0d9034 Add eventlog_store_sudo() and use it in sudoreplay.
This replaces the custom log formatting used by "sudoreplay -l".
2023-01-22 15:27:53 -07:00
Todd C. Miller
733303ed96 Add --build-only flag to skip building packages. 2023-01-21 09:43:15 -07:00