Skip to content

Commit c684bf0

Browse files
committed
Merge sudo 1.9.12 from tip.
--HG-- branch : 1.9
2 parents 898a1de + 802e500 commit c684bf0

336 files changed

Lines changed: 27803 additions & 19016 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql-analysis.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [ "main" ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [ "main" ]
2020
schedule:
21-
- cron: '19 3 * * 2'
21+
- cron: '25 15 * * 0'
2222

2323
jobs:
2424
analyze:
@@ -34,37 +34,39 @@ jobs:
3434
matrix:
3535
language: [ 'cpp', 'python' ]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37-
# Learn more about CodeQL language support at https://git.io/codeql-language-support
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v2
41+
uses: actions/checkout@v3
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
45+
uses: github/codeql-action/init@v2
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
4949
# By default, queries listed here will override any specified in a config file.
5050
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
5254

55+
5356
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5457
# If this step fails, then you should remove it and run the build manually (see below)
5558
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
59+
uses: github/codeql-action/autobuild@v2
5760

5861
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6063

61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6466

65-
#- run: |
66-
# make bootstrap
67-
# make release
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
6870

6971
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
72+
uses: github/codeql-action/analyze@v2

INSTALL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ for a list of packages required to build sudo.
3030

3131
## Simple sudo installation
3232

33-
0. If you are upgrading from a previous version of sudo, read
33+
1. If you are upgrading from a previous version of sudo, read
3434
[docs/UPGRADE.md](docs/UPGRADE.md) before proceeding.
3535

36-
1. Read the "OS dependent notes" section for any particular
36+
2. Read the "OS dependent notes" section for any particular
3737
"gotchas" relating to your operating system.
3838

39-
2. `cd` to the source or build directory and type `./configure`
39+
3. `cd` to the source or build directory and type `./configure`
4040
to generate a Makefile and config.h file suitable for building
4141
sudo. Before you actually run configure you should read the
4242
"Available configure options" section to see if there are
@@ -320,7 +320,7 @@ Defaults are listed in brackets after the description.
320320
Adds the specified library (or libraries) to SUDO_LIBS and
321321
and VISUDO_LIBS so sudo will link against them. If the
322322
library doesn't start with "-l" or end in ".a" or ".o" a
323-
"-l" will be pre-pended to it. Multiple libraries may be
323+
"-l" will be prepended to it. Multiple libraries may be
324324
specified as long as they are space separated.
325325

326326
--with-libtool=PATH

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ The file getentropy.c bears the following license:
296296

297297
The embedded copy of zlib bears the following license:
298298

299-
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
299+
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
300300

301301
This software is provided 'as-is', without any express or implied
302302
warranty. In no event will the authors be held liable for any damages
@@ -319,7 +319,7 @@ The embedded copy of zlib bears the following license:
319319

320320
The embedded copy of protobuf-c bears the following license:
321321

322-
Copyright (c) 2008-2018, Dave Benson and the protobuf-c authors.
322+
Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors.
323323
All rights reserved.
324324

325325
Redistribution and use in source and binary forms, with or without

MANIFEST

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ lib/util/event_select.c
220220
lib/util/explicit_bzero.c
221221
lib/util/fatal.c
222222
lib/util/fchmodat.c
223+
lib/util/fchownat.c
223224
lib/util/fnmatch.c
224225
lib/util/freezero.c
225226
lib/util/fstatat.c
@@ -251,6 +252,8 @@ lib/util/mkdirat.c
251252
lib/util/mksiglist.c
252253
lib/util/mksigname.c
253254
lib/util/mktemp.c
255+
lib/util/mmap_alloc.c
256+
lib/util/multiarch.c
254257
lib/util/nanosleep.c
255258
lib/util/openat.c
256259
lib/util/parseln.c
@@ -278,6 +281,8 @@ lib/util/regress/glob/globtest.c
278281
lib/util/regress/glob/globtest.in
279282
lib/util/regress/harness.in
280283
lib/util/regress/mktemp/mktemp_test.c
284+
lib/util/regress/multiarch/multiarch_test.c
285+
lib/util/regress/open_parent_dir/open_parent_dir_test.c
281286
lib/util/regress/parse_gids/parse_gids_test.c
282287
lib/util/regress/progname/progname_test.c
283288
lib/util/regress/strsig/strsig_test.c
@@ -1018,6 +1023,8 @@ plugins/sudoers/regress/testsudoers/test17.out.ok
10181023
plugins/sudoers/regress/testsudoers/test17.sh
10191024
plugins/sudoers/regress/testsudoers/test18.out.ok
10201025
plugins/sudoers/regress/testsudoers/test18.sh
1026+
plugins/sudoers/regress/testsudoers/test19.out.ok
1027+
plugins/sudoers/regress/testsudoers/test19.sh
10211028
plugins/sudoers/regress/testsudoers/test2.inc
10221029
plugins/sudoers/regress/testsudoers/test2.out.ok
10231030
plugins/sudoers/regress/testsudoers/test2.sh
@@ -1196,6 +1203,7 @@ src/exec.c
11961203
src/exec_common.c
11971204
src/exec_intercept.c
11981205
src/exec_intercept.h
1206+
src/exec_iolog.c
11991207
src/exec_monitor.c
12001208
src/exec_nopty.c
12011209
src/exec_preload.c

Makefile.in

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ python_version = @PYTHON_VERSION@
5858

5959
SUBDIRS = lib/util @ZLIB_SRC@ lib/eventlog lib/fuzzstub lib/iolog \
6060
lib/protobuf-c @LOGSRV_SRC@ @LOGSRVD_SRC@ plugins/audit_json \
61-
plugins/group_file plugins/sample_approval plugins/sudoers \
62-
plugins/system_group @PYTHON_PLUGIN_SRC@ src include docs examples
61+
plugins/group_file plugins/sudoers plugins/system_group \
62+
@PYTHON_PLUGIN_SRC@ src include docs examples
6363

64-
SAMPLES = plugins/sample
64+
SAMPLES = plugins/sample plugins/sample_approval
6565

6666
VERSION = @PACKAGE_VERSION@
6767
PACKAGE_TARNAME = @PACKAGE_TARNAME@
@@ -70,6 +70,8 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
7070

7171
SHELL = @SHELL@
7272

73+
EGREP = @EGREP@
74+
GREP = @GREP@
7375
SED = @SED@
7476

7577
INSTALL = $(SHELL) $(scriptdir)/install-sh -c
@@ -105,19 +107,19 @@ PVS_IGNORE = 'V707,V011,V002,V536,V568'
105107
PVS_LOG_OPTS = -a 'GA:1,2' -e -t errorfile -d $(PVS_IGNORE)
106108

107109
all: config.status
108-
for d in $(SUBDIRS); do \
110+
for d in $(SUBDIRS) $(SAMPLES); do \
109111
(cd $$d && exec $(MAKE) $@) && continue; \
110112
exit $$?; \
111113
done
112114

113115
check check-verbose check-fuzzer fuzz pre-install: config.status
114-
for d in $(SUBDIRS); do \
116+
for d in $(SUBDIRS) $(SAMPLES); do \
115117
(cd $$d && exec $(MAKE) $@) && continue; \
116118
exit $$?; \
117119
done
118120

119121
uncrustify.files: Makefile
120-
grep '\.[ch]$$' $(top_srcdir)/MANIFEST | egrep -v '(/zlib/|/(arc4random|arc4random_uniform|chacha_private|charclass|fnmatch|getaddrinfo|getcwd|getdate|getentropy|getopt|getopt_long|glob|gram|inet_ntop|inet_pton|log_server.pb-c|mktemp|pw_dup|reallocarray|mktemp_test|protobuf-c|snprintf|stdbool|strlcat|strlcpy|sudo_queue|toke)\.[ch]$$)' > uncrustify.files
122+
$(GREP) '\.[ch]$$' $(top_srcdir)/MANIFEST | $(EGREP) -v '(/zlib/|/(arc4random|arc4random_uniform|chacha_private|charclass|fnmatch|getaddrinfo|getcwd|getdate|getentropy|getopt|getopt_long|glob|gram|inet_ntop|inet_pton|log_server.pb-c|mktemp|pw_dup|reallocarray|mktemp_test|protobuf-c|snprintf|stdbool|strlcat|strlcpy|sudo_queue|toke)\.[ch]$$)' > uncrustify.files
121123

122124
reformat: uncrustify.files
123125
( cd $(top_srcdir) && uncrustify -c etc/uncrustify.cfg --replace --no-backup -F $(top_builddir)/uncrustify.files )
@@ -126,19 +128,19 @@ check-format: uncrustify.files
126128
( cd $(top_srcdir) && uncrustify -c etc/uncrustify.cfg --check -F $(top_builddir)/uncrustify.files )
127129

128130
spell:
129-
( cd $(top_srcdir) && codespell -I etc/codespell.ignore -x etc/codespell.exclude `egrep -v -f etc/codespell.skip MANIFEST` )
131+
( cd $(top_srcdir) && codespell -I etc/codespell.ignore -x etc/codespell.exclude `$(EGREP) -v -f etc/codespell.skip MANIFEST` )
130132

131133
cppcheck: config.status
132134
rval=0; \
133-
for d in $(SUBDIRS); do \
135+
for d in $(SUBDIRS) $(SAMPLES); do \
134136
echo checking $$d; \
135137
(cd $$d && exec $(MAKE) CPPCHECK_OPTS="$(CPPCHECK_OPTS)" $@) || rval=`expr $$rval + $$?`; \
136138
done; \
137139
exit $$rval
138140

139141
splint: config.status
140142
rval=0; \
141-
for d in $(SUBDIRS); do \
143+
for d in $(SUBDIRS) $(SAMPLES); do \
142144
echo splinting $$d; \
143145
(cd $$d && exec $(MAKE) SPLINT_OPTS="$(SPLINT_OPTS)" $@) || rval=`expr $$rval + $$?`; \
144146
done; \
@@ -161,7 +163,7 @@ cov-analyze: cov-upload
161163
pvs-studio: config.status
162164
files=; \
163165
rval=0; \
164-
for d in $(SUBDIRS); do \
166+
for d in $(SUBDIRS) $(SAMPLES); do \
165167
(cd $$d && exec $(MAKE) PVS_IGNORE="$(PVS_IGNORE)" pvs-log-files) || rval=`expr $$rval + $$?`; \
166168
for f in $$d/*.plog; do \
167169
if test "$$f" != "$$d/*.plog"; then \
@@ -234,7 +236,7 @@ depend: siglist.c signame.c
234236

235237
ChangeLog:
236238
if test -d $(srcdir)/.hg; then \
237-
if hg log -R $(srcdir) --style=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \
239+
if hg log -R $(srcdir) --template=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \
238240
mv -f $@.tmp $(srcdir)/$@; \
239241
else \
240242
rm -f $@.tmp; \
@@ -440,4 +442,4 @@ sandwich:
440442
fi
441443

442444
.PHONY: clean mostlyclean distclean cleandir clobber realclean ChangeLog \
443-
me a sandwhich check-format reformat
445+
me a sandwich check-format reformat

NEWS

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,127 @@
1+
What's new in Sudo 1.9.12
2+
3+
* Fixed a bug in the ptrace-based intercept mode where the current
4+
working directory could include garbage at the end.
5+
6+
* Fixed a compilation error on systems that lack the stdint.h
7+
header. Bug #1035
8+
9+
* Fixed a bug when logging the command's exit status in intercept
10+
mode. The wrong command could be logged with the exit status.
11+
12+
* For ptrace-based intercept mode, sudo will now attempt to
13+
verify that the command path name, arguments and environment
14+
have not changed from the time when they were authorized by the
15+
security policy. The new "intercept_verify" sudoers setting can
16+
be used to control this behavior.
17+
18+
* Fixed running commands with a relative path (e.g. ./foo) in
19+
intercept mode. Previously, this would fail if sudo's current
20+
working directory was different from that of the command.
21+
22+
* Sudo now supports passing the execve(2) system call the NULL
23+
pointer for the `argv` and/or `envp` arguments when in intercept
24+
mode. Linux treats a NULL pointer like an empty array.
25+
26+
* The sudoers LDAP schema now allows sudoUser, sudoRunasUser and
27+
sudoRunasGroup to include UTF-8 characters, not just 7-bit ASCII.
28+
29+
* Fixed a problem with "sudo -i" on SELinux when the target user's
30+
home directory is not searchable by sudo. GitHub issue #160.
31+
32+
* Neovim has been added to the list of visudo editors that support
33+
passing the line number on the command line.
34+
35+
* Fixed a bug in sudo's SHA384 and SHA512 message digest padding.
36+
37+
* Added a new "-N" (--no-update) command line option to sudo which
38+
can be used to prevent sudo from updating the user's cached
39+
credentials. It is now possible to determine whether or not a
40+
user's cached credentials are currently valid by running:
41+
42+
$ sudo -Nnv
43+
44+
and checking the exit value. One use case for this is to indicate
45+
in a shell prompt that sudo is "active" for the user.
46+
47+
* PAM approval modules are no longer invoked when running sub-commands
48+
in intercept mode unless the "intercept_authenticate" option is set.
49+
There is a substantial performance penalty for calling into PAM
50+
for each command run. PAM approval modules are still called for
51+
the initial command.
52+
53+
* Intercept mode on Linux now uses process_vm_readv(2) and
54+
process_vm_writev(2) if available.
55+
56+
* The XDG_CURRENT_DESKTOP environment variable is now preserved
57+
by default. This makes it possible for graphical applications
58+
to choose the correct theme when run via sudo.
59+
60+
* On 64-bit systems, if sudo fails to load a sudoers group plugin,
61+
it will use system-specific heuristics to try to locate a 64-bit
62+
version of the plugin.
63+
64+
* The cvtsudoers manual now documents the JSON and CSV output
65+
formats. GitHub issue #172.
66+
67+
* Fixed a bug where sub-commands were not being logged to a remote
68+
log server when log_subcmds was enabled. GitHub issue #174.
69+
70+
* The new log_stdin, log_stdout, log_stderr, log_ttyin, and log_ttyout
71+
sudoers settings can be used to support more fine-grained I/O logging.
72+
The sudo front-end no longer allocates a pseudo-terminal when running
73+
a command if the I/O logging plugin requests logging of stdin, stdout,
74+
or stderr but not terminal input/output.
75+
76+
* Quieted a libgcrypt run-time initialization warning.
77+
This fixes Debian bug #1019428 and Ubuntu bug #1397663.
78+
79+
* Fixed a bug in visudo that caused literal backslashes to be removed
80+
from the EDITOR environment variable. GitHub issue #179.
81+
82+
* The sudo Python plugin now implements the "find_spec" method instead
83+
of the the deprecated "find_module". This fixes a test failure when
84+
a newer version of setuptools that doesn't include "find_module" is
85+
found on the system.
86+
87+
* Fixed a bug introduced in sudo 1.9.9 where sudo_logsrvd created
88+
the process ID file, usually /var/run/sudo/sudo_logsrvd.pid, as
89+
a directory instead of a plain file. The same bug could result
90+
in I/O log directories that end in six or more X's being created
91+
literally in addition to the name being used as a template for
92+
the mkdtemp(3) function.
93+
94+
* Fixed a long-standing bug where a sudoers rule with a command
95+
line argument of "", which indicates the command may be run with
96+
no arguments, would also match a literal "" on the command line.
97+
GitHub issue #182.
98+
99+
* Added the -I option to visudo which only edits the main sudoers
100+
file. Include files are not edited unless a syntax error is found.
101+
102+
* Fixed "sudo -l -U otheruser" output when the runas list is empty.
103+
Previously, sudo would list the invoking user instead of the
104+
list user. GitHub issue #183.
105+
106+
* Fixed the display of command tags and options in "sudo -l" output
107+
when the RunAs user or group changes. A new line is started for
108+
RunAs changes which means we need to display the command tags
109+
and options again. GitHub issue #184.
110+
111+
* The sesh helper program now uses getopt_long(3) to parse the
112+
command line options.
113+
114+
* The embedded copy of zlib has been updated to version 1.2.13.
115+
116+
* Fixed a bug that prevented event log data from being sent to the
117+
log server when I/O logging was not enabled. This only affected
118+
systems without PAM or configurations where the pam_session and
119+
pam_setcred options were disabled in the sudoers file.
120+
121+
* Fixed a bug where "sudo -l" output included a carriage return
122+
after the newline. This is only needed when displaying to a
123+
terminal in raw mode. Bug #1042.
124+
1125
What's new in Sudo 1.9.11p3
2126

3127
* Fixed "connection reset" errors on AIX when running shell scripts

0 commit comments

Comments
 (0)