Skip to content

Commit 22298e1

Browse files
committed
Merge sudo 1.9.15p2 from tip.
--HG-- branch : 1.9
2 parents 70e1e98 + 62895ea commit 22298e1

File tree

7 files changed

+73
-35
lines changed

7 files changed

+73
-35
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
What's new in Sudo 1.9.15p2
2+
3+
* Fixed a bug on BSD systems where sudo would not restore the
4+
terminal settings on exit if the terminal had parity enabled.
5+
GitHub issue #326.
6+
17
What's new in Sudo 1.9.15p1
28

39
* Fixed a bug introduced in sudo 1.9.15 that prevented LDAP-based

configure

Lines changed: 9 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.72c for sudo 1.9.15p1.
3+
# Generated by GNU Autoconf 2.72c for sudo 1.9.15p2.
44
#
55
# Report bugs to <https://bugzilla.sudo.ws/>.
66
#
@@ -614,8 +614,8 @@ MAKEFLAGS=
614614
# Identity of this package.
615615
PACKAGE_NAME='sudo'
616616
PACKAGE_TARNAME='sudo'
617-
PACKAGE_VERSION='1.9.15p1'
618-
PACKAGE_STRING='sudo 1.9.15p1'
617+
PACKAGE_VERSION='1.9.15p2'
618+
PACKAGE_STRING='sudo 1.9.15p2'
619619
PACKAGE_BUGREPORT='https://bugzilla.sudo.ws/'
620620
PACKAGE_URL=''
621621

@@ -1642,7 +1642,7 @@ if test "$ac_init_help" = "long"; then
16421642
# Omit some internal or obsolete options to make the list less imposing.
16431643
# This message is too long to be a string in the A/UX 3.1 sh.
16441644
cat <<_ACEOF
1645-
'configure' configures sudo 1.9.15p1 to adapt to many kinds of systems.
1645+
'configure' configures sudo 1.9.15p2 to adapt to many kinds of systems.
16461646

16471647
Usage: $0 [OPTION]... [VAR=VALUE]...
16481648

@@ -1708,7 +1708,7 @@ fi
17081708

17091709
if test -n "$ac_init_help"; then
17101710
case $ac_init_help in
1711-
short | recursive ) echo "Configuration of sudo 1.9.15p1:";;
1711+
short | recursive ) echo "Configuration of sudo 1.9.15p2:";;
17121712
esac
17131713
cat <<\_ACEOF
17141714

@@ -2003,7 +2003,7 @@ fi
20032003
test -n "$ac_init_help" && exit $ac_status
20042004
if $ac_init_version; then
20052005
cat <<\_ACEOF
2006-
sudo configure 1.9.15p1
2006+
sudo configure 1.9.15p2
20072007
generated by GNU Autoconf 2.72c
20082008

20092009
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2823,7 +2823,7 @@ cat >config.log <<_ACEOF
28232823
This file contains any messages produced by compilers while
28242824
running configure, to aid debugging if configure makes a mistake.
28252825

2826-
It was created by sudo $as_me 1.9.15p1, which was
2826+
It was created by sudo $as_me 1.9.15p2, which was
28272827
generated by GNU Autoconf 2.72c. Invocation command line was
28282828

28292829
$ $0$ac_configure_args_raw
@@ -36671,7 +36671,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
3667136671
# report actual input values of CONFIG_FILES etc. instead of their
3667236672
# values after options handling.
3667336673
ac_log="
36674-
This file was extended by sudo $as_me 1.9.15p1, which was
36674+
This file was extended by sudo $as_me 1.9.15p2, which was
3667536675
generated by GNU Autoconf 2.72c. Invocation command line was
3667636676

3667736677
CONFIG_FILES = $CONFIG_FILES
@@ -36739,7 +36739,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
3673936739
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
3674036740
ac_cs_config='$ac_cs_config_escaped'
3674136741
ac_cs_version="\\
36742-
sudo config.status 1.9.15p1
36742+
sudo config.status 1.9.15p2
3674336743
configured by $0, generated by GNU Autoconf 2.72c,
3674436744
with options \\"\$ac_cs_config\\"
3674536745

configure.ac

Lines changed: 1 addition & 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.69])
21-
AC_INIT([sudo], [1.9.15p1], [https://bugzilla.sudo.ws/], [sudo])
21+
AC_INIT([sudo], [1.9.15p2], [https://bugzilla.sudo.ws/], [sudo])
2222
AC_CONFIG_HEADERS([config.h pathnames.h])
2323
AC_CONFIG_SRCDIR([src/sudo.c])
2424
AC_CONFIG_AUX_DIR([scripts])

lib/util/term.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ sudo_term_restore_v1(int fd, bool flush)
178178
ret = true;
179179
goto unlock;
180180
}
181+
#if !TCSASOFT
182+
/* Only systems without TCSASOFT make changes to c_cflag. */
181183
if ((term.c_cflag & CONTROL_FLAGS) != (cur_term.c_cflag & CONTROL_FLAGS)) {
182184
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: not restoring terminal, "
183185
"c_cflag changed; 0x%x, expected 0x%x", __func__,
@@ -186,6 +188,7 @@ sudo_term_restore_v1(int fd, bool flush)
186188
ret = true;
187189
goto unlock;
188190
}
191+
#endif
189192
if ((term.c_lflag & LOCAL_FLAGS) != (cur_term.c_lflag & LOCAL_FLAGS)) {
190193
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: not restoring terminal, "
191194
"c_lflag changed; 0x%x, expected 0x%x", __func__,

plugins/sudoers/sudoers.h

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ struct group_list {
7878

7979
/*
8080
* Parse configuration settings.
81-
* Do not change the order without updating SUDOERS_PARSER_CONFIG_INITIALIZER.
8281
*/
8382
struct sudoers_parser_config {
8483
const char *sudoers_path;
@@ -91,26 +90,30 @@ struct sudoers_parser_config {
9190
gid_t sudoers_gid;
9291
};
9392
#define SUDOERS_PARSER_CONFIG_INITIALIZER { \
94-
NULL, /* sudoers_path */ \
95-
false, /* strict */ \
96-
1, /* verbose level 1 */ \
97-
true, /* recovery */ \
98-
false, /* ignore_perms */ \
99-
SUDOERS_MODE, \
100-
SUDOERS_UID, \
101-
SUDOERS_GID \
93+
.sudoers_path = NULL, \
94+
.strict = false, \
95+
.verbose = 1, \
96+
.recovery = true, \
97+
.ignore_perms = false, \
98+
.sudoers_mode = SUDOERS_MODE, \
99+
.sudoers_uid = SUDOERS_UID, \
100+
.sudoers_gid = SUDOERS_GID \
102101
}
103102

104103
/*
105104
* Settings passed in from the sudo front-end.
106-
* Do not change the order without updating SUDOERS_CONTEXT_INITIALIZER.
107105
*/
108106
struct sudoers_plugin_settings {
109107
const char *plugin_dir;
110108
const char *ldap_conf;
111109
const char *ldap_secret;
112110
unsigned int flags;
113111
};
112+
#define SUDOERS_PLUGIN_SETTINGS_INITIALIZER { \
113+
.plugin_dir = _PATH_SUDO_PLUGIN_DIR, \
114+
.ldap_conf = _PATH_LDAP_CONF, \
115+
.ldap_secret = _PATH_LDAP_SECRET \
116+
}
114117

115118
/*
116119
* Info pertaining to the invoking user.
@@ -183,11 +186,6 @@ struct sudoers_runas_context {
183186
#endif
184187
};
185188

186-
#define SUDOERS_CONTEXT_INITIALIZER { \
187-
SUDOERS_PARSER_CONFIG_INITIALIZER, \
188-
{ _PATH_SUDO_PLUGIN_DIR, _PATH_LDAP_CONF, _PATH_LDAP_SECRET } \
189-
}
190-
191189
/*
192190
* Global configuration for the sudoers module.
193191
*/
@@ -205,6 +203,10 @@ struct sudoers_context {
205203
unsigned int mode;
206204
char uuid_str[37];
207205
};
206+
#define SUDOERS_CONTEXT_INITIALIZER { \
207+
SUDOERS_PARSER_CONFIG_INITIALIZER, \
208+
SUDOERS_PLUGIN_SETTINGS_INITIALIZER, \
209+
}
208210

209211
/*
210212
* sudo_get_gidlist() type values

scripts/mkpkg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ configure="${scriptdir}/../configure"
104104
osrelease=`echo "$osversion" | sed -e 's/^[^0-9]*//' -e 's/-.*$//'`
105105
: ${MAKE=make}
106106

107-
if [ $build_packages = true -a $osversion = unknown ]; then
107+
if [ $build_packages = true -a "$osversion" = "unknown" ]; then
108108
echo "unable to determine platform" 1>&2
109109
exit 1
110110
fi

scripts/pp

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
# Copyright 2023 One Identity LLC. ALL RIGHTS RESERVED
3-
pp_revision="20230127"
3+
pp_revision="20231108"
44
# Copyright 2018 One Identity LLC. ALL RIGHTS RESERVED.
55
#
66
# Redistribution and use in source and binary forms, with or without
@@ -794,6 +794,11 @@ pp_strip_binaries () {
794794
fi
795795
}
796796

797+
pp_is_version_greater () {
798+
smaller_version="$(echo -e "$1\n$2" | sort -V | head -1)"
799+
test x"$smaller_version" = x"$1"
800+
}
801+
797802
pp_if_true=0
798803
pp_if_false=0
799804

@@ -1293,6 +1298,7 @@ pp_files_expand () {
12931298
if test $# -gt 0; then
12941299
_a=`eval echo \"$1\"`
12951300
case ",$_a," in *,volatile,*) _flags="${_flags}v";; esac
1301+
case ",$_a," in *,missingok,*) _flags="${_flags}m";; esac
12961302
case ",$_a," in *,optional,*) _optional=true;; esac
12971303
case ",$_a," in *,symlink,*) _has_target=true;; esac
12981304
case ",$_a," in *,ignore-others,*) _flags="${_flags}i";; esac
@@ -1948,6 +1954,10 @@ pp_backend_aix () {
19481954
cat $root_wrkdir/$pp_aix_bff_name.$ex.inventory
19491955
fi >&2
19501956

1957+
for fileset in ${pp_aix_deprecated_filesets}; do
1958+
echo "$fileset"
1959+
done >$user_wrkdir/$pp_aix_bff_name.$ex.namelist
1960+
19511961
if test x"" != x"${pp_aix_copyright:-$copyright}"; then
19521962
echo "${pp_aix_copyright:-$copyright}" > $user_wrkdir/$pp_aix_bff_name.$ex.copyright
19531963
echo "${pp_aix_copyright:-$copyright}" > $root_wrkdir/$pp_aix_bff_name.$ex.copyright
@@ -5702,7 +5712,10 @@ pp_rpm_writefiles () {
57025712
test x"$farch" = x"noarch" || pp_add_to_list pp_rpm_arch_seen $farch
57035713
fi
57045714

5705-
case $f in *v*) _l="%config(noreplace) $_l";; esac
5715+
case $f in
5716+
*v*) _l="%config(noreplace) $_l";;
5717+
*m*) _l="%config(missingok) $_l";;
5718+
esac
57065719
echo "$_l"
57075720
done
57085721
echo
@@ -6321,7 +6334,7 @@ pp_rpm_service_group_make_init_script () {
63216334
local script=/etc/init.d/$grp
63226335
local out=$pp_destdir$script
63236336

6324-
pp_add_file_if_missing $script run 755 || return 0
6337+
pp_add_file_if_missing $script run 755 m || return 0
63256338

63266339
cat <<-. >>$out
63276340
#!/bin/sh
@@ -6411,7 +6424,7 @@ pp_rpm_service_make_service_files () {
64116424
local out=$pp_destdir$script
64126425
local _process _cmd _rpmlevels
64136426

6414-
pp_add_file_if_missing $script run 755 || return 0
6427+
pp_add_file_if_missing $script run 755 m || return 0
64156428

64166429
#-- start out as an empty shell script
64176430
cat <<-'.' >$out
@@ -7954,8 +7967,8 @@ pp_backend_bsd_init () {
79547967
pp_bsd_desc=
79557968
pp_bsd_message=
79567969

7957-
# FreeBSD uses package.txz, DragonFly uses package.pkg.
7958-
if [ "$pp_bsd_os" = "DragonFly" ]; then
7970+
# Newer "pkg" (>=1.17.0) generates package.pkg, before that package.txz.
7971+
if pp_is_version_greater 1.17.0 "$(pkg --version)"; then
79597972
pp_bsd_pkg_sfx=pkg
79607973
else
79617974
pp_bsd_pkg_sfx=txz
@@ -8982,17 +8995,29 @@ pp_systemd_service_install_common () {
89828995
;;
89838996
esac
89848997
fi
8985-
else
8986-
RUNNING=1
8998+
fi
8999+
9000+
# If the service is not running according to its sysv script (eg. systemd service
9001+
# is not using a pidfile the sysv script needs), or its sysv script is not present any more,
9002+
# check how systemd thinks.
9003+
# We also try to restart the service in case something went wrong with it.
9004+
if $systemctl_cmd is-active "$svc" >/dev/null 2>&1 || $systemctl_cmd is-failed "$svc" >/dev/null 2>&1; then
9005+
$systemctl_cmd stop "$svc" >/dev/null 2>&1
9006+
RUNNING=0
89879007
fi
89889008
89899009
# Enable the $svc.service
89909010
$systemctl_cmd daemon-reload >/dev/null 2>&1
9011+
9012+
# We do not need the init.d script any more, and it causes problems on SLES
9013+
# where systemd sysv compatibility is enforced and broken on default installs
9014+
rm -f "/etc/init.d/$svc"
9015+
89919016
$systemctl_cmd enable $svc.service >/dev/null 2>&1
89929017
89939018
# Now that the service has been enabled, start it again if it was running before.
89949019
if [ $RUNNING -eq 0 ]; then
8995-
/etc/init.d/$svc start > /dev/null 2>&1
9020+
$systemctl_cmd start $svc.service >/dev/null 2>&1
89969021
fi
89979022
fi
89989023
}
@@ -9058,6 +9083,8 @@ pp_systemd_service_remove_common () {
90589083
_pp_systemd_init
90599084
fi
90609085
9086+
$systemctl_cmd stop $svc.service > /dev/null 2>&1
9087+
90619088
# Remove the systemd unit service file
90629089
if [ "x$systemd_service_dir" != "x$systemd_system_unit_dir" ]; then
90639090
rm -f "$systemd_system_unit_dir/$svc.service"

0 commit comments

Comments
 (0)