mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
Minor changes to help the VMS port
This commit is contained in:
parent
9921fb3a8c
commit
aa29ba1689
4
AUTHORS
4
AUTHORS
@ -131,6 +131,10 @@ The files cipher/rndunix.c and cipher/rndw32.c are based on rndunix.c
|
|||||||
and rndwin32.c from cryptlib.
|
and rndwin32.c from cryptlib.
|
||||||
Copyright Peter Gutmann, Paul Kendall, and Chris Wedgwood 1996-1999.
|
Copyright Peter Gutmann, Paul Kendall, and Chris Wedgwood 1996-1999.
|
||||||
|
|
||||||
|
The code to help with the VMS port (indicated by __VMS and
|
||||||
|
corresponding Changelog entries) was contributed by Steven M. Schweda.
|
||||||
|
<sms at antinode dot info>.
|
||||||
|
|
||||||
The RPM specs file scripts/gnupg.spec has been contributed by
|
The RPM specs file scripts/gnupg.spec has been contributed by
|
||||||
several people.
|
several people.
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2010-09-28 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* configure.ac (AH_BOTTOM) [__VMS]: Fix homedir.
|
||||||
|
|
||||||
2010-09-23 Werner Koch <wk@g10code.com>
|
2010-09-23 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
Release 1.4.11rc1.
|
Release 1.4.11rc1.
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
2010-09-28 Steven M. Schweda <sms@antinode.info> (wk)
|
||||||
|
|
||||||
|
Changes to help the VMS port. See
|
||||||
|
http://antinode.info/dec/sw/gnupg.html .
|
||||||
|
|
||||||
|
* random.c [__VMS]: Include rmsdef.h and vms.h.
|
||||||
|
(LOCK_SEED_FILE) [__VMS]: Set to 0.
|
||||||
|
(getfnc_gather_random) [USE_RNDVMS]: Call rndvms_gather_random.
|
||||||
|
(read_seed_file) [__VMS]: Allow reading by others.
|
||||||
|
(update_random_seed_file) [__VMS]: Use VMS specific open call.
|
||||||
|
* rand-internal.h (rndvms_gather_random): New.
|
||||||
|
|
||||||
2008-04-17 David Shaw <dshaw@jabberwocky.com>
|
2008-04-17 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* camellia-glue.c (selftest, camellia_get_info), cipher.c
|
* camellia-glue.c (selftest, camellia_get_info), cipher.c
|
||||||
|
@ -63,13 +63,23 @@
|
|||||||
#include "rand-internal.h"
|
#include "rand-internal.h"
|
||||||
#include "algorithms.h"
|
#include "algorithms.h"
|
||||||
|
|
||||||
|
#ifdef __VMS
|
||||||
|
# include <rmsdef.h>
|
||||||
|
# include "vms.h"
|
||||||
|
#endif /* def __VMS */
|
||||||
|
|
||||||
#ifndef RAND_MAX /* for SunOS */
|
#ifndef RAND_MAX /* for SunOS */
|
||||||
#define RAND_MAX 32767
|
#define RAND_MAX 32767
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* 2008-03-31 SMS.
|
||||||
|
* VMS C RTL before V8.3 lacks byte-range file locking, but by default,
|
||||||
|
* a file opened for write access is not shared, so mutual exclusion can
|
||||||
|
* most generally be handled at the open(). */
|
||||||
|
|
||||||
/* Check whether we can lock the seed file read write. */
|
/* Check whether we can lock the seed file read write. */
|
||||||
#if defined(HAVE_FCNTL) && defined(HAVE_FTRUNCATE) && !defined(HAVE_W32_SYSTEM)
|
#if defined(HAVE_FCNTL) && defined(HAVE_FTRUNCATE) \
|
||||||
|
&& !defined(HAVE_W32_SYSTEM) && !defined(__VMS)
|
||||||
#define LOCK_SEED_FILE 1
|
#define LOCK_SEED_FILE 1
|
||||||
#else
|
#else
|
||||||
#define LOCK_SEED_FILE 0
|
#define LOCK_SEED_FILE 0
|
||||||
@ -177,6 +187,9 @@ getfnc_gather_random (void))(void (*)(const void*, size_t, int), int,
|
|||||||
# ifdef USE_RNDUNIX
|
# ifdef USE_RNDUNIX
|
||||||
return rndunix_gather_random;
|
return rndunix_gather_random;
|
||||||
# endif
|
# endif
|
||||||
|
# ifdef USE_RNDVMS
|
||||||
|
return rndvms_gather_random;
|
||||||
|
# endif
|
||||||
# ifdef USE_RNDEGD
|
# ifdef USE_RNDEGD
|
||||||
return rndegd_gather_random;
|
return rndegd_gather_random;
|
||||||
# endif
|
# endif
|
||||||
@ -402,7 +415,7 @@ lock_seed_file (int fd, const char *fname, int for_write)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backoff > 2) /* Show the first message after ~2.25 seconds. */
|
if (backoff > 2) /* Show the first message after ~3.75 seconds. */
|
||||||
log_info( _("waiting for lock on `%s'...\n"), fname);
|
log_info( _("waiting for lock on `%s'...\n"), fname);
|
||||||
|
|
||||||
tv.tv_sec = backoff;
|
tv.tv_sec = backoff;
|
||||||
@ -434,6 +447,9 @@ read_seed_file(void)
|
|||||||
|
|
||||||
#if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
|
#if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
|
||||||
fd = open( seed_file_name, O_RDONLY | O_BINARY );
|
fd = open( seed_file_name, O_RDONLY | O_BINARY );
|
||||||
|
#elif defined( __VMS)
|
||||||
|
/* We're only reading, so allow others to do anything. */
|
||||||
|
fd = open( seed_file_name, O_RDONLY, 0777, "shr=get,put,upd" );
|
||||||
#else
|
#else
|
||||||
fd = open( seed_file_name, O_RDONLY );
|
fd = open( seed_file_name, O_RDONLY );
|
||||||
#endif
|
#endif
|
||||||
@ -535,11 +551,40 @@ update_random_seed_file()
|
|||||||
# if LOCK_SEED_FILE
|
# if LOCK_SEED_FILE
|
||||||
fd = open( seed_file_name, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR );
|
fd = open( seed_file_name, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR );
|
||||||
# else
|
# else
|
||||||
|
# ifdef __VMS
|
||||||
|
/* Open the seed file for exclusive write access, but allow other
|
||||||
|
* readers. Loop until success. Complain after a few failures. */
|
||||||
|
{
|
||||||
|
int backoff = 0;
|
||||||
|
|
||||||
|
while ((fd = open( seed_file_name,
|
||||||
|
O_WRONLY|O_CREAT,
|
||||||
|
S_IRUSR|S_IWUSR,
|
||||||
|
"shr=get")) == -1 )
|
||||||
|
{
|
||||||
|
if ((errno != EVMSERR) || (vaxc$errno != RMS$_FLK))
|
||||||
|
{
|
||||||
|
/* Some unexpected open failure. */
|
||||||
|
log_info (_("can't lock `%s': %s\n"),
|
||||||
|
seed_file_name, strerror (errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (backoff > 2) /* Show the first message after ~3.75 seconds. */
|
||||||
|
log_info( _("waiting for lock on `%s'...\n"), seed_file_name);
|
||||||
|
|
||||||
|
wait_vms( backoff+ 0.25);
|
||||||
|
if (backoff < 10)
|
||||||
|
backoff++ ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# else /* !def __VMS */
|
||||||
fd = open( seed_file_name, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR );
|
fd = open( seed_file_name, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR );
|
||||||
|
# endif /* !def __VMS */
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
if( fd == -1 ) {
|
if( fd == -1 ) {
|
||||||
log_info(_("can't create `%s': %s\n"), seed_file_name, strerror(errno) );
|
log_info(_("can't create `%s': %s\n"), seed_file_name, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,29 @@
|
|||||||
|
2010-09-28 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpgv.c (ttyfp_is, init_ttyfp) [__VMS]: Add subs.
|
||||||
|
|
||||||
|
2010-09-28 Steven M. Schweda <sms@antinode.info> (wk)
|
||||||
|
|
||||||
|
Changes to help the VMS port. See
|
||||||
|
http://antinode.info/dec/sw/gnupg.html .
|
||||||
|
|
||||||
|
* build-packet.c (do_plaintext) [__VMS]: Disable error message.
|
||||||
|
* keyserver.c (keyserver_spawn) [__VMS]: Do not add the DIRSEP_S.
|
||||||
|
* misc.c [__VMS]: Include <time.h>.
|
||||||
|
* signal.c [__VMS]: Include vms.h.
|
||||||
|
(got_fatal_signal) [__VMS]: Restore terminal echo.
|
||||||
|
* plaintext.c [__VMS]: Include vms.h.
|
||||||
|
* openfile.c (make_outfile_name): __VMS] Do not use.
|
||||||
|
(open_outfile) [__VMS]: Use vms_append_ext.
|
||||||
|
(try_make_homedir) [__VMS]: chmod directory.
|
||||||
|
* misc.c (disable_core_dumps) [__VMS]: Disable.
|
||||||
|
(path_access) [__VMS]: Do not use.
|
||||||
|
|
||||||
|
2010-09-28 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* passphrase.c [!ENABLE_AGENT_SUPPORT]: Do not include
|
||||||
|
sys/socket.h to help the VMS port.
|
||||||
|
|
||||||
2010-08-31 Werner Koch <wk@g10code.com>
|
2010-08-31 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* mainproc.c (print_pkenc_list): Print a STATUS_ERROR. Fixes
|
* mainproc.c (print_pkenc_list): Print a STATUS_ERROR. Fixes
|
||||||
|
@ -491,9 +491,14 @@ do_plaintext( IOBUF out, int ctb, PKT_plaintext *pt )
|
|||||||
wipememory(buf,1000); /* burn the buffer */
|
wipememory(buf,1000); /* burn the buffer */
|
||||||
if( (ctb&0x40) && !pt->len )
|
if( (ctb&0x40) && !pt->len )
|
||||||
iobuf_set_partial_block_mode(out, 0 ); /* turn off partial */
|
iobuf_set_partial_block_mode(out, 0 ); /* turn off partial */
|
||||||
|
|
||||||
|
/* On VMS, byte counts will not match for some file record
|
||||||
|
* formats, so it's best to disable the following error. */
|
||||||
|
#ifndef __VMS
|
||||||
if( pt->len && n != pt->len )
|
if( pt->len && n != pt->len )
|
||||||
log_error("do_plaintext(): wrote %lu bytes but expected %lu bytes\n",
|
log_error("do_plaintext(): wrote %lu bytes but expected %lu bytes\n",
|
||||||
(ulong)n, (ulong)pt->len );
|
(ulong)n, (ulong)pt->len );
|
||||||
|
#endif
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -418,6 +418,10 @@ void tty_kill_prompt(void) {}
|
|||||||
int tty_get_answer_is_yes( const char *prompt ) {return 0;}
|
int tty_get_answer_is_yes( const char *prompt ) {return 0;}
|
||||||
int tty_no_terminal(int onoff) {return 0;}
|
int tty_no_terminal(int onoff) {return 0;}
|
||||||
void tty_cleanup_after_signal (void) {}
|
void tty_cleanup_after_signal (void) {}
|
||||||
|
#ifdef __VMS
|
||||||
|
FILE *ttyfp_is (void) { return stderr; }
|
||||||
|
void init_ttyfp (void) { }
|
||||||
|
#endif /*__VMS*/
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
void tty_enable_completion(rl_completion_func_t *completer) {}
|
void tty_enable_completion(rl_completion_func_t *completer) {}
|
||||||
void tty_disable_completion(void) {}
|
void tty_disable_completion(void) {}
|
||||||
|
@ -1012,7 +1012,9 @@ keyserver_spawn(enum ks_action action,STRLIST list,KEYDB_SEARCH_DESC *desc,
|
|||||||
command=xmalloc(strlen(libexecdir)+strlen(DIRSEP_S)+
|
command=xmalloc(strlen(libexecdir)+strlen(DIRSEP_S)+
|
||||||
GPGKEYS_PREFIX_LEN+strlen(scheme)+3+strlen(EXEEXT)+1);
|
GPGKEYS_PREFIX_LEN+strlen(scheme)+3+strlen(EXEEXT)+1);
|
||||||
strcpy(command,libexecdir);
|
strcpy(command,libexecdir);
|
||||||
strcat(command,DIRSEP_S);
|
#ifndef __VMS
|
||||||
|
strcat (command, DIRSEP_S);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
end=command+strlen(command);
|
end=command+strlen(command);
|
||||||
|
14
g10/misc.c
14
g10/misc.c
@ -54,6 +54,10 @@
|
|||||||
#include "dynload.h"
|
#include "dynload.h"
|
||||||
#endif /*_WIN32*/
|
#endif /*_WIN32*/
|
||||||
|
|
||||||
|
#ifdef __VMS
|
||||||
|
# include <time.h>
|
||||||
|
#endif /* def __VMS */
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "photoid.h"
|
#include "photoid.h"
|
||||||
@ -106,7 +110,7 @@ trap_unaligned(void)
|
|||||||
int
|
int
|
||||||
disable_core_dumps()
|
disable_core_dumps()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DOSISH_SYSTEM
|
#if defined(HAVE_DOSISH_SYSTEM) || defined(__VMS)
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SETRLIMIT
|
#ifdef HAVE_SETRLIMIT
|
||||||
@ -1333,7 +1337,11 @@ get_libexecdir (void)
|
|||||||
return GNUPG_LIBEXECDIR;
|
return GNUPG_LIBEXECDIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Similar to access(2), but uses PATH to find the file. */
|
/* Similar to access(2), but uses PATH to find the file.
|
||||||
|
|
||||||
|
(2006-07-08 SMS: See "vmslib/vms.c" for a VMS-specific replacement
|
||||||
|
function) */
|
||||||
|
#ifndef __VMS
|
||||||
int
|
int
|
||||||
path_access(const char *file,int mode)
|
path_access(const char *file,int mode)
|
||||||
{
|
{
|
||||||
@ -1376,3 +1384,5 @@ path_access(const char *file,int mode)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif /*ndef __VMS*/
|
||||||
|
|
||||||
|
@ -98,7 +98,11 @@ overwrite_filep( const char *fname )
|
|||||||
/****************
|
/****************
|
||||||
* Strip know extensions from iname and return a newly allocated
|
* Strip know extensions from iname and return a newly allocated
|
||||||
* filename. Return NULL if we can't do that.
|
* filename. Return NULL if we can't do that.
|
||||||
|
*
|
||||||
|
* (See vmslib/vms.c for the VMS-specific replacement function,
|
||||||
|
* vms_make_outfile_name())
|
||||||
*/
|
*/
|
||||||
|
#ifndef __VMS
|
||||||
char *
|
char *
|
||||||
make_outfile_name( const char *iname )
|
make_outfile_name( const char *iname )
|
||||||
{
|
{
|
||||||
@ -125,6 +129,7 @@ make_outfile_name( const char *iname )
|
|||||||
log_info(_("%s: unknown suffix\n"), iname );
|
log_info(_("%s: unknown suffix\n"), iname );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif /* ndef __VMS */
|
||||||
|
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
|
@ -39,6 +39,13 @@
|
|||||||
#include "status.h"
|
#include "status.h"
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
#ifdef __VMS
|
||||||
|
# include "vms.h" /* Not part of the standard GnuPG tarball. See
|
||||||
|
http://antinode.info/dec/sw/gnupg.html */
|
||||||
|
# define fopen fopen_vms
|
||||||
|
#endif /* def __VMS */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
* Handle a plaintext packet. If MFX is not NULL, update the MDs
|
* Handle a plaintext packet. If MFX is not NULL, update the MDs
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2010-09-28 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* ttyio.h (ttyfp_is, init_ttyfp) [__VMS]: New.
|
||||||
|
|
||||||
2009-09-03 Werner Koch <wk@g10code.com>
|
2009-09-03 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* util.h (xtryvasprintf): New.
|
* util.h (xtryvasprintf): New.
|
||||||
|
@ -43,6 +43,11 @@ void tty_kill_prompt(void);
|
|||||||
int tty_get_answer_is_yes( const char *prompt );
|
int tty_get_answer_is_yes( const char *prompt );
|
||||||
int tty_no_terminal(int onoff);
|
int tty_no_terminal(int onoff);
|
||||||
|
|
||||||
|
#ifdef __VMS
|
||||||
|
FILE *ttyfp_is (void);
|
||||||
|
void init_ttyfp (void);
|
||||||
|
#endif /*__VMS*/
|
||||||
|
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
void tty_enable_completion(rl_completion_func_t *completer);
|
void tty_enable_completion(rl_completion_func_t *completer);
|
||||||
void tty_disable_completion(void);
|
void tty_disable_completion(void);
|
||||||
|
@ -46,7 +46,7 @@ if [ "$1" = "--build-number" -a -n "$2" ]; then
|
|||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
else
|
else
|
||||||
build_number=$(date -u '+%j%k' | sed 's/^0*\(.*\)/\1/')
|
build_number=$(date -u '+%j%H' | sed 's/^0*\(.*\)/\1/')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
2010-09-28 Steven M. Schweda <sms@antinode.info> (wk)
|
||||||
|
|
||||||
|
Changes to help the VMS port. See
|
||||||
|
http://antinode.info/dec/sw/gnupg.html .
|
||||||
|
|
||||||
|
* cert.c [__VMS]: Include cert_vms.h.
|
||||||
|
* ttyio.c [__VMS]: Include vms.h.
|
||||||
|
(init_ttyfp) [__VMS]: Make global.
|
||||||
|
(ttyfp_is) [__VMS]: New.
|
||||||
|
(do_get) [__VMS]: Disable terminal echo.
|
||||||
|
* srv.c [__VMS]: Include cert_vms.h.
|
||||||
|
* secmem.c (lock_pool) [__VMS]: Use log_warning.
|
||||||
|
* pka.c [USE_DNS_PKA]: Define T_CERT.
|
||||||
|
* logger.c [__VMS]: Include unistd.h and ttyio.h.
|
||||||
|
(g10_log_print_prefix) [__VMS]: Init logfp.
|
||||||
|
* iobuf.c [__VMS]: Include vms.h.
|
||||||
|
(iobuf_get_filelength) [__VMS]: Use VMS specific method.
|
||||||
|
|
||||||
2009-09-03 Werner Koch <wk@g10code.com>
|
2009-09-03 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* ttyio.c (tty_printf) [_WIN32]: s/xtryasprintf/xtryvasprint/
|
* ttyio.c (tty_printf) [_WIN32]: s/xtryasprintf/xtryvasprint/
|
||||||
|
22
util/iobuf.c
22
util/iobuf.c
@ -41,6 +41,11 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "dynload.h"
|
#include "dynload.h"
|
||||||
#include "iobuf.h"
|
#include "iobuf.h"
|
||||||
|
|
||||||
|
#ifdef __VMS
|
||||||
|
# include "vms.h"
|
||||||
|
# define open open_vms
|
||||||
|
#endif /* def __VMS */
|
||||||
|
|
||||||
/* The size of the internal buffers.
|
/* The size of the internal buffers.
|
||||||
NOTE: If you change this value you MUST also adjust the regression
|
NOTE: If you change this value you MUST also adjust the regression
|
||||||
@ -1916,13 +1921,24 @@ iobuf_get_filelength (IOBUF a, int *overflow )
|
|||||||
if (overflow)
|
if (overflow)
|
||||||
*overflow = 0;
|
*overflow = 0;
|
||||||
|
|
||||||
if( a->directfp ) {
|
if (a->directfp)
|
||||||
|
{
|
||||||
FILE *fp = a->directfp;
|
FILE *fp = a->directfp;
|
||||||
|
|
||||||
if( !fstat(fileno(fp), &st) )
|
#ifdef __VMS
|
||||||
|
/* 2009-02-19 SMS.
|
||||||
|
* On VMS, use a VMS-specific method to determine file size.
|
||||||
|
* For some non-UNIX-like file formats, the fstat() result
|
||||||
|
* will not agree with the C Standard I/O functions such as
|
||||||
|
* getc() and fread(), so these must be detected and handled
|
||||||
|
* specially. */
|
||||||
|
return vms_file_size (fileno( fp));
|
||||||
|
#else /*!__VMS */
|
||||||
|
if( !fstat(fileno(fp), &st) )
|
||||||
return st.st_size;
|
return st.st_size;
|
||||||
log_error("fstat() failed: %s\n", strerror(errno) );
|
log_error("fstat() failed: %s\n", strerror(errno) );
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif /*!__VMS */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hmmm: file_filter may have already been removed */
|
/* Hmmm: file_filter may have already been removed */
|
||||||
@ -1975,6 +1991,8 @@ iobuf_get_filelength (IOBUF a, int *overflow )
|
|||||||
}
|
}
|
||||||
log_error ("GetFileSize for handle %p failed: %s\n",
|
log_error ("GetFileSize for handle %p failed: %s\n",
|
||||||
fp, w32_strerror (0));
|
fp, w32_strerror (0));
|
||||||
|
#elif defined(__VMS)
|
||||||
|
return vms_file_size (my_fileno (fp));
|
||||||
#else
|
#else
|
||||||
if( !fstat(my_fileno(fp), &st) )
|
if( !fstat(my_fileno(fp), &st) )
|
||||||
return st.st_size;
|
return st.st_size;
|
||||||
|
@ -27,6 +27,11 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
#ifdef __VMS
|
||||||
|
# include <unistd.h>
|
||||||
|
# include "ttyio.h"
|
||||||
|
#endif /* def __VMS */
|
||||||
|
|
||||||
static char pidstring[15];
|
static char pidstring[15];
|
||||||
static char *pgm_name;
|
static char *pgm_name;
|
||||||
static int errorcount;
|
static int errorcount;
|
||||||
|
25
util/pka.c
25
util/pka.c
@ -24,15 +24,22 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef USE_DNS_PKA
|
#ifdef USE_DNS_PKA
|
||||||
#include <sys/types.h>
|
# include <sys/types.h>
|
||||||
#ifdef _WIN32
|
# ifdef _WIN32
|
||||||
#include <windows.h>
|
# include <windows.h>
|
||||||
#else
|
# else
|
||||||
#include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
#include <arpa/nameser.h>
|
# include <arpa/nameser.h>
|
||||||
#include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
#include <resolv.h>
|
# include <resolv.h>
|
||||||
#endif
|
/* Not every installation has gotten around to supporting CERTs yet... */
|
||||||
|
# ifndef T_CERT
|
||||||
|
# define T_CERT 37
|
||||||
|
# ifdef __VMS
|
||||||
|
# include "cert_vms.h"
|
||||||
|
# endif /* def __VMS */
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
#endif /* USE_DNS_PKA */
|
#endif /* USE_DNS_PKA */
|
||||||
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
36
util/ttyio.c
36
util/ttyio.c
@ -50,6 +50,10 @@
|
|||||||
#include <readline/history.h>
|
#include <readline/history.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __VMS
|
||||||
|
# include "vms.h"
|
||||||
|
#endif /* __VMS */
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "ttyio.h"
|
#include "ttyio.h"
|
||||||
@ -130,7 +134,23 @@ tty_cleanup_after_signal (void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
#ifdef __VMS
|
||||||
|
/* 2006-08-10 SMS.
|
||||||
|
Interface function needed for VMS (unless someone
|
||||||
|
wishes to make "ttyfp" global). See g10_log_print_prefix() in
|
||||||
|
util/logger.c. */
|
||||||
|
FILE *
|
||||||
|
ttyfp_is (void)
|
||||||
|
{
|
||||||
|
return ttyfp;
|
||||||
|
}
|
||||||
|
#endif /* def __VMS */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __VMS
|
||||||
|
static
|
||||||
|
#endif
|
||||||
|
void
|
||||||
init_ttyfp(void)
|
init_ttyfp(void)
|
||||||
{
|
{
|
||||||
if( initialized )
|
if( initialized )
|
||||||
@ -507,6 +527,11 @@ do_get( const char *prompt, int hidden )
|
|||||||
if( tcsetattr( fileno(ttyfp), TCSAFLUSH, &term ) )
|
if( tcsetattr( fileno(ttyfp), TCSAFLUSH, &term ) )
|
||||||
log_fatal("tcsetattr() failed: %s\n", strerror(errno) );
|
log_fatal("tcsetattr() failed: %s\n", strerror(errno) );
|
||||||
#endif
|
#endif
|
||||||
|
# ifdef __VMS
|
||||||
|
/* Disable terminal echo. */
|
||||||
|
if (vms_set_term_echo (0))
|
||||||
|
log_fatal ("error disabling terminal echo: %s\n", strerror (errno));
|
||||||
|
# endif /* __VMS */
|
||||||
}
|
}
|
||||||
|
|
||||||
tty_printf( "%s", prompt );
|
tty_printf( "%s", prompt );
|
||||||
@ -539,11 +564,16 @@ do_get( const char *prompt, int hidden )
|
|||||||
|
|
||||||
|
|
||||||
if( hidden ) {
|
if( hidden ) {
|
||||||
#ifdef HAVE_TCGETATTR
|
# ifdef HAVE_TCGETATTR
|
||||||
if( tcsetattr(fileno(ttyfp), TCSAFLUSH, &termsave) )
|
if( tcsetattr(fileno(ttyfp), TCSAFLUSH, &termsave) )
|
||||||
log_error("tcsetattr() failed: %s\n", strerror(errno) );
|
log_error("tcsetattr() failed: %s\n", strerror(errno) );
|
||||||
restore_termios = 0;
|
restore_termios = 0;
|
||||||
#endif
|
# endif
|
||||||
|
# ifdef __VMS
|
||||||
|
/* Restore (most likely enable) terminal echo. */
|
||||||
|
if (vms_set_term_echo( -1))
|
||||||
|
log_fatal ("error enabling terminal echo: %s\n", strerror (errno));
|
||||||
|
# endif /* __VMS */
|
||||||
}
|
}
|
||||||
#endif /* end unix version */
|
#endif /* end unix version */
|
||||||
buf[i] = 0;
|
buf[i] = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user