1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-07 23:27:48 +02:00

Fix standard directories for Wince.

Typo fix.
This commit is contained in:
Werner Koch 2010-09-13 10:17:04 +00:00
parent 299ed4c9e2
commit 4fdd83b401
4 changed files with 39 additions and 46 deletions

View File

@ -35,7 +35,7 @@
we use one context to do all encryption and decryption. */ we use one context to do all encryption and decryption. */
static pth_mutex_t encryption_lock; static pth_mutex_t encryption_lock;
/* The encryption context. This is the only place where the /* The encryption context. This is the only place where the
encryption key for all cached entries is available. It would nice encryption key for all cached entries is available. It would be nice
to keep this (or just the key) in some hardware device, for example to keep this (or just the key) in some hardware device, for example
a TPM. Libgcrypt could be extended to provide such a service. a TPM. Libgcrypt could be extended to provide such a service.
With the current scheme it is easy to retrieve the cached entries With the current scheme it is easy to retrieve the cached entries

View File

@ -1,3 +1,12 @@
2010-09-13 Werner Koch <wk@g10code.com>
* homedir.c (gnupg_bindir) [W32CE]: Change to bin/.
(gnupg_libexecdir) [W32]: Call gnupg_bindir.
(gnupg_libdir, gnupg_datadir, gnupg_localedir) [W32]: Simplify by
using xstrconcat.
(gnupg_module_name): Ditto.
(w32_rootdir): Strip a trailing "bin".
2010-09-02 Werner Koch <wk@g10code.com> 2010-09-02 Werner Koch <wk@g10code.com>
* util.h (GPG_ERR_NOT_INITIALIZED): Define if not defined. * util.h (GPG_ERR_NOT_INITIALIZED): Define if not defined.

View File

@ -217,8 +217,15 @@ w32_rootdir (void)
got_dir = 1; got_dir = 1;
p = strrchr (dir, DIRSEP_C); p = strrchr (dir, DIRSEP_C);
if (p) if (p)
{
*p = 0; *p = 0;
else /* If we are installed below "bin" we strip that and use
the top directory instead. */
p = strrchr (dir, DIRSEP_C);
if (p && !strcmp (p+1, "bin"))
*p = 0;
}
if (!p)
{ {
log_debug ("bad filename `%s' returned for this process\n", dir); log_debug ("bad filename `%s' returned for this process\n", dir);
*dir = 0; *dir = 0;
@ -291,7 +298,13 @@ gnupg_sysconfdir (void)
const char * const char *
gnupg_bindir (void) gnupg_bindir (void)
{ {
#ifdef HAVE_W32_SYSTEM #if defined (HAVE_W32CE_SYSTEM)
static char *name;
if (!name)
name = xstrconcat (w32_rootdir (), DIRSEP_S "bin", NULL);
return name;
#elif defined(HAVE_W32_SYSTEM)
return w32_rootdir (); return w32_rootdir ();
#else /*!HAVE_W32_SYSTEM*/ #else /*!HAVE_W32_SYSTEM*/
return GNUPG_BINDIR; return GNUPG_BINDIR;
@ -305,7 +318,7 @@ const char *
gnupg_libexecdir (void) gnupg_libexecdir (void)
{ {
#ifdef HAVE_W32_SYSTEM #ifdef HAVE_W32_SYSTEM
return w32_rootdir (); return gnupg_bindir ();
#else /*!HAVE_W32_SYSTEM*/ #else /*!HAVE_W32_SYSTEM*/
return GNUPG_LIBEXECDIR; return GNUPG_LIBEXECDIR;
#endif /*!HAVE_W32_SYSTEM*/ #endif /*!HAVE_W32_SYSTEM*/
@ -318,13 +331,7 @@ gnupg_libdir (void)
static char *name; static char *name;
if (!name) if (!name)
{ name = xstrconcat (w32_rootdir (), DIRSEP_S "lib" DIRSEP_S "gnupg", NULL);
const char *s1, *s2;
s1 = w32_rootdir ();
s2 = DIRSEP_S "lib" DIRSEP_S "gnupg";
name = xmalloc (strlen (s1) + strlen (s2) + 1);
strcpy (stpcpy (name, s1), s2);
}
return name; return name;
#else /*!HAVE_W32_SYSTEM*/ #else /*!HAVE_W32_SYSTEM*/
return GNUPG_LIBDIR; return GNUPG_LIBDIR;
@ -338,13 +345,7 @@ gnupg_datadir (void)
static char *name; static char *name;
if (!name) if (!name)
{ name = xstrconcat (w32_rootdir (), DIRSEP_S "share" DIRSEP_S "gnupg", NULL);
const char *s1, *s2;
s1 = w32_rootdir ();
s2 = DIRSEP_S "share" DIRSEP_S "gnupg";
name = xmalloc (strlen (s1) + strlen (s2) + 1);
strcpy (stpcpy (name, s1), s2);
}
return name; return name;
#else /*!HAVE_W32_SYSTEM*/ #else /*!HAVE_W32_SYSTEM*/
return GNUPG_DATADIR; return GNUPG_DATADIR;
@ -359,13 +360,8 @@ gnupg_localedir (void)
static char *name; static char *name;
if (!name) if (!name)
{ name = xstrconcat (w32_rootdir (), DIRSEP_S "share" DIRSEP_S "locale",
const char *s1, *s2; NULL);
s1 = w32_rootdir ();
s2 = DIRSEP_S "share" DIRSEP_S "locale";
name = xmalloc (strlen (s1) + strlen (s2) + 1);
strcpy (stpcpy (name, s1), s2);
}
return name; return name;
#else /*!HAVE_W32_SYSTEM*/ #else /*!HAVE_W32_SYSTEM*/
return LOCALEDIR; return LOCALEDIR;
@ -472,17 +468,10 @@ dirmngr_socket_name (void)
const char * const char *
gnupg_module_name (int which) gnupg_module_name (int which)
{ {
const char *s, *s2;
#define X(a,b) do { \ #define X(a,b) do { \
static char *name; \ static char *name; \
if (!name) \ if (!name) \
{ \ name = xstrconcat (gnupg_ ## a (), DIRSEP_S b EXEEXT_S, NULL); \
s = gnupg_ ## a (); \
s2 = DIRSEP_S b EXEEXT_S; \
name = xmalloc (strlen (s) + strlen (s2) + 1); \
strcpy (stpcpy (name, s), s2); \
} \
return name; \ return name; \
} while (0) } while (0)

View File

@ -1,7 +1,6 @@
2010-09-06 Werner Koch <wk@g10code.com> 2010-09-06 Werner Koch <wk@g10code.com>
* card-util.c (card_status): Remove stub creation for GnuPG >= 2.
* card-util.c (card_status): Remove stub creation fro GnuPG >= 2.
(card_store_subkey): Temporary disable this code. (card_store_subkey): Temporary disable this code.
* keyedit.c (show_key_with_all_names): Merge secret and public key * keyedit.c (show_key_with_all_names): Merge secret and public key
@ -10,12 +9,10 @@
* delkey.c (do_delete_key): Ditto. * delkey.c (do_delete_key): Ditto.
* export.c (subkey_in_list_p, exact_subkey_match_p): Ditto. * export.c (subkey_in_list_p, exact_subkey_match_p): Ditto.
(new_subkey_list_item): Ditto. (new_subkey_list_item): Ditto.
* keyid.c (keystr_from_sk, keystr_from_sk_with_sub) * keyid.c (keystr_from_sk, keystr_from_sk_with_sub)
(keyid_from_sk, nbits_from_sk, datestr_from_sk) (keyid_from_sk, nbits_from_sk, datestr_from_sk)
(expirestr_from_sk, colon_datestr_from_sk, fingerprint_from_sk) (expirestr_from_sk, colon_datestr_from_sk, fingerprint_from_sk)
(serialno_and_fpr_from_sk, do_fingerprint_md_sk): Remove. (serialno_and_fpr_from_sk, do_fingerprint_md_sk): Remove.
* import.c (print_import_ok): Remove arg SK. * import.c (print_import_ok): Remove arg SK.
(import_secret_one): Adjust for seckey_info format. (import_secret_one): Adjust for seckey_info format.
(transfer_secret_keys): Ditto. Use gpg_format_keydesc. (transfer_secret_keys): Ditto. Use gpg_format_keydesc.
@ -24,11 +21,9 @@
(auto_create_card_key_stub): Remove - not anymore needed. (auto_create_card_key_stub): Remove - not anymore needed.
(update_sec_keyblock_with_cardinfo): Remove. (update_sec_keyblock_with_cardinfo): Remove.
(import_secret_one): Use arg option instead of the global option. (import_secret_one): Use arg option instead of the global option.
* free-packet.c (copy_public_key): Adjust for seckey_info format. * free-packet.c (copy_public_key): Adjust for seckey_info format.
(copy_public_parts_to_secret_key, copy_secret_key) (copy_public_parts_to_secret_key, copy_secret_key)
(cmp_secret_keys, cmp_public_secret_key): Remove. (cmp_secret_keys, cmp_public_secret_key): Remove.
* passphrase.c (gpg_format_keydesc): Add arg MODE and change all * passphrase.c (gpg_format_keydesc): Add arg MODE and change all
callers. callers.
* keyring.c (keyring_search): Remove special case for secret keys. * keyring.c (keyring_search): Remove special case for secret keys.