setuid (euid) after setuid (uid) on System 5

Ian G Batten igb at Fulcrum.BT.CO.UK
Wed Mar 15 04:38:08 AEST 1989


Should the following program work or not, on System Five?  This is a
common idiom in the source code of HoneyDanber uucp, and two local System
Five machines refuse to honour the second setuid.  The manual page implies
they should.  Please, no flames --- just mail me an answer.  I've been
sweating blood over the code all day and I hope I can lodge this as a
kernel problem.

ian

main ()
{
  int uid, euid;

  printf ("uid = %d; euid = %d\n", uid = getuid (), euid = geteuid ());
  if (setuid (uid) != 0)
    perror ("setuid (uid)");
  printf ("uid = %d; euid = %d\n", getuid (), geteuid ());
  if (setuid (euid) != 0)
    perror ("setuid (euid)");
  printf ("uid = %d; euid = %d\n", getuid (), geteuid ());
}
-- 
Ian G Batten, BT Fulcrum - igb at fulcrum.bt.co.uk - ...!uunet!ukc!fulcrum!igb



More information about the Comp.bugs.sys5 mailing list