mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
* passphrase.c (agent_send_all_options): Make use of $GPG_TTY.
* g10.c (main): Disable use-agent if passphrase-fd is given later. Suggested by Kurt Garloff. * exec.c, g10.c, gpgv.c, passphrase.c, photoid.c: s/__MINGW32__/_WIN32/ to help building on native Windows compilers. Requested by Brian Gladman. From Werner on stable branch.
This commit is contained in:
parent
6eb9d6297f
commit
17e67cd29b
@ -1,3 +1,15 @@
|
|||||||
|
2003-08-28 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* passphrase.c (agent_send_all_options): Make use of $GPG_TTY.
|
||||||
|
|
||||||
|
* g10.c (main): Disable use-agent if passphrase-fd is given
|
||||||
|
later. Suggested by Kurt Garloff.
|
||||||
|
|
||||||
|
* exec.c, g10.c, gpgv.c, passphrase.c, photoid.c:
|
||||||
|
s/__MINGW32__/_WIN32/ to help building on native Windows
|
||||||
|
compilers. Requested by Brian Gladman. From Werner on stable
|
||||||
|
branch.
|
||||||
|
|
||||||
2003-08-25 David Shaw <dshaw@jabberwocky.com>
|
2003-08-25 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* options.h, g10.c (main): Add list-option
|
* options.h, g10.c (main): Add list-option
|
||||||
|
10
g10/exec.c
10
g10/exec.c
@ -1,5 +1,5 @@
|
|||||||
/* exec.c - generic call-a-program code
|
/* exec.c - generic call-a-program code
|
||||||
* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -59,7 +59,7 @@ int set_exec_path(const char *path,int method) { return G10ERR_GENERAL; }
|
|||||||
char *mkdtemp(char *template);
|
char *mkdtemp(char *template);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
/* This is a nicer system() for windows that waits for programs to
|
/* This is a nicer system() for windows that waits for programs to
|
||||||
return before returning control to the caller. I hate helpful
|
return before returning control to the caller. I hate helpful
|
||||||
computers. */
|
computers. */
|
||||||
@ -139,7 +139,7 @@ static int make_tempdir(struct exec_info *info)
|
|||||||
|
|
||||||
if(tmp==NULL)
|
if(tmp==NULL)
|
||||||
{
|
{
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
tmp=m_alloc(256);
|
tmp=m_alloc(256);
|
||||||
if(GetTempPath(256,tmp)==0)
|
if(GetTempPath(256,tmp)==0)
|
||||||
strcpy(tmp,"c:\\windows\\temp");
|
strcpy(tmp,"c:\\windows\\temp");
|
||||||
@ -176,7 +176,7 @@ static int make_tempdir(struct exec_info *info)
|
|||||||
|
|
||||||
sprintf(info->tempdir,"%s" DIRSEP_S "gpg-XXXXXX",tmp);
|
sprintf(info->tempdir,"%s" DIRSEP_S "gpg-XXXXXX",tmp);
|
||||||
|
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
m_free(tmp);
|
m_free(tmp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -502,7 +502,7 @@ int exec_read(struct exec_info *info)
|
|||||||
if(DBG_EXTPROG)
|
if(DBG_EXTPROG)
|
||||||
log_debug("system() command is %s\n",info->command);
|
log_debug("system() command is %s\n",info->command);
|
||||||
|
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
info->progreturn=win_system(info->command);
|
info->progreturn=win_system(info->command);
|
||||||
#else
|
#else
|
||||||
info->progreturn=system(info->command);
|
info->progreturn=system(info->command);
|
||||||
|
@ -1186,8 +1186,7 @@ main( int argc, char **argv )
|
|||||||
VERIFY_SHOW_POLICY|VERIFY_SHOW_NOTATION|VERIFY_SHOW_KEYSERVER;
|
VERIFY_SHOW_POLICY|VERIFY_SHOW_NOTATION|VERIFY_SHOW_KEYSERVER;
|
||||||
opt.trust_model=TM_AUTO;
|
opt.trust_model=TM_AUTO;
|
||||||
opt.mangle_dos_filenames = 1;
|
opt.mangle_dos_filenames = 1;
|
||||||
|
#if defined (_WIN32)
|
||||||
#if defined (__MINGW32__)
|
|
||||||
set_homedir ( read_w32_registry_string( NULL,
|
set_homedir ( read_w32_registry_string( NULL,
|
||||||
"Software\\GNU\\GnuPG", "HomeDir" ));
|
"Software\\GNU\\GnuPG", "HomeDir" ));
|
||||||
#else
|
#else
|
||||||
@ -1530,7 +1529,7 @@ main( int argc, char **argv )
|
|||||||
break;
|
break;
|
||||||
case oLoadExtension:
|
case oLoadExtension:
|
||||||
#ifndef __riscos__
|
#ifndef __riscos__
|
||||||
#if defined(USE_DYNAMIC_LINKING) || defined(__MINGW32__)
|
#if defined(USE_DYNAMIC_LINKING) || defined(_WIN32)
|
||||||
if(check_permissions(pargs.r.ret_str,2))
|
if(check_permissions(pargs.r.ret_str,2))
|
||||||
log_info(_("cipher extension \"%s\" not loaded due to "
|
log_info(_("cipher extension \"%s\" not loaded due to "
|
||||||
"unsafe permissions\n"),pargs.r.ret_str);
|
"unsafe permissions\n"),pargs.r.ret_str);
|
||||||
@ -1665,6 +1664,7 @@ main( int argc, char **argv )
|
|||||||
case oCompress: opt.compress = pargs.r.ret_int; break;
|
case oCompress: opt.compress = pargs.r.ret_int; break;
|
||||||
case oPasswdFD:
|
case oPasswdFD:
|
||||||
pwfd = iobuf_translate_file_handle (pargs.r.ret_int, 0);
|
pwfd = iobuf_translate_file_handle (pargs.r.ret_int, 0);
|
||||||
|
opt.use_agent = 0;
|
||||||
break;
|
break;
|
||||||
#ifdef __riscos__
|
#ifdef __riscos__
|
||||||
case oPasswdFile:
|
case oPasswdFile:
|
||||||
|
@ -153,7 +153,7 @@ main( int argc, char **argv )
|
|||||||
opt.trust_model = TM_ALWAYS;
|
opt.trust_model = TM_ALWAYS;
|
||||||
opt.batch = 1;
|
opt.batch = 1;
|
||||||
|
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
opt.homedir = read_w32_registry_string( NULL, "Software\\GNU\\GnuPG", "HomeDir" );
|
opt.homedir = read_w32_registry_string( NULL, "Software\\GNU\\GnuPG", "HomeDir" );
|
||||||
#else
|
#else
|
||||||
opt.homedir = getenv("GNUPGHOME");
|
opt.homedir = getenv("GNUPGHOME");
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined (__MINGW32__) || defined (__CYGWIN32__)
|
#if defined (_WIN32) || defined (__CYGWIN32__)
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -100,7 +100,7 @@ static char *fd_passwd = NULL;
|
|||||||
static char *next_pw = NULL;
|
static char *next_pw = NULL;
|
||||||
static char *last_pw = NULL;
|
static char *last_pw = NULL;
|
||||||
|
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
static int read_fd = 0;
|
static int read_fd = 0;
|
||||||
static int write_fd = 0;
|
static int write_fd = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -190,7 +190,7 @@ read_passphrase_from_fd( int fd )
|
|||||||
static int
|
static int
|
||||||
writen ( int fd, const void *buf, size_t nbytes )
|
writen ( int fd, const void *buf, size_t nbytes )
|
||||||
{
|
{
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
DWORD nwritten, nleft = nbytes;
|
DWORD nwritten, nleft = nbytes;
|
||||||
|
|
||||||
while (nleft > 0) {
|
while (nleft > 0) {
|
||||||
@ -233,7 +233,7 @@ writen ( int fd, const void *buf, size_t nbytes )
|
|||||||
static int
|
static int
|
||||||
readn ( int fd, void *buf, size_t buflen, size_t *ret_nread )
|
readn ( int fd, void *buf, size_t buflen, size_t *ret_nread )
|
||||||
{
|
{
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
DWORD nread, nleft = buflen;
|
DWORD nread, nleft = buflen;
|
||||||
|
|
||||||
while (nleft > 0) {
|
while (nleft > 0) {
|
||||||
@ -327,7 +327,7 @@ readline (int fd, char *buf, size_t buflen)
|
|||||||
|
|
||||||
#if !defined (__riscos__)
|
#if !defined (__riscos__)
|
||||||
|
|
||||||
#if !defined (__MINGW32__)
|
#if !defined (_WIN32)
|
||||||
/* For the new Assuan protocol we may have to send options */
|
/* For the new Assuan protocol we may have to send options */
|
||||||
static int
|
static int
|
||||||
agent_send_option (int fd, const char *name, const char *value)
|
agent_send_option (int fd, const char *name, const char *value)
|
||||||
@ -375,7 +375,11 @@ agent_send_all_options (int fd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!opt.ttyname)
|
if (!opt.ttyname)
|
||||||
dft_ttyname = tty_get_ttyname ();
|
{
|
||||||
|
dft_ttyname = getenv ("GPG_TTY");
|
||||||
|
if ((!dft_ttyname || !*dft_ttyname) && tty_get_ttyname ())
|
||||||
|
dft_ttyname = tty_get_ttyname ();
|
||||||
|
}
|
||||||
if (opt.ttyname || dft_ttyname)
|
if (opt.ttyname || dft_ttyname)
|
||||||
{
|
{
|
||||||
if (agent_send_option (fd, "ttyname",
|
if (agent_send_option (fd, "ttyname",
|
||||||
@ -432,7 +436,7 @@ agent_send_all_options (int fd)
|
|||||||
#endif
|
#endif
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
#endif /*!__MINGW32__*/
|
#endif /*!_WIN32*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -443,7 +447,7 @@ agent_send_all_options (int fd)
|
|||||||
static int
|
static int
|
||||||
agent_open (int *ret_prot)
|
agent_open (int *ret_prot)
|
||||||
{
|
{
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
int fd;
|
int fd;
|
||||||
char *infostr, *p;
|
char *infostr, *p;
|
||||||
HANDLE h;
|
HANDLE h;
|
||||||
@ -588,7 +592,7 @@ agent_open (int *ret_prot)
|
|||||||
static void
|
static void
|
||||||
agent_close ( int fd )
|
agent_close ( int fd )
|
||||||
{
|
{
|
||||||
#if defined (__MINGW32__)
|
#if defined (_WIN32)
|
||||||
HANDLE h = OpenEvent(EVENT_ALL_ACCESS, FALSE, "gpg_agent");
|
HANDLE h = OpenEvent(EVENT_ALL_ACCESS, FALSE, "gpg_agent");
|
||||||
ResetEvent(h);
|
ResetEvent(h);
|
||||||
#else
|
#else
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef __MINGW32__
|
#ifdef _WIN32
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# ifndef VER_PLATFORM_WIN32_WINDOWS
|
# ifndef VER_PLATFORM_WIN32_WINDOWS
|
||||||
# define VER_PLATFORM_WIN32_WINDOWS 1
|
# define VER_PLATFORM_WIN32_WINDOWS 1
|
||||||
@ -223,7 +223,7 @@ char *image_type_to_string(byte type,int style)
|
|||||||
#if !defined(FIXED_PHOTO_VIEWER) && !defined(DISABLE_PHOTO_VIEWER)
|
#if !defined(FIXED_PHOTO_VIEWER) && !defined(DISABLE_PHOTO_VIEWER)
|
||||||
static const char *get_default_photo_command(void)
|
static const char *get_default_photo_command(void)
|
||||||
{
|
{
|
||||||
#if defined(__MINGW32__)
|
#if defined(_WIN32)
|
||||||
OSVERSIONINFO osvi;
|
OSVERSIONINFO osvi;
|
||||||
|
|
||||||
memset(&osvi,0,sizeof(osvi));
|
memset(&osvi,0,sizeof(osvi));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user