From owner-freebsd-bugs Fri Jan 18 12:30:12 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BF6AE37B417 for ; Fri, 18 Jan 2002 12:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0IKU1J19028; Fri, 18 Jan 2002 12:30:01 -0800 (PST) (envelope-from gnats) 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 X-Send-Pr-Version: 3.113 Subject: bin/34045: [PATCH] let pam_ssh.so session work (with xdm) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 18 12:30:01 PST 2002 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message