Skip to content

Add setfsgid()/setfsuid() on linux #441

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

Merged
merged 1 commit into from
Nov 6, 2016
Merged

Add setfsgid()/setfsuid() on linux #441

merged 1 commit into from
Nov 6, 2016

Conversation

borisfaure
Copy link
Contributor

Tested with the following code ran as root and then looking at the owner/group of /tmp/foo.txt.

extern crate libc;

use std::fs::File;

fn main() {
    unsafe {
        libc::setfsuid(1234u32);
        libc::setfsgid(5678u32);
    }
    File::create("/tmp/foo.txt").ok();
}

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Nov 5, 2016

📌 Commit 28d0afa has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Nov 6, 2016

⌛ Testing commit 28d0afa with merge 376dc54...

bors added a commit that referenced this pull request Nov 6, 2016
Add setfsgid()/setfsuid() on linux

Tested with the following code ran as root and then looking at the owner/group of `/tmp/foo.txt`.
```rust
extern crate libc;

use std::fs::File;

fn main() {
    unsafe {
        libc::setfsuid(1234u32);
        libc::setfsgid(5678u32);
    }
    File::create("/tmp/foo.txt").ok();
}
```
@alexcrichton alexcrichton merged commit 852db73 into rust-lang:master Nov 6, 2016
Susurrus pushed a commit to Susurrus/libc that referenced this pull request Mar 26, 2017
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.

4 participants