2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-29 21:38:05 +00:00

13161 Commits

Author SHA1 Message Date
Todd C. Miller
72cee2fa25 Explicitly link check_symbols with zlib.
Fixes a test failure on some systems when using sudo's built-in zlib.
2024-02-29 12:41:36 -07:00
Fabrice Fontaine
f66ebfa0f3 m4/openssl.m4: fix cross-compilation with wolfssl
Do not append -I/usr/include/wolfssl when cross-compiling

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2024-02-22 11:12:22 -07:00
Todd C. Miller
81acb2bd7b Regenerate dependencies 2024-02-21 13:17:54 -07:00
Todd C. Miller
3944ab1fbe Use $(CPP) instead if $(CC) -E when buiding .i files from .c. 2024-02-21 12:31:50 -07:00
Todd C. Miller
2a61e4b07d Add missing subdirs to depend target. 2024-02-21 13:01:15 -07:00
Todd C. Miller
9b073f3124 Using $< in a non-suffix rule context is a GNU make extension. 2024-02-21 13:01:14 -07:00
Yann E. MORIN
6ec958f27e lib/utils: detect failure to generate signals list and names
Currently, we generate the signal list and names by running cpp on our
header, and piping the result into sed.

However, when cpp fails [0], we do not catch that failure, as the error
code of the LHS of a pipe is lost, with the pipe returning the RHS-most
return code.

Fix that by introducing two new intermediate rules, each to generate the
preprocessed .i files, and use those as dependencies and input to the
rule that generates the headers. Those two .i files will be cleaned up
by the existing *.i glob.

[0] a failure happens on recent hosts, due to inconsistency with
time64_t and large-file support (lines elided and wrapped for
readability):

    /usr/bin/cpp [...] ./sys_signame.h \
    | /usr/bin/sed -e '1,/^int sudo_end_of_headers;/d' -e '/^#/d' > mksigname.h
    In file included from /usr/include/features.h:394,
                     from /usr/include/sys/types.h:25,
                     from ./sys_signame.h:4:
    /usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
       26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
          |     ^~~~~
    /usr/bin/gcc [...] ./mksigname.c -o mksigname
    In file included from /usr/include/features.h:394,
                     from /usr/include/bits/libc-header-start.h:33,
                     from /usr/include/stdlib.h:26,
                     from ./mksigname.c:27:
    /usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
       26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
          |     ^~~~~
    make[2]: *** [Makefile:263: mksigname] Error 1

In that case, we were lucky that the subsequent gcc call also failed,
and for the same reason. That time64_t and lfs issue should be fixed (at
least investigated), but that does not mean we should not be more robust
when parsing the header either.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-02-18 07:17:58 -07:00
Todd C. Miller
f3ebf31aa9 Regen with autoconf 2.72 2024-02-18 07:10:08 -07:00
Todd C. Miller
bafdcc3d40 Check if ac_cv_sys_file_offset_bits is "64", not "yes"
This is used for determining whether to set _TIME_BITS with autoconf
versions before 2.72.
2024-02-18 07:09:10 -07:00
Yann E. MORIN
5bbfaa8e68 src/exec_ptrace: fix build without precess_vm_readv()
Commit 32f4b98f6b4a (sudo frontend: silence most -Wconversion warnings.)
broke the build on C libraries that miss process_vm_readv(), like
uClibc-ng.

Indeed, the ssize_t nwritten is declared guarded by HAVE_PROCESS_VM_READV,
but is then re-assigned and used a few lines below, outside any guard.

Fix that by always declaring the object, as it is always needed.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-02-17 11:28:46 -07:00
Todd C. Miller
f69031da24 Quest no longer sponsors sudo development. 2024-01-31 10:05:50 -07:00
Todd C. Miller
0a39814e4b Correct a misleading debug message. 2024-01-23 10:57:00 -07:00
Todd C. Miller
eb4506f434 Update embedded copy of zlib to version 1.3.1. 2024-01-23 09:16:22 -07:00
Todd C. Miller
3899f2ef90 Update copyright data in the package files. 2024-01-18 07:00:38 -07:00
Rose
725d3fdc20 Prefer putchar over fputc where possible
putchar is easier to understand than fputc and printf and does less work than those two do.
2024-01-13 15:24:43 -07:00
Rose
7fc7d69532 Add restrict qualifiers to strlcpy_no_slash
It's just strlcpy except it replaces '/' with '_'.
2024-01-13 15:20:10 -07:00
Todd C. Miller
67e328d6f8 Only log "a password is required" for "sudo -n" if a command is specified.
This means that it is not logged for "sudo -nv" and "sudo -nl".
We only log this message when sudo's -n flag is specified (and not
when the user presses ^C at the password prompt) so that there is
a record of failed non-interactive commands.
2024-01-10 13:54:41 -07:00
Todd C. Miller
b39dc7c5f1 Document side-effects of enabling the use_pty option. 2024-01-08 14:28:58 -07:00
Todd C. Miller
ff3dbe60b1 Update "!use_pty" example to only disable it for non-root users.
Also add a commented out entry for "exec_background" which can also
be used to prevent sudo from consuming tty input.
Related to GitHub issue #338
2024-01-08 14:16:29 -07:00
Todd C. Miller
00452471b1 Add check for sysconf(_SC_PAGESIZE) failure. 2024-01-01 11:03:01 -07:00
Todd C. Miller
f52fa574c7 sudo_edit_mktemp: remove useless cast 2024-01-01 11:05:23 -07:00
Todd C. Miller
22b01501eb Welcome to 2024 2023-12-31 07:58:23 -07:00
Todd C. Miller
c15e0aeea8 Bump zlib copyright date for version 1.3 2023-12-31 07:58:04 -07:00
Todd C. Miller
69a024304f Restore the ability to override default configure settings.
The user-specified options must go last...
2023-12-30 11:21:08 -07:00
Todd C. Miller
a0a68f22c6 Added tag SUDO_1_9_15p5 for changeset 4418cfdc5b2a
--HG--
branch : 1.9
2023-12-29 14:47:57 -07:00
Todd C. Miller
00b2bd3589 Sudo 1.9.15p5 2023-12-29 14:43:39 -07:00
Todd C. Miller
fc9369cb44 Sudo 1.9.15p5
--HG--
branch : 1.9
SUDO_1_9_15p5 v1.9.15p5
2023-12-29 14:43:39 -07:00
Todd C. Miller
b5a3513fb9 Handle Debian GNU Hurd 2023-12-28 18:45:30 -07:00
Todd C. Miller
ada47ee108 Properly handle sysconf(_SC_LOGIN_NAME_MAX) returning -1 on failure.
The cast to size_t needs to be outside the MAX() macro or the -1
will get cast to unsigned.

--HG--
branch : 1.9
2023-12-28 09:00:49 -07:00
Todd C. Miller
e4057faca2 Properly handle sysconf(_SC_LOGIN_NAME_MAX) returning -1 on failure.
The cast to size_t needs to be outside the MAX() macro or the -1
will get cast to unsigned.
2023-12-28 09:00:49 -07:00
Todd C. Miller
63ebe354c9 Automatically migrate lecture file path from name-based to uid-based.
GitHub issue #342.

--HG--
branch : 1.9
2023-12-22 09:39:24 -07:00
Todd C. Miller
ad4dc22d5a Automatically migrate lecture file path from name-based to uid-based.
GitHub issue #342.
2023-12-22 09:39:24 -07:00
Todd C. Miller
63f2c54b86 Add missing checks for strdup() failure. 2023-12-21 16:55:08 -07:00
Todd C. Miller
286c8ddc5b Disable netgroup_query when netgroup_base is not set.
The logic was inverted when support for netgroup_query was added.
This supercedes PR #341.

--HG--
branch : 1.9
2023-12-19 20:16:35 -07:00
Todd C. Miller
5fbf7a3625 Disable netgroup_query when netgroup_base is not set.
The logic was inverted when support for netgroup_query was added.
This supercedes PR #341.
2023-12-19 20:16:35 -07:00
Todd C. Miller
0e8b722e84 In the NOEXEC example make it clear that "shanty" is a host.
Bug #1064

--HG--
branch : 1.9
2023-12-19 09:55:09 -07:00
Todd C. Miller
6d4ffe6743 In the NOEXEC example make it clear that "shanty" is a host.
Bug #1064
2023-12-19 09:55:09 -07:00
Todd C. Miller
10fd66ac99 closefrom_nodebug: skip fds < 0
This can only happen if lowfd < 0, which is never the case.
Quiets a static analyzer warning.
2023-12-18 13:32:53 -07:00
Todd C. Miller
318e0eff35 Fix printing of warning when a Defaults setting is missing a value.
This is a bug in parse_default_entry() introduced in sudo 1.8.19
when support for using the default syslog facility was added at the
wrong place in a switch().

--HG--
branch : 1.9
2023-12-16 08:08:44 -07:00
Todd C. Miller
7019148160 Fix printing of warning when a Defaults setting is missing a value.
This is a bug in parse_default_entry() introduced in sudo 1.8.19
when support for using the default syslog facility was added at the
wrong place in a switch().
2023-12-16 08:08:44 -07:00
Todd C. Miller
f67a7e623e Sprinkle some more const in defaults.c. 2023-12-15 15:05:02 -07:00
Todd C. Miller
ae7dc397b4 Fix evaluation of a tuple used in "true" boolean context.
Previously, a tuple in boolean context was always treated as a
negated entry, which doesn't match the documentation.  We assume
that there are at least two tuple entries where the first maps to
boolean false and the second maps to boolean true.

--HG--
branch : 1.9
2023-12-15 14:57:59 -07:00
Todd C. Miller
2df637b262 Fix evaluation of a tuple used in "true" boolean context.
Previously, a tuple in boolean context was always treated as a
negated entry, which doesn't match the documentation.  We assume
that there are at least two tuple entries where the first maps to
boolean false and the second maps to boolean true.
2023-12-15 14:57:59 -07:00
Todd C. Miller
80a2794b00 Added tag SUDO_1_9_15p4 for changeset cc9d22d261de
--HG--
branch : 1.9
2023-12-15 12:09:39 -07:00
Todd C. Miller
680352b917 Sudo 1.9.15p4 2023-12-15 10:57:24 -07:00
Todd C. Miller
2535c5ae14 Sudo 1.9.15p4
--HG--
branch : 1.9
SUDO_1_9_15p4 v1.9.15p4
2023-12-15 10:57:24 -07:00
Todd C. Miller
fbc4c50d4d sudoers_lookup_pseudo: init match to UNSPEC for sudo_nss_can_continue().
Otherwise, processing will stop after the first sudoers nsswitch
service specification where [SUCCESS=return] is present.
2023-12-15 10:45:22 -07:00
Todd C. Miller
5f6e0a41dc sudoers_lookup_pseudo: init match to UNSPEC for sudo_nss_can_continue().
Otherwise, processing will stop after the first sudoers nsswitch
service specification where [SUCCESS=return] is present.

--HG--
branch : 1.9
2023-12-15 10:45:22 -07:00
Todd C. Miller
319ada9ab7 Added tag SUDO_1_9_15p3 for changeset 20d368229c6a
--HG--
branch : 1.9
2023-12-13 12:50:20 -07:00
Todd C. Miller
c9198ef4df Sudo 1.9.15p3 2023-12-13 12:15:12 -07:00