Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't pass uid twice to determine_auth_status #984

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/sudo/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::sudo::Duration;
use crate::sudoers::{
AuthenticatingUser, Authentication, Authorization, DirChange, Judgement, Restrictions, Sudoers,
};
use crate::system::interface::UserId;
use crate::system::term::current_tty_name;
use crate::system::timestamp::{RecordScope, SessionRecordFile, TouchResult};
use crate::system::{escape_os_str_lossy, Process};
Expand Down Expand Up @@ -168,7 +167,6 @@ impl<Auth: AuthPlugin> Pipeline<Auth> {
must_authenticate,
context.use_session_records,
scope,
context.current_user.uid,
&context.current_user,
prior_validity,
);
Expand Down Expand Up @@ -238,7 +236,6 @@ fn determine_auth_status(
must_policy_authenticate: bool,
use_session_records: bool,
record_for: Option<RecordScope>,
auth_uid: UserId,
current_user: &CurrentUser,
prior_validity: Duration,
) -> AuthStatus {
Expand All @@ -247,7 +244,7 @@ fn determine_auth_status(
} else if let (true, Some(record_for)) = (use_session_records, record_for) {
match SessionRecordFile::open_for_user(current_user, prior_validity) {
Ok(mut sr) => {
match sr.touch(record_for, auth_uid) {
match sr.touch(record_for, current_user.uid) {
// if a record was found and updated within the timeout, we do not need to authenticate
Ok(TouchResult::Updated { .. }) => AuthStatus::new(false, Some(sr)),
Ok(TouchResult::NotFound | TouchResult::Outdated { .. }) => {
Expand Down
Loading