diff options
author | Werner Koch <[email protected]> | 2014-03-13 13:24:14 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-03-13 13:24:14 +0000 |
commit | 766355b5d4f63261c428531fdbdafb8b67de9369 (patch) | |
tree | 8a63f519a71d83aee42993ff1f4c5f01db4a0d04 /src/posix-util.c | |
parent | Avoid pointer arithmetic on void pointer. (diff) | |
download | gpgme-766355b5d4f63261c428531fdbdafb8b67de9369.tar.gz gpgme-766355b5d4f63261c428531fdbdafb8b67de9369.zip |
Add configure option --enable-fixed-path.
* configure.ac: Add option --enable-fixed-path.
(FIXED_SEARCH_PATH): New ac_define.
* src/posix-util.c (walk_path): Make use of the option. Remove
current directory from fallback PATH.
--
Note that using this option PATH is entirely ignored by GPGME and only
the given value is used instead to locate the GnuPG binaries.
On Android the use of PATH is not desirable. Instead the GnuPG tools
are expected in a fixed directory. By using
./configure --enable-fixed-path="/foo/bar"
gpg et al are expected to be installed as /foo/bar/gpg. With
./configure --enable-fixed-path="/foo/bar:/bin"
gpg is expected as /foo/bar/gpg or /bin/gpg.
Diffstat (limited to 'src/posix-util.c')
-rw-r--r-- | src/posix-util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/posix-util.c b/src/posix-util.c index 1b92ec17..e78cd771 100644 --- a/src/posix-util.c +++ b/src/posix-util.c @@ -78,9 +78,13 @@ walk_path (const char *pgm) const char *orig_path, *path, *s; char *fname, *p; +#ifdef FIXED_SEARCH_PATH + orig_path = FIXED_SEARCH_PATH; +#else orig_path = getenv ("PATH"); if (!orig_path) - orig_path = "/bin:/usr/bin:."; + orig_path = "/bin:/usr/bin"; +#endif fname = malloc (strlen (orig_path) + 1 + strlen (pgm) + 1); if (!fname) |