This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

About ld.so and suid programmes


Hello,
   I am not sure whether this is right place to ask or
not.
I am using glibc-2.2.5 version on a redhat-linux 7.2
I am trying to understand the behaviour of
__libc_enable_secure stuff.

I have a programme that is suid root. Inside the
programme, there is setuid(0); and after that
setenv("LD_LIBRARY_PATH", "/opt/pkg1/lib", 1);
execve("/opt/pkg1/bin/xxx", argv, envp);

/opt/pkg1/bin/xxx needs /opt/pkg1/lib/libpkg1.so.2,
but ld.so is complaining that unable to open
libpkg1.so.2

I tried to modify this programme as

setuid(0);

if ((pid = fork())) {
    waitpid(pid, &status, 0);
} else {
   setenv("LD_LIBRARY_PATH", "/opt/pkg1/lib", 1);
   execve("/opt/pkg1/bin/xxx", argv, envp);
}

still same problem.

I thought that, for this programe say a.out which is
suid, the LD_LIBRARY_PATH will be unset by ld.so, by
the time control comes to main, but for
/opt/pkg1/bin/xxx, a different execve the ld.so should
see that uid and euid is same and also gid and egid is
same, so it shouldn't unset LD_LIBRARY_PATH. Am I
missing something.

Thanks.


		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]