[sudo-workers] plugins/sample

Michael horse_dung at hotmail.com
Fri May 6 04:22:21 MDT 2016


There are some problems with the plugins/sample/sample_plugin.c which prevents it from working.  Patch supplied below:


--- a/sudo-1.8.16/plugins/sample/sample_plugin.c 2016-05-06 10:52:02.137726105 +0100
+++ b/sudo-1.8.16/plugins/sample/sample_plugin.c 2016-05-06 11:14:17.893270105 +0100
@@ -187,7 +187,7 @@
     msg.msg_type = SUDO_CONV_PROMPT_ECHO_OFF;
     msg.msg = "Password: ";
     memset(&repl, 0, sizeof(repl));
-    sudo_conv(1, &msg, &repl);
+    sudo_conv(1, &msg, &repl, NULL);
     if (repl.reply == NULL) {
  sudo_log(SUDO_CONV_ERROR_MSG, "missing password\n");
  return false;
@@ -462,7 +462,7 @@
     return rval;
 }

-struct policy_plugin sample_policy = {
+__dso_public struct policy_plugin sample_policy = {
     SUDO_POLICY_PLUGIN,
     SUDO_API_VERSION,
     policy_open,

It might also be nice to include some "hints" in the source or a README on how to build and install the plugin.  Like:


1. Compile the sudo source as normal.

2. This plugin isn't compiled by default, so go to plugins/sample and run "make".

3. Copy plugins/sample/.libs/sample_plugin.so to /usr/lib/sudo.

4. Keep a root window lying around as you might lock yourself out of your box if the next step fails.

5. Modify /etc/sudo.conf (create if needed) and add "Plugin sample_policy sample_plugin.so"




More information about the sudo-workers mailing list