From 28d0afa6570066b1841dd0c992c0ad0988483e0b Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sat, 5 Nov 2016 21:19:53 +0100 Subject: [PATCH] Add setfsgid()/setfsuid() on linux --- libc-test/build.rs | 1 + src/unix/notbsd/linux/mod.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index bbd9f8cf..e1a3efe0 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -162,6 +162,7 @@ fn main() { cfg.header("sys/ipc.h"); cfg.header("sys/msg.h"); cfg.header("sys/shm.h"); + cfg.header("sys/fsuid.h"); cfg.header("pty.h"); cfg.header("shadow.h"); } diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index c011b8c4..c4189e30 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -714,6 +714,8 @@ extern { riovcnt: ::c_ulong, flags: ::c_ulong) -> isize; pub fn reboot(how_to: ::c_int) -> ::c_int; + pub fn setfsgid(gid: ::gid_t) -> ::c_int; + pub fn setfsuid(uid: ::uid_t) -> ::c_int; pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;