2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 09:57:41 +00:00

Compile in support for insults by default.

Insults are still disabled by default but can be enabled in the
sudoers file.  To completely disable insult support, use the
--without-insults configure option.
This commit is contained in:
Todd C. Miller 2024-06-08 08:24:54 -06:00
parent e9d65e67aa
commit 50ae48a4ba
3 changed files with 51 additions and 40 deletions

View File

@ -807,14 +807,16 @@ Defaults are listed in brackets after the description.
--with-classic-insults
Uses insults from sudo "classic." If you just specify --with-insults
you will get the classic and CSOps insults. This is on by default if
--with-insults is given.
you will get the classic and CSOps insults. You must either specify
--with-insults or enable insults in the sudoers file for this to have
any effect.
--with-csops-insults
Insults the user with an extra set of insults (some quotes, some
original) from a sysadmin group at CU (CSOps). You must specify
--with-insults as well for this to have any effect. This is on by
default if --with-insults is given.
original) from a sysadmin group at CU (CSOps). If you just specify
--with-insults you will get the classic and CSOps insults. You
must either specify --with-insults or enable insults in the sudoers
file for this to have any effect.
--with-editor=PATH
Specify the default editor path for use by visudo. This may be a
@ -880,13 +882,19 @@ Defaults are listed in brackets after the description.
Sudoers option: ignore_dot
--with-insults
Define this if you want to be insulted for typing an incorrect password
just like the original sudo(8). This is off by default.
Define this if you want to be insulted by default for typing
an incorrect password just like the original sudo(8).
Insults may be optionally disabled in the sudoers file.
Sudoers option: insults
--with-insults=no, --without-insults
By default, sudo will include support for insults that can be
enabled via the sudoers file. However, if --with-insults=no is
used, no insults will be available, even if enabled in sudoers.
--with-insults=disabled
Include support for insults but disable them unless explicitly
enabled in sudoers.
enabled in the sudoers file. This is the default.
Sudoers option: !insults
--with-iologdir[=DIR]

31
configure vendored
View File

@ -5295,8 +5295,6 @@ printf "%s\n" "$as_me: adding CSOps standard options" >&6;}
CHECKSIA=false
with_ignore_dot=yes
insults=on
with_classic_insults=yes
with_csops_insults=yes
with_env_editor=yes
: ${mansectsu='8'}
: ${mansectform='5'}
@ -6135,6 +6133,8 @@ esac
fi
with_classic_insults=yes
with_csops_insults=yes
# Check whether --with-insults was given.
if test ${with_insults+y}
@ -6143,14 +6143,12 @@ then :
yes) insults=on
printf "%s\n" "#define USE_INSULTS 1" >>confdefs.h
with_classic_insults=yes
with_csops_insults=yes
;;
disabled) insults=off
with_classic_insults=yes
with_csops_insults=yes
;;
no) insults=off
with_classic_insults=no
with_csops_insults=no
;;
*) as_fn_error $? "--with-insults does not take an argument." "$LINENO" 5
;;
@ -38456,17 +38454,18 @@ echo " password prompt : ${passprompt}" >&6
echo " password prompt timeout : ${password_timeout} minutes" >&6
echo " password tries : ${passwd_tries}" >&6
echo " bad password message : ${badpass_message}" >&6
if test "$insults" = "on"; then
i=""
test "$with_python_insults" = "yes" && i="python ${i}"
test "$with_goons_insults" = "yes" && i="goons ${i}"
test "$with_hal_insults" = "yes" && i="hal ${i}"
test "$with_csops_insults" = "yes" && i="csops ${i}"
test "$with_classic_insults" = "yes" && i="classic ${i}"
else
i=no
insult_sets=""
test "$with_python_insults" = "yes" && insult_sets="python ${insult_sets}"
test "$with_goons_insults" = "yes" && insult_sets="goons ${insult_sets}"
test "$with_hal_insults" = "yes" && insult_sets="hal ${insult_sets}"
test "$with_csops_insults" = "yes" && insult_sets="csops ${insult_sets}"
test "$with_classic_insults" = "yes" && insult_sets="classic ${insult_sets}"
if test -z "$insult_sets"; then
insult_sets=no
elif test "$insults" != "on"; then
insult_sets="${insult_sets} (disabled)"
fi
echo " insults : $i" >&6
echo " insults : $insult_sets" >&6
echo " display lecture : ${lecture}" >&6
echo " timestamp (credential) type : ${timestamp_type}" >&6
echo " timestamp (credential) timeout: ${timeout} minutes" >&6

View File

@ -440,8 +440,6 @@ AC_ARG_WITH(csops, [AS_HELP_STRING([--with-csops], [add CSOps standard options])
CHECKSIA=false
with_ignore_dot=yes
insults=on
with_classic_insults=yes
with_csops_insults=yes
with_env_editor=yes
: ${mansectsu='8'}
: ${mansectform='5'}
@ -963,18 +961,23 @@ AC_ARG_WITH(tty-tickets, [AS_HELP_STRING([--with-tty-tickets], [use a different
;;
esac])
dnl
dnl The order of the insults options is important. The main option
dnl must come first, followed by all-insults, then the individual ones.
dnl The classic and csops insult sets are always included by default.
dnl
with_classic_insults=yes
with_csops_insults=yes
AC_ARG_WITH(insults, [AS_HELP_STRING([--with-insults], [insult the user for entering an incorrect password])],
[case $with_insults in
yes) insults=on
AC_DEFINE(USE_INSULTS)
with_classic_insults=yes
with_csops_insults=yes
;;
disabled) insults=off
with_classic_insults=yes
with_csops_insults=yes
;;
no) insults=off
with_classic_insults=no
with_csops_insults=no
;;
*) AC_MSG_ERROR([--with-insults does not take an argument.])
;;
@ -4510,17 +4513,18 @@ echo " password prompt : ${passprompt}" >&AS_MESSAGE_FD
echo " password prompt timeout : ${password_timeout} minutes" >&AS_MESSAGE_FD
echo " password tries : ${passwd_tries}" >&AS_MESSAGE_FD
echo " bad password message : ${badpass_message}" >&AS_MESSAGE_FD
if test "$insults" = "on"; then
i=""
test "$with_python_insults" = "yes" && i="python ${i}"
test "$with_goons_insults" = "yes" && i="goons ${i}"
test "$with_hal_insults" = "yes" && i="hal ${i}"
test "$with_csops_insults" = "yes" && i="csops ${i}"
test "$with_classic_insults" = "yes" && i="classic ${i}"
else
i=no
insult_sets=""
test "$with_python_insults" = "yes" && insult_sets="python ${insult_sets}"
test "$with_goons_insults" = "yes" && insult_sets="goons ${insult_sets}"
test "$with_hal_insults" = "yes" && insult_sets="hal ${insult_sets}"
test "$with_csops_insults" = "yes" && insult_sets="csops ${insult_sets}"
test "$with_classic_insults" = "yes" && insult_sets="classic ${insult_sets}"
if test -z "$insult_sets"; then
insult_sets=no
elif test "$insults" != "on"; then
insult_sets="${insult_sets} (disabled)"
fi
echo " insults : $i" >&AS_MESSAGE_FD
echo " insults : $insult_sets" >&AS_MESSAGE_FD
echo " display lecture : ${lecture}" >&AS_MESSAGE_FD
echo " timestamp (credential) type : ${timestamp_type}" >&AS_MESSAGE_FD
echo " timestamp (credential) timeout: ${timeout} minutes" >&AS_MESSAGE_FD