From 5906a5c26c392b9687d14951a6da3a5195b576be Mon Sep 17 00:00:00 2001 From: Ryan Mallon Date: Tue, 8 Oct 2013 14:52:49 +0200 Subject: libbb: Add xsetegid(), xseteuid(), xopen_as_uid_gid() functions Signed-off-by: Ryan Mallon Signed-off-by: Denys Vlasenko --- include/libbb.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 1315e5f8f..3ab1d6b46 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -461,6 +461,8 @@ void record_signo(int signo); /* not FAST_FUNC! */ void xsetgid(gid_t gid) FAST_FUNC; void xsetuid(uid_t uid) FAST_FUNC; +void xsetegid(gid_t egid) FAST_FUNC; +void xseteuid(uid_t euid) FAST_FUNC; void xchdir(const char *path) FAST_FUNC; void xchroot(const char *path) FAST_FUNC; void xsetenv(const char *key, const char *value) FAST_FUNC; @@ -469,11 +471,12 @@ void bb_unsetenv_and_free(char *key) FAST_FUNC; void xunlink(const char *pathname) FAST_FUNC; void xstat(const char *pathname, struct stat *buf) FAST_FUNC; void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC; +int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC; +int open_or_warn(const char *pathname, int flags) FAST_FUNC; +int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; int xopen(const char *pathname, int flags) FAST_FUNC; int xopen_nonblocking(const char *pathname) FAST_FUNC; -int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; -int open_or_warn(const char *pathname, int flags) FAST_FUNC; -int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC; +int xopen_as_uid_gid(const char *pathname, int flags, uid_t u, gid_t g) FAST_FUNC; int open_or_warn_stdin(const char *pathname) FAST_FUNC; int xopen_stdin(const char *pathname) FAST_FUNC; void xrename(const char *oldpath, const char *newpath) FAST_FUNC; -- cgit v1.2.3