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

Remove workaround for Podman on FreeBSD forgetting setuid flags once fixed in Podman #948

Open
bjorn3 opened this issue Jan 6, 2025 · 0 comments

Comments

@bjorn3
Copy link
Collaborator

bjorn3 commented Jan 6, 2025

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282539

if cfg!(target_os = "freebsd") {
// Podman on FreeBSD forgets the setuid bit when building an image. Manually restore it
// as necessary for the current container.
// Reported upstream as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282539
let _ = Command::new("chmod")
.arg("755")
.arg("/home")
.output(&env)
.unwrap();
if is_original_sudo() {
Command::new("chflags")
.arg("noschg")
.arg("/usr/bin/su")
.output(&env)
.unwrap()
.assert_success()
.unwrap();
}
Command::new("chmod")
.arg("4755")
.arg(BIN_SUDO)
.arg("/usr/bin/su")
.output(&env)
.unwrap()
.assert_success()
.unwrap();
Command::new("chmod")
.arg("755")
.arg("/usr/local/sbin")
.output(&env)
.unwrap()
.assert_success()
.unwrap();
}

@bjorn3 bjorn3 changed the title Remove workaround for Remove workaround for Podman on FreeBSD forgetting setuid flags once fixed in Podman Jan 6, 2025
@bjorn3 bjorn3 added the freebsd label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants