Subject: Re: PAM and Xserver
To: None <current-users@netbsd.org>
From: Jukka Salmi <j+nbsd@2005.salmi.ch>
List: current-users
Date: 03/02/2005 22:50:04
--PmA2V3Z32TCmWXqI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Christos Zoulas --> current-users (2005-03-01 17:39:34 -0500):
[...]
> Who owns /dev/console at that point, and who owns it in the working case?

I noticed what causes the problem: src/usr.bin/login/login_pam.c
does not call ttyaction() as login.c does. Why? If this is not done
intentionally, the attached patch fixes the problem.


Cheers, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

--PmA2V3Z32TCmWXqI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="login_pam.c_ttyaction"

--- login_pam.c.orig	2005-03-01 11:31:45.000000000 +0100
+++ login_pam.c	2005-03-02 22:31:18.000000000 +0100
@@ -461,6 +461,9 @@
 	(void)chown(ttyn, pwd->pw_uid,
 	    (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid);
 
+	if (ttyaction(ttyn, "login", pwd->pw_name))
+		(void)printf("Warning: ttyaction failed.\n");
+
 	/* Nothing else left to fail -- really log in. */
         update_db(quietlog);
 

--PmA2V3Z32TCmWXqI--