SCO 5.0.5 question (username not known)

Jim Knoble jmknoble at jmknoble.cx
Mon Feb 12 16:59:34 EST 2001


Circa 2001-Feb-11 00:37:45 +0100 dixit Gert Doering:

: The system call required is "setluid(uid_t)", and should be done at the
: place in sshd where the user ID is set, all root privileges are revoked,
: and the user shell is "to be called".  Caveat: if sshd is run from the
: command line, like "make ; make install; sshd", setluid() will fail - but
: there's nothing we can do, except recommend to run sshd only from
: /etc/inittab (":once:" settings).

Actually, what sshd probably wants to do is something like the following:

  #ifdef HAVE_SETLUID
  if (-1 == getluid()) {
    setluid(my_uid);
  }
  #else
  #ifdef HAVE_SETAUID
  /* Similar stuff for Solaris or other systems with setauid(). */
  #endif
  #endif

-- 
jim knoble | jmknoble at jmknoble.cx | http://www.jmknoble.cx/





More information about the openssh-unix-dev mailing list