]> granicus.if.org Git - sudo/commitdiff
Bring back SUDOERS_PLUGIN but add .dylib -> .so conversion for
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 20 Mar 2010 00:01:00 +0000 (20:01 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 20 Mar 2010 00:01:00 +0000 (20:01 -0400)
Darwin where libraries end in .dylib but modules end in .so

config.h.in
configure
configure.in
src/load_plugins.c

index 586753a8c9ff8908b1132b7d2d391a7dcb56b5e5..01a26bffb1a9ff0b313eee36ca7c5d64271fbed5 100644 (file)
@@ -25,6 +25,9 @@
 /* Define to 1 if using `alloca.c'. */
 #undef C_ALLOCA
 
+/* The name of the sudoers plugin, including extension. */
+#undef SUDOERS_PLUGIN
+
 /* Define to 1 if you want sudo to display "command not allowed" instead of
    "command not found" when a command cannot be found. */
 #undef DONT_LEAK_PATH_INFO
index 2857e6a90e53bdaff27a67b288ccd3d38ab4b771..2dacaad42322bec0f6f52fcd5182b114c4a9c2aa 100755 (executable)
--- a/configure
+++ b/configure
@@ -11989,6 +11989,12 @@ if test "$enable_shared" = "no"; then
     with_noexec=no
 else
     eval _shrext="$shrext_cmds"
+    # Darwin uses .dylib for libraries but .so for modules
+    if test X"$_shrext" = X".dylib"; then
+       _shrext2=".so"
+    else
+       _shrext2="$_shrext"
+    fi
 fi
 { echo "$as_me:$LINENO: checking path to sudo_noexec.so" >&5
 echo $ECHO_N "checking path to sudo_noexec.so... $ECHO_C" >&6; }
@@ -26288,6 +26294,10 @@ _ACEOF
     eval PLUGINDIR="$with_plugindir"
     cat >>confdefs.h <<EOF
 #define _PATH_SUDO_PLUGIN_DIR "$PLUGINDIR"
+EOF
+
+    cat >>confdefs.h <<EOF
+#define SUDOERS_PLUGIN "sudoers$_shrext2"
 EOF
 
     exec_prefix="$oexec_prefix"
@@ -27729,6 +27739,8 @@ fi
 
 
 
+
+
 
 
 
index 7a1d449c6c9844ec7f77ebc665a1490699dac772..496e3dc4f2d0013b2169414cc64ed1e93cb836dc 100644 (file)
@@ -1325,6 +1325,12 @@ if test "$enable_shared" = "no"; then
     with_noexec=no
 else
     eval _shrext="$shrext_cmds"
+    # Darwin uses .dylib for libraries but .so for modules
+    if test X"$_shrext" = X".dylib"; then
+       _shrext2=".so"
+    else
+       _shrext2="$_shrext"
+    fi
 fi
 AC_MSG_CHECKING(path to sudo_noexec.so)
 AC_ARG_WITH(noexec, [AS_HELP_STRING([--with-noexec[=PATH]], [fully qualified pathname of sudo_noexec.so])],
@@ -2695,6 +2701,7 @@ if test X"$with_noexec" != X"no" -o X"$with_selinux" != X"no"; then
     fi
     eval PLUGINDIR="$with_plugindir"
     SUDO_DEFINE_UNQUOTED(_PATH_SUDO_PLUGIN_DIR, "$PLUGINDIR")
+    SUDO_DEFINE_UNQUOTED(SUDOERS_PLUGIN, "sudoers$_shrext2")
     exec_prefix="$oexec_prefix"
 fi
 
@@ -2722,6 +2729,7 @@ dnl
 AH_TEMPLATE(BROKEN_SYSLOG, [Define to 1 if the `syslog' function returns a non-zero int to denote failure.])
 AH_TEMPLATE(CLASSIC_INSULTS, [Define to 1 if you want the insults from the "classic" version sudo.])
 AH_TEMPLATE(CSOPS_INSULTS, [Define to 1 if you want insults culled from the twisted minds of CSOps.])
+AH_TEMPLATE(SUDOERS_PLUGIN, [The name of the sudoers plugin, including extension.])
 AH_TEMPLATE(DONT_LEAK_PATH_INFO, [Define to 1 if you want sudo to display "command not allowed" instead of "command not found" when a command cannot be found.])
 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.])
index 4e955ffd63b3122ac8a6fb1386da0b81832ed46f..496ed79aaa35830519b2d331f08f622754f0cf1f 100644 (file)
@@ -61,7 +61,7 @@ sudo_read_conf(const char *conf_file)
        /* Default values */
        info = emalloc(sizeof(*info));
        info->symbol_name = "sudoers_policy";
-       info->path = "sudoers.so";
+       info->path = SUDOERS_PLUGIN;
        info->prev = info;
        info->next = NULL;
        tq_append(&pil, info);