mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
agent: Tell pinentry the hostname the agent is running on.
* agent/call-pinentry.c [!W32]: Incluse utsname.h (start_pinentry): Pass nodename to OPTION/owner. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
309f464a59
commit
042fe711c7
@ -31,6 +31,7 @@
|
|||||||
# include <sys/wait.h>
|
# include <sys/wait.h>
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
|
# include <sys/utsname.h>
|
||||||
#endif
|
#endif
|
||||||
#include <npth.h>
|
#include <npth.h>
|
||||||
|
|
||||||
@ -544,7 +545,16 @@ start_pinentry (ctrl_t ctrl)
|
|||||||
if (ctrl->client_pid)
|
if (ctrl->client_pid)
|
||||||
{
|
{
|
||||||
char *optstr;
|
char *optstr;
|
||||||
if ((optstr = xtryasprintf ("OPTION owner=%lu", ctrl->client_pid)))
|
const char *nodename = "";
|
||||||
|
|
||||||
|
#ifndef HAVE_W32_SYSTEM
|
||||||
|
struct utsname utsbuf;
|
||||||
|
if (!uname (&utsbuf))
|
||||||
|
nodename = utsbuf.nodename;
|
||||||
|
#endif /*!HAVE_W32_SYSTEM*/
|
||||||
|
|
||||||
|
if ((optstr = xtryasprintf ("OPTION owner=%lu %s",
|
||||||
|
ctrl->client_pid, nodename)))
|
||||||
{
|
{
|
||||||
assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
|
assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user