#include "i18n.h"
#include "util.h"
+#include "init.h"
/* Constants for the options. */
switch(level)
{
- case 11: p = "dirmngr-client (GnuPG)";
+ case 11: p = "dirmngr-client (@GNUPG@)";
break;
case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break;
int cmd_loadcrl = 0;
int cmd_squid_mode = 0;
+ early_system_init ();
set_strusage (my_strusage);
log_set_prefix ("dirmngr-client",
JNLIB_LOG_WITH_PREFIX);
assuan_context_t ctx;
int try_default = 0;
- infostr = opt.force_pipe_server? NULL : getenv ("DIRMNGR_INFO");
+ infostr = opt.force_pipe_server? NULL : getenv (DIRMNGR_INFO_NAME);
if (only_daemon && (!infostr || !*infostr))
{
- infostr = xstrdup (dirmngr_socket_name ());
+ if (dirmngr_user_socket_name ())
+ infostr = xstrdup (dirmngr_user_socket_name ());
+ else
+ infostr = xstrdup (dirmngr_sys_socket_name ());
try_default = 1;
}
{
const char *pgmname;
const char *argv[3];
- int no_close_list[3];
+ assuan_fd_t no_close_list[3];
int i;
if (only_daemon)
if (log_get_fd () != -1)
no_close_list[i++] = assuan_fd_from_posix_fd (log_get_fd ());
no_close_list[i++] = assuan_fd_from_posix_fd (es_fileno (es_stderr));
- no_close_list[i] = -1;
+ no_close_list[i] = ASSUAN_INVALID_FD;
/* Connect to the agent and perform initial handshaking. */
rc = assuan_pipe_connect (ctx, opt.dirmngr_program, argv,
{
if ( !(p = strchr (infostr, ':')) || p == infostr)
{
- log_error (_("malformed DIRMNGR_INFO environment variable\n"));
+ log_error (_("malformed %s environment variable\n"),
+ DIRMNGR_INFO_NAME);
xfree (infostr);
if (only_daemon)
return NULL;