Add EXAMPLES variables for use in the man pages for the examples directory.

This commit is contained in:
Todd C. Miller
2022-06-06 08:36:44 -06:00
parent 24522fb4e4
commit 96c3c28194
4 changed files with 64 additions and 19 deletions

22
configure vendored
View File

@@ -840,6 +840,7 @@ SEMAN
PSMAN
LCMAN
BAMAN
EXAMPLES
DEVEL
SUDOERS_GID
SUDOERS_UID
@@ -3574,6 +3575,7 @@ ac_config_headers="$ac_config_headers config.h pathnames.h"
#
@@ -32430,6 +32432,26 @@ while test X"$plugindir" != X"$_plugindir"; do
done
exec_prefix="$oexec_prefix"
# Convert exampledir to something that can be used in the man pages
# I wish there was a better way to expand this.
EXAMPLES="$exampledir"
while :; do
EXAMPLES="`echo \"$EXAMPLES\" | sed -e 's/(/{/g' -e 's/)/}/g'`"
case "$EXAMPLES" in
*\${[A-Za-z]*}*)
eval EXAMPLES="$EXAMPLES"
;;
*)
break
;;
esac
done
case "$EXAMPLES" in
NONE/*)
EXAMPLES="${ac_default_prefix}${EXAMPLES#NONE}"
;;
esac
if test X"$enable_intercept" != X"no"; then
SUDO_OBJS="${SUDO_OBJS} intercept.pb-c.o"
PROGS="${PROGS} sudo_intercept.la"

View File

@@ -63,6 +63,7 @@ AC_SUBST([SUDOERS_MODE])
AC_SUBST([SUDOERS_UID])
AC_SUBST([SUDOERS_GID])
AC_SUBST([DEVEL])
AC_SUBST([EXAMPLES])
AC_SUBST([BAMAN])
AC_SUBST([LCMAN])
AC_SUBST([PSMAN])
@@ -5048,7 +5049,7 @@ dnl
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
dnl
dnl Expand exec_prefix in in variables used by the manual pages
dnl Expand exec_prefix in variables used by the manual pages
dnl
oexec_prefix="$exec_prefix"
if test "$exec_prefix" = '$(prefix)'; then
@@ -5088,6 +5089,26 @@ while test X"$plugindir" != X"$_plugindir"; do
done
exec_prefix="$oexec_prefix"
# Convert exampledir to something that can be used in the man pages
# I wish there was a better way to expand this.
EXAMPLES="$exampledir"
while :; do
EXAMPLES="`echo \"$EXAMPLES\" | sed -e 's/(/{/g' -e 's/)/}/g'`"
case "$EXAMPLES" in
*\${[[A-Za-z]]*}*)
eval EXAMPLES="$EXAMPLES"
;;
*)
break
;;
esac
done
case "$EXAMPLES" in
NONE/*)
EXAMPLES="${ac_default_prefix}${EXAMPLES#NONE}"
;;
esac
dnl
dnl Defer setting _PATH_SUDO_NOEXEC, etc until after exec_prefix is set
dnl

View File

@@ -17,7 +17,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.TH "SUDO_PLUGIN_PYTHON" "5" "February 16, 2022" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
.TH "SUDO_PLUGIN_PYTHON" "5" "June 6, 2022" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
.nh
.if n .ad l
.SH "NAME"
@@ -184,7 +184,8 @@ The plugin arguments are as follows:
ModulePath
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".
directory,
\fI@plugindir@/python\fR.
.TP 6n
ClassName
(Optional.) The name of the class implementing the sudo Python plugin.
@@ -553,7 +554,7 @@ To try it, register it by adding the following lines to
.sp
.RS 0n
Plugin python_policy python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_policy_plugin.py \e
ModulePath=@EXAMPLES@/example_policy_plugin.py \e
ClassName=SudoPolicyPlugin
.RE
.fi
@@ -845,7 +846,7 @@ To try it, register it by adding the following lines to
.sp
.RS 4n
Plugin python_io python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_io_plugin.py \e
ModulePath=@EXAMPLES@/example_io_plugin.py \e
ClassName=SudoIOPlugin
.RE
.fi
@@ -1161,7 +1162,7 @@ To try it, register it by adding the following lines to
.sp
.RS 4n
Plugin python_audit python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_audit_plugin.py \e
ModulePath=@EXAMPLES@/example_audit_plugin.py \e
ClassName=SudoAuditPlugin
.RE
.fi
@@ -1302,7 +1303,7 @@ To try it, register it by adding the following lines to
.sp
.RS 4n
Plugin python_approval python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_approval_plugin.py \e
ModulePath=@EXAMPLES@/example_approval_plugin.py \e
ClassName=BusinessHoursApprovalPlugin
.RE
.fi
@@ -1399,7 +1400,7 @@ file by adding the following lines:
.sp
.RS 4n
Defaults group_plugin="python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_group_plugin.py \e
ModulePath=@EXAMPLES@/example_group_plugin.py \e
ClassName=SudoGroupPlugin"
.RE
.fi
@@ -1558,7 +1559,7 @@ To try it, register it by adding the following lines to
.sp
.RS 4n
Plugin python_io python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_conversation.py \e
ModulePath=@EXAMPLES@/example_conversation.py \e
ClassName=ReasonLoggerIOPlugin
.RE
.fi
@@ -1737,7 +1738,7 @@ To try it, register it by adding the following lines to
.sp
.RS 4n
Plugin python_io python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_debugging.py \e
ModulePath=@EXAMPLES@/example_debugging.py \e
ClassName=DebugDemoPlugin
Debug python_plugin.so \e

View File

@@ -16,7 +16,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd February 16, 2022
.Dd June 6, 2022
.Dt SUDO_PLUGIN_PYTHON @mansectform@
.Os Sudo @PACKAGE_VERSION@
.Sh NAME
@@ -155,7 +155,8 @@ The plugin arguments are as follows:
.It ModulePath
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".
directory,
.Pa @plugindir@/python .
.It ClassName
(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
@@ -449,7 +450,7 @@ To try it, register it by adding the following lines to
.Pa @sysconfdir@/sudo.conf :
.Bd -literal
Plugin python_policy python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_policy_plugin.py \e
ModulePath=@EXAMPLES@/example_policy_plugin.py \e
ClassName=SudoPolicyPlugin
.Ed
.Pp
@@ -683,7 +684,7 @@ To try it, register it by adding the following lines to
.Pa @sysconfdir@/sudo.conf :
.Bd -literal -offset 4n
Plugin python_io python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_io_plugin.py \e
ModulePath=@EXAMPLES@/example_io_plugin.py \e
ClassName=SudoIOPlugin
.Ed
.Ss Audit plugin API
@@ -930,7 +931,7 @@ To try it, register it by adding the following lines to
.Pa @sysconfdir@/sudo.conf :
.Bd -literal -offset 4n
Plugin python_audit python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_audit_plugin.py \e
ModulePath=@EXAMPLES@/example_audit_plugin.py \e
ClassName=SudoAuditPlugin
.Ed
.Pp
@@ -1036,7 +1037,7 @@ To try it, register it by adding the following lines to
.Pa @sysconfdir@/sudo.conf :
.Bd -literal -offset 4n
Plugin python_approval python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_approval_plugin.py \e
ModulePath=@EXAMPLES@/example_approval_plugin.py \e
ClassName=BusinessHoursApprovalPlugin
.Ed
.Pp
@@ -1113,7 +1114,7 @@ To try it, register it in the
file by adding the following lines:
.Bd -literal -offset 4n
Defaults group_plugin="python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_group_plugin.py \e
ModulePath=@EXAMPLES@/example_group_plugin.py \e
ClassName=SudoGroupPlugin"
.Ed
.Pp
@@ -1249,7 +1250,7 @@ To try it, register it by adding the following lines to
.Pa @sysconfdir@/sudo.conf :
.Bd -literal -offset 4n
Plugin python_io python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_conversation.py \e
ModulePath=@EXAMPLES@/example_conversation.py \e
ClassName=ReasonLoggerIOPlugin
.Ed
.Ss Information / error display API
@@ -1398,7 +1399,7 @@ To try it, register it by adding the following lines to
.Pa @sysconfdir@/sudo.conf :
.Bd -literal -offset 4n
Plugin python_io python_plugin.so \e
ModulePath=@prefix@/share/doc/sudo/examples/example_debugging.py \e
ModulePath=@EXAMPLES@/example_debugging.py \e
ClassName=DebugDemoPlugin
Debug python_plugin.so \e