aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-08-06 13:29:27 +0000
committerWerner Koch <[email protected]>2002-08-06 13:29:27 +0000
commita1259acdcbfb368db72a37381f895b5a9e16b835 (patch)
tree015ff64680fe830d48e44ed3ba6e5fd7b43db3fd
parenttidying up RISC OS stuff (diff)
downloadgnupg-a1259acdcbfb368db72a37381f895b5a9e16b835.tar.gz
gnupg-a1259acdcbfb368db72a37381f895b5a9e16b835.zip
* g10.c (main): Try to use "gpg.conf" as default option file.
* openfile.c (copy_options_file): Changed name of created file.
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/g10.c17
-rw-r--r--g10/openfile.c6
3 files changed, 23 insertions, 5 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 52357d6c3..03daf0fd8 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-06 Werner Koch <[email protected]>
+
+ * g10.c (main): Try to use "gpg.conf" as default option file.
+ * openfile.c (copy_options_file): Changed name of created file.
+
2002-08-02 Werner Koch <[email protected]>
* Makefile.am (LDFLAGS): Removed DYNLINK_LDFLAGS.
diff --git a/g10/g10.c b/g10/g10.c
index 7da518e25..e004015bd 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -979,8 +979,21 @@ main( int argc, char **argv )
/* Okay, we are now working under our real uid */
if( default_config )
- configname = make_filename(opt.homedir, "options", NULL );
-
+ {
+ configname = make_filename(opt.homedir, "gpg.conf", NULL );
+ if (!access (configname, R_OK))
+ { /* Print a warning when both config files are present. */
+ char *p = make_filename(opt.homedir, "options", NULL );
+ if (!access (p, R_OK))
+ log_info (_("NOTE: old default options file `%s' ignored\n"), p);
+ m_free (p);
+ }
+ else
+ { /* Keep on using the old default one. */
+ m_free (configname);
+ configname = make_filename(opt.homedir, "options", NULL );
+ }
+ }
argc = orig_argc;
argv = orig_argv;
pargs.argc = &argc;
diff --git a/g10/openfile.c b/g10/openfile.c
index 1bc4cf04c..84e600cbf 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -301,7 +301,7 @@ copy_options_file( const char *destdir )
m_free(fname);
return;
}
- strcpy(stpcpy(fname, destdir), DIRSEP_S "options" );
+ strcpy(stpcpy(fname, destdir), DIRSEP_S "gpg.conf" );
dst = fopen( fname, "w" );
if( !dst ) {
log_error(_("%s: can't create: %s\n"), fname, strerror(errno) );
@@ -320,7 +320,7 @@ copy_options_file( const char *destdir )
}
fclose( dst );
fclose( src );
- log_info(_("%s: new options file created\n"), fname );
+ log_info(_("new configuration file `%s' created\n"), fname );
m_free(fname);
}
@@ -353,7 +353,7 @@ try_make_homedir( const char *fname )
log_info( _("%s: directory created\n"), fname );
copy_options_file( fname );
log_info(_("you have to start GnuPG again, "
- "so it can read the new options file\n") );
+ "so it can read the new configuration file\n") );
g10_exit(1);
}
}