Skip to content

Commit 821d31c

Browse files
committed
merge sudo 1.9.4p1 from tip
--HG-- branch : 1.9
2 parents 4159f7c + 4949fd2 commit 821d31c

23 files changed

Lines changed: 575 additions & 453 deletions

NEWS

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
What's new in Sudo 1.9.4p1
2+
3+
* Sudo on macOS now supports users with more than 16 groups without
4+
needing to set "group_source" to "dynamic" in /etc/sudo.conf.
5+
Previously, only the first 15 were used when matching group-based
6+
rules in sudoers. Bug #946.
7+
8+
* Fixed a regression introduced in version 1.9.4 where sudo would
9+
not build when configured using the --without-sendmail option.
10+
Bug #947.
11+
12+
* Fixed a problem where if I/O logging was disabled and sudo was
13+
unable to connect to sudo_logsrvd, the command would still be
14+
allowed to run even when the "ignore_logfile_errors" sudoers
15+
option was enabled.
16+
17+
* Fixed a crash introduced in version 1.9.4 when attempting to run
18+
a command as a non-existent user. Bug #948.
19+
20+
* The installed sudo.conf file now has the default sudoers Plugin
21+
lines commented out. This fixes a potential conflict when there
22+
is both a system-installed version of sudo and a user-installed
23+
version. GitHub issue #75.
24+
25+
* Fixed a regression introduced in sudo 1.9.4 where sudo would run
26+
the command as a child process even when a pseudo-terminal was
27+
not in use and the "pam_session" and "pam_setcred" options were
28+
disabled. GitHub issue #76.
29+
30+
* Fixed a regression introduced in sudo 1.8.9 where the "closefrom"
31+
sudoers option could not be set to a value of 3. Bug #950.
32+
133
What's new in Sudo 1.9.4
234

335
* The sudoers parser will now detect when an upper-case reserved
@@ -18,7 +50,7 @@ What's new in Sudo 1.9.4
1850
the sudoers plugin.
1951

2052
* JSON log entries sent to syslog now use "minimal" JSON which
21-
skips all non-essention whitespace.
53+
skips all non-essential white space.
2254

2355
* The sudoers plugin can now produce JSON-formatted logs. The
2456
"log_format" sudoers option can be used to select sudo or json

config.h.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,11 @@
13711371
# undef _LINUX_SOURCE_COMPAT
13721372
#endif
13731373

1374+
/* Enable unlimited getgroups(2) support on macOS. */
1375+
#ifndef _DARWIN_UNLIMITED_GETGROUPS
1376+
# undef _DARWIN_UNLIMITED_GETGROUPS
1377+
#endif
1378+
13741379
/* Enable prototypes in GCC fixed includes on older systems. */
13751380
#ifndef __USE_FIXED_PROTOTYPES__
13761381
# undef __USE_FIXED_PROTOTYPES__

configure

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for sudo 1.9.4.
3+
# Generated by GNU Autoconf 2.69 for sudo 1.9.4p1.
44
#
55
# Report bugs to <https://bugzilla.sudo.ws/>.
66
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
590590
# Identity of this package.
591591
PACKAGE_NAME='sudo'
592592
PACKAGE_TARNAME='sudo'
593-
PACKAGE_VERSION='1.9.4'
594-
PACKAGE_STRING='sudo 1.9.4'
593+
PACKAGE_VERSION='1.9.4p1'
594+
PACKAGE_STRING='sudo 1.9.4p1'
595595
PACKAGE_BUGREPORT='https://bugzilla.sudo.ws/'
596596
PACKAGE_URL=''
597597

