From ruben@verweg.com  Sat Jun  9 07:27:32 2001
Return-Path: <ruben@verweg.com>
Received: from keyser.soze.com (keyser.soze.com [194.165.93.196])
	by hub.freebsd.org (Postfix) with ESMTP
	id F3BF137B401; Sat,  9 Jun 2001 07:27:30 -0700 (PDT)
	(envelope-from ruben@verweg.com)
Received: from erg.verweg.com ([132.229.90.89])
	by keyser.soze.com (8.9.1/8.9.1) with ESMTP id QAA17098;
	Sat, 9 Jun 2001 16:24:18 +0200 (CEST)
Received: (from ruben@localhost)
	by erg.verweg.com (8.9.3+3.2W/8.9.3) id QAA18537;
	Sat, 9 Jun 2001 16:27:28 +0200 (CEST)
Message-Id: <20010609162726.A18504@erg.verweg.com>
Date: Sat, 9 Jun 2001 16:27:27 +0200
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

>Number:         27988
>Category:       bin
>Synopsis:       [PATCH] let pam_ssh.so explicitly start ssh-agent with bourne
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 09 07:30:01 PDT 2001
>Closed-Date:    Mon Jul 14 03:26:38 PDT 2003
>Last-Modified:  Mon Jul 14 03:26:38 PDT 2003
>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



    <machine, os, target, libraries (multiple lines)>
>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 with status 1

>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: Marc Perisa <perisa@porsche.de>
To: freebsd-gnats-submit@FreeBSD.org, ruben@verweg.com
Cc:  
Subject: Re: bin/27988: [PATCH] let pam_ssh.so explicitly start ssh-agent
 with bourne
Date: Wed, 29 May 2002 03:57:59 +0200

 Hi,
 
 is this still the case after the major PAM rewriting?
 
 Thanks
 
 Marc
 
 
 
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 18:00:11 PDT 2003 
Responsible-Changed-Why:  
Assign to SSH maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=27988 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Mon Jul 14 03:26:34 PDT 2003 
State-Changed-Why:  
OBE 

http://www.freebsd.org/cgi/query-pr.cgi?pr=27988 
>Unformatted:
 >shell
