<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[138086] trunk/dports/security/gpg-agent</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/138086">138086</a></dd>
<dt>Author</dt> <dd>ionic@macports.org</dd>
<dt>Date</dt> <dd>2015-06-27 18:13:40 -0700 (Sat, 27 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>gpg-agent: add ssh_agent variant. Only works on Darwin-based platforms. (Maybe) Fixes: #46113.

Enables the sections normally commented out in the launchd plist file.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportssecuritygpgagentPortfile">trunk/dports/security/gpg-agent/Portfile</a></li>
<li><a href="#trunkdportssecuritygpgagentfilespatchagent_gpgagentclaunchddiff">trunk/dports/security/gpg-agent/files/patch-agent_gpg-agent.c-launchd.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportssecuritygpgagentPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/security/gpg-agent/Portfile (138085 => 138086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/security/gpg-agent/Portfile        2015-06-28 01:13:34 UTC (rev 138085)
+++ trunk/dports/security/gpg-agent/Portfile        2015-06-28 01:13:40 UTC (rev 138086)
</span><span class="lines">@@ -117,7 +117,14 @@
</span><span class="cx">     reinplace -W &quot;${worksrcpath}&quot; &quot;s|@LABEL@|${startupitem.uniquename}|g&quot; gpg-agent.plist.default
</span><span class="cx"> 
</span><span class="cx">     if {${os.platform} eq &quot;darwin&quot;} {
</span><del>-        reinplace -W &quot;${worksrcpath}&quot; &quot;s|@SSH_SUPPORT@||g&quot; gpg-agent.plist.default
</del><ins>+        if {[variant_isset ssh_agent]} {
+            # Remove lines with @SSH_SUPPORT@ in them.
+            # Uncomments sections.
+            reinplace -W &quot;${worksrcpath}&quot; &quot;/@SSH_SUPPORT@/d&quot; gpg-agent.plist.default
+        } else {
+            # Simply remove all @SSH_SUPPORT@ strings to comment out these sections.
+            reinplace -W &quot;${worksrcpath}&quot; &quot;s|@SSH_SUPPORT@||g&quot; gpg-agent.plist.default
+        }
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -171,6 +178,19 @@
</span><span class="cx">     configure.args-append   --with-pinentry-pgm=${applications_dir}/pinentry-mac.app/Contents/MacOS/pinentry-mac
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+variant ssh_agent description {Enables SSH agent support.} {
+    notes-append &quot;
+                   You have enabled the optional SSH agent feature.
+
+                   This only has an effect on Darwin-based platforms.
+
+                   It is your responsiblity to disable any other SSH agent
+                   so that this feature has a chance to actually work.
+
+                   Please note that this feature is untested.
+                 &quot;
+}
+
</ins><span class="cx"> livecheck.type      regex
</span><span class="cx"> livecheck.url       ftp://ftp.gnupg.org/gcrypt/gnupg/
</span><span class="cx"> livecheck.regex     gnupg-(2\\.0\\.\\d+)
</span></span></pre></div>
<a id="trunkdportssecuritygpgagentfilespatchagent_gpgagentclaunchddiff"></a>
<div class="modfile"><h4>Modified: trunk/dports/security/gpg-agent/files/patch-agent_gpg-agent.c-launchd.diff (138085 => 138086)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/security/gpg-agent/files/patch-agent_gpg-agent.c-launchd.diff        2015-06-28 01:13:34 UTC (rev 138085)
+++ trunk/dports/security/gpg-agent/files/patch-agent_gpg-agent.c-launchd.diff        2015-06-28 01:13:40 UTC (rev 138086)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><del>---- agent/gpg-agent.c.old        2015-06-27 23:15:37.000000000 +0200
-+++ agent/gpg-agent.c        2015-06-28 00:02:13.000000000 +0200
</del><ins>+--- agent/gpg-agent.c.old        2015-06-28 01:50:38.000000000 +0200
++++ agent/gpg-agent.c        2015-06-28 01:55:16.000000000 +0200
</ins><span class="cx"> @@ -47,6 +47,79 @@
</span><span class="cx">  #include &lt;unistd.h&gt;
</span><span class="cx">  #include &lt;signal.h&gt;
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx">      {
</span><span class="cx">        log_set_prefix (NULL, JNLIB_LOG_WITH_PREFIX);
</span><span class="cx">        check_for_running_agent (0, 0);
</span><del>-@@ -1054,6 +1169,217 @@
</del><ins>+@@ -1054,6 +1169,209 @@
</ins><span class="cx">        agent_deinit_default_ctrl (ctrl);
</span><span class="cx">        xfree (ctrl);
</span><span class="cx">      }
</span><span class="lines">@@ -198,18 +198,6 @@
</span><span class="cx"> +      /* Must leave SSH support enabled - #46113. */
</span><span class="cx"> +      /* opt.ssh_support = 0; */
</span><span class="cx"> +
</span><del>-+      /* Quick-check to see if SSH support was requested but another application is
-+       * providing an SSH auth socket via launchd. */
-+      if (opt.ssh_support) {
-+        REMOVE_ENV_VAR_FROM_LAUNCHD (GPG_ENV_SOCKET_SSH);
-+
-+        if (getenv (GPG_ENV_SOCKET_SSH) != NULL) {
-+          log_error (&quot;Another program is already providing SSH agent support via launchd. &quot;
-+                     &quot;Disabling SSH agent support in gpg-agent.\n&quot;);
-+          opt.ssh_support = 0;
-+        }
-+      }
-+
</del><span class="cx"> +      /* Fetch socket from launchd. */
</span><span class="cx"> +      launch_data_t checkin_request, checkin_response;
</span><span class="cx"> +
</span><span class="lines">@@ -276,21 +264,25 @@
</span><span class="cx"> +          log_error (&quot;No file descriptor returned for the agent socket.\n&quot;);
</span><span class="cx"> +          exit (1);
</span><span class="cx"> +        }
</span><del>-+        else {
</del><ins>++        /* This scope is merely here to easily get rid of &quot;cur&quot;. */
++        {
</ins><span class="cx"> +          launch_data_t cur = launch_data_array_get_index (data_array_agent, 0);
</span><span class="cx"> +          fd = launch_data_get_fd (cur);
</span><span class="cx"> +        }
</span><span class="cx"> +
</span><del>-+        if (opt.ssh_support &amp;&amp; ((fd_count_ssh = launch_data_array_get_count (data_array_ssh)) &gt; 1))
-+          log_info (&quot;launchd returned more than one file descriptor for the SSH socket - ignoring extraneous ones.\n&quot;);
-+        else if (opt.ssh_support &amp;&amp; (fd_count_ssh == 0)) {
-+          log_error (&quot;No file descriptor returned for the SSH socket.\n&quot;);
-+          exit (1);
</del><ins>++        if (opt.ssh_support) {
++          if ((fd_count_ssh = launch_data_array_get_count (data_array_ssh)) &gt; 1)
++            log_info (&quot;launchd returned more than one file descriptor for the SSH socket - ignoring extraneous ones.\n&quot;);
++          else if (fd_count_ssh == 0) {
++            log_error (&quot;No file descriptor returned for the SSH socket.\n&quot;);
++            exit (1);
++          }
++          /* This scope is merely here to easily get rid of &quot;cur&quot;. */
++          {
++            launch_data_t cur = launch_data_array_get_index (data_array_ssh, 0);
++            fd_ssh = launch_data_get_fd (cur);
++          }
</ins><span class="cx"> +        }
</span><del>-+        else if (opt.ssh_support) {
-+          launch_data_t cur = launch_data_array_get_index (data_array_ssh, 0);
-+          fd_ssh = launch_data_get_fd (cur);
-+        }
</del><span class="cx"> +      }
</span><span class="cx"> +
</span><span class="cx"> +      char *gpg_socket = getenv (GPG_ENV_SOCKET_AGENT);
</span></span></pre>
</div>
</div>

</body>
</html>