Skip to content

Commit 9bd2214

Browse files
committed
Remove auth_user argument of SessionRecordFile::disable
We only ever pass None for it and I can't find any case where we would need to pass something different.
1 parent d4fff9e commit 9bd2214

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/sudo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn sudo_process() -> Result<(), Error> {
101101
let user = CurrentUser::resolve()?;
102102
let mut record_file =
103103
SessionRecordFile::open_for_user(&user, Duration::seconds(0))?;
104-
record_file.disable(scope, None)?;
104+
record_file.disable(scope)?;
105105
}
106106
Ok(())
107107
}

src/system/timestamp.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,12 @@ impl SessionRecordFile {
216216
Ok(TouchResult::NotFound)
217217
}
218218

219-
/// Disable all records that match the given scope. If an auth user id is
220-
/// given then only records with the given scope that are targeting that
221-
/// specific user will be disabled.
222-
pub fn disable(&mut self, scope: RecordScope, auth_user: Option<&AuthUser>) -> io::Result<()> {
219+
/// Disable all records that match the given scope.
220+
pub fn disable(&mut self, scope: RecordScope) -> io::Result<()> {
223221
let lock = FileLock::exclusive(&self.file, false)?;
224222
self.seek_to_first_record()?;
225223
while let Some(record) = self.next_record()? {
226-
let must_disable = auth_user
227-
.map(|tu| record.matches(&scope, tu))
228-
.unwrap_or_else(|| record.scope == scope);
229-
if must_disable {
224+
if record.scope == scope {
230225
self.file.seek(io::SeekFrom::Current(-SIZE_OF_BOOL))?;
231226
write_bool(false, &mut self.file)?;
232227
}

0 commit comments

Comments
 (0)