Codebase list gpgme1.0 / eb37d64
core: Support dirinfo("socketdir") * src/dirinfo.c (WANT_SOCKETDIR): New. (dirinfo): Add field socketdir. (parse_output): Support "socketdir". (get_gpgconf_item): Return socketdir. * tests/t-engine-info.c (main): Add socketdir to the output. * src/w32-util.c (_gpgme_create_process_utf8): Fix indentation. -- GnuPG-bug-id: 5613 This is not strictly necessary because we could deduce this from one of the other socket info items but it is more clean to have a dedicated info item. The socketdir item is available for 5 years now (GnuPG commit 8e3fa5a4b205c534de2142e5d071712f957cf06a) Werner Koch 2 years ago
4 changed file(s) with 24 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
9090 homedir, sysconfdir, bindir, libexecdir, libdir,
9191 datadir, localedir, agent-socket, agent-ssh-socket,
9292 dirmngr-socket, uiserver-socket, gpgconf-name, gpg-name,
93 gpgsm-name, g13-name
93 gpgsm-name, g13-name, socketdir.
9494
9595 This may be extended in the future.
9696 */
4343 WANT_LIBDIR,
4444 WANT_DATADIR,
4545 WANT_LOCALEDIR,
46 WANT_SOCKETDIR,
4647 WANT_AGENT_SOCKET,
4748 WANT_AGENT_SSH_SOCKET,
4849 WANT_DIRMNGR_SOCKET,
6667 char *libdir;
6768 char *datadir;
6869 char *localedir;
70 char *socketdir;
6971 char *agent_socket;
7072 char *agent_ssh_socket;
7173 char *dirmngr_socket;
151153 dirinfo.datadir = strdup (value);
152154 else if (!strcmp (line, "localedir") && !dirinfo.localedir)
153155 dirinfo.localedir = strdup (value);
156 else if (!strcmp (line, "socketdir") && !dirinfo.socketdir)
157 dirinfo.socketdir = strdup (value);
154158 else if (!strcmp (line, "agent-socket") && !dirinfo.agent_socket)
155159 {
156160 const char name[] = "S.uiserver";
309313 _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL,
310314 "gpgme-dinfo: homedir='%s'\n",
311315 dirinfo.homedir);
316 if (dirinfo.socketdir)
317 _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL,
318 "gpgme-dinfo: sockdir='%s'\n",
319 dirinfo.socketdir);
312320 if (dirinfo.agent_socket)
313321 _gpgme_debug (NULL,DEBUG_INIT, -1, NULL, NULL, NULL,
314322 "gpgme-dinfo: agent='%s'\n",
335343 case WANT_LIBDIR: result = dirinfo.libdir; break;
336344 case WANT_DATADIR: result = dirinfo.datadir; break;
337345 case WANT_LOCALEDIR: result = dirinfo.localedir; break;
346 case WANT_SOCKETDIR: result = dirinfo.socketdir; break;
338347 case WANT_AGENT_SOCKET: result = dirinfo.agent_socket; break;
339348 case WANT_AGENT_SSH_SOCKET: result = dirinfo.agent_ssh_socket; break;
340349 case WANT_DIRMNGR_SOCKET: result = dirinfo.dirmngr_socket; break;
475484 return get_gpgconf_item (WANT_DATADIR);
476485 else if (!strcmp (what, "localedir"))
477486 return get_gpgconf_item (WANT_LOCALEDIR);
487 else if (!strcmp (what, "socketdir"))
488 return get_gpgconf_item (WANT_SOCKETDIR);
478489 else
479490 return NULL;
480491 }
840840
841841
842842 /* Like CreateProcessA but mapping the arguments to wchar API */
843 int _gpgme_create_process_utf8 (const char *application_name_utf8,
844 char *command_line_utf8,
845 LPSECURITY_ATTRIBUTES lpProcessAttributes,
846 LPSECURITY_ATTRIBUTES lpThreadAttributes,
847 BOOL bInheritHandles,
848 DWORD dwCreationFlags,
849 void *lpEnvironment,
850 char *working_directory_utf8,
851 LPSTARTUPINFOA si,
852 LPPROCESS_INFORMATION lpProcessInformation)
843 int
844 _gpgme_create_process_utf8 (const char *application_name_utf8,
845 char *command_line_utf8,
846 LPSECURITY_ATTRIBUTES lpProcessAttributes,
847 LPSECURITY_ATTRIBUTES lpThreadAttributes,
848 BOOL bInheritHandles,
849 DWORD dwCreationFlags,
850 void *lpEnvironment,
851 char *working_directory_utf8,
852 LPSTARTUPINFOA si,
853 LPPROCESS_INFORMATION lpProcessInformation)
853854 {
854855 BOOL ret;
855856 wchar_t *application_name = utf8_to_wchar0 (application_name_utf8);
117117 "libdir",
118118 "datadir",
119119 "localedir",
120 "socketdir",
120121 "agent-socket",
121122 "agent-ssh-socket",
122123 "dirmngr-socket",