process fails if setuid bit is set


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat process fails if setuid bit is set
Prev   Next
# 1  
Old 12-01-2010
process fails if setuid bit is set

Hi,

OS : Linux

I have an executable (P1) owned by user say "abcd" and the setuid bit is set. And there is another executable (P2) which brings up the process (P1).

When the setuid bit is set, the process P1 is failing, if the setuid bit is not set there is no issue.

I was wondering if there is anything to do with the invoking process P2. P2 is owned by another user say "defg" and permissions are -r-xr-xr-w.

I found a thread something similar, not sure whether compiling and linking needs to be done separately.
setuid bit on user + dynamically linked libraries

Any suggestions would be of great help.

Thanks,
Ahamed
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Java 32 bit installation fails on an AIX platform

Hello. It is my first to deal with Java installation on an AIX platform. I am now trying to install Java 32bit using installp command. However, it throws back the message that the installation media cannot be found. I need to install Java 32bit to proceed with an installation of Oracle JD... (0 Replies)
Discussion started by: EJ2019
0 Replies

2. UNIX for Beginners Questions & Answers

What keeps me from abusing setuid(0) and programs with setuid bit set?

Just learning about the privilege escalation method provided by setuid. Correct me if I am wrong but what it does is change the uid of the current process to whatever uid I set. Right ? So what stops me from writing my own C program and calling setuid(0) within it and gaining root privileges ? ... (2 Replies)
Discussion started by: sreyan32
2 Replies

3. Shell Programming and Scripting

Setuid not working in Linux as script fails to write to file.

Hi, I have the following 3 test files to test setuid bit which if it works I would like to implement in our application. However setuid doesnot seem to be having any impact on my test below.Following are the 3 files of interest in /tmp/ folder. $ ls -ltr *env* -rw------- 1 g332008 users 6... (23 Replies)
Discussion started by: waavman
23 Replies

4. Programming

c program to set the m-bit to n-bit

I have a 32bit number and without using for loop,I want to set mbit to n bit. Say m bit may be 2nd or 5th or 9th or 10th.n bit may be 22nd or 27or 11th bit. I assume m<n. Please help me.Thanks acdc (6 Replies)
Discussion started by: acdc
6 Replies

5. Linux

Please explain setuid bit clearly!

Dear all, I am newbie with linux, i dont understand any code. I have googled a long time. Please help me explain about setuid bit on linux (Centos 6) Here: 1/ I chmod u+s for /sbin/iptables but normal user still cannot perform command (ex: /sbin/iptables -L) 2/Someone says : setuid only... (6 Replies)
Discussion started by: all4cfa
6 Replies

6. UNIX for Dummies Questions & Answers

setuid & sticky bit

Can anyone explain me difference between setuid and sticky bit? and also between setuid and chown? (3 Replies)
Discussion started by: kkalyan
3 Replies

7. UNIX for Dummies Questions & Answers

How can we set the Sticky bit in the umask itself

How can we set the Sticky bit in the umask itself. Please help me :confused: (3 Replies)
Discussion started by: geniman2004
3 Replies

8. HP-UX

setuid bit - error

hi i have written small script which will login 2 two different users with su but if we run from normal user it prompts for password so i chnaged the owner of script to root and added setuid bit with chmod u+s <script_name> but when i run the script i get following message Warning:... (3 Replies)
Discussion started by: zedex
3 Replies

9. Programming

setuid bit on user + dynamically linked libraries

hi all, i have a critical and specific problem with respect to set uid bit on user and the dll's for a binary, (under the userid A) it needs libraries from /usr/lib and informix libraries from $INFORMIXDIR/lib/esql but this binary should be kicked off from id B, hence s-bit on user is... (5 Replies)
Discussion started by: matrixmadhan
5 Replies

10. UNIX for Advanced & Expert Users

setuid sticky bit

I have a binary. It is having the following permissions rws rws rwx mqm:mqm runmqtrm The same program on another machine is rws rws rwx root: mqm runmqtrm This program is a setuid program. This is what my understanding is. Whatever user the program is started under, it will finally be... (0 Replies)
Discussion started by: bandaru
0 Replies
Login or Register to Ask a Question
ISSETUGID(2)						      BSD System Calls Manual						      ISSETUGID(2)

NAME
issetugid -- is current executable running setuid or setgid SYNOPSIS
#include <unistd.h> int issetugid(void); DESCRIPTION
The issetugid() function returns 1 if the process was made setuid or setgid as the result of the last execve() system call. Otherwise it returns 0. This system call exists so that library routines (inside libc, libtermlib, or other libraries) can gaurantee safe behavior when used inside setuid or setgid programs. Some library routines may not be passed sufficient information to know if the current program was started setuid or setgid because higher level calling code may have made changes to the uid or the euid. In particular, it is wise to use this call to determine if a pathname returned from a getenv() call may safely be used to open() the specified file. issetugid() is unaffected by calls to setuid(), fork(), and other such calls. It is only controlled by execve(). ERRORS
The issetugid() function is always successful, and no return value is reserved to indicate an error. SEE ALSO
execve(2), setuid(2), seteuid(2,) setgid(2), setegid(2) HISTORY
A lstat() function call appeared in OpenBSD 2.0 OpenBSD 2.0 August, 25 1996 OpenBSD 2.0