From ruben@helium-vw.xs4all.nl  Fri Jan 18 12:29:55 2002
Return-Path: <ruben@helium-vw.xs4all.nl>
Received: from helium-vw.xs4all.nl (helium-vw.xs4all.nl [194.109.251.55])
	by hub.freebsd.org (Postfix) with ESMTP
	id CAC9137B404; Fri, 18 Jan 2002 12:29:53 -0800 (PST)
Received: (from root@localhost)
	by helium.verweg.com (8.11.3/8.11.2) id f59EJs709301;
	Sat, 9 Jun 2001 16:19:54 +0200 (CEST)
	(envelope-from ruben)
Received: (from ruben@localhost)
	by helium.verweg.com (8.11.3/8.11.3av) id f59EJpk09293;
	Sat, 9 Jun 2001 16:19:51 +0200 (CEST)
	(envelope-from ruben)
Message-Id: <200106091419.f59EJpk09293@helium.verweg.com>
Date: Sat, 9 Jun 2001 16:19:51 +0200 (CEST)
From: ruben@verweg.com
Reply-To: ruben@verweg.com
To: FreeBSD-gnats-submit@freebsd.org
Cc: green@freebsd.org
Subject: [PATCH] let pam_ssh.so session work (with xdm)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         34045
>Category:       bin
>Synopsis:       [PATCH] let pam_ssh.so explicitly start ssh-agent with bourne shell syntax
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    markm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 18 12:30:01 PST 2002
>Closed-Date:    Thu Jan 24 02:53:22 PST 2002
>Last-Modified:  Tue Jan 29 06:16:25 PST 2002
>Originator:     Ruben van Staveren
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
Verweg dot Com
>Environment:
System: FreeBSD helium.verweg.com 4.3-STABLE FreeBSD 4.3-STABLE #0: Wed May 30 15:17:54 CEST 2001 root@helium.verweg.com:/usr/obj/usr/cvsup/4.0-stable/src/sys/HELIUM i386


	
>Description:
	The pam_ssh module has the possibility to start ssh-agent for you,
	making a single logon possible by directly feeding your passphrase into
	the agent (obtained during the authentification phase)

	However, ssh-agent has the habit on my system to present its output
	in C shell format whereas pam_ssh expects it to be in Bourne shell format
	(pam_ssh.c, lines 397-409)

	This does not affect the auth capability, only the session phase.

>How-To-Repeat:
	
	Use pam_ssh.so as a session and auth module for xdm in /etc/pam.conf
	and observe the contents of the ~/.ssh/agent-* file after logon
	
	the following syslog messages also apply:

	Jun  9 13:19:47 helium -:0            : pam_ssh: could not connect to agent
	Jun  9 14:45:11 helium -:0            : pam_ssh: /usr/bin/ssh-agent -k exited wi

>Fix:

	Instead of tinkering with the parsing, or changing user shells and or the 
	way xdm is started, let pam_ssh.so explicitly start ssh-agent to output 
	Bourne shell syntax. Here's a patch.

--- src/crypto/openssh/pam_ssh/pam_ssh.c.orig	Sat Jun  9 15:46:44 2001
+++ src/crypto/openssh/pam_ssh/pam_ssh.c	Sat Jun  9 15:46:53 2001
@@ -373,7 +373,7 @@
 	saved_uid = geteuid();
 	(void)seteuid(pwent->pw_uid);
 	env_fp = fopen(env_file, "w");
-	pipe = popen(PATH_SSH_AGENT, "r");
+	pipe = popen(PATH_SSH_AGENT " -s", "r");
 	(void)seteuid(saved_uid);
 	if (!pipe) {
 		syslog(LOG_ERR, "%s: %s: %m", MODULE_NAME, PATH_SSH_AGENT);

>Release-Note:
>Audit-Trail:

From: Ruben van Staveren <ruben@verweg.com>
To: freebsd-gnats-submit@FreeBSD.org, ruben@verweg.com
Cc:  
Subject: Re: bin/34045: [PATCH] let pam_ssh.so explicitly start ssh-agent with bourne shell syntax
Date: Thu, 24 Jan 2002 10:35:40 +0100

 Sorry, bin/34045 is misfiled. It was caused by switching back to an old queue
 which had amongst this pr other several jobs and thus can be `closed'
 
 o [2001/06/09] bin/27988   [PATCH] let pam_ssh.so explicitly start
                            ssh-agent with bourne
 o [2002/01/18] bin/34045   [PATCH] let pam_ssh.so explicitly start
                            ssh-agent with bourne shell syntax
 
 Regards,
 	Ruben
 
 -- 
    ,-_  .----------------------------------------------------------------.
   /() ) |       Ruben van Staveren      http://ruben.is.verweg.com/      |_o
  (__ (  |Men are from Mars. Women are from Venus. Computers are from hell| #>
 =/  ()  `----------------------------------------------------------------' 4
State-Changed-From-To: open->closed 
State-Changed-By: keramida 
State-Changed-When: Thu Jan 24 02:53:22 PST 2002 
State-Changed-Why:  
The same as bin/27988 
(refiled by Submitter: Ruben van Staveren <ruben@verweg.com>). 
Thanks for notifying bugs@freebsd.org about the duplicate, Ruben. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34045 
Responsible-Changed-From-To: freebsd-bugs->markm 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Jan 29 06:16:13 PST 2002 
Responsible-Changed-Why:  
Over to PAM maintainer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34045 
>Unformatted:
