Skip to content

Commit

Permalink
merge sudo 1.9.4p2 from tip
Browse files Browse the repository at this point in the history
--HG--
branch : 1.9
  • Loading branch information
millert committed Dec 20, 2020
2 parents 9dddd4f + 4151d8f commit be7da00
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 32 deletions.
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
What's new in Sudo 1.9.4p2

* Fixed a bug introduced in sudo 1.9.4p1 which could lead to a crash
if the sudoers file contains a runas user-specific Defaults entry.
Bug #951.

What's new in Sudo 1.9.4p1

* Sudo on macOS now supports users with more than 16 groups without
Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for sudo 1.9.4p1.
# Generated by GNU Autoconf 2.69 for sudo 1.9.4p2.
#
# Report bugs to <https://bugzilla.sudo.ws/>.
#
Expand Down Expand Up @@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sudo'
PACKAGE_TARNAME='sudo'
PACKAGE_VERSION='1.9.4p1'
PACKAGE_STRING='sudo 1.9.4p1'
PACKAGE_VERSION='1.9.4p2'
PACKAGE_STRING='sudo 1.9.4p2'
PACKAGE_BUGREPORT='https://bugzilla.sudo.ws/'
PACKAGE_URL=''

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

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

Expand Down Expand Up @@ -1650,7 +1650,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sudo 1.9.4p1:";;
short | recursive ) echo "Configuration of sudo 1.9.4p2:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1924,7 +1924,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sudo configure 1.9.4p1
sudo configure 1.9.4p2
generated by GNU Autoconf 2.69

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

It was created by sudo $as_me 1.9.4p1, which was
It was created by sudo $as_me 1.9.4p2, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -28755,7 +28755,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sudo $as_me 1.9.4p1, which was
This file was extended by sudo $as_me 1.9.4p2, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -28821,7 +28821,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
sudo config.status 1.9.4p1
sudo config.status 1.9.4p2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl
AC_PREREQ([2.59])
AC_INIT([sudo], [1.9.4p1], [https://bugzilla.sudo.ws/], [sudo])
AC_INIT([sudo], [1.9.4p2], [https://bugzilla.sudo.ws/], [sudo])
AC_CONFIG_HEADERS([config.h pathnames.h])
AC_CONFIG_SRCDIR([src/sudo.c])
dnl
Expand Down
4 changes: 0 additions & 4 deletions etc/uncrustify-small.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,6 @@ mod_remove_extra_semicolon = true # true/false
# braces if there are no variable declarations in the block.
mod_case_brace = remove # ignore/add/remove/force

# Whether to remove a void 'return;' that appears as the last statement in a
# function.
mod_remove_empty_return = true # true/false

# Add or remove the comma after the last value of an enumeration.
mod_enum_last_comma = remove # ignore/add/remove/force

Expand Down
2 changes: 1 addition & 1 deletion etc/uncrustify.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2837,7 +2837,7 @@ mod_case_brace = remove # ignore/add/remove/force

# Whether to remove a void 'return;' that appears as the last statement in a
# function.
mod_remove_empty_return = true # true/false
mod_remove_empty_return = false # true/false

# Add or remove the comma after the last value of an enumeration.
mod_enum_last_comma = remove # ignore/add/remove/force
Expand Down
34 changes: 17 additions & 17 deletions plugins/sudoers/sudoers.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,23 +393,6 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
}
}

/*
* Set runas passwd/group entries based on command line or sudoers.
* Note that if runas_group was specified without runas_user we
* run the command as the invoking user.
*/
if (sudo_user.runas_group != NULL) {
if (!set_runasgr(sudo_user.runas_group, false))
goto done;
if (!set_runaspw(sudo_user.runas_user ?
sudo_user.runas_user : user_name, false))
goto done;
} else {
if (!set_runaspw(sudo_user.runas_user ?
sudo_user.runas_user : def_runas_default, false))
goto done;
}

/* If given the -P option, set the "preserve_groups" flag. */
if (ISSET(sudo_mode, MODE_PRESERVE_GROUPS))
def_preserve_groups = true;
Expand Down Expand Up @@ -875,6 +858,23 @@ init_vars(char * const envp[])
debug_return_bool(false);
}

/*
* Set runas passwd/group entries based on command line or sudoers.
* Note that if runas_group was specified without runas_user we
* run the command as the invoking user.
*/
if (sudo_user.runas_group != NULL) {
if (!set_runasgr(sudo_user.runas_group, false))
debug_return_bool(false);
if (!set_runaspw(sudo_user.runas_user ?
sudo_user.runas_user : user_name, false))
debug_return_bool(false);
} else {
if (!set_runaspw(sudo_user.runas_user ?
sudo_user.runas_user : def_runas_default, false))
debug_return_bool(false);
}

debug_return_bool(true);
}

Expand Down

0 comments on commit be7da00

Please sign in to comment.