From 3f890e4db8dbdc122395c1f190b5035c7b46adce Mon Sep 17 00:00:00 2001 From: Robert Manner Date: Thu, 2 Jan 2020 13:19:12 +0100 Subject: [PATCH] doc/sudo_plugin_python: indent code examples for easier readability --- doc/sudo_plugin_python.man.in | 28 ++++++++++++++-------------- doc/sudo_plugin_python.mdoc.in | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/doc/sudo_plugin_python.man.in b/doc/sudo_plugin_python.man.in index d0708f424..3e0b3ed0c 100644 --- a/doc/sudo_plugin_python.man.in +++ b/doc/sudo_plugin_python.man.in @@ -136,7 +136,7 @@ Example usage in sudo.conf(@mansectform@): .nf .sp -.RS 0n +.RS 6n Plugin python_policy python_plugin.so ModulePath= ClassName= Plugin python_io python_plugin.so ModulePath= ClassName= .RE @@ -147,7 +147,7 @@ Example group provider plugin usage in the file: .nf .sp -.RS 0n +.RS 6n Defaults group_plugin="python_plugin.so ModulePath= ClassName=" .RE .fi @@ -165,7 +165,7 @@ sudo.conf(@mansectform@). For example: .nf .sp -.RS 0n +.RS 6n Plugin python_policy python_plugin.so ModulePath= ClassName= .RE .fi @@ -267,7 +267,7 @@ convenience function can be used to convert them to a dictionary. This function should return a result code or a tuple in the following format: .nf .sp -.RS 10n +.RS 12n return (rc, command_info_out, argv_out, user_env_out) .RE .fi @@ -349,7 +349,7 @@ if the user is not present in the password database. .sp Example conversion: .nf -.RS 6n +.RS 12n user_pwd = pwd.struct_passwd(user_pwd) if user_pwd else None .RE .fi @@ -534,7 +534,7 @@ sudo.conf(@mansectform@). For example: .nf .sp -.RS 0n +.RS 6n Plugin python_io python_plugin.so ModulePath= ClassName= .RE .fi @@ -810,7 +810,7 @@ To try it, register it by adding the following lines to \fI@sysconfdir@/sudo.conf\fR: .nf .sp -.RS 0n +.RS 6n Plugin python_io python_plugin.so \e ModulePath=@prefix@/share/doc/sudo/examples/example_io_plugin.py \e ClassName=SudoIOPlugin @@ -823,7 +823,7 @@ file. For example: .nf .sp -.RS 0n +.RS 6n Defaults group_plugin="python_plugin.so ModulePath= ClassName=" .RE .fi @@ -904,7 +904,7 @@ To try it, register it in the file by adding the following lines: .nf .sp -.RS 0n +.RS 6n Defaults group_plugin="python_plugin.so \e ModulePath=@prefix@/share/doc/sudo/examples/example_group_plugin.py \e ClassName=SudoGroupPlugin" @@ -923,7 +923,7 @@ user. For example: .nf .sp -.RS 0n +.RS 6n %:mygroup ALL=(ALL) NOPASSWD: ALL .RE .fi @@ -1063,7 +1063,7 @@ To try it, register it by adding the following lines to \fI@sysconfdir@/sudo.conf\fR: .nf .sp -.RS 0n +.RS 6n Plugin python_io python_plugin.so \e ModulePath=@prefix@/share/doc/sudo/examples/example_conversation.py \e ClassName=ReasonLoggerIOPlugin @@ -1124,7 +1124,7 @@ For example, to store debug output in use a line like the following: .nf .sp -.RS 0n +.RS 6n Debug python_plugin.so /var/log/sudo_python_debug \e plugin@trace,c_calls@trace .RE @@ -1139,7 +1139,7 @@ For example to just see the debug output of calls, use: .nf .sp -.RS 0n +.RS 6n Debug python_plugin.so /var/log/sudo_python_debug plugin@trace .RE .fi @@ -1228,7 +1228,7 @@ To try it, register it by adding the following lines to \fI@sysconfdir@/sudo.conf\fR: .nf .sp -.RS 0n +.RS 6n Plugin python_io python_plugin.so \e ModulePath=@prefix@/share/doc/sudo/examples/example_debugging.py \e ClassName=DebugDemoPlugin diff --git a/doc/sudo_plugin_python.mdoc.in b/doc/sudo_plugin_python.mdoc.in index 18320b68e..fa40f700e 100644 --- a/doc/sudo_plugin_python.mdoc.in +++ b/doc/sudo_plugin_python.mdoc.in @@ -116,7 +116,7 @@ plugin it is loading as arguments. .Pp Example usage in .Xr sudo.conf @mansectform@ : -.Bd -literal +.Bd -literal -offset indent Plugin python_policy python_plugin.so ModulePath= ClassName= Plugin python_io python_plugin.so ModulePath= ClassName= .Ed @@ -124,7 +124,7 @@ Plugin python_io python_plugin.so ModulePath= ClassName= Example group provider plugin usage in the .Em sudoers file: -.Bd -literal +.Bd -literal -offset indent Defaults group_plugin="python_plugin.so ModulePath= ClassName=" .Ed .Pp @@ -139,7 +139,7 @@ The name of the class implementing the sudo Python plugin. Policy plugins must be registered in .Xr sudo.conf @mansectform@ . For example: -.Bd -literal +.Bd -literal -offset indent Plugin python_policy python_plugin.so ModulePath= ClassName= .Ed .Pp @@ -227,7 +227,7 @@ convenience function can be used to convert them to a dictionary. .El .Pp This function should return a result code or a tuple in the following format: -.Bd -literal -offset 4n +.Bd -literal -offset indent return (rc, command_info_out, argv_out, user_env_out) .Ed .Pp @@ -297,7 +297,7 @@ Convertible to pwd.struct_passwd or if the user is not present in the password database. .Pp Example conversion: -.Bd -literal -compact +.Bd -literal -compact -offset indent user_pwd = pwd.struct_passwd(user_pwd) if user_pwd else None .Ed .It Fa user_env @@ -432,7 +432,7 @@ in addition to another policy plugin, such as I/O plugins must be registered in .Xr sudo.conf @mansectform@ . For example: -.Bd -literal +.Bd -literal -offset indent Plugin python_io python_plugin.so ModulePath= ClassName= .Ed .Pp @@ -653,7 +653,7 @@ system call, otherwise 0. Sudo ships a Python I/O plugin example. To try it, register it by adding the following lines to .Pa @sysconfdir@/sudo.conf : -.Bd -literal +.Bd -literal -offset indent Plugin python_io python_plugin.so \e ModulePath=@prefix@/share/doc/sudo/examples/example_io_plugin.py \e ClassName=SudoIOPlugin @@ -663,7 +663,7 @@ A group provider plugin is registered in the .Xr sudoers @mansectform@ file. For example: -.Bd -literal +.Bd -literal -offset indent Defaults group_plugin="python_plugin.so ModulePath= ClassName=" .Ed .Pp @@ -727,7 +727,7 @@ Sudo ships a Python group plugin example. To try it, register it in the .Em sudoers file by adding the following lines: -.Bd -literal +.Bd -literal -offset indent Defaults group_plugin="python_plugin.so \e ModulePath=@prefix@/share/doc/sudo/examples/example_group_plugin.py \e ClassName=SudoGroupPlugin" @@ -743,7 +743,7 @@ If you add a rule that uses this group, it will affect the .Em test user. For example: -.Bd -literal +.Bd -literal -offset indent %:mygroup ALL=(ALL) NOPASSWD: ALL .Ed .Pp @@ -863,7 +863,7 @@ or the user interrupted the conversation by pressing control-C. Sudo ships with an example plugin demonstrating the Python conversation API. To try it, register it by adding the following lines to .Pa @sysconfdir@/sudo.conf : -.Bd -literal +.Bd -literal -offset indent Plugin python_io python_plugin.so \e ModulePath=@prefix@/share/doc/sudo/examples/example_conversation.py \e ClassName=ReasonLoggerIOPlugin @@ -918,7 +918,7 @@ with the program set to For example, to store debug output in .Pa /var/log/sudo_python_debug , use a line like the following: -.Bd -literal +.Bd -literal -offset indent Debug python_plugin.so /var/log/sudo_python_debug \e plugin@trace,c_calls@trace .Ed @@ -930,7 +930,7 @@ strings, separated by commas For example to just see the debug output of .Fn sudo.debug calls, use: -.Bd -literal +.Bd -literal -offset indent Debug python_plugin.so /var/log/sudo_python_debug plugin@trace .Ed .Pp @@ -1000,7 +1000,7 @@ one or more messages to log Sudo ships an example debug plugin by default. To try it, register it by adding the following lines to .Pa @sysconfdir@/sudo.conf : -.Bd -literal +.Bd -literal -offset indent Plugin python_io python_plugin.so \e ModulePath=@prefix@/share/doc/sudo/examples/example_debugging.py \e ClassName=DebugDemoPlugin