02-20-2006
setgroups() will set the list of secondary groups.
7 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have been looking at setuid and setgid.
I understand that setuid determines who owns the file and setgid determines which group of people can access the file... yeah?!
But i need to know how to actually use setuid and setgid. I'm guessing chmod will feature somewhere..
Any help... (1 Reply)
Discussion started by: crispy
1 Replies
2. Shell Programming and Scripting
About System and Perl: Sun Solaris 5.9 sparc, Perl 5.6.1
I've decided to use the perl file::find module to look for all the SETUID and SETGID files on my unix boxes. I wrote something like this: (I've shorted it a little to make it simple)
#!/opt/perl/bin/perl
use File::Find;
find... (1 Reply)
Discussion started by: x96riley3
1 Replies
3. Solaris
hi..
why we go for setuid, setgid permissions?
as a system admin ,when we use this ,except default solaris setuid,setgid files and dirs..
hopes that anyone can help me regarding this.. (1 Reply)
Discussion started by: saravananpalani
1 Replies
4. UNIX for Dummies Questions & Answers
Hi all!
I have a folder with permissions 2770 (SETGID)
drwxrws--- 2 loguser admins 5 Mar 17 11:11 mydir
Inside that folder there are some files with permissions 0640:
-rw-r----- 1 loguser admins 0 Mar 17 11:11 monday.log
-rw-r----- 1 loguser admins ... (2 Replies)
Discussion started by: verdepollo
2 Replies
5. UNIX for Dummies Questions & Answers
While I was looking for tips for hardening the security of my MAC OSX I found the following posting:
"<How to disable Setuid and Setgid Binaries >
Setuid programs run with the privileges of the file's owner
(which is often root), no matter which user executes them.
Bugs in these programs... (6 Replies)
Discussion started by: Vera
6 Replies
6. Solaris
I have a user AAA who's who is part of a group call clserv and techsupp, His userfiles have the following permissions:-
drwxrwx--- 16 AAA clserv 1858 Aug 22 12:48 UserFiles
he has a link in his UserFiles/
lrwxrwxrwx 1 root root 36 Mar 9 2013 TECHSUPP_GLOBAL... (5 Replies)
Discussion started by: kilobyter
5 Replies
7. Shell Programming and Scripting
so im writing a script for a android system. these types of systems are not the typical unix systems.
what i need to do is basic. i have a script which I put in a directory and then zipped up the directory in a zip file. that way, when the script is unzipped, the person unzipping will see... (1 Reply)
Discussion started by: SkySmart
1 Replies
LEARN ABOUT OPENDARWIN
setgid
SETUID(2) BSD System Calls Manual SETUID(2)
NAME
setuid, seteuid, setgid, setegid -- set user and group ID
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
int
setuid(uid_t uid);
int
seteuid(uid_t euid);
int
setgid(gid_t gid);
int
setegid(gid_t egid);
DESCRIPTION
The setuid() function sets the real and effective user IDs and the saved set-user-ID of the current process to the specified value. The
setuid() function is permitted if the effective user ID is that of the super user, or if the specified user ID is the same as the effective
user ID. If not, but the specified user ID is the same as the real user ID, setuid() will set the effective user ID to the real user ID.
The setgid() function sets the real and effective group IDs and the saved set-group-ID of the current process to the specified value. The
setgid() function is permitted if the effective user ID is that of the super user, or if the specified group ID is the same as the effective
group ID. If not, but the specified group ID is the same as the real group ID, setgid() will set the effective group ID to the real group
ID.
The seteuid() function (setegid()) sets the effective user ID (group ID) of the current process. The effective user ID may be set to the
value of the real user ID or the saved set-user-ID (see intro(2) and execve(2)); in this way, the effective user ID of a set-user-ID exe-
cutable may be toggled by switching to the real user ID, then re-enabled by reverting to the set-user-ID value. Similarly, the effective
group ID may be set to the value of the real group ID or the saved set-user-ID.
RETURN VALUES
Upon success, these functions return 0; otherwise -1 is returned.
If the user is not the super user, or the uid specified is not the real, effective ID, or saved ID, these functions return -1.
SEE ALSO
getuid(2), getgid(2)
STANDARDS
The setuid() and setgid() functions are compliant with the ISO/IEC 9945-1:1990 (``POSIX.1'') specification with _POSIX_SAVED_IDS defined,
with the extensions allowed in section B.4.2.2. The seteuid() and setegid() functions are extensions based on the POSIX concept of
_POSIX_SAVED_IDS, and have been proposed for a future revision of the standard.
4.2 Berkeley Distribution June 4, 1993 4.2 Berkeley Distribution