diff --git a/cipher/rand-internal.h b/cipher/rand-internal.h index c1d7db960..8a1aecc3b 100644 --- a/cipher/rand-internal.h +++ b/cipher/rand-internal.h @@ -23,6 +23,8 @@ int rndunix_gather_random (void (*add)(const void*, size_t, int), int requester, size_t length, int level); int rndlinux_gather_random (void (*add)(const void*, size_t, int), int requester, size_t length, int level); +int rndvms_gather_random (void (*add)(const void*, size_t, int), + int requester, size_t length, int level); int rndegd_connect_socket (int nofail); int rndegd_gather_random (void (*add)(const void*, size_t, int), int requester, size_t length, int level ); diff --git a/configure.ac b/configure.ac index 8639fc90b..4a4da6f62 100644 --- a/configure.ac +++ b/configure.ac @@ -470,7 +470,7 @@ is intended for making fat binary builds on OS X. */ # define GNUPG_HOMEDIR "c:\\\\gnupg" #else # ifdef __VMS -# define GNUPG_HOMEDIR "/SYS\$LOGIN/gnupg" +# define GNUPG_HOMEDIR "/SYS$LOGIN/gnupg" # else # define GNUPG_HOMEDIR "~/.gnupg" # endif diff --git a/g10/ChangeLog b/g10/ChangeLog index 8085c097d..0e14379dd 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,12 +1,9 @@ -2010-09-28 Werner Koch - - * gpgv.c (ttyfp_is, init_ttyfp) [__VMS]: Add subs. - 2010-09-28 Steven M. Schweda (wk) Changes to help the VMS port. See http://antinode.info/dec/sw/gnupg.html . + * gpgv.c (ttyfp_is, init_ttyfp) [__VMS]: Add stubs. * build-packet.c (do_plaintext) [__VMS]: Disable error message. * keyserver.c (keyserver_spawn) [__VMS]: Do not add the DIRSEP_S. * misc.c [__VMS]: Include . diff --git a/g10/openfile.c b/g10/openfile.c index 0ac5965cd..73fd5db33 100644 --- a/g10/openfile.c +++ b/g10/openfile.c @@ -248,8 +248,13 @@ open_outfile( const char *iname, int mode, IOBUF *a ) #endif /* USE_ONLY_8DOT3 */ { buf = xmalloc(strlen(iname)+4+1); +#ifdef __VMS + vms_append_ext (buf, iname, + mode==1 ? "asc" : mode==2 ? "sig" : "gpg"); +#else /*!def __VMS*/ strcpy(stpcpy(buf,iname), mode==1 ? EXTSEP_S "asc" : mode==2 ? EXTSEP_S "sig" : EXTSEP_S "gpg"); +#endif /*!def __VMS*/ } name = buf; } @@ -435,6 +440,15 @@ try_make_homedir( const char *fname ) fname, strerror(errno) ); else if( !opt.quiet ) log_info( _("directory `%s' created\n"), fname ); + +#ifdef __VMS + /* Explicitly remove group and world (other) access, which may + be allowed by default. */ + if (chmod (fname, S_IRWXU )) + log_fatal ("can't set protection on directory `%s': %s\n", + fname, strerror (errno)); +#endif /*def __VMS*/ + copy_options_file( fname ); /* log_info(_("you have to start GnuPG again, " */ /* "so it can read the new configuration file\n") ); */ diff --git a/g10/passphrase.c b/g10/passphrase.c index c93cde64d..3bd159e22 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -25,9 +25,11 @@ #include #include #include -#if !defined(HAVE_DOSISH_SYSTEM) && !defined(__riscos__) -#include -#include +#ifdef ENABLE_AGENT_SUPPORT +# if !defined(HAVE_DOSISH_SYSTEM) && !defined(__riscos__) +# include +# include +# endif #endif #if defined (_WIN32) #include diff --git a/g10/signal.c b/g10/signal.c index cd24dc0c8..4aaa11eaa 100644 --- a/g10/signal.c +++ b/g10/signal.c @@ -38,6 +38,10 @@ #include "main.h" #include "ttyio.h" +#ifdef __VMS +# include "vms.h" +#endif /* __VMS */ + #ifdef HAVE_DOSISH_SYSTEM void init_signals(void) {} void pause_on_sigusr(int which) {} @@ -110,6 +114,12 @@ got_fatal_signal( int sig ) #endif write(2, " caught ... exiting\n", 20 ); +#ifdef __VMS + /* 2006-08-10 SMS. + Restore terminal echo, if needed, before exiting. */ + vms_set_term_echo (-1); +#endif /* def __VMS */ + /* Reset action to default action and raise signal again. */ init_one_signal (sig, SIG_DFL, 0); remove_lockfiles (); diff --git a/util/cert.c b/util/cert.c index 8bc924468..0eaead586 100644 --- a/util/cert.c +++ b/util/cert.c @@ -37,7 +37,10 @@ /* Not every installation has gotten around to supporting CERTs yet... */ #ifndef T_CERT -#define T_CERT 37 +# define T_CERT 37 +# ifdef __VMS +# include "cert_vms.h" +# endif /* def __VMS */ #endif #ifdef USE_DNS_CERT diff --git a/util/logger.c b/util/logger.c index 745344443..d63161196 100644 --- a/util/logger.c +++ b/util/logger.c @@ -123,6 +123,28 @@ log_set_strict(int val) void g10_log_print_prefix(const char *text) { +#ifdef __VMS + /* 2006-08-10 SMS. + VMS terminal carriage control differs from that on UNIX, and one + result is overwritten messages when terminal output is done + through multiple file pointers (like logfp and ttyfp), even when + they both are connected to the same terminal. The accomodation + attempted here is to initialize ttyfp before logfp, and if stderr + and ttyfp are both terminals (presumably the same one), to set an + unset logfp to ttyfp instead of to stderr. */ + if (!logfp ) + { + FILE *ttyfp_local; + + init_ttyfp(); + ttyfp_local = ttyfp_is (); + if (isatty (fileno (stderr)) && isatty (fileno (ttyfp_local))) + { + logfp = ttyfp_local; + } + } +#endif /* def __VMS */ + if( !logfp ) logfp = stderr; if( pgm_name ) diff --git a/util/secmem.c b/util/secmem.c index f54c3a5b4..88af07fde 100644 --- a/util/secmem.c +++ b/util/secmem.c @@ -189,7 +189,11 @@ lock_pool( void *p, size_t n ) && errno != ENOMEM #endif ) - log_error("can't lock memory: %s\n", strerror(err)); +#ifdef __VMS + log_warning ("can't lock memory: %s\n", strerror(err)); +#else + log_error ("can't lock memory: %s\n", strerror(err)); +#endif show_warning = 1; } diff --git a/util/srv.c b/util/srv.c index 1e23887ca..81df9f575 100644 --- a/util/srv.c +++ b/util/srv.c @@ -36,7 +36,10 @@ /* Not every installation has gotten around to supporting SRVs yet... */ #ifndef T_SRV -#define T_SRV 33 +# define T_SRV 33 +# ifdef __VMS +# include "cert_vms.h" +# endif /* def __VMS */ #endif static int