aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-07-19 08:50:28 +0000
committerWerner Koch <[email protected]>2005-07-19 08:50:28 +0000
commit730247b19e0beb29245140b4c4832d0274844c67 (patch)
tree7436be628286af01d908a19b06f04f191b5d7f89 /g10/misc.c
parent* samplekeys.asc: Update 99242560. (diff)
downloadgnupg-730247b19e0beb29245140b4c4832d0274844c67.tar.gz
gnupg-730247b19e0beb29245140b4c4832d0274844c67.zip
* configure.ac [W32]: Always set DISABLE_KEYSERVER_PATH.
* export.c (parse_export_options): New option export-reset-subkey-passwd. (do_export_stream): Implement it. * misc.c (get_libexecdir): New. * keyserver.c (keyserver_spawn): Use it
Diffstat (limited to '')
-rw-r--r--g10/misc.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c
index 70667cf7e..0bf71c264 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -1146,3 +1146,36 @@ default_homedir (void)
return dir;
}
+
+
+/* Return the name of the libexec directory. The name is allocated in
+ a static area on the first use. This function won't fail. */
+const char *
+get_libexecdir (void)
+{
+#ifdef HAVE_W32_SYSTEM
+ static int got_dir;
+ static char *dir;
+
+ if (!got_dir)
+ {
+ dir = read_w32_registry_string ("HKEY_LOCAL_MACHINE",
+ "Software\\GNU\\GnuPG",
+ "Install Directory");
+ if (dir && !*dir)
+ {
+ /* To avoid problems with using an empty dir we don't allow
+ for that. */
+ free (dir);
+ dir = NULL;
+ }
+ got_dir = 1;
+ }
+
+ if (dir)
+ return dir;
+ /* Fallback to the hardwired value. */
+#endif /*HAVE_W32_SYSTEM*/
+
+ return GNUPG_LIBEXECDIR;
+}