mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
More W32 related changes
This commit is contained in:
parent
831cd76256
commit
a7fe86bc02
25 changed files with 392 additions and 181 deletions
|
@ -1,8 +1,13 @@
|
|||
2007-06-26 Werner Koch <wk@g10code.com>
|
||||
|
||||
* openfile.c (try_make_homedir): Support W32; use standard_homedir.
|
||||
|
||||
2007-06-25 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpg.c (main): Replace iobuf_translate_file_handle by
|
||||
* gpg.c, gpgv.c: Include sysutils.h.
|
||||
(main): Replace iobuf_translate_file_handle by
|
||||
translate_sys2libc_fd.
|
||||
* gpgv.c (main): Ditto.
|
||||
|
||||
|
||||
2007-06-21 Werner Koch <wk@g10code.com>
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "filter.h"
|
||||
#include "ttyio.h"
|
||||
#include "i18n.h"
|
||||
#include "sysutils.h"
|
||||
#include "status.h"
|
||||
#include "keyserver-internal.h"
|
||||
#include "exec.h"
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "filter.h"
|
||||
#include "ttyio.h"
|
||||
#include "i18n.h"
|
||||
#include "sysutils.h"
|
||||
#include "status.h"
|
||||
#include "call-agent.h"
|
||||
|
||||
|
|
|
@ -404,37 +404,35 @@ copy_options_file( const char *destdir )
|
|||
|
||||
|
||||
void
|
||||
try_make_homedir( const char *fname )
|
||||
try_make_homedir (const char *fname)
|
||||
{
|
||||
const char *defhome = GNUPG_DEFAULT_HOMEDIR;
|
||||
const char *defhome = standard_homedir ();
|
||||
|
||||
/* Create the directory only if the supplied directory name is the
|
||||
same as the default one. This way we avoid to create arbitrary
|
||||
directories when a non-default home directory is used. To cope
|
||||
with HOME, we do compare only the suffix if we see that the
|
||||
default homedir does start with a tilde. */
|
||||
if ( opt.dry_run || opt.no_homedir_creation )
|
||||
return;
|
||||
|
||||
if (
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
#warning use a function and not a constant
|
||||
( !compare_filenames (fname, defhome) )
|
||||
#else
|
||||
( *defhome == '~'
|
||||
&& (strlen(fname) >= strlen (defhome+1)
|
||||
&& !strcmp(fname+strlen(fname)-strlen(defhome+1), defhome+1 ) ))
|
||||
|| (*defhome != '~' && !compare_filenames( fname, defhome ) )
|
||||
#endif
|
||||
|
||||
/* Create the directory only if the supplied directory name
|
||||
* is the same as the default one. This way we avoid to create
|
||||
* arbitrary directories when a non-default homedirectory is used.
|
||||
* To cope with HOME, we do compare only the suffix if we see that
|
||||
* the default homedir does start with a tilde.
|
||||
*/
|
||||
if( opt.dry_run || opt.no_homedir_creation )
|
||||
return;
|
||||
|
||||
if ( ( *defhome == '~'
|
||||
&& ( strlen(fname) >= strlen (defhome+1)
|
||||
&& !strcmp(fname+strlen(fname)-strlen(defhome+1),
|
||||
defhome+1 ) ))
|
||||
|| ( *defhome != '~'
|
||||
&& !compare_filenames( fname, defhome ) )
|
||||
) {
|
||||
if( mkdir( fname, S_IRUSR|S_IWUSR|S_IXUSR ) )
|
||||
log_fatal( _("can't create directory `%s': %s\n"),
|
||||
fname, strerror(errno) );
|
||||
else if( !opt.quiet )
|
||||
log_info( _("directory `%s' created\n"), fname );
|
||||
copy_options_file( fname );
|
||||
/* log_info(_("you have to start GnuPG again, " */
|
||||
/* "so it can read the new configuration file\n") ); */
|
||||
/* g10_exit(1); */
|
||||
)
|
||||
{
|
||||
if ( mkdir (fname, S_IRUSR|S_IWUSR|S_IXUSR) )
|
||||
log_fatal ( _("can't create directory `%s': %s\n"),
|
||||
fname, strerror(errno) );
|
||||
else if (!opt.quiet )
|
||||
log_info ( _("directory `%s' created\n"), fname );
|
||||
copy_options_file( fname );
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue