Sponsored Content
Operating Systems Linux Red Hat process fails if setuid bit is set Post 302496731 by ahamed101 on Tuesday 15th of February 2011 05:29:10 AM
Old 02-15-2011
Thank you for all the response. The issue was the env variable LD_LIBRARY_PATH.

Quoting from internet

For security reasons, LD_LIBRARY_PATH is ignored at runtime for executables that have their setuid or setgid bit set. This severely limits the usefulness of LD_LIBRARY_PATH.

The exit error code which I was getting : 127 unable to open shared object. When I did an strace I could see that, it was searching for the depedendent libraries on /usr/lib and not the ones present in LD_LIBRARY_PATH. So for testing I created a link from the actual library path to /usr/lib and it worked. Smilie

regards,
Ahamed.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
SETUID(2)						     Linux Programmer's Manual							 SETUID(2)

NAME
setuid - set user identity SYNOPSIS
#include <sys/types.h> #include <unistd.h> int setuid(uid_t uid); DESCRIPTION
setuid sets the effective user ID of the current process. If the effective userid of the caller is root, the real and saved user ID's are also set. Under Linux, setuid is implemented like the POSIX version with the _POSIX_SAVED_IDS feature. This allows a setuid (other than root) pro- gram to drop all of its user privileges, do some un-privileged work, and then re-engage the original effective user ID in a secure manner. If the user is root or the program is setuid root, special care must be taken. The setuid function checks the effective uid of the caller and if it is the superuser, all process related user ID's are set to uid. After this has occurred, it is impossible for the program to regain root privileges. Thus, a setuid-root program wishing to temporarily drop root privileges, assume the identity of a non-root user, and then regain root priv- ileges afterwards cannot use setuid. You can accomplish this with the (non-POSIX, BSD) call seteuid. RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
EPERM The user is not the super-user, and uid does not match the real or saved user ID of the calling process. CONFORMING TO
SVr4, SVID, POSIX.1. Not quite compatible with the 4.4BSD call, which sets all of the real, saved, and effective user IDs. SVr4 documents an additional EINVAL error condition. LINUX-SPECIFIC REMARKS Linux has the concept of filesystem user ID, normally equal to the effective user ID. The setuid call also sets the filesystem user ID of the current process. See setfsuid(2). If uid is different from the old effective uid, the process will be forbidden from leaving core dumps. SEE ALSO
getuid(2), setreuid(2), seteuid(2), setfsuid(2) Linux 1.1.36 1994-07-29 SETUID(2)
All times are GMT -4. The time now is 02:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy