plugins/python: autodetect ClassName field

If "ClassName" is not specified, load the one and only sudo.Plugin from
the module (if so), otherwise display which plugins are available from
which the system admin can choose.
This commit is contained in:
Robert Manner
2020-02-26 16:59:18 +01:00
committed by Todd C. Miller
parent 5c96b4407d
commit 34b4bb72d6
6 changed files with 115 additions and 22 deletions

View File

@@ -156,7 +156,11 @@ The path of a python file which contains the class of the sudo Python plugin.
It must be either an absolute path or a path relative to the sudo Python plugin
directory: "@plugindir@/python".
.It ClassName
The name of the class implementing the sudo Python plugin.
(Optional.) The name of the class implementing the sudo Python plugin.
If not supplied, the one and only sudo.Plugin that is present in the module
will be used.
If there are multiple such plugins in the module (or none), it
will result in an error.
.El
.Ss Policy plugin API
Policy plugins must be registered in