Changeset 138083


Ignore:
Timestamp:
Jun 28, 2015, 1:13:25 AM (4 years ago)
Author:
ionic@…
Message:

gpg-agent: update to 2.0.28. Regenerate launchd patch file.

Additionally:

  • Fixes capitalization and spelling errors in the patch file.
  • Enables SSH support. Needs implementation in the Portfile scheduled for later.
Location:
trunk/dports/security/gpg-agent
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/security/gpg-agent/Portfile

    r138080 r138083  
    66# When updating gpg-agent, update gnupg2 also if applicable.
    77name                gpg-agent
    8 version             2.0.27
     8version             2.0.28
    99revision            0
    1010categories          security mail
     
    2525use_bzip2           yes
    2626
    27 checksums           rmd160  52aaf841339713aef9e2e034b1e045bec31d6322 \
    28                     sha256  57646d3e4b919fa1e5c8f1c0cf5fe1215333041c493a5ebc4b8f2978dbe930f2
     27checksums           rmd160  ba35deebf89284f5e2debc0bd82b229f594d0306 \
     28                    sha256  ce092ee4ab58fd19b9fb34a460c07b06c348f4360dd5dd4886d041eb521a534c
    2929
    3030startupitem.location \
  • trunk/dports/security/gpg-agent/files/patch-agent_gpg-agent.c-launchd.diff

    r128050 r138083  
    1 --- agent/gpg-agent.c.old
    2 +++ agent/gpg-agent.c
     1--- agent/gpg-agent.c.old       2015-06-27 23:15:37.000000000 +0200
     2+++ agent/gpg-agent.c   2015-06-28 00:02:13.000000000 +0200
    33@@ -47,6 +47,79 @@
    44 #include <unistd.h>
     
    9191 
    9292   oPinentryProgram,
    93 @@ -133,6 +209,9 @@
     93@@ -134,6 +210,9 @@
    9494   { 301, NULL, 0, N_("@Options:\n ") },
    9595 
     
    101101   { oVerbose, "verbose",     0, N_("verbose") },
    102102   { oQuiet,    "quiet",     0, N_("be somewhat more quiet") },
    103 @@ -475,6 +554,19 @@
     103@@ -478,6 +557,19 @@
    104104 {
    105105   remove_socket (socket_name);
     
    121121 
    122122 
    123 @@ -596,6 +688,9 @@
     123@@ -603,6 +695,9 @@
    124124   int nogreeting = 0;
    125125   int pipe_server = 0;
     
    131131   int csh_style = 0;
    132132   char *logfile = NULL;
    133 @@ -816,6 +911,9 @@
     133@@ -823,6 +918,9 @@
    134134         case oSh: csh_style = 0; break;
    135135         case oServer: pipe_server = 1; break;
     
    141141         case oDisplay: default_display = xstrdup (pargs.r.ret_str); break;
    142142         case oTTYname: default_ttyname = xstrdup (pargs.r.ret_str); break;
    143 @@ -858,6 +956,19 @@
     143@@ -865,6 +963,19 @@
    144144         default : pargs.err = configfp? 1:2; break;
    145145        }
    146146     }
    147147+
    148 +  /* When running under launchd control, only start for real users ie UID >= 500
     148+  /* When running under launchd control, only start for real users, i.e., UID >= 500
    149149+   *
    150 +   * Do this check early to avoid filling logs */
    151 +
    152 +#ifdef __APPLE_LAUNCHD__
    153 +  if (launchd_child && geteuid() < 500)
     150+   * Do this check early to avoid filling logs. */
     151+
     152+#ifdef __APPLE_LAUNCHD__
     153+  if (launchd_child && geteuid () < 500)
    154154+    {
    155155+      log_error ("launchd only supported for real users - i.e., UID >= 500\n");
     
    161161     {
    162162       fclose( configfp );
    163 @@ -983,7 +1094,11 @@
     163@@ -992,7 +1103,11 @@
    164164   /* If this has been called without any options, we merely check
    165165      whether an agent is already running.  We do this here so that we
     
    173173       log_set_prefix (NULL, JNLIB_LOG_WITH_PREFIX);
    174174       check_for_running_agent (0, 0);
    175 @@ -1045,6 +1160,217 @@
     175@@ -1054,6 +1169,217 @@
    176176       agent_deinit_default_ctrl (ctrl);
    177177       xfree (ctrl);
     
    184184+
    185185+      /* Remove the DISPLAY variable so that a pinentry does not
    186 +       * default to a specific display.  There is still a default
     186+       * default to a specific display. There is still a default
    187187+       * display when gpg-agent was started using --display or a
    188 +       * client requested this using an OPTION command.  Note, that we
    189 +       * don't do this when running in reverse daemon mode (i.e. when
    190 +       * exec the program given as arguments). */
     188+       * client requested this using an OPTION command. Note, that we
     189+       * don't do this when running in reverse daemon mode (i.e., when
     190+       * execcuting the program given as arguments). */
    191191+
    192192+      if (!opt.keep_display && !argc)
     
    196196+      pid = getpid ();
    197197+
    198 +      /* Disable SSH support for good. */
    199 +      opt.ssh_support = 0;
     198+      /* Must leave SSH support enabled - #46113. */
     199+      /* opt.ssh_support = 0; */
    200200+
    201201+      /* Quick-check to see if SSH support was requested but another application is
     
    205205+
    206206+        if (getenv (GPG_ENV_SOCKET_SSH) != NULL) {
    207 +          log_error ("another program is already providing SSH agent support via launchd. "
    208 +                     "disabling SSH agent support in gpg-agent.\n");
     207+          log_error ("Another program is already providing SSH agent support via launchd. "
     208+                     "Disabling SSH agent support in gpg-agent.\n");
    209209+          opt.ssh_support = 0;
    210210+        }
     
    249249+
    250250+        if (got_sockets < need_sockets) {
    251 +          log_error ("launchd returned less seconds than necessary. "
     251+          log_error ("launchd returned less sockets than necessary. "
    252252+                     "needed: %zu, given: %zu.\n", need_sockets, got_sockets);
    253253+          exit (1);
     
    260260+        launch_data_t data_array_agent, data_array_ssh;
    261261+        if ((data_array_agent = launch_data_dict_lookup (socket_dict, GPG_SOCKET_NAME_AGENT)) == NULL) {
    262 +          log_error ("no agent socket defined in launchd plist file.\n");
     262+          log_error ("No agent socket defined in launchd plist file.\n");
    263263+          exit (1);
    264264+        }
     
    266266+        if (opt.ssh_support &&
    267267+            ((data_array_ssh = launch_data_dict_lookup (socket_dict, GPG_SOCKET_NAME_SSH)) == NULL)) {
    268 +          log_error ("no ssh socket defined in launchd plist file.\n");
     268+          log_error ("No ssh socket defined in launchd plist file.\n");
    269269+          exit (1);
    270270+        }
     
    274274+          log_info ("launchd returned more than one file descriptor for the agent socket - ignoring extraneous ones.\n");
    275275+        else if (fd_count_agent == 0) {
    276 +          log_error ("no file descriptor returned for the agent socket.\n");
     276+          log_error ("No file descriptor returned for the agent socket.\n");
    277277+          exit (1);
    278278+        }
     
    283283+
    284284+        if (opt.ssh_support && ((fd_count_ssh = launch_data_array_get_count (data_array_ssh)) > 1))
    285 +          log_info ("launchd returned more than one file descriptor for the ssh socket - ignoring extraneous ones.\n");
     285+          log_info ("launchd returned more than one file descriptor for the SSH socket - ignoring extraneous ones.\n");
    286286+        else if (opt.ssh_support && (fd_count_ssh == 0)) {
    287 +          log_error ("no file descriptor returned for the ssh socket.\n");
     287+          log_error ("No file descriptor returned for the SSH socket.\n");
    288288+          exit (1);
    289289+        }
     
    296296+      char *gpg_socket = getenv (GPG_ENV_SOCKET_AGENT);
    297297+      if (!gpg_socket) {
    298 +        log_error ("no agent socket environment variable defined by launchd.\n");
     298+        log_error ("No agent socket environment variable defined by launchd.\n");
    299299+        exit (1);
    300300+      }
     
    302302+      char *ssh_socket = getenv (GPG_ENV_SOCKET_SSH);
    303303+      if (opt.ssh_support && !ssh_socket) {
    304 +        log_error ("no ssh socket environment variable defined by launchd.\n");
     304+        log_error ("No SSH socket environment variable defined by launchd.\n");
    305305+        exit (1);
    306306+      }
Note: See TracChangeset for help on using the changeset viewer.