10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hey guys,
Suppose i run passwd via bash shell. It is a suid program, which temporarily runs as root(owner) and modifies the user entries.
However, when i write a C file and give 4755 permission and root ownership to the 'a.out' file , it doesn't run as root in bash shell. I verified this by... (2 Replies)
Discussion started by: syncmaster
2 Replies
2. AIX
Dear all experts in this forum,
I have faced a audit issue as auditor told that we should not have SUID on /bin/su. As I have checked using Google, I found most of the site only telling that /bin/su should have the permission bit as -rwsr-xr-x but never explain why /bin/su need this permission... (4 Replies)
Discussion started by: kwliew999
4 Replies
3. Cybersecurity
Hello
My system is Debian-503-amd64. After I installed the "lpr" package, I found that some files with SUID bit come from this package. As:
ls -l /usr/bin/lp*
....
-rwsr-sr-x 1 root lp 31800 2008-05-20 /usr/bin/lpq
-rwsr-sr-x 1 root lp 28504 2008-05-20 /usr/bin/lpr
-rwsr-sr-x 1... (1 Reply)
Discussion started by: ZR_Lang
1 Replies
4. UNIX for Advanced & Expert Users
Hi,
I am setting up SUID permissions on a binary.
It gets set for most of the users, however, 1 in 10 users is unable to set these.
For those who works:
> chmod 6555 Test
> ls -l Test
-r-sr-sr-x 1 A B 5524 Nov 15 14:53 Test
For those where it doesn't work:
> chmod 6555 Test... (14 Replies)
Discussion started by: vibhor_agarwali
14 Replies
5. UNIX for Dummies Questions & Answers
I'm writing this command/script to allow students to vi a private file of mine
in a private directory of mine. chmod 700 dir chmod 660 file
however since i own the directory and file; the script has to be ran by me so to speak, im just not sure how to set about doing this.
the script is... (5 Replies)
Discussion started by: StrengthThaDon
5 Replies
6. UNIX for Advanced & Expert Users
Hi
Senario: I have previleges to edit a file F but User B does not have sufficient privs to edit it.
In order for B to edit it I tried an indirect way. I created a script to edit F and SUID this script so that B can execute it with the privs of me. But this is not working . can some one help... (3 Replies)
Discussion started by: Pankaj Mishra
3 Replies
7. Solaris
Hi all,
Thanks for all replays and for reading in advance (as per usual)
Anyhow I have been asked to come up with a list of programs that have SUID root permissions and also for any programs with SGID permissions. Has anyone got any idea with out going through each program indiviually how I... (2 Replies)
Discussion started by: B14speedfreak
2 Replies
8. UNIX for Dummies Questions & Answers
what is SUID ? can someone explain or point me to a link ?
thanks
simon2000 (2 Replies)
Discussion started by: simon2000
2 Replies
9. Cybersecurity
Hi all,
Where can i find list of suid and gid files common for the system, let's say RedHat 7.1?
Thank you all
Regards
:D (1 Reply)
Discussion started by: solvman
1 Replies
10. Programming
Hi all
I'm getting file info through stat( char *filename, struct stat *buf)
Taking all the file attributes to buf->st_mode,
How can i check the suid bit in there, if suid bit mask is 0004000??
Thank you all (1 Reply)
Discussion started by: solvman
1 Replies
issetugid(2) System Calls issetugid(2)
NAME
issetugid - determine if current executable is running setuid or setgid
SYNOPSIS
#include <unistd.h>
int issetugid(void);
DESCRIPTION
The issetugid() function enables library functions (in libtermlib, libc, or other libraries) to guarantee safe behavior when used in setuid
or setgid programs or programs that run with more privileges after a succesful exec(2). Some library functions might be passed insufficient
information and not know whether the current program was started setuid or setgid because a higher level calling code might have made
changes to the uid, euid, gid, or egid. These low-level library functions are therefore unable to determine if they are being run with ele-
vated or normal privileges.
The issetugid() function should be used to determine if a path name returned from a getenv(3C) call can be used safely to open the speci-
fied file. It is often not safe to open such a file because the status of the effective uid is not known.
The result of a call to issetugid() is unaffected by calls to setuid(), setgid(), or other such calls. In case of a call to fork(2), the
child process inherits the same status.
The status of issetugid() is affected only by execve() (see exec(2)). If a child process executes a new executable file, a new issetugid()
status will be based on the existing process's uid, euid, gid, and egid permissions and on the modes of the executable file. If the new
executable file modes are setuid or setgid, or if the existing process is executing the new image with uid != euid or gid != egid, or if
the permitted set before the call to the exec function is not a superset of the inheritable set at that time, issetugid() returns 1 in the
new process.
RETURN VALUES
The issetugid() function returns 1 if the process was made setuid or setgid as the result of the last or a previous call to execve(). Oth-
erwise it returns 0.
ERRORS
The issetugid() function is always successful. No return value is reserved to indicate an error.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
exec(2), fork(2), setuid(2), getenv(3C), attributes(5), privileges(5)
SunOS 5.11 19 Feb 2003 issetugid(2)