From 92c609a6ccfdb0289c4b5af04e1d4ffd03e49a3f Mon Sep 17 00:00:00 2001 From: deadwood Date: Wed, 10 Aug 2016 05:03:23 +0000 Subject: [PATCH] posixc.library: implement seteuid function git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@52850 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- compiler/posixc/include/aros/posixc/unistd.h | 2 +- compiler/posixc/mmakefile.src | 1 + compiler/posixc/posixc.conf | 6 ++-- compiler/posixc/seteuid.c | 48 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 compiler/posixc/seteuid.c diff --git a/compiler/posixc/include/aros/posixc/unistd.h b/compiler/posixc/include/aros/posixc/unistd.h index a540170658..fcadfed6aa 100644 --- a/compiler/posixc/include/aros/posixc/unistd.h +++ b/compiler/posixc/include/aros/posixc/unistd.h @@ -415,7 +415,7 @@ ssize_t readlink(const char * restrict path, char * restrict buf, size_t bufsize /* NOTIMPL ssize_t readlinkat(int, const char *restrict, char *restrict, size_t); */ int rmdir(const char *path); /* NOTIMPL int setegid(gid_t egid); */ -/* NOTIMPL int seteuid(uid_t euid); */ +int seteuid(uid_t euid); int setgid(gid_t gid); /* NOTIMPL int setpgid(pid_t pid, pid_t pgrp); */ /* NOTIMPL int setpgrp(pid_t pid, pid_t pgrp); */ diff --git a/compiler/posixc/mmakefile.src b/compiler/posixc/mmakefile.src index 1faa3e98c8..1d4ebc8d68 100644 --- a/compiler/posixc/mmakefile.src +++ b/compiler/posixc/mmakefile.src @@ -143,6 +143,7 @@ POSIXC := \ seekdir \ setbuf \ setenv \ + seteuid \ setgid \ setgrent \ setpwent \ diff --git a/compiler/posixc/posixc.conf b/compiler/posixc/posixc.conf index feac0b4404..2b4a919893 100644 --- a/compiler/posixc/posixc.conf +++ b/compiler/posixc/posixc.conf @@ -1,5 +1,5 @@ ##begin config -version 0.2 +version 0.3 basename PosixC libbasetypeextern struct PosixCBase libbasetype struct PosixCIntBase @@ -988,9 +988,9 @@ ssize_t readlink(const char * restrict path, char * restrict buf, size_t bufsize .skip 1 #ssize_t readlinkat(int, const char *restrict, char *restrict, size_t) int rmdir(const char *path) -.skip 2 +.skip 1 #int setegid(gid_t egid) -#int seteuid(uid_t euid) +int seteuid(uid_t euid) int setgid(gid_t gid) .skip 5 #int setpgid(pid_t pid, pid_t pgrp) diff --git a/compiler/posixc/seteuid.c b/compiler/posixc/seteuid.c new file mode 100644 index 0000000000..73a3593ed4 --- /dev/null +++ b/compiler/posixc/seteuid.c @@ -0,0 +1,48 @@ +/* + Copyright © 2016, The AROS Development Team. All rights reserved. + $Id$ + + POSIX.1-2008 function seteuid(). +*/ + +#include +#include + +#include "__posixc_intbase.h" + +/***************************************************************************** + + NAME */ +#include + + int seteuid( + +/* SYNOPSIS */ + uid_t uid) + +/* FUNCTION + + INPUTS + + RESULT + + NOTES + Does not check permissions. + + EXAMPLE + + BUGS + + SEE ALSO + + INTERNALS + +******************************************************************************/ +{ + struct PosixCIntBase *PosixCBase = + (struct PosixCIntBase *)__aros_getbase_PosixCBase(); + + PosixCBase->euid = uid; + + return 0; +} /* seteuid() */ -- 2.11.4.GIT