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

Various improvements to chroot #3960

Merged
merged 3 commits into from
Sep 21, 2022
Merged

Conversation

sylvestre
Copy link
Contributor

Try to fix the issue skipped test: user nobody lacks execute permissions like
https://github.com/coreutils/coreutils/blob/master/tests/cp/special-bits.sh#L45

(but this line fails as it is parsed as cp -p c c2 is part of the chroot args

@sylvestre
Copy link
Contributor Author

And glad we are now testing chroot for real :)

Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

I'm not sure I fully understand the --skip-chdir implementation. It seems to me that --skip-chdir implies that the chdir never happens, not that it still happens and is then restored?

@sylvestre
Copy link
Contributor Author

You are correct :)
we do it internally to make sure that the chroot(".") works but, in the chroot, we are back in the initial dir

@tertsdiepraam
Copy link
Member

Hmm I see, so we can't do something like this?

let err = unsafe {
    chroot(CString::new(root).unwrap().as_bytes_with_nul().as_ptr() as *const libc::c_char)
};
// some error handling
if !skip_chdir {
    std::env::set_current_dir(root).unwrap();
}

@sylvestre
Copy link
Contributor Author

I tried this but it didn't work (but maybe it is my fault). I will have a look again

@sylvestre sylvestre force-pushed the chroot-improv branch 2 times, most recently from 1febdb2 to 002fcb6 Compare September 21, 2022 16:57
@sylvestre
Copy link
Contributor Author

Yeah:
Warning: Changes from 'main': PASS +1 / FAIL +7 / ERROR +0 / SKIP -8

@sylvestre
Copy link
Contributor Author

Hmm I see, so we can't do something like this?

worked great, thanks :)

@tertsdiepraam tertsdiepraam merged commit 6e74408 into uutils:main Sep 21, 2022
@sylvestre sylvestre deleted the chroot-improv branch September 21, 2022 20:38
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