]> granicus.if.org Git - sudo/commitdiff
Monty Python insults from Philip Hudson
authorTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 17 Apr 2018 13:10:43 +0000 (07:10 -0600)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 17 Apr 2018 13:10:43 +0000 (07:10 -0600)
INSTALL
MANIFEST
NEWS
config.h.in
configure
configure.ac
plugins/sudoers/Makefile.in
plugins/sudoers/ins_python.h [new file with mode: 0644]
plugins/sudoers/insults.h

diff --git a/INSTALL b/INSTALL
index 0d7298fc92517733561b3a7f31955993c104e65b..ea3e8b678b0d356539e5f087c94e071bcb1e8a6c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -705,6 +705,11 @@ Options that set runtime-changeable default values:
        and warning.
        Sudoers option: syslog_goodpri
 
+  --with-python-insults
+       Insults the user with lines from "Monty Python's Flying Circus" when an
+       incorrect password is entered. You must either specify --with-insults or
+       enable insults in the sudoers file for this to have any effect.
+
   --with-goons-insults
        Insults the user with lines from the "Goon Show" when an incorrect
        password is entered.  You must either specify --with-insults or
index ac88d4e5b52e454f33a4bff4e5b45bda53f113fe..54f886963fd671d42ddaa51ee7330e9ecabe59c0 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -299,6 +299,7 @@ plugins/sudoers/ins_2001.h
 plugins/sudoers/ins_classic.h
 plugins/sudoers/ins_csops.h
 plugins/sudoers/ins_goons.h
+plugins/sudoers/ins_python.h
 plugins/sudoers/insults.h
 plugins/sudoers/interfaces.c
 plugins/sudoers/interfaces.h
diff --git a/NEWS b/NEWS
index fdb62645496c13f5b98e1e156a57bf8acce013a5..adced027650e1f1436090eac283673f0f6212a21 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,8 @@ What's new in Sudo 1.8.23
    checks the directory for writability before using it.  Previously,
    sudoedit only performed an existence check.  Bug #827.
 
+ * Sudo now includes an optional set of Monty Python-inspired insults.
+
 What's new in Sudo 1.8.22
 
  * Commands run in the background from a script run via sudo will
index e728a3d72e77a933b5a0c02ba48040e7430f9ba7..fcd73d587dfe23b22ba765a679bbfabf9ca15595 100644 (file)
 /* Define to const if the `putenv' takes a const argument. */
 #undef PUTENV_CONST
 
+/* Define to 1 if you want insults from "Monty Python's Flying Circus". */
+#undef PYTHON_INSULTS
+
 /* The default value of preloaded objects (if any). */
 #undef RTLD_PRELOAD_DEFAULT
 
index aad6822cf575e727da55fbf19e9dc9e572608893..e8abf6643a8c80775d5e61ba9fff789d3d2022c3 100755 (executable)
--- a/configure
+++ b/configure
@@ -922,6 +922,7 @@ with_classic_insults
 with_csops_insults
 with_hal_insults
 with_goons_insults
+with_python_insults
 with_nsswitch
 with_ldap
 with_ldap_conf_file
@@ -1752,6 +1753,8 @@ Optional Packages:
   --with-csops-insults    include CSOps insults
   --with-hal-insults      include 2001-like insults
   --with-goons-insults    include the insults from the "Goon Show"
+  --with-python-insults   include the insults from "Monty Python's Flying
+                          Circus"
   --with-nsswitch[=PATH]  path to nsswitch.conf
   --with-ldap[=DIR]       enable LDAP support
   --with-ldap-conf-file   path to LDAP configuration file
@@ -5771,6 +5774,7 @@ if test "${with_all_insults+set}" = set; then :
                with_csops_insults=yes
                with_hal_insults=yes
                with_goons_insults=yes
+               with_python_insults=yes
                ;;
     no)                ;;
     *)         as_fn_error $? "\"--with-all-insults does not take an argument.\"" "$LINENO" 5
@@ -5836,6 +5840,20 @@ fi
 
 
 
+# Check whether --with-python-insults was given.
+if test "${with_python_insults+set}" = set; then :
+  withval=$with_python_insults; case $with_python_insults in
+    yes)       $as_echo "#define PYTHON_INSULTS 1" >>confdefs.h
+
+        ;;
+    no)                ;;
+    *)         as_fn_error $? "\"--with-python-insults does not take an argument.\"" "$LINENO" 5
+        ;;
+esac
+fi
+
+
+
 # Check whether --with-nsswitch was given.
 if test "${with_nsswitch+set}" = set; then :
   withval=$with_nsswitch; case $with_nsswitch in
@@ -5891,6 +5909,7 @@ 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; }
     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}"
@@ -28781,5 +28800,6 @@ fi
 
 
 
+
 
 
index 310bb206a118868c8f38252c24fbb98fc774a697..1d28321ef5949accee99e7049ce111acd97af810 100644 (file)
@@ -1089,6 +1089,7 @@ AC_ARG_WITH(all-insults, [AS_HELP_STRING([--with-all-insults], [include all the
                with_csops_insults=yes
                with_hal_insults=yes
                with_goons_insults=yes
+               with_python_insults=yes
                ;;
     no)                ;;
     *)         AC_MSG_ERROR(["--with-all-insults does not take an argument."])
@@ -1131,6 +1132,15 @@ AC_ARG_WITH(goons-insults, [AS_HELP_STRING([--with-goons-insults], [include the
                ;;
 esac])
 
+AC_ARG_WITH(python-insults, [AS_HELP_STRING([--with-python-insults], [include the insults from "Monty Python's Flying Circus"])],
+[case $with_python_insults in
+    yes)       AC_DEFINE(PYTHON_INSULTS)
+        ;;
+    no)                ;;
+    *)         AC_MSG_ERROR(["--with-python-insults does not take an argument."])
+        ;;
+esac])
+
 AC_ARG_WITH(nsswitch, [AS_HELP_STRING([--with-nsswitch[[=PATH]]], [path to nsswitch.conf])],
 [case $with_nsswitch in
     no)                ;;
@@ -1160,6 +1170,7 @@ dnl include all insult sets on one line
 if test "$insults" = "on"; then
     AC_MSG_CHECKING(which insult sets to include)
     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}"
@@ -4408,6 +4419,7 @@ AH_TEMPLATE(ENV_DEBUG, [Define to 1 to enable environment function debugging.])
 AH_TEMPLATE(ENV_EDITOR, [Define to 1 if you want visudo to honor the EDITOR and VISUAL env variables.])
 AH_TEMPLATE(FQDN, [Define to 1 if you want to require fully qualified hosts in sudoers.])
 AH_TEMPLATE(ENV_RESET, [Define to 1 to enable environment resetting by default.])
+AH_TEMPLATE(PYTHON_INSULTS, [Define to 1 if you want insults from "Monty Python's Flying Circus".])
 AH_TEMPLATE(GOONS_INSULTS, [Define to 1 if you want insults from the "Goon Show".])
 AH_TEMPLATE(HAL_INSULTS, [Define to 1 if you want 2001-like insults.])
 AH_TEMPLATE(HAVE_AFS, [Define to 1 if you use AFS.])
index a095a8d643adc92c0ab8a7a28e1645cb5780bf62..15ca1f9e7a0a6ec57556df6936c365a37c45835c 100644 (file)
@@ -1283,6 +1283,7 @@ sudo_auth.lo: $(authdir)/sudo_auth.c $(devdir)/def_data.h \
               $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/ins_2001.h \
               $(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \
               $(srcdir)/ins_goons.h $(srcdir)/insults.h $(srcdir)/logging.h \
+              $(srcdir)/ins_python.h $(srcdir)/insults.h $(srcdir)/logging.h \
               $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
               $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
               $(top_builddir)/pathnames.h
diff --git a/plugins/sudoers/ins_python.h b/plugins/sudoers/ins_python.h
new file mode 100644 (file)
index 0000000..28f53d2
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2018 Todd C. Miller <Todd.Miller@sudo.ws>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef SUDOERS_INS_PYTHON_H
+#define SUDOERS_INS_PYTHON_H
+
+    /*
+     * Insults from "Monty Python's Flying Circus" and family.
+     */
+
+    "That is no basis for supreme executive power!",
+    "You empty-headed animal food trough wiper!",
+    "I fart in your general direction!",
+    "Your mother was a hamster and your father smelt of elderberries!",
+    "You must cut down the mightiest tree in the forest... with... a herring!",
+    "I wave my private parts at your aunties!",
+    "He's not the Messiah, he's a very naughty boy!",
+    "I wish to make a complaint.",
+    "When you're walking home tonight, and some homicidal maniac comes after you with a bunch of loganberries, don't come crying to me!",
+    "This man, he doesn't know when he's beaten! He doesn't know when he's winning, either. He has no... sort of... sensory apparatus...",
+    "There's nothing wrong with you that an expensive operation can't prolong.",
+    "I'm very sorry, but I'm not allowed to argue unless you've paid.",
+
+#endif /* SUDOERS_INS_PYTHON_H */
index 2114cc2b9c27380b3647e89455780273588187e2..58d7f9d217c379b5719e3359d73bb569aabca411 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef SUDOERS_INSULTS_H
 #define SUDOERS_INSULTS_H
 
-#if defined(HAL_INSULTS) || defined(GOONS_INSULTS) || defined(CLASSIC_INSULTS) || defined(CSOPS_INSULTS)
+#if defined(HAL_INSULTS) || defined(GOONS_INSULTS) || defined(CLASSIC_INSULTS) || defined(CSOPS_INSULTS) || defined(PYTHON_INSULTS)
 
 /*
  * Use one or more set of insults as determined by configure
@@ -40,6 +40,10 @@ char *insults[] = {
 
 # ifdef CSOPS_INSULTS
 #  include "ins_csops.h"
+# endif
+
+# ifdef PYTHON_INSULTS
+#  include "ins_python.h"
 # endif
 
     NULL
@@ -56,6 +60,6 @@ char *insults[] = {
  */
 #define INSULT         (insults[time(NULL) % NOFINSULTS])
 
-#endif /* HAL_INSULTS || GOONS_INSULTS || CLASSIC_INSULTS || CSOPS_INSULTS */
+#endif /* HAL_INSULTS || GOONS_INSULTS || CLASSIC_INSULTS || CSOPS_INSULTS || PYTHON_INSULTS */
 
 #endif /* SUDOERS_INSULTS_H */