From: Todd C. Miller Date: Mon, 18 Sep 2017 16:45:02 +0000 (-0600) Subject: Make PC insults the default and add new configure option, X-Git-Tag: SUDO_1_8_22^2~81 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=749cdc9d957949999d5d5b5cbb0adf842f32c370;p=sudo Make PC insults the default and add new configure option, enable-offensive-insults, to enable the offensive insults. --- diff --git a/INSTALL b/INSTALL index 6c3216f60..5b5826684 100644 --- a/INSTALL +++ b/INSTALL @@ -360,6 +360,10 @@ Optional features: Specify the path to the SSSD shared library, which is loaded at run-time. + --enable-offensive-insults + Enable potentially offensive sudo insults from the classic + version of sudo. + Operating system-specific options: --disable-setreuid Disable use of the setreuid() function for operating systems @@ -816,9 +820,6 @@ Options that set runtime-changeable default values: the failure and exits. The default is 3. Sudoers option: passwd_tries - --with-pc-insults - Replace politically incorrect insults with less objectionable ones. - --with-runas-default=USER The default user to run commands as if the -u flag is not specified on the command line. This defaults to "root". diff --git a/config.h.in b/config.h.in index d81e71e27..922fbeb3c 100644 --- a/config.h.in +++ b/config.h.in @@ -958,6 +958,10 @@ /* Define if your C preprocessor does not support variadic macros. */ #undef NO_VARIADIC_MACROS +/* Define to 1 to include offensive insults from the classic version of sudo. + */ +#undef OFFENSIVE_INSULTS + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -986,10 +990,6 @@ /* The passwd prompt timeout (in minutes). */ #undef PASSWORD_TIMEOUT -/* Define to 1 to replace politically incorrect insults with less offensive - ones. */ -#undef PC_INSULTS - /* Define to 1 to enable replacement getcwd if system getcwd is broken. */ #undef PREFER_PORTABLE_GETCWD diff --git a/configure b/configure index d55862cbe..4146c8813 100755 --- a/configure +++ b/configure @@ -851,6 +851,7 @@ ac_user_opts=' enable_option_checking with_otp_only with_alertmail +with_pc_insults with_devel with_CC with_rpath @@ -925,7 +926,6 @@ with_nsswitch with_ldap with_ldap_conf_file with_ldap_secret_file -with_pc_insults with_secure_path with_interfaces with_askpass @@ -964,6 +964,7 @@ enable_devsearch with_selinux enable_sasl enable_timestamp_type +enable_offensive_insults enable_gss_krb5_ccache_name enable_shared enable_static @@ -1650,6 +1651,8 @@ Optional Features: --enable-sasl Enable/disable LDAP SASL support --timestamp-type=TYPE Set the default time stamp record type to global, ppid or tty. + --enable-offensive-insults + Enable potentially offensive sudo insults. --enable-gss-krb5-ccache-name Use GSS-API to set the Kerberos V cred cache name --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1668,6 +1671,7 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-otp-only deprecated --with-alertmail deprecated + --with-pc-insults deprecated --with-devel add development options --with-CC C compiler to use --with-rpath deprecated, use --disable-rpath @@ -1749,8 +1753,6 @@ Optional Packages: --with-ldap[=DIR] enable LDAP support --with-ldap-conf-file path to LDAP configuration file --with-ldap-secret-file path to LDAP secret password file - --with-pc-insults replace politically incorrect insults with less - offensive ones --with-secure-path override the user's path with a built-in one --without-interfaces don't try to read the ip addr of ether interfaces --with-askpass=PATH Fully qualified pathname of askpass helper @@ -4450,6 +4452,22 @@ fi +# Check whether --with-pc-insults was given. +if test "${with_pc_insults+set}" = set; then : + withval=$with_pc_insults; case $with_pc_insults in + yes) enable_offensive_insults=no + { $as_echo "$as_me:${as_lineno-$LINENO}: --with-pc-insults option deprecated, it is now the default" >&5 +$as_echo "$as_me: --with-pc-insults option deprecated, it is now the default" >&6;} + ;; + no) enable_offensive_insults=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: --without-pc-insults option deprecated, use --enable-offensive-insults" >&5 +$as_echo "$as_me: --without-pc-insults option deprecated, use --enable-offensive-insults" >&6;} + ;; +esac +fi + + + # Check whether --with-devel was given. if test "${with_devel+set}" = set; then : @@ -5862,20 +5880,6 @@ cat >>confdefs.h <>confdefs.h - - ;; - no) ;; - *) as_fn_error $? "\"--with-pc-insults does not take an argument.\"" "$LINENO" 5 - ;; -esac -fi - - if test "$insults" = "on"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking which insult sets to include" >&5 $as_echo_n "checking which insult sets to include... " >&6; } @@ -6775,6 +6779,18 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# Check whether --enable-offensive_insults was given. +if test "${enable_offensive_insults+set}" = set; then : + enableval=$enable_offensive_insults; +else + enable_offensive_insults=no +fi + +if test "$enable_offensive_insults" = "yes"; then + $as_echo "#define OFFENSIVE_INSULTS 1" >>confdefs.h + +fi + # Check whether --enable-gss_krb5_ccache_name was given. if test "${enable_gss_krb5_ccache_name+set}" = set; then : enableval=$enable_gss_krb5_ccache_name; check_gss_krb5_ccache_name=$enableval diff --git a/configure.ac b/configure.ac index 4e6fea56b..8924782e3 100644 --- a/configure.ac +++ b/configure.ac @@ -288,6 +288,16 @@ AC_ARG_WITH(alertmail, [AS_HELP_STRING([--with-alertmail], [deprecated])], ;; esac]) +AC_ARG_WITH(pc-insults, [AS_HELP_STRING([--with-pc-insults], [deprecated])], +[case $with_pc_insults in + yes) enable_offensive_insults=no + AC_MSG_NOTICE([--with-pc-insults option deprecated, it is now the default]) + ;; + no) enable_offensive_insults=yes + AC_MSG_NOTICE([--without-pc-insults option deprecated, use --enable-offensive-insults]) + ;; +esac]) + dnl dnl Options for --with dnl @@ -1142,15 +1152,6 @@ AC_ARG_WITH(ldap-secret-file, [AS_HELP_STRING([--with-ldap-secret-file], [path t test -n "$with_ldap_secret_file" && ldap_secret="$with_ldap_secret_file" SUDO_DEFINE_UNQUOTED(_PATH_LDAP_SECRET, "$ldap_secret", [Path to the ldap.secret file]) -AC_ARG_WITH(pc-insults, [AS_HELP_STRING([--with-pc-insults], [replace politically incorrect insults with less offensive ones])], -[case $with_pc_insults in - yes) AC_DEFINE(PC_INSULTS) - ;; - no) ;; - *) AC_MSG_ERROR(["--with-pc-insults does not take an argument."]) - ;; -esac]) - dnl include all insult sets on one line if test "$insults" = "on"; then AC_MSG_CHECKING(which insult sets to include) @@ -1576,6 +1577,13 @@ AC_ARG_ENABLE(timestamp-type, ]) AC_DEFINE_UNQUOTED(TIMESTAMP_TYPE, $timestamp_type) +AC_ARG_ENABLE(offensive_insults, +[AS_HELP_STRING([--enable-offensive-insults], [Enable potentially offensive sudo insults.])], +[], [enable_offensive_insults=no]) +if test "$enable_offensive_insults" = "yes"; then + AC_DEFINE(OFFENSIVE_INSULTS) +fi + dnl dnl gss_krb5_ccache_name() may not work on Heimdal so we don't use it by default dnl @@ -4449,7 +4457,7 @@ AH_TEMPLATE(NO_PAM_SESSION, [Define to 1 if you don't want to use sudo's PAM ses AH_TEMPLATE(NO_ROOT_MAILER, [Define to avoid runing the mailer as root.]) AH_TEMPLATE(NO_ROOT_SUDO, [Define to 1 if root should not be allowed to use sudo.]) AH_TEMPLATE(TIMESTAMP_TYPE, [Define to global, ppid or tty to set the default timestamp record type.]) -AH_TEMPLATE(PC_INSULTS, [Define to 1 to replace politically incorrect insults with less offensive ones.]) +AH_TEMPLATE(OFFENSIVE_INSULTS, [Define to 1 to include offensive insults from the classic version of sudo.]) AH_TEMPLATE(PREFER_PORTABLE_GETCWD, [Define to 1 to enable replacement getcwd if system getcwd is broken.]) AH_TEMPLATE(SECURE_PATH, [A colon-separated list of directories to override the user's PATH with.]) AH_TEMPLATE(SEND_MAIL_WHEN_NOT_OK, [Define to 1 to send mail when the user is not allowed to run a command.]) diff --git a/plugins/sudoers/ins_classic.h b/plugins/sudoers/ins_classic.h index ddf27c85a..70e49e744 100644 --- a/plugins/sudoers/ins_classic.h +++ b/plugins/sudoers/ins_classic.h @@ -22,7 +22,7 @@ */ "Wrong! You cheating scum!", -#ifdef PC_INSULTS +#ifndef OFFENSIVE_INSULTS "And you call yourself a Rocket Scientist!", #else "No soap, honkie-lips.",