Made set[e]gid() and set[e]uid() succeed in case they don't have anything to do.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19553 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-12-18 18:00:21 +00:00
parent c2c739ce33
commit 6b507ddd46

View File

@ -1,14 +1,15 @@
/* /*
** Copyright 2002, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License. * Distributed under the terms of the MIT License.
*/ */
#include <unistd.h>
#include <syscalls.h> #include <syscalls.h>
#include <string.h>
#include <stdio.h>
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
// ToDo: implement the user/group functions for real! // ToDo: implement the user/group functions for real!
@ -62,6 +63,9 @@ cuserid(char *s)
int int
setgid(gid_t gid) setgid(gid_t gid)
{ {
if (gid == 0)
return 0;
return EPERM; return EPERM;
} }
@ -69,6 +73,9 @@ setgid(gid_t gid)
int int
setuid(uid_t uid) setuid(uid_t uid)
{ {
if (uid == 0)
return 0;
return EPERM; return EPERM;
} }
@ -76,6 +83,9 @@ setuid(uid_t uid)
int int
setegid(gid_t gid) setegid(gid_t gid)
{ {
if (gid == 0)
return 0;
return EPERM; return EPERM;
} }
@ -83,6 +93,9 @@ setegid(gid_t gid)
int int
seteuid(uid_t uid) seteuid(uid_t uid)
{ {
if (uid == 0)
return 0;
return EPERM; return EPERM;
} }