-1.8.0a1 March 21, 2010 1
+1.8.0a1 April 13, 2010 1
char * const settings[], char * const user_info[],
char * const user_env[]);
- Returns 1 on success, 0 on failure and -1 on error. On error, the
+ Returns 1 on success, 0 on failure, -1 if a general error ocurred,
+ or -2 if there was a usage error. In the latter case, s\bsu\bud\bdo\bo will
+ print a usage message before it exits. If an error occurs, the
plugin may optionally call the conversation function with
SUDO_CONF_ERROR_MSG to present additional error information to the
user.
settings
A vector of user-supplied s\bsu\bud\bdo\bo settings in the form of
- "name=value" strings. The vector is terminated by a NULL
- pointer. These settings correspond to flags the user specified
-1.8.0a1 March 21, 2010 2
+1.8.0a1 April 13, 2010 2
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ "name=value" strings. The vector is terminated by a NULL
+ pointer. These settings correspond to flags the user specified
when running s\bsu\bud\bdo\bo. As such, they will only be present when the
corresponding flag has been specified on the command line.
ignore_ticket=bool
Set to true if the user specified the -k flag along with a
- command, indicating that the user wishes to ignore any
- cached authentication credentials.
-1.8.0a1 March 21, 2010 3
+1.8.0a1 April 13, 2010 3
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ command, indicating that the user wishes to ignore any
+ cached authentication credentials.
+
login_class=string
BSD login class to use when setting resource limits and
nice value, if specified by the -c flag.
tty=string
The path to the user's terminal device. If the user has no
terminal device associated with the session, the value will
- be empty, as in tty=.
-
-
-1.8.0a1 March 21, 2010 4
+1.8.0a1 April 13, 2010 4
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ be empty, as in tty=.
+
host=string
The local machine's hostname as returned by the
gethostname() system call.
If the user requests detailed version information, the verbose flag
will be set.
- check_policy
-
-1.8.0a1 March 21, 2010 5
+1.8.0a1 April 13, 2010 5
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ check_policy
int (*check_policy)(int argc, char * const argv[]
char *env_add[], char **command_info[],
char **argv_out[], char **user_env_out[]);
Effective user ID to run the command as. If not specified,
the value of _\br_\bu_\bn_\ba_\bs_\b__\bu_\bi_\bd is used.
- runas_gid=gid
- Group ID to run the command as.
-1.8.0a1 March 21, 2010 6
+
+1.8.0a1 April 13, 2010 6
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ runas_gid=gid
+ Group ID to run the command as.
+
runas_egid=gid
Effective group ID to run the command as. If not
specified, the value of _\br_\bu_\bn_\ba_\bs_\b__\bg_\bi_\bd is used.
argv_out
The NULL-terminated argument vector to pass to the _\be_\bx_\be_\bc_\bv_\be_\b(_\b)
system call when executing the command. The plugin is
- responsible for allocating and populating the vector.
-
-
-1.8.0a1 March 21, 2010 7
+1.8.0a1 April 13, 2010 7
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ responsible for allocating and populating the vector.
+
user_env_out
The NULL-terminated environment vector to use when executing
the command. The plugin is responsible for allocating and
SUDO_CONF_ERROR_MSG to present additional error information to the
user.
- invalidate
- void (*invalidate)(int remove);
-1.8.0a1 March 21, 2010 8
+1.8.0a1 April 13, 2010 8
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ invalidate
+ void (*invalidate)(int remove);
+
The invalidate function is called when s\bsu\bud\bdo\bo is called with the -k
or -K flag. For policy plugins such as _\bs_\bu_\bd_\bo_\be_\br_\bs that cache
authentication credentials, this function will invalidate the
-
-
-
-1.8.0a1 March 21, 2010 9
+1.8.0a1 April 13, 2010 9
char * const settings[], char * const user_info[],
char * const user_env[]);
- Returns 1 on success, 0 if the command should not be logged and -1
- on error. On error, the plugin may optionally call the
- conversation function with SUDO_CONF_ERROR_MSG to present
- additional error information to the user.
+ The _\bo_\bp_\be_\bn function is run before the _\bl_\bo_\bg_\b__\bi_\bn_\bp_\bu_\bt, _\bl_\bo_\bg_\b__\bo_\bu_\bt_\bp_\bu_\bt or
+ _\bs_\bh_\bo_\bw_\b__\bv_\be_\br_\bs_\bi_\bo_\bn functions are called. It is only called if the
+ version is being requested or the _\bc_\bh_\be_\bc_\bk_\b__\bp_\bo_\bl_\bi_\bc_\by function has
+ returned successfully. It returns 1 on success, 0 on failure, -1
+ if a general error ocurred, or -2 if there was a usage error. In
+ the latter case, s\bsu\bud\bdo\bo will print a usage message before it exits.
+ If an error occurs, the plugin may optionally call the conversation
+ function with SUDO_CONF_ERROR_MSG to present additional error
+ information to the user.
The function arguments are as follows:
the major and minor version number of the plugin API supported
by s\bsu\bud\bdo\bo.
- conversation
- A pointer to the conversation function that may be used by the
- _\bs_\bh_\bo_\bw_\b__\bv_\be_\br_\bs_\bi_\bo_\bn function to display version information (see
- show_version below). The conversation function may also be
-
-1.8.0a1 March 21, 2010 10
+1.8.0a1 April 13, 2010 10
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ conversation
+ A pointer to the conversation function that may be used by the
+ _\bs_\bh_\bo_\bw_\b__\bv_\be_\br_\bs_\bi_\bo_\bn function to display version information (see
+ show_version below). The conversation function may also be
used to display additional error message to the user.
settings
call. The value of exit_status is undefined if error is non-
zero.
- error
- If the command could not be executed, this is set to the value
- of errno set by the _\be_\bx_\be_\bc_\bv_\be(2) system call. If the command was
- successfully executed, the value of error is 0.
-1.8.0a1 March 21, 2010 11
+1.8.0a1 April 13, 2010 11
SUDO_PLUGIN(1m) MAINTENANCE COMMANDS SUDO_PLUGIN(1m)
+ error
+ If the command could not be executed, this is set to the value
+ of errno set by the _\be_\bx_\be_\bc_\bv_\be(2) system call. If the command was
+ successfully executed, the value of error is 0.
+
show_version
int (*show_version)(int verbose);
-
-
-
-
-
-1.8.0a1 March 21, 2010 12
+1.8.0a1 April 13, 2010 12
-1.8.0a1 March 21, 2010 13
+1.8.0a1 April 13, 2010 13
.\" ========================================================================
.\"
.IX Title "SUDO_PLUGIN @mansectsu@"
-.TH SUDO_PLUGIN @mansectsu@ "March 21, 2010" "1.8.0a1" "MAINTENANCE COMMANDS"
+.TH SUDO_PLUGIN @mansectsu@ "April 13, 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
\& char * const user_env[]);
.Ve
.Sp
-Returns 1 on success, 0 on failure and \-1 on error.
-On error, the plugin may optionally call the conversation function with
-\&\f(CW\*(C`SUDO_CONF_ERROR_MSG\*(C'\fR to present additional error information to the
-user.
+Returns 1 on success, 0 on failure, \-1 if a general error ocurred,
+or \-2 if there was a usage error. In the latter case, \fBsudo\fR will
+print a usage message before it exits. If an error occurs, the
+plugin may optionally call the conversation function with
+\&\f(CW\*(C`SUDO_CONF_ERROR_MSG\*(C'\fR to present additional error information to
+the user.
.Sp
The function arguments are as follows:
.RS 4
\& char * const user_env[]);
.Ve
.Sp
-Returns 1 on success, 0 if the command should not be logged and \-1 on error.
-On error, the plugin may optionally call the conversation function with
-\&\f(CW\*(C`SUDO_CONF_ERROR_MSG\*(C'\fR to present additional error information to the
-user.
+The \fIopen\fR function is run before the \fIlog_input\fR, \fIlog_output\fR
+or \fIshow_version\fR functions are called. It is only called if the
+version is being requested or the \fIcheck_policy\fR function has
+returned successfully. It returns 1 on success, 0 on failure, \-1
+if a general error ocurred, or \-2 if there was a usage error. In
+the latter case, \fBsudo\fR will print a usage message before it exits.
+If an error occurs, the plugin may optionally call the conversation
+function with \f(CW\*(C`SUDO_CONF_ERROR_MSG\*(C'\fR to present additional error
+information to the user.
.Sp
The function arguments are as follows:
.RS 4
char * const settings[], char * const user_info[],
char * const user_env[]);
-Returns 1 on success, 0 on failure and -1 on error.
-On error, the plugin may optionally call the conversation function with
-C<SUDO_CONF_ERROR_MSG> to present additional error information to the
-user.
+Returns 1 on success, 0 on failure, -1 if a general error ocurred,
+or -2 if there was a usage error. In the latter case, B<sudo> will
+print a usage message before it exits. If an error occurs, the
+plugin may optionally call the conversation function with
+C<SUDO_CONF_ERROR_MSG> to present additional error information to
+the user.
The function arguments are as follows:
char * const settings[], char * const user_info[],
char * const user_env[]);
-Returns 1 on success, 0 if the command should not be logged and -1 on error.
-On error, the plugin may optionally call the conversation function with
-C<SUDO_CONF_ERROR_MSG> to present additional error information to the
-user.
+The I<open> function is run before the I<log_input>, I<log_output>
+or I<show_version> functions are called. It is only called if the
+version is being requested or the I<check_policy> function has
+returned successfully. It returns 1 on success, 0 on failure, -1
+if a general error ocurred, or -2 if there was a usage error. In
+the latter case, B<sudo> will print a usage message before it exits.
+If an error occurs, the plugin may optionally call the conversation
+function with C<SUDO_CONF_ERROR_MSG> to present additional error
+information to the user.
The function arguments are as follows: