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 PSMAN
LCMAN LCMAN
BAMAN BAMAN
EXAMPLES
DEVEL DEVEL
SUDOERS_GID SUDOERS_GID
SUDOERS_UID 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 done
exec_prefix="$oexec_prefix" 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 if test X"$enable_intercept" != X"no"; then
SUDO_OBJS="${SUDO_OBJS} intercept.pb-c.o" SUDO_OBJS="${SUDO_OBJS} intercept.pb-c.o"
PROGS="${PROGS} sudo_intercept.la" PROGS="${PROGS} sudo_intercept.la"

View File

@@ -63,6 +63,7 @@ AC_SUBST([SUDOERS_MODE])
AC_SUBST([SUDOERS_UID]) AC_SUBST([SUDOERS_UID])
AC_SUBST([SUDOERS_GID]) AC_SUBST([SUDOERS_GID])
AC_SUBST([DEVEL]) AC_SUBST([DEVEL])
AC_SUBST([EXAMPLES])
AC_SUBST([BAMAN]) AC_SUBST([BAMAN])
AC_SUBST([LCMAN]) AC_SUBST([LCMAN])
AC_SUBST([PSMAN]) AC_SUBST([PSMAN])
@@ -5048,7 +5049,7 @@ dnl
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
dnl 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 dnl
oexec_prefix="$exec_prefix" oexec_prefix="$exec_prefix"
if test "$exec_prefix" = '$(prefix)'; then if test "$exec_prefix" = '$(prefix)'; then
@@ -5088,6 +5089,26 @@ while test X"$plugindir" != X"$_plugindir"; do
done done
exec_prefix="$oexec_prefix" 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
dnl Defer setting _PATH_SUDO_NOEXEC, etc until after exec_prefix is set dnl Defer setting _PATH_SUDO_NOEXEC, etc until after exec_prefix is set
dnl dnl

View File

@@ -17,7 +17,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" 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 .nh
.if n .ad l .if n .ad l
.SH "NAME" .SH "NAME"
@@ -184,7 +184,8 @@ The plugin arguments are as follows:
ModulePath ModulePath
The path of a python file which contains the class of the sudo Python plugin. 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 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 .TP 6n
ClassName ClassName
(Optional.) The name of the class implementing the sudo Python plugin. (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 .sp
.RS 0n .RS 0n
Plugin python_policy python_plugin.so \e 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 ClassName=SudoPolicyPlugin
.RE .RE
.fi .fi
@@ -845,7 +846,7 @@ To try it, register it by adding the following lines to
.sp .sp
.RS 4n .RS 4n
Plugin python_io python_plugin.so \e 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 ClassName=SudoIOPlugin
.RE .RE
.fi .fi
@@ -1161,7 +1162,7 @@ To try it, register it by adding the following lines to
.sp .sp
.RS 4n .RS 4n
Plugin python_audit python_plugin.so \e 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 ClassName=SudoAuditPlugin
.RE .RE
.fi .fi
@@ -1302,7 +1303,7 @@ To try it, register it by adding the following lines to
.sp .sp
.RS 4n .RS 4n
Plugin python_approval python_plugin.so \e 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 ClassName=BusinessHoursApprovalPlugin
.RE .RE
.fi .fi
@@ -1399,7 +1400,7 @@ file by adding the following lines:
.sp .sp
.RS 4n .RS 4n
Defaults group_plugin="python_plugin.so \e 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" ClassName=SudoGroupPlugin"
.RE .RE
.fi .fi
@@ -1558,7 +1559,7 @@ To try it, register it by adding the following lines to
.sp .sp
.RS 4n .RS 4n
Plugin python_io python_plugin.so \e 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 ClassName=ReasonLoggerIOPlugin
.RE .RE
.fi .fi
@@ -1737,7 +1738,7 @@ To try it, register it by adding the following lines to
.sp .sp
.RS 4n .RS 4n
Plugin python_io python_plugin.so \e 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 ClassName=DebugDemoPlugin
Debug python_plugin.so \e Debug python_plugin.so \e

View File

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