Modify the authentication API such that the init and cleanup functions
are always called, regardless of whether or not we are going to verify a password. This is needed for proper PAM session support.
This commit is contained in:
@@ -12,7 +12,7 @@ typedef struct sudo_auth {
|
||||
char *name; /* name of the method in string form */
|
||||
void *data; /* method-specific data pointer */
|
||||
|
||||
int (*init)(struct passwd *pw, char **prompt, sudo_auth *auth);
|
||||
int (*init)(struct passwd *pw, sudo_auth *auth);
|
||||
int (*setup)(struct passwd *pw, char **prompt, sudo_auth *auth);
|
||||
int (*verify)(struct passwd *pw, char *p, sudo_auth *auth);
|
||||
int (*cleanup)(struct passwd *pw, sudo_auth *auth);
|
||||
@@ -64,11 +64,10 @@ The member functions can return the following values:
|
||||
|
||||
The functions in the struct are as follows:
|
||||
|
||||
int init(struct passwd *pw, char **prompt, sudo_auth *auth)
|
||||
int init(struct passwd *pw, sudo_auth *auth)
|
||||
Function to do any one-time initialization for the auth
|
||||
method. All of the "init" functions are run before anything
|
||||
else. A pointer to the prompt string may be used to add
|
||||
method-specific info to the prompt.
|
||||
else.
|
||||
|
||||
int setup(struct passwd *pw, char **prompt, sudo_auth *auth)
|
||||
Function to do method-specific setup. All the "setup"
|
||||
|
Reference in New Issue
Block a user