To:blowtorch - Setuid uid/euid issue


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers To:blowtorch - Setuid uid/euid issue
# 1  
Old 08-17-2006
To:blowtorch - Setuid uid/euid issue

Hi,

Its a shell script. rws by root, r_s by group named "other" and r_x by all others.

How can i set the uid from inside a setuid program. please let me know.

Also I dont have a c compiler on the system.
Thanks
Reply With Quote
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

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

2. Solaris

Need help with setuid.

Hi Gurus, I need your suggestions,to implement setuid. Here is the situation. I have a user xyz on a solaris zone.He needs to install a package using a pkgadd command but i guess only a root can run that .Is there any way I can set the setuid bit on the pkgadd which is in the location... (6 Replies)
Discussion started by: rama krishna
6 Replies

3. UNIX for Dummies Questions & Answers

Changing the user id or euid of the shell itself

Hi all, Ok, bear with me on this one, I am a bit new to Unix and it might take me a little bit of time to articulate my question. I know that every process has a user id and an effective user id. This seems to include the shell itself, because when I type 'ps', I see 'bash' listed as a... (2 Replies)
Discussion started by: oddthingy
2 Replies

4. Solaris

rbac and execution attributes (uid and euid)

Hi all, I have a question to see if I understand the euid and uid attributes correctly for rbac (/etc/security/exec_attr): All: * Audit Control: /etc/init.d/audit euid=0, egid=3 /etc/security/bsmconv uid=0 /etc/security/bsmunconv uid=0 /usr/sbin/audit euid=0 /usr/sbin/auditconfig... (6 Replies)
Discussion started by: deadeyes
6 Replies

5. Red Hat

euid and egid frpm proc

hi, can anyone tell me where can i find euid and egid from /proc file system in RHEL 4? i read stat file, but i got only uid and gid, and cudnot find any entry regarding euid and egid.please suggest... thanks, sanjay (2 Replies)
Discussion started by: sanjaykhuntia
2 Replies

6. Solaris

EUID set for all non-root users

We have a Solaris box. I noticed that whenever any non-root user logins into the box and issues the command id the output is (for example) uid=42568(sam) gid=1245(sam) euid=0(root) egid=2(bin). I have not given any privileges to anyone explicitly. When I issued ls -l in the /usr/bin directory I... (1 Reply)
Discussion started by: chrisanto_2000
1 Replies

7. UNIX for Dummies Questions & Answers

setuid

could u plz give me clear idea of spcial permissions setuid,getuid and striky bit . (1 Reply)
Discussion started by: Prem
1 Replies

8. UNIX for Advanced & Expert Users

Setuid Program with (-rwsr-sr-x 1 root other ) UID/EUID issue

Hi, I have a program with the following suid setup -rwsr-sr-x 1 root other 653 Aug 16 17:00 restart_server It basically starts up a service that has to be started by root. I just want the normal users to be able to restart the service using the script above. But when the... (7 Replies)
Discussion started by: 0ktalmagik
7 Replies

9. UNIX for Advanced & Expert Users

setuid

I have a C wrapper programme which basically execute a shell script. The shell script has 700 as permission and oracle is owner of the shell script. The C execuatble has 4711 permission so that means that it has setuid bit set and group and others can execute the C executable. The reason why I am... (2 Replies)
Discussion started by: sanjay92
2 Replies
Login or Register to Ask a Question
setuid(3)						     Library Functions Manual							 setuid(3)

Name
       setuid, seteuid, setruid, setgid, setegid, setrgid - set user and group ID

Syntax
       #include <sys/types.h>
       #include <unistd.h>

       setuid(uid)
       uid_t uid;
       seteuid(euid)
       uid_t euid;
       setruid(ruid)
       uid_t ruid;

       setgid(gid)
       gid_t gid;
       setegid(egid)
       gid_t egid;
       setrgid(rgid)
       gid_t rgid;

Description
       The subroutine sets both the real and effective user ID of the current process to the ID specified.  Likewise, the subroutine sets the real
       and effective group ID of the current process to the ID specified.

       The subroutine sets the effective user ID of the current process, while the subroutine sets the effective group ID of the current process.

       The subroutine sets the real user ID of the current process, while the subroutine sets the real group ID of the current process.

       These calls are only permitted to the super-user or if the argument is the real or effective ID.

Environment
       POSIX
       SYSTEM_FIVE
       When your program is compiled in POSIX or System V mode the following semantics apply when using the or functions:

       If the process is the super-user the real, effective, and saved set (as described in user/group ID are set to uid.

       If the process is not the super-user, but uid is equal to the real or the saved set user/group ID, the effective user/group ID  is  set	to
       uid.  The real and saved set user/group ID remain unchanged.

       POSIX
       In POSIX mode, the function returns a value of type uid_t. The function returns a value of type gid_t.

Return Values
       Zero is returned if the user ID or group ID is set; -1 is returned otherwise.

See Also
       setreuid(2), setregid(2), getuid(2), getgid(2)

																	 setuid(3)