1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* asshelp.c (send_pinentry_environment) [W32]: Do not use ttyname.

* w32-pth.c, w32-pth.h: New.

* Makefile.am (gpgsm_LDADD): Put libassuan before jnlib because
under W32 we need the w32 pth code from jnlib.

* misc.c (setup_pinentry_env) [W32]: Disabled.
This commit is contained in:
Werner Koch 2004-12-07 11:21:40 +00:00
parent 0a058ac53c
commit b50a587d8d
10 changed files with 75 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2004-12-07 Werner Koch <wk@g10code.com>
* asshelp.c (send_pinentry_environment) [W32]: Do not use ttyname.
2004-12-06 Werner Koch <wk@g10code.com>
* exechelp.h, exechelp.c: New. Based on code from ../sm/import.c.

View File

@ -66,8 +66,13 @@ send_pinentry_environment (assuan_context_t ctx,
if (!opt_ttyname)
{
dft_ttyname = getenv ("GPG_TTY");
#ifdef HAVE_DOSISH_SYSTEM
if (!dft_ttyname || !*dft_ttyname )
dft_ttyname = "/dev/tty"; /* Use a fake. */
#else
if ((!dft_ttyname || !*dft_ttyname) && ttyname (0))
dft_ttyname = ttyname (0);
#endif
}
if (opt_ttyname || dft_ttyname)
{

View File

@ -345,7 +345,7 @@ try_gettext=yes
have_dosish_system=no
have_w32_system=no
case "${host}" in
*-*-mingw32*)
*-mingw32*)
# special stuff for Windoze NT
ac_cv_have_dev_random=no
AC_DEFINE(USE_ONLY_8DOT3,1,
@ -677,7 +677,7 @@ fi
AC_SUBST(GPGKEYS_MAILTO)
case "${host}" in
*-*-mingw32*)
*-mingw32*)
PRINTABLE_OS_NAME="MingW32"
;;
*-*-cygwin*)

View File

@ -1,3 +1,7 @@
2004-12-07 Werner Koch <wk@g10code.com>
* w32-pth.c, w32-pth.h: New.
2004-11-26 Werner Koch <wk@g10code.com>
* logging.c [_WIN32]: Don't include socket headers.

View File

@ -37,7 +37,9 @@ libjnlib_a_SOURCES = \
argparse.c argparse.h \
logging.c logging.h \
dotlock.c dotlock.h \
types.h mischelp.h
types.h mischelp.h \
w32-pth.c w32-pth.h \
w32-afunix.c w32-afunix.h
# xmalloc.c xmalloc.h

42
jnlib/w32-pth.c Normal file
View File

@ -0,0 +1,42 @@
/* w32-pth.c - GNU Pth emulation for W32 (MS Windows).
* Copyright (C) 2004 g10 Code GmbH
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GnuPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifdef HAVE_W32_SYSTEM
#include <stdio.h>
#include <windows.h>
#include <io.h>
#include "w32-pth.h"
ssize_t
pth_read (int fd, void *buffer, size_t size)
{
return read (fd, buffer, size);
}
ssize_t
pth_write (int fd, const void *buffer, size_t size)
{
return write (fd, buffer, size);
}
#endif /*HAVE_W32_SYSTEM*/

View File

@ -18,9 +18,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* Note that this header is usually through a symlinked pth.h file.
This is needed so that we don't have a pth.h file here which would
conflict if a system really has pth available. */
/* Note that this header is usually used through a symlinked pth.h
file. This is needed so that we don't have a pth.h file here which
would conflict if a system really has pth available. */
#ifndef W32_PTH_H
#define W32_PTH_H

View File

@ -1,3 +1,10 @@
2004-12-07 Werner Koch <wk@g10code.com>
* Makefile.am (gpgsm_LDADD): Put libassuan before jnlib because
under W32 we need the w32 pth code from jnlib.
* misc.c (setup_pinentry_env) [W32]: Disabled.
2004-12-06 Werner Koch <wk@g10code.com>
* gpgsm.c (run_protect_tool) [_WIN32]: Disabled.

View File

@ -51,8 +51,9 @@ gpgsm_SOURCES = \
certreqgen.c
gpgsm_LDADD = ../jnlib/libjnlib.a ../kbx/libkeybox.a ../common/libcommon.a \
$(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(KSBA_LIBS) -lgpg-error \
gpgsm_LDADD = $(LIBASSUAN_LIBS) ../jnlib/libjnlib.a ../kbx/libkeybox.a \
../common/libcommon.a \
$(LIBGCRYPT_LIBS) $(KSBA_LIBS) -lgpg-error \
$(LIBINTL)

View File

@ -38,6 +38,7 @@
void
setup_pinentry_env (void)
{
#ifndef HAVE_W32_SYSTEM
char *lc;
if (opt.display)
@ -75,6 +76,6 @@ setup_pinentry_env (void)
else if ( (lc = setlocale (LC_MESSAGES, "")) )
setenv ("LC_MESSAGES", lc, 1);
#endif
#endif /*!HAVE_W32_SYSTEM*/
}