Fix a PAM_USER mismatch in session open/close. We update PAM_USER
to the target user immediately before setting resource limits, which is after the monitor process has forked (so it has the old value). Also, if the user did not authenticate, there is no pamh in the monitor so we need to init pam here too. This means we end up calling pam_start() twice, which should be fixed, but at least the session is always properly closed now.
This commit is contained in:
@@ -33,7 +33,7 @@ typedef struct sudo_auth {
|
||||
int (*verify)(struct passwd *pw, char *p, struct sudo_auth *auth);
|
||||
int (*cleanup)(struct passwd *pw, struct sudo_auth *auth);
|
||||
int (*begin_session)(struct passwd *pw, struct sudo_auth *auth);
|
||||
int (*end_session)(struct sudo_auth *auth);
|
||||
int (*end_session)(struct passwd *pw, struct sudo_auth *auth);
|
||||
} sudo_auth;
|
||||
|
||||
/* Values for sudo_auth.flags. */
|
||||
@@ -62,7 +62,7 @@ int pam_init(struct passwd *pw, char **prompt, sudo_auth *auth);
|
||||
int pam_verify(struct passwd *pw, char *prompt, sudo_auth *auth);
|
||||
int pam_cleanup(struct passwd *pw, sudo_auth *auth);
|
||||
int pam_begin_session(struct passwd *pw, sudo_auth *auth);
|
||||
int pam_end_session(sudo_auth *auth);
|
||||
int pam_end_session(struct passwd *pw, sudo_auth *auth);
|
||||
int sia_setup(struct passwd *pw, char **prompt, sudo_auth *auth);
|
||||
int sia_verify(struct passwd *pw, char *prompt, sudo_auth *auth);
|
||||
int sia_cleanup(struct passwd *pw, sudo_auth *auth);
|
||||
|
Reference in New Issue
Block a user