aboutsummaryrefslogtreecommitdiffstats
path: root/common/asshelp.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/asshelp.c')
-rw-r--r--common/asshelp.c47
1 files changed, 7 insertions, 40 deletions
diff --git a/common/asshelp.c b/common/asshelp.c
index 5c32c6ed3..c03e67bff 100644
--- a/common/asshelp.c
+++ b/common/asshelp.c
@@ -564,18 +564,7 @@ start_new_dirmngr (assuan_context_t *r_ctx,
return err;
}
- sockname = dirmngr_user_socket_name ();
- if (sockname)
- {
- /* First try the local socket name and only if that fails try
- the system socket. */
- err = assuan_socket_connect (ctx, sockname, 0, 0);
- if (err)
- sockname = dirmngr_sys_socket_name ();
- }
- else
- sockname = dirmngr_sys_socket_name ();
-
+ sockname = dirmngr_socket_name ();
err = assuan_socket_connect (ctx, sockname, 0, 0);
#ifdef USE_DIRMNGR_AUTO_START
@@ -583,22 +572,9 @@ start_new_dirmngr (assuan_context_t *r_ctx,
{
lock_spawn_t lock;
const char *argv[4];
- int try_system_daemon = 0;
char *abs_homedir;
- /* No connection: Try start a new Dirmngr. On Windows this will
- fail because the Dirmngr is expected to be a system service.
- However on WinCE we don't distinguish users and thus we can
- start it. */
-
- /* We prefer to start it as a user daemon. */
- sockname = dirmngr_user_socket_name ();
- if (!sockname)
- {
- sockname = dirmngr_sys_socket_name ();
- try_system_daemon = 1;
- }
-
+ /* No connection: Try start a new Dirmngr. */
if (!dirmngr_program || !*dirmngr_program)
dirmngr_program = gnupg_module_name (GNUPG_MODULE_NAME_DIRMNGR);
@@ -631,20 +607,11 @@ start_new_dirmngr (assuan_context_t *r_ctx,
}
argv[0] = "--daemon";
- if (try_system_daemon)
- argv[1] = NULL;
- else
- { /* Try starting as user daemon - dirmngr does this if the
- home directory is given on the command line. */
- argv[1] = "--homedir";
- argv[2] = abs_homedir;
- argv[3] = NULL;
- }
-
- /* On the use of HOMEDIR for locking: Under Windows HOMEDIR is
- not used thus it does not matter. Under Unix we should
- TRY_SYSTEM_DAEMON should never be true because
- dirmngr_user_socket_name() won't return NULL. */
+ /* Try starting the daemon. Versions of dirmngr < 2.1.15 do
+ * this only if the home directory is given on the command line. */
+ argv[1] = "--homedir";
+ argv[2] = abs_homedir;
+ argv[3] = NULL;
if (!(err = lock_spawning (&lock, gnupg_homedir (), "dirmngr", verbose))
&& assuan_socket_connect (ctx, sockname, 0, 0))