@@ -1584,7 +1584,7 @@ if test "$ac_init_help" = "long"; then
15841584
# Omit some internal or obsolete options to make the list less imposing.
15851585
# This message is too long to be a string in the A/UX 3.1 sh.
15861586
cat <<_ACEOF
1587-
\`configure' configures sudo 1.9.4 to adapt to many kinds of systems.
1587+
\`configure' configures sudo 1.9.4p1 to adapt to many kinds of systems.
15881588

15891589
Usage: $0 [OPTION]... [VAR=VALUE]...
15901590

@@ -1650,7 +1650,7 @@ fi
16501650

16511651
if test -n "$ac_init_help"; then
16521652
case $ac_init_help in
1653-
short | recursive ) echo "Configuration of sudo 1.9.4:";;
1653+
short | recursive ) echo "Configuration of sudo 1.9.4p1:";;
16541654
esac
16551655
cat <<\_ACEOF
16561656

@@ -1924,7 +1924,7 @@ fi
19241924
test -n "$ac_init_help" && exit $ac_status
19251925
if $ac_init_version; then
19261926
cat <<\_ACEOF
1927-
sudo configure 1.9.4
1927+
sudo configure 1.9.4p1
19281928
generated by GNU Autoconf 2.69
19291929

19301930
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2633,7 +2633,7 @@ cat >config.log <<_ACEOF
26332633
This file contains any messages produced by compilers while
26342634
running configure, to aid debugging if configure makes a mistake.
26352635

2636-
It was created by sudo $as_me 1.9.4, which was
2636+
It was created by sudo $as_me 1.9.4p1, which was
26372637
generated by GNU Autoconf 2.69. Invocation command line was
26382638

26392639
$ $0 $@
@@ -16183,6 +16183,10 @@ fi
1618316183
done
1618416184

1618516185

16186+
# macOS >= 10.6 getgroups(2) can support more than > 16 groups
16187+
$as_echo "#define _DARWIN_UNLIMITED_GETGROUPS 1" >>confdefs.h
16188+
16189+
1618616190
# We need to force a flat namespace to make libc
1618716191
# symbol hooking work like it does on ELF.
1618816192
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-force_flat_namespace" >&5
@@ -28751,7 +28755,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2875128755
# report actual input values of CONFIG_FILES etc. instead of their
2875228756
# values after options handling.
2875328757
ac_log="
28754-
This file was extended by sudo $as_me 1.9.4, which was
28758+
This file was extended by sudo $as_me 1.9.4p1, which was
2875528759
generated by GNU Autoconf 2.69. Invocation command line was
2875628760

2875728761
CONFIG_FILES = $CONFIG_FILES
@@ -28817,7 +28821,7 @@ _ACEOF
2881728821
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2881828822
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2881928823
ac_cs_version="\\
28820-
sudo config.status 1.9.4
28824+
sudo config.status 1.9.4p1
2882128825
configured by $0, generated by GNU Autoconf 2.69,
2882228826
with options \\"\$ac_cs_config\\"
2882328827

configure.ac

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1818
dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1919
dnl
2020
AC_PREREQ([2.59])
21-
AC_INIT([sudo], [1.9.4], [https://bugzilla.sudo.ws/], [sudo])
21+
AC_INIT([sudo], [1.9.4p1], [https://bugzilla.sudo.ws/], [sudo])
2222
AC_CONFIG_HEADERS([config.h pathnames.h])
2323
AC_CONFIG_SRCDIR([src/sudo.c])
2424
dnl
@@ -2292,6 +2292,9 @@ case "$host" in
22922292
# Undocumented API that dynamically allocates the groups.
22932293
AC_CHECK_FUNCS([getgrouplist_2], [AC_CHECK_DECLS([getgrouplist_2])])
22942294

2295+
# macOS >= 10.6 getgroups(2) can support more than > 16 groups
2296+
AC_DEFINE([_DARWIN_UNLIMITED_GETGROUPS])
2297+
22952298
# We need to force a flat namespace to make libc
22962299
# symbol hooking work like it does on ELF.
22972300
AX_CHECK_LINK_FLAG([-Wl,-force_flat_namespace], [AX_APPEND_FLAG([-Wl,-force_flat_namespace], [SUDO_LDFLAGS])])
@@ -5019,6 +5022,11 @@ AH_BOTTOM([/* Symbol visibility controls */
50195022
# undef _LINUX_SOURCE_COMPAT
50205023
#endif
50215024
5025+
/* Enable unlimited getgroups(2) support on macOS. */
5026+
#ifndef _DARWIN_UNLIMITED_GETGROUPS
5027+
# undef _DARWIN_UNLIMITED_GETGROUPS
5028+
#endif
5029+
50225030
/* Enable prototypes in GCC fixed includes on older systems. */
50235031
#ifndef __USE_FIXED_PROTOTYPES__
50245032
# undef __USE_FIXED_PROTOTYPES__

doc/sudo.conf.man.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1818
.\"
1919
.nr SL @SEMAN@
20-
.TH "SUDO.CONF" "@mansectform@" "October 30, 2020" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
20+
.TH "SUDO.CONF" "@mansectform@" "December 5, 2020" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
2121
.nh
2222
.if n .ad l
2323
.SH "NAME"
@@ -708,9 +708,9 @@ front end configuration
708708
# The plugin_options are optional.
709709
#
710710
# The sudoers plugin is used by default if no Plugin lines are present.
711-
Plugin sudoers_policy sudoers.so
712-
Plugin sudoers_io sudoers.so
713-
Plugin sudoers_audit sudoers.so
711+
#Plugin sudoers_policy sudoers.so
712+
#Plugin sudoers_io sudoers.so
713+
#Plugin sudoers_audit sudoers.so
714714

715715
#
716716
# Sudo askpass:

doc/sudo.conf.mdoc.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1717
.\"
1818
.nr SL @SEMAN@
19-
.Dd October 30, 2020
19+
.Dd December 5, 2020
2020
.Dt SUDO.CONF @mansectform@
2121
.Os Sudo @PACKAGE_VERSION@
2222
.Sh NAME
@@ -642,9 +642,9 @@ front end configuration
642642
# The plugin_options are optional.
643643
#
644644
# The sudoers plugin is used by default if no Plugin lines are present.
645-
Plugin sudoers_policy sudoers.so
646-
Plugin sudoers_io sudoers.so
647-
Plugin sudoers_audit sudoers.so
645+
#Plugin sudoers_policy sudoers.so
646+
#Plugin sudoers_io sudoers.so
647+
#Plugin sudoers_audit sudoers.so
648648

649649
#
650650
# Sudo askpass:

doc/sudoers.man.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
.nr BA @BAMAN@
2626
.nr LC @LCMAN@
2727
.nr PS @PSMAN@
28-
.TH "SUDOERS" "@mansectform@" "October 30, 2020" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
28+
.TH "SUDOERS" "@mansectform@" "December 11, 2020" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
2929
.nh
3030
.if n .ad l
3131
.SH "NAME"
@@ -3049,7 +3049,9 @@ If
30493049
\fIpam_setcred\fR,
30503050
and
30513051
\fIuse_pty\fR
3052-
are disabled and I/O logging has not been configured,
3052+
are disabled,
3053+
\fIlog_servers\fR
3054+
has not been set and I/O logging has not been configured,
30533055
\fBsudo\fR
30543056
will execute the command directly instead of running it as a child
30553057
process.
@@ -3070,7 +3072,9 @@ If
30703072
\fIpam_setcred\fR,
30713073
and
30723074
\fIuse_pty\fR
3073-
are disabled and I/O logging has not been configured,
3075+
are disabled,
3076+
\fIlog_servers\fR
3077+
has not been set and I/O logging has not been configured,
30743078
\fBsudo\fR
30753079
will execute the command directly instead of running it as a child
30763080
process.

doc/sudoers.mdoc.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
.nr BA @BAMAN@
2525
.nr LC @LCMAN@
2626
.nr PS @PSMAN@
27-
.Dd October 30, 2020
27+
.Dd December 11, 2020
2828
.Dt SUDOERS @mansectform@
2929
.Os Sudo @PACKAGE_VERSION@
3030
.Sh NAME
@@ -2874,7 +2874,9 @@ If
28742874
.Em pam_setcred ,
28752875
and
28762876
.Em use_pty
2877-
are disabled and I/O logging has not been configured,
2877+
are disabled,
2878+
.Em log_servers
2879+
has not been set and I/O logging has not been configured,
28782880
.Nm sudo
28792881
will execute the command directly instead of running it as a child
28802882
process.
@@ -2894,7 +2896,9 @@ If
28942896
.Em pam_setcred ,
28952897
and
28962898
.Em use_pty
2897-
are disabled and I/O logging has not been configured,
2899+
are disabled,
2900+
.Em log_servers
2901+
has not been set and I/O logging has not been configured,
28982902
.Nm sudo
28992903
will execute the command directly instead of running it as a child
29002904
process.

examples/sudo.conf.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
# The plugin_options are optional.
1212
#
1313
# The sudoers plugin is used by default if no Plugin lines are present.
14-
Plugin sudoers_policy sudoers.so
15-
Plugin sudoers_io sudoers.so
16-
Plugin sudoers_audit sudoers.so
14+
#Plugin sudoers_policy sudoers.so
15+
#Plugin sudoers_io sudoers.so
16+
#Plugin sudoers_audit sudoers.so
1717

1818
#
1919
# Sudo askpass:

lib/eventlog/eventlog.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
static FILE *eventlog_stub_open_log(int type, const char *logfile);
7979
static void eventlog_stub_close_log(int type, FILE *fp);
8080

81-
/* Eventlog config settings */
81+
/* Eventlog config settings (default values). */
8282
static struct eventlog_config evl_conf = {
8383
EVLOG_NONE, /* type */
8484
EVLOG_SUDO, /* format */
@@ -91,7 +91,11 @@ static struct eventlog_config evl_conf = {
9191
false, /* omit_hostname */
9292
_PATH_SUDO_LOGFILE, /* logpath */
9393
"%h %e %T", /* time_fmt */
94+
#ifdef _PATH_SUDO_SENDMAIL
9495
_PATH_SUDO_SENDMAIL, /* mailerpath */
96+
#else
97+
NULL, /* mailerpath (disabled) */
98+
#endif
9599
"-t", /* mailerflags */
96100
NULL, /* mailfrom */
97101
MAILTO, /* mailto */
@@ -191,8 +195,10 @@ new_logline(int flags, const char *message, const char *errstr,
191195
}
192196
if (evlog->command != NULL) {
193197
len += sizeof(LL_CMND_STR) - 1 + strlen(evlog->command);
194-
for (i = 1; evlog->argv[i] != NULL; i++)
195-
len += strlen(evlog->argv[i]) + 1;
198+
if (evlog->argv != NULL) {
199+
for (i = 1; evlog->argv[i] != NULL; i++)
200+
len += strlen(evlog->argv[i]) + 1;
201+
}
196202
}
197203

198204
/*
@@ -267,10 +273,12 @@ new_logline(int flags, const char *message, const char *errstr,
267273
goto toobig;
268274
if (strlcat(line, evlog->command, len) >= len)
269275
goto toobig;
270-
for (i = 1; evlog->argv[i] != NULL; i++) {
271-
if (strlcat(line, " ", len) >= len ||
272-
strlcat(line, evlog->argv[i], len) >= len)
273-
goto toobig;
276+
if (evlog->argv != NULL) {
277+
for (i = 1; evlog->argv[i] != NULL; i++) {
278+
if (strlcat(line, " ", len) >= len ||
279+
strlcat(line, evlog->argv[i], len) >= len)
280+
goto toobig;
281+
}
274282
}
275283
}
276284

@@ -1436,8 +1444,10 @@ eventlog_setconf(struct eventlog_config *conf)
14361444
evl_conf.logpath = _PATH_SUDO_LOGFILE;
14371445
if (evl_conf.time_fmt == NULL)
14381446
evl_conf.time_fmt = "%h %e %T";
1447+
#ifdef _PATH_SUDO_SENDMAIL
14391448
if (evl_conf.mailerpath == NULL)
14401449
evl_conf.mailerpath = _PATH_SUDO_SENDMAIL;
1450+
#endif
14411451
if (evl_conf.mailerflags == NULL)
14421452
evl_conf.mailerflags = "-t";
14431453
if (evl_conf.mailto == NULL)

0 commit comments

Comments
 (0)