From owner-freebsd-bugs Sat Jun 9 7:30:10 2001 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 8119337B405 for ; Sat, 9 Jun 2001 07:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f59EU1i84067; Sat, 9 Jun 2001 07:30:01 -0700 (PDT) (envelope-from gnats) 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 X-Send-Pr-Version: 3.113 Subject: bin/27988: [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: 27988 >Category: bin >Synopsis: [PATCH] let pam_ssh.so explicitly start ssh-agent with bourne >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jun 09 07:30:01 PDT 2001 >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 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: >Unformatted: >shell To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message