Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B77F5647D for ; Mon, 25 Jul 2011 14:33:57 +0000 (UTC) Received: (qmail 53357 invoked by uid 500); 25 Jul 2011 14:33:57 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 53316 invoked by uid 500); 25 Jul 2011 14:33:57 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 53309 invoked by uid 99); 25 Jul 2011 14:33:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2011 14:33:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2011 14:33:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9E3FE2388901 for ; Mon, 25 Jul 2011 14:33:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1150723 - /subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c Date: Mon, 25 Jul 2011 14:33:33 -0000 To: commits@subversion.apache.org From: stsp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110725143333.9E3FE2388901@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stsp Date: Mon Jul 25 14:33:32 2011 New Revision: 1150723 URL: http://svn.apache.org/viewvc?rev=1150723&view=rev Log: On the gpg-agent-password-store branch, send the values of the LC_CTYPE and DISPLAY variables to gpg-agent. These might be useful for the pinentry program. * subversion/libsvn_auth_gpg_agent/gpg_agent.c (password_get_gpg_agent): If LC_CTYPE and/or DISPLAY environment variables are set, use their values as arguments for the --lc-ctype and --display options of gpg-agent. Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150723&r1=1150722&r2=1150723&view=diff ============================================================================== --- subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original) +++ subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 14:33:32 2011 @@ -101,6 +101,8 @@ password_get_gpg_agent(const char **pass struct sockaddr_un addr; const char *tty_name; const char *tty_type; + const char *lc_ctype; + const char *display; const char *socket_name = NULL; svn_checksum_t *digest = NULL; @@ -195,6 +197,46 @@ password_get_gpg_agent(const char **pass return FALSE; } + /* Send LC_CTYPE to the gpg-agent daemon. */ + lc_ctype = getenv("LC_CTYPE"); + if (lc_ctype == NULL) + lc_ctype = getenv("LC_ALL"); + if (lc_ctype == NULL) + lc_ctype = getenv("LANG"); + if (lc_ctype != NULL) + { + request = apr_psprintf(pool, "OPTION lc-ctype=%s\n", lc_ctype); + send(sd, request, strlen(request), 0); + if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1)) + { + close(sd); + return FALSE; + } + if (strncmp(buffer, "OK", 2) != 0) + { + close(sd); + return FALSE; + } + } + + /* Send DISPLAY to the gpg-agent daemon. */ + display = getenv("DISPLAY"); + if (display != NULL) + { + request = apr_psprintf(pool, "OPTION display=%s\n", display); + send(sd, request, strlen(request), 0); + if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1)) + { + close(sd); + return FALSE; + } + if (strncmp(buffer, "OK", 2) != 0) + { + close(sd); + return FALSE; + } + } + /* Create the CACHE_ID which will be generated based on REALMSTRING similar to other password caching mechanisms. */ digest = svn_checksum_create(svn_checksum_md5, pool);