1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Create the extra sockets in the standard socket dir.

* agent/gpg-agent.c (main): Take the socketdir in account for the
default sockets.
* tools/gpgconf.c (list_dirs): Add "agent-extra-socket" and
"agent-browser-socket".

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-09-30 19:21:51 +02:00
parent 95cf7afff0
commit 80cc16e072
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 14 additions and 6 deletions

View File

@ -1047,8 +1047,7 @@ main (int argc, char **argv )
if (! opt.extra_socket)
{
opt.extra_socket = 1; /* (1 = points into r/o section) */
socket_name_extra = GPG_AGENT_EXTRA_SOCK_NAME;
opt.extra_socket = 1;
}
else if (socket_name_extra
&& (!strcmp (socket_name_extra, "none")
@ -1061,8 +1060,7 @@ main (int argc, char **argv )
if (! opt.browser_socket)
{
opt.browser_socket = 1; /* (1 = points into r/o section) */
socket_name_browser = GPG_AGENT_BROWSER_SOCK_NAME;
opt.browser_socket = 1;
}
else if (socket_name_browser
&& (!strcmp (socket_name_browser, "none")
@ -1253,7 +1251,11 @@ main (int argc, char **argv )
if (opt.extra_socket)
{
socket_name_extra = create_socket_name (socket_name_extra, 0);
if (socket_name_extra)
socket_name_extra = create_socket_name (socket_name_extra, 0);
else
socket_name_extra = create_socket_name
/**/ (GPG_AGENT_EXTRA_SOCK_NAME, 1);
opt.extra_socket = 2; /* Indicate that it has been malloced. */
fd_extra = create_server_socket (socket_name_extra, 0, 0,
&redir_socket_name_extra,
@ -1262,7 +1264,11 @@ main (int argc, char **argv )
if (opt.browser_socket)
{
socket_name_browser = create_socket_name (socket_name_browser, 0);
if (socket_name_browser)
socket_name_browser = create_socket_name (socket_name_browser, 0);
else
socket_name_browser= create_socket_name
/**/ (GPG_AGENT_BROWSER_SOCK_NAME, 1);
opt.browser_socket = 2; /* Indicate that it has been malloced. */
fd_browser = create_server_socket (socket_name_browser, 0, 0,
&redir_socket_name_browser,

View File

@ -166,6 +166,8 @@ list_dirs (estream_t fp, char **names)
{ "socketdir", gnupg_socketdir, NULL },
{ "dirmngr-socket", dirmngr_socket_name, NULL,},
{ "agent-ssh-socket", gnupg_socketdir, GPG_AGENT_SSH_SOCK_NAME },
{ "agent-extra-socket", gnupg_socketdir, GPG_AGENT_EXTRA_SOCK_NAME },
{ "agent-browser-socket",gnupg_socketdir, GPG_AGENT_BROWSER_SOCK_NAME },
{ "agent-socket", gnupg_socketdir, GPG_AGENT_SOCK_NAME },
{ "homedir", gnupg_homedir, NULL }
};