home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:5176 comp.mail.mh:1262
- Newsgroups: comp.unix.programmer,comp.mail.mh
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!rochester!rocksanne!leisner
- From: leisner@wrc.xerox.com ( Marty Leisner)
- Subject: setuid programs and calls...
- Message-ID: <1992Nov5.220832.3217@spectrum.xerox.com>
- Sender: news@spectrum.xerox.com
- Reply-To: leisner.henr801c@xerox.com
- Organization: Xerox
- X-Newsreader: TIN [version 1.1 PL6]
- Date: Thu, 5 Nov 1992 22:08:32 GMT
- Lines: 60
-
-
- I have two programs. There both setuid to root...:
- I'm on Sparcs on SunOS 4.1.2...
-
- This works:
- cat readzombi2.c
- main()
- {
- if(0 != setuid(220)) {
- perror("setuid failed: ");
- exit(1);
- }
- system("printenv LD_LIBRARY_PATH");
- system("scan -file /net/zombi/files5/spool/mail/leisner");
- system("id");
- }
-
- leisner@annapurna$ ls -l readzombi2*
- -rwsr-xr-x 1 root staff 24576 Nov 5 16:23 readzombi2*
- -rw-r--r-- 1 leisner staff 192 Nov 5 12:58 readzombi2.c
- leisner@annapurna$ readzombi2
- /usr/lib/X11:/usr/openwin/lib:/usr/marty/lib
- 1 10/22 Ellie Young I'm away from the USENIX office<<I will be out of the office from October 20-
- 2 11/05 Marty Leisner 767 <<hi there >>
- uid=220(leisner2) gid=10(staff) groups=10(staff),0(wheel),2(kmem),3(bin),6(news),25(testrcs)
-
- This doesn't:
- leisner@annapurna$ cat readzombimail.c; ls -l readzombimail*; readzombimail
- #include <stdio.h>
-
- main()
- {
- int i;
-
- if(0 != setruid(220)) {
- perror("setuid failed: ");
- exit(1);
- }
- system("printenv LD_LIBRARY_PATH");
- i = system("scan -file /net/zombi/files5/spool/mail/leisner");
- printf("i = %d\n", i);
- system("id");
- }
-
- -rwsr-xr-x 1 root staff 24576 Nov 5 16:31 readzombimail*
- -rw-r--r-- 1 leisner staff 250 Nov 5 16:31 readzombimail.c
- /usr/lib/X11:/usr/openwin/lib:/usr/marty/lib
- ld.so: libmh.so.1: not found
- i = 32512
- uid=220(leisner2) gid=10(staff) euid=0(root) groups=10(staff),0(wheel),2(kmem),3(bin),6(news),25(testrcs),300(siena)
-
- I don't understand why it can't find the shared library doing setruid instead of setuid (I see nothing else different
- (except for the i).
-
- What am I missing? This doesn't make sense to me...
-
- --
- marty
- leisner.henr801c@xerox.com
- Member of the League for Programming Freedom
-