Subject: Re: Politically Correct way of doing password authentication?
To: None <ziff@eecs.umich.edu>
From: John Kohl <jtk@kolvir.blrc.ma.us>
List: current-users
Date: 09/18/1994 18:22:44
I've compiled pppd with setuid(getuid()) and setgid(getgid()), and it
works just fine.  I also made pppd open the device in O_NDELAY mode--I
don't know why it was commented out, but modems react much better if you
open them this way.

Here are patches:
===================================================================
RCS file: RCS/main.c,v
retrieving revision 1.11
diff -c -r1.11 main.c
*** 1.11	1994/07/04 19:30:22
--- main.c	1994/09/18 22:19:36
***************
*** 348,354 ****
      /*
       * Open the serial device and set it up to be the ppp interface.
       */
!     if ((fd = open(devnam, O_RDWR /*| O_NDELAY*/)) < 0) {
  	syslog(LOG_ERR, "open(%s): %m", devnam);
  	die(1);
      }
--- 348,354 ----
      /*
       * Open the serial device and set it up to be the ppp interface.
       */
!     if ((fd = open(devnam, O_RDWR | O_NDELAY)) < 0) {
  	syslog(LOG_ERR, "open(%s): %m", devnam);
  	die(1);
      }
***************
*** 1144,1151 ****
      }
  
      if (pid == 0) {
! 	setreuid(getuid(), getuid());
! 	setregid(getgid(), getgid());
  	sigprocmask(SIG_SETMASK, &mask, NULL);
  	dup2(in, 0);
  	dup2(out, 1);
--- 1144,1151 ----
      }
  
      if (pid == 0) {
! 	setuid(getuid());
! 	setgid(getgid());
  	sigprocmask(SIG_SETMASK, &mask, NULL);
  	dup2(in, 0);
  	dup2(out, 1);