tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* LD_LIBRARY_PATH env corruption when using setuid
@ 1998-03-03 16:52 Ajay Nautiyal
  0 siblings, 0 replies; only message in thread
From: Ajay Nautiyal @ 1998-03-03 16:52 UTC (permalink / raw)
  To: tru64-unix-managers

Howdy folks,
	Has anyone ever had a problem with setuid corrupting the LD_LIBRARY_PATH environment variable?  This problem occurs on both DU 3.2g and 4.0b.  We used the following program to test the different systems, it seems that when the setuid bit is set and a different user, than the one for whom the setuid bit is set, executes the program the LD_LIBRARY_PATH environment variable get changed to including the users real uid and gid.  If the LD_LIBRARY_PATH is not set no corruption occurs.  If the setuid bit is not set, no corruption occurs.  If the user executing the program is the same as the user for whom the setuid bit was set, no corruption occurs.  The corruption is always consist ant,  the uid and gid numbers are inserted at the beginning.  Has anyone seen or heard of this before?  Any help would be appreciated.

TIA.

The test program:

#include <stdlib.h>

main( int argc, char **argv, char** envr)

{
  char ** p = envr;
  char *s;
  int i=1;
  char * ld_library_path;

  while (*p)
    {
      printf("%d : %s\n", i++, *p++ );
    }
  
  ld_library_path = getenv("LD_LIBRARY_PATH");
  printf("ld_library_path: %s\n", ld_library_path);
}

after compiling the program, I set the suid bit for root, and executed the program.  The output looked like this:

[clip]
LD_LIBRARY_PATH=91411/tmp:/usr/bin:/usr/local/bin
[clip]

If you need any more information, please email me.  Thanks.
Ajay Nautiyal - sxan@ts.sois.alaska.edu
Systems Programmer

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-03-03 16:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-03-03 16:52 LD_LIBRARY_PATH env corruption when using setuid Ajay Nautiyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox