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

test: sudo stores an uid instead of a username since 1.9.15 #19602

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

jelly
Copy link
Member

@jelly jelly commented Nov 13, 2023

This fixed a security issue where a username could contain a path separator so now it uses an uid instead.

This fixed a security issue where a username could contain a path
separator so now it uses an uid instead.
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this can and should be improved, but let's not block the image refresh. Good enough (assuming green)

@@ -69,6 +69,12 @@ class TestSuperuser(testlib.MachineCase):
self.restore_file("/var/lib/sudo/lectured/admin")
m.execute("rm -rf /var/{db,lib}/sudo/lectured/admin")

# Sudo since 1.9.15 uses a UID not a username https://www.sudo.ws/releases/stable/#1.9.15
uid = m.execute("id -u admin").strip()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we don't simply restore_dir("/var/db/sudo/lectured") and remove all files in it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good question, happy to do that. Seems the test flakes a bit so I will retry it and then do a follow up once the image is merged

@martinpitt
Copy link
Member

Meh, this flake is sticky.

@jelly jelly merged commit e36f0e2 into cockpit-project:main Nov 13, 2023
92 checks passed
@jelly jelly deleted the sudo-uid-lectured branch November 13, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants