plugins/sample

Michael <[email protected]>
Newsgroups gmane.comp.tools.sudo.devel
Message-ID <VI1PR0801MB12788A09811ACE1C0B4F45B4EB7D0@VI1PR0801MB1278.eurprd08.prod.outlook.com>
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"


____________________________________________________________
sudo-workers mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
https://www.sudo.ws/mailman/listinfo/sudo-workers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.