Subject: patch to make xdm call setlogin()
To: None <current-users@netbsd.org>
From: matthew green <mrg@mame.mu.oz.au>
List: current-users
Date: 12/17/1994 18:00:40
here's a patch to fix that bug in xdm.  can someone who knows what
channels to go through to get this fix incorporated in to R6 proper
please contact me?  (rather than 10 people all sending it in).

if someone thinks there is a better test than `__NetBSD__', please
let me know.  as <sys/param.h> defines BSD4_4 as being `1', perhaps
this would be better done with

#if defined(BSD4_4) && (BSD4_4 > 1)

i'm not sure.

.mrg.

*** xc/programs/xdm/session.c.orig	Sat Dec 17 17:42:33 1994
--- xc/programs/xdm/session.c	Sat Dec 17 17:44:48 1994
***************
*** 527,532 ****
--- 527,545 ----
  	    return (0);
  	}
  #else /* AIXV3 */
+ 
+ #ifdef __NetBSD__
+ 	/*
+ 	 * 4.4BSD's setlogin() and getlogin() are implimented in the kernel,
+ 	 * not from utmp.
+ 	 */
+ 	if (setlogin(name) < 0)
+ 	{
+ 	    LogError("setlogin for \"%s\" failed, errno=%d\n", name, errno);
+ 	    return (0);
+ 	}
+ #endif
+ 
  #ifdef NGROUPS_MAX
  	if (setgid(verify->groups[0]) < 0)
  	{