set user ID

set user ID

Post by Miche » Thu, 15 Nov 2001 01:33:02



Hi all,
I'm writing a program which needs to track some system info, i.e. it
needs
root privileges to be run. So I did the following:

my_user-> su
root-> chown root:system my_prog
root-> chmod ug+s my_prog

Now, what happens is that:

1) if I launch my_prog as root, it goes fine
2) if I launch it as my_user (which is what I need to do), it seems to
be
unable to locate some dynamic libraries, even if their path is
specified in root's .cshrc file

What's the difference between the two cases ?

tia

Michele

 
 
 

set user ID

Post by John Gord » Thu, 15 Nov 2001 01:47:21



> 1) if I launch my_prog as root, it goes fine
> 2) if I launch it as my_user (which is what I need to do), it seems to
> be unable to locate some dynamic libraries, even if their path is
> specified in root's .cshrc file

LD_LIBRARY_PATH is ignored for setuid programs.

---
"... What with you being his parents and all, I think that you could
be trusted not to shaft him."  -- Robert Chang, rec.games.board



 
 
 

set user ID

Post by Rocke Robertso » Sat, 17 Nov 2001 05:47:22



> Hi all,
> I'm writing a program which needs to track some system info, i.e. it
> needs
> root privileges to be run. So I did the following:

> my_user-> su
> root-> chown root:system my_prog
> root-> chmod ug+s my_prog

> Now, what happens is that:

> 1) if I launch my_prog as root, it goes fine
> 2) if I launch it as my_user (which is what I need to do), it seems to
> be
> unable to locate some dynamic libraries, even if their path is
> specified in root's .cshrc file

> What's the difference between the two cases ?

> tia

> Michele

When you build your executable, make sure you link it with:

gcc -R /usr/local/lib -o my_prog my_prog.c

This way, no library path is needed. (I'm pretty sure this is the way
around it).

~rocker

--
Rocke Robertson
NCS/GTIS/PWGSC
700 Montreal Rd.

(613) 748-4604

 
 
 

1. set user id and set group id bits

How can I find out whether a file has a set user id bit or set group id bit?
can "ls" tell me?

--
------                              
Sang Kim                        

2. NIS+ without DES

3. Set User ID

4. NYS servers

5. set-user-Id scripts in csh

6. unattended inode?

7. How to use set user id bit

8. Portable storage

9. Set user id does not work (Mandrake 7)

10. Permissions question - set-user-id

11. Help: Set-user-ID

12. set user id problem

13. about Set-User-ID