2010/4/26 Viktor TARASOV <viktor.tara...@opentrust.com>:
> Ludovic Rousseau wrote:
>> 2010/4/15 Andreas Jellinghaus <a...@dungeon.inka.de>:
>>
>>> Am Donnerstag 15 April 2010 19:41:45 schrieb OpenSC:
>>>
>>>> #120: pkcs15-init needs to accept ctrl-c
>>>> --------------------+------------------------------------------------------
>>>> - Reporter:  aj      |       Owner:  opensc-de...@…
>>>>      Type:  defect  |      Status:  new
>>>>  Priority:  normal  |   Milestone:  0.12.0
>>>> Component:  tools   |     Version:  0.11.1
>>>>  Severity:  normal  |    Keywords:
>>>> --------------------+------------------------------------------------------
>>>> -
>>>>
>>>> Comment(by viktor.tara...@…):
>>>>
>>>>  I propose to implement local version of getpass() sensible to Ctrl-C .
>>>>
>>>>  Any objections?
>>>>
>>>>
>>> can you test attached patch? it is incomplete, but replaces getpass
>>> with out own code. it uses the recommended replacement for getpass -
>>> turn off echo with termios.
>>>
>>> like getline it will allocate space and the caller needs to free
>>> that space (and for PINs and passwords: cleanse it). because of
>>> that interface change the difference is quite big.
>>>
>>
>> getline() is a GNU extension.
>> >From getline(3) on Debian:
>> CONFORMING TO
>>        Both  getline()  and  getdelim()  were originally GNU extensions.  
>> They
>>        were standardized in POSIX.1-2008.
>>
>> And on Mac OS X Snow Leopard I do not have getline().
>>
>> Maybe a correct solution is to test for the presence of getline in
>> configure.ac and use
>> #ifdef HAVE_GETLINE
>> #else
>> /* Windows and Mac OS X */
>> #endif
>>
>
> I've applied your proposals, thanks.
>
> I'm not sure about availability on MacOS of getchar() or _getch().
> Can you check r4266, please?

Compilation fails with:
Undefined symbols:
  "__getch", referenced from:
      _util_getpass in util.o

Mac OS X does not have _getch().

On Mac OS X util_getpass() should use the tcsetattr() dance as
described in 
http://www.opensc-project.org/opensc/attachment/ticket/120/opensc-getpass.patch

-- 
 Dr. Ludovic Rousseau
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to