diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/ChangeLog | 21 | ||||
-rw-r--r-- | g10/Makefile.am | 2 | ||||
-rw-r--r-- | g10/call-agent.c | 2 | ||||
-rw-r--r-- | g10/gpg.c | 7 | ||||
-rw-r--r-- | g10/gpgv.c | 7 | ||||
-rw-r--r-- | g10/keyserver.c | 4 | ||||
-rw-r--r-- | g10/misc.c | 37 | ||||
-rw-r--r-- | g10/openfile.c | 5 |
8 files changed, 38 insertions, 47 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 17f19a36b..d87d98ec3 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,24 @@ +2007-06-14 Werner Koch <[email protected]> + + * call-agent.c (start_agent): Use gnupg_module_name. + +2007-06-12 Werner Koch <[email protected]> + + * openfile.c (copy_options_file): Use gnupg_datadir. + * misc.c (get_libexecdir): Remove. Changed all callers to use + gnupg_libexecdir. + * gpg.c (check_permissions): Use gnupg_libdir. + + * gpg.c (main): Replace some calls by init_common_subsystems. + * gpgv.c (main): Ditto. + +2007-06-11 Werner Koch <[email protected]> + + * Makefile.am (needed_libs): Use libcommonstd macro. + + * gpgv.c (main) [W32]: Call pth_init. + * gpg.c (main) [W32]: Call pth_init. + 2007-06-08 Werner Koch <[email protected]> * Makefile.am (gpg2_LDADD): Syntax fix. diff --git a/g10/Makefile.am b/g10/Makefile.am index 3313aa6bd..defe80409 100644 --- a/g10/Makefile.am +++ b/g10/Makefile.am @@ -29,7 +29,7 @@ include $(top_srcdir)/am/cmacros.am AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS) -needed_libs = ../common/libcommon.a ../jnlib/libjnlib.a ../gl/libgnu.a +needed_libs = $(libcommon) ../jnlib/libjnlib.a ../gl/libgnu.a bin_PROGRAMS = gpg2 gpgv2 diff --git a/g10/call-agent.c b/g10/call-agent.c index 637669176..f2edfc0f4 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -106,7 +106,7 @@ start_agent (void) } if (!opt.agent_program || !*opt.agent_program) - opt.agent_program = GNUPG_DEFAULT_AGENT; + opt.agent_program = gnupg_module_name (GNUPG_MODULE_NAME_AGENT); if ( !(pgmname = strrchr (opt.agent_program, '/'))) pgmname = opt.agent_program; else @@ -1147,7 +1147,7 @@ check_permissions(const char *path,int item) if(strchr(path,DIRSEP_C)) tmppath=make_filename(path,NULL); else - tmppath=make_filename(GNUPG_LIBDIR,path,NULL); + tmppath=make_filename(gnupg_libdir (),path,NULL); } else tmppath=xstrdup(path); @@ -1814,6 +1814,9 @@ main (int argc, char **argv ) gcry_control (GCRYCTL_DISABLE_INTERNAL_LOCKING); log_set_prefix ("gpg", 1); + /* Make sure that our subsystems are ready. */ + init_common_subsystems (); + /* Check that the libraries are suitable. Do it right here because the option parsing may need services of the library. */ if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) ) @@ -1939,8 +1942,6 @@ main (int argc, char **argv ) assuan_set_assuan_err_source (GPG_ERR_SOURCE_DEFAULT); - set_native_charset (NULL); /* Try to auto set the character set */ - /* Try for a version specific config file first */ if( default_config ) { diff --git a/g10/gpgv.c b/g10/gpgv.c index 6734ee2f7..73f3be09b 100644 --- a/g10/gpgv.c +++ b/g10/gpgv.c @@ -122,8 +122,13 @@ main( int argc, char **argv ) set_strusage (my_strusage); log_set_prefix ("gpgv", 1); + + /* Make sure that our subsystems are ready. */ + init_common_subsystems (); + gnupg_init_signals (0, NULL); i18n_init(); + opt.command_fd = -1; /* no command fd */ opt.pgp2_workarounds = 1; opt.keyserver_options.options|=KEYSERVER_AUTO_KEY_RETRIEVE; @@ -136,8 +141,6 @@ main( int argc, char **argv ) tty_batchmode(1); disable_dotlock(); - set_native_charset (NULL); /* Try to auto set the character set */ - pargs.argc = &argc; pargs.argv = &argv; pargs.flags= 1; /* do not remove the args */ diff --git a/g10/keyserver.c b/g10/keyserver.c index e195e98df..ee11251b9 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -970,7 +970,7 @@ keyserver_spawn(enum ks_action action,strlist_t list,KEYDB_SEARCH_DESC *desc, byte *line=NULL; struct exec_info *spawn; const char *scheme; - const char *libexecdir = get_libexecdir (); + const char *libexecdir = gnupg_libexecdir (); assert(keyserver); @@ -996,7 +996,7 @@ keyserver_spawn(enum ks_action action,strlist_t list,KEYDB_SEARCH_DESC *desc, After some more thinking about this we came to the conclusion that it is better to load the helpers from the directory where the program of this process lives. Fortunately Windows provides - a way to retrieve this and our get_libexecdir function has been + a way to retrieve this and our gnupg_libexecdir function has been modified to return just this. Setting the exec-path is not anymore required. set_exec_path(libexecdir); diff --git a/g10/misc.c b/g10/misc.c index 89ad92643..c743da614 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -1224,43 +1224,6 @@ is_valid_mailbox (const char *name) } -/* 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[MAX_PATH+5]; - - if (!got_dir) - { - char *p; - - if ( !GetModuleFileName ( NULL, dir, MAX_PATH) ) - { - log_debug ("GetModuleFileName failed: %s\n", w32_strerror (0)); - *dir = 0; - } - got_dir = 1; - p = strrchr (dir, DIRSEP_C); - if (p) - *p = 0; - else - { - log_debug ("bad filename `%s' returned for this process\n", dir); - *dir = 0; - } - } - - if (*dir) - return dir; - /* Fallback to the hardwired value. */ -#endif /*HAVE_W32_SYSTEM*/ - - return GNUPG_LIBEXECDIR; -} - /* Similar to access(2), but uses PATH to find the file. */ int path_access(const char *file,int mode) diff --git a/g10/openfile.c b/g10/openfile.c index 008752fb8..095aad9f4 100644 --- a/g10/openfile.c +++ b/g10/openfile.c @@ -330,7 +330,7 @@ open_sigfile( const char *iname, progress_filter_context_t *pfx ) static void copy_options_file( const char *destdir ) { - const char *datadir = GNUPG_DATADIR; + const char *datadir = gnupg_datadir (); char *fname; FILE *src, *dst; int linefeeds=0; @@ -407,6 +407,9 @@ void try_make_homedir( const char *fname ) { const char *defhome = GNUPG_DEFAULT_HOMEDIR; +#ifdef HAVE_W32_SYSTEM +#warning use a function and not a constant +#endif /* Create the directory only if the supplied directory name * is the same as the default one. This way we avoid to create |