Package: vpnc
Version: 0.3.3+SVN20051028-3
Severity: normal
Tags: patch

vpnc is using the "obsolete" getpass function (cf getpass manpage) to retrieve 
the user password.
This funtion directly manipulates /dev/tty to turn off echoing of the password 
on the tty (which is ok).
However, when the standard input is not a terminal, but a pipe (e.g. for an 
automatic connexion), it makes
vpnc unable to get the password. This prevents kvpnc to work. Indeed this 
latter is forking a vpnc process
and connects its standard input to a pipe, to fed it with the password provided 
by the user. I have reported
this bug to kvpnc (cf Bug#377713: kvpnc: Cisco connection does not work). But 
after having furtherly explored
the problem, it turns out to be a bug in vpnc. I provide a small patch 
(config.c) that fixes the problem on my system (it is
inspired after what is done in ssh). Before calling getpass, I test if the 
standard input is a tty or not. In the
first case I call getpass, otherwise stdin is connected through a pipe, I use 
instead getline (the password is anyway
invisible).

665a666
>       int stdinfd;
788c789,793
<                       s = strdup(getpass(""));
---
>                       stdinfd = fileno(stdin);
>                       if(isatty(stdinfd))
>                               s = strdup(getpass(""));
>                       else
>                               getline(&s,&s_len,stdin);



-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.20
Locale: LANG=fr_FR, LC_CTYPE=fr_FR (charmap=ISO-8859-1) (ignored: LC_ALL set to 
fr_FR)

Versions of packages vpnc depends on:
ii  iproute                       20051007-4 Professional tools to control the 
ii  libc6                         2.3.6-15   GNU C Library: Shared libraries
ii  libgcrypt11                   1.2.2-1    LGPL Crypto library - runtime libr
ii  libgpg-error0                 1.2-1      library for common error values an

vpnc recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to