]> granicus.if.org Git - sudo/commitdiff
Clarify sudoedit a tad.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 May 2010 13:39:01 +0000 (09:39 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 May 2010 13:39:01 +0000 (09:39 -0400)
doc/sudo_plugin.cat
doc/sudo_plugin.man.in
doc/sudo_plugin.pod

index 08be5adb587e8f87e089abdb7c7fb4d2f53bc742..91fa20a0bc219743ec56381e8f06c08ffa7d3ca5 100644 (file)
@@ -61,7 +61,7 @@ S\bSu\bud\bdo\bo P\bPl\blu\bug\bgi\bin\bn A\bAP\bPI\bI
 
 
 
-1.8.0a1                    May 13, 2010                         1
+1.8.0a1                    May 14, 2010                         1
 
 
 
@@ -127,7 +127,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                         2
+1.8.0a1                    May 14, 2010                         2
 
 
 
@@ -193,7 +193,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                         3
+1.8.0a1                    May 14, 2010                         3
 
 
 
@@ -259,7 +259,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                         4
+1.8.0a1                    May 14, 2010                         4
 
 
 
@@ -325,7 +325,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                         5
+1.8.0a1                    May 14, 2010                         5
 
 
 
@@ -391,7 +391,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                         6
+1.8.0a1                    May 14, 2010                         6
 
 
 
@@ -457,7 +457,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                         7
+1.8.0a1                    May 14, 2010                         7
 
 
 
@@ -523,7 +523,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                         8
+1.8.0a1                    May 14, 2010                         8
 
 
 
@@ -562,18 +562,19 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
                                   char **argv_out[], char **user_env_out[]);
 
            The _\bc_\bh_\be_\bc_\bk_\b__\bs_\bu_\bd_\bo_\be_\bd_\bi_\bt function is called instead of _\bc_\bh_\be_\bc_\bk_\b__\bp_\bo_\bl_\bi_\bc_\by when
-           s\bsu\bud\bdo\bo is invoked as s\bsu\bud\bdo\boe\bed\bdi\bit\bt or with the -e flag.  s\bsu\bud\bdo\boe\bed\bdi\bit\bt is a
-           mechanism for editing one or more files where the user's editor is
-           run with the user's credentials instead of elevated privileges.
-           s\bsu\bud\bdo\bo does this by creating user-writable temporary copies of the
-           files to be edited and then overwriting the originals with the
-           temporary copies after editing is complete.
+           s\bsu\bud\bdo\bo is invoked as s\bsu\bud\bdo\boe\bed\bdi\bit\bt or when the -e flag is specified.
+           s\bsu\bud\bdo\boe\bed\bdi\bit\bt is a mechanism for editing one or more files where an
+           editor is run with the user's credentials instead of with elevated
+           privileges.  s\bsu\bud\bdo\bo achieves this by creating user-writable temporary
+           copies of the files to be edited and then overwriting the originals
+           with the temporary copies after editing is complete.
 
            The plugin should choose the editor to be used, potentially from a
-           variable in the user's environment, and include it in _\ba_\br_\bg_\bv_\b__\bo_\bu_\bt.
-           The files to be edited should be copied from _\ba_\br_\bg_\bv into _\ba_\br_\bg_\bv_\b__\bo_\bu_\bt,
-           separated from the editor and its arguments by a "--" element.  The
-           "--" will be removed by s\bsu\bud\bdo\bo before the editor is executed.
+           variable in the user's environment, such as EDITOR, and include it
+           in _\ba_\br_\bg_\bv_\b__\bo_\bu_\bt.  The files to be edited should be copied from _\ba_\br_\bg_\bv
+           into _\ba_\br_\bg_\bv_\b__\bo_\bu_\bt, separated from the editor and its arguments by a
+           "--" element.  The "--" will be removed by s\bsu\bud\bdo\bo before the editor
+           is executed.
 
            Returns 1 if the command is allowed, 0 if not allowed, -1 for a
            general error, or -2 for a usage error.  In the latter case, s\bsu\bud\bdo\bo
@@ -582,14 +583,13 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
            function with SUDO_CONF_ERROR_MSG to present additional error
            information to the user.
 
-           The function arguments are the same as for _\bc_\bh_\be_\bc_\bk_\b__\bp_\bo_\bl_\bi_\bc_\by.
-
-       _\bC_\bo_\bn_\bv_\be_\br_\bs_\ba_\bt_\bi_\bo_\bn _\bA_\bP_\bI
+           The function arguments are the same as for _\bc_\bh_\be_\bc_\bk_\b__\bp_\bo_\bl_\bi_\bc_\by, except
+           that _\ba_\br_\bg_\bv_\b[_\b0_\b] will always be the string "sudoedit".
 
 
 
 
-1.8.0a1                    May 13, 2010                         9
+1.8.0a1                    May 14, 2010                         9
 
 
 
@@ -598,6 +598,8 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
+       _\bC_\bo_\bn_\bv_\be_\br_\bs_\ba_\bt_\bi_\bo_\bn _\bA_\bP_\bI
+
        If the plugin needs to interact with the user, it may do so via the
        conversation function.  A plugin should not attempt to read directly
        from the standard input or the user's tty (neither of which are
@@ -653,9 +655,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-
-
-1.8.0a1                    May 13, 2010                        10
+1.8.0a1                    May 14, 2010                        10
 
 
 
@@ -721,7 +721,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                        11
+1.8.0a1                    May 14, 2010                        11
 
 
 
@@ -787,7 +787,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                        12
+1.8.0a1                    May 14, 2010                        12
 
 
 
@@ -853,7 +853,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                        13
+1.8.0a1                    May 14, 2010                        13
 
 
 
@@ -919,7 +919,7 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                        14
+1.8.0a1                    May 14, 2010                        14
 
 
 
@@ -985,6 +985,6 @@ SUDO_PLUGIN(1m)        MAINTENANCE COMMANDS       SUDO_PLUGIN(1m)
 
 
 
-1.8.0a1                    May 13, 2010                        15
+1.8.0a1                    May 14, 2010                        15
 
 
index e94a4b29bb2f3d8bb02501e9a4840bf51d98d3aa..be3746340ffc59055a0ea6ab7596cadb309d0cda 100644 (file)
 .\" ========================================================================
 .\"
 .IX Title "SUDO_PLUGIN @mansectsu@"
-.TH SUDO_PLUGIN @mansectsu@ "May 13, 2010" "1.8.0a1" "MAINTENANCE COMMANDS"
+.TH SUDO_PLUGIN @mansectsu@ "May 14, 2010" "1.8.0a1" "MAINTENANCE COMMANDS"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -647,18 +647,19 @@ support credential caching.
 .Ve
 .Sp
 The \fIcheck_sudoedit\fR function is called instead of \fIcheck_policy\fR
-when \fBsudo\fR is invoked as \fBsudoedit\fR or with the \f(CW\*(C`\-e\*(C'\fR flag.
-\&\fBsudoedit\fR is a mechanism for editing one or more files where the
-user's editor is run with the user's credentials instead of elevated
-privileges.  \fBsudo\fR does this by creating user-writable temporary
-copies of the files to be edited and then overwriting the originals
-with the temporary copies after editing is complete.
+when \fBsudo\fR is invoked as \fBsudoedit\fR or when the \f(CW\*(C`\-e\*(C'\fR flag is
+specified.  \fBsudoedit\fR is a mechanism for editing one or more files
+where an editor is run with the user's credentials instead of with
+elevated privileges.  \fBsudo\fR achieves this by creating user-writable
+temporary copies of the files to be edited and then overwriting the
+originals with the temporary copies after editing is complete.
 .Sp
 The plugin should choose the editor to be used, potentially from a
-variable in the user's environment, and include it in \fIargv_out\fR.
-The files to be edited should be copied from \fIargv\fR into \fIargv_out\fR,
-separated from the editor and its arguments by a \f(CW"\-\-"\fR element.
-The \f(CW"\-\-"\fR will be removed by \fBsudo\fR before the editor is executed.
+variable in the user's environment, such as \f(CW\*(C`EDITOR\*(C'\fR, and include
+it in \fIargv_out\fR.  The files to be edited should be copied from
+\&\fIargv\fR into \fIargv_out\fR, separated from the editor and its arguments
+by a \f(CW"\-\-"\fR element.  The \f(CW"\-\-"\fR will be removed by \fBsudo\fR before
+the editor is executed.
 .Sp
 Returns 1 if the command is allowed, 0 if not allowed, \-1 for a
 general error, or \-2 for a usage error.  In the latter case, \fBsudo\fR
@@ -667,7 +668,8 @@ the plugin may optionally call the conversation or plugin_printf
 function with \f(CW\*(C`SUDO_CONF_ERROR_MSG\*(C'\fR to present additional error
 information to the user.
 .Sp
-The function arguments are the same as for \fIcheck_policy\fR.
+The function arguments are the same as for \fIcheck_policy\fR, except
+that \fIargv[0]\fR will always be the string \*(L"sudoedit\*(R".
 .PP
 \fIConversation \s-1API\s0\fR
 .IX Subsection "Conversation API"
index eca8c1f26e768be1c2f82cac0fb5292d6d8ad5a1..fb8a1ac408ec8be6e4df3f984dec4734548e6b9f 100644 (file)
@@ -571,18 +571,19 @@ support credential caching.
                        char **argv_out[], char **user_env_out[]);
 
 The I<check_sudoedit> function is called instead of I<check_policy>
-when B<sudo> is invoked as B<sudoedit> or with the C<-e> flag.
-B<sudoedit> is a mechanism for editing one or more files where the
-user's editor is run with the user's credentials instead of elevated
-privileges.  B<sudo> does this by creating user-writable temporary
-copies of the files to be edited and then overwriting the originals
-with the temporary copies after editing is complete.
+when B<sudo> is invoked as B<sudoedit> or when the C<-e> flag is
+specified.  B<sudoedit> is a mechanism for editing one or more files
+where an editor is run with the user's credentials instead of with
+elevated privileges.  B<sudo> achieves this by creating user-writable
+temporary copies of the files to be edited and then overwriting the
+originals with the temporary copies after editing is complete.
 
 The plugin should choose the editor to be used, potentially from a
-variable in the user's environment, and include it in I<argv_out>.
-The files to be edited should be copied from I<argv> into I<argv_out>,
-separated from the editor and its arguments by a C<"--"> element.
-The C<"--"> will be removed by B<sudo> before the editor is executed.
+variable in the user's environment, such as C<EDITOR>, and include
+it in I<argv_out>.  The files to be edited should be copied from
+I<argv> into I<argv_out>, separated from the editor and its arguments
+by a C<"--"> element.  The C<"--"> will be removed by B<sudo> before
+the editor is executed.
 
 Returns 1 if the command is allowed, 0 if not allowed, -1 for a
 general error, or -2 for a usage error.  In the latter case, B<sudo>
@@ -591,7 +592,8 @@ the plugin may optionally call the conversation or plugin_printf
 function with C<SUDO_CONF_ERROR_MSG> to present additional error
 information to the user.
 
-The function arguments are the same as for I<check_policy>.
+The function arguments are the same as for I<check_policy>, except
+that I<argv[0]> will always be the string "sudoedit".
 
 =back