This is the mail archive of the
mailing list for the glibc project.
Re: getpass obsolete?
>From: "Petter Reinholdtsen" <email@example.com>
>Sent: Wednesday, May 28, 2003 5:42 AM
>Subject: Re: getpass obsolete?
>> The man pages are not the documentation of the GNU C library. Read
>> the glibc info manual (or the manual that is available online in
>> various formats). "info libc" might work on your system, if you
>> have info reader and the GNU C library manual installed.
>Yeah, yeah. Ignore manual pages, use the info file instead. Sounds
>like a reflex reaction. The GNU C library is not developed in a
>vacuume. What about answering the question asked instead?
>I find the following:
>[DIGITAL] The getpass() function is not threadsafe because it manipulates
>global signal state.
>The getpass() function is scheduled to be withdrawn from a future
> version of the X/Open CAE Specification.
>The interesting question is why it is scheduled for removal. Looking
<The Single UNIX . Specification, Version 2, I find the explanation:
> This function was marked LEGACY since it provides no functionality
> which a user could not easily implement, and its name is misleading.
Thanks Petter. :) I've actually read the opengroup specification and don't know where to proceed from there. I want to be able to
reuse getpass but since it wouldn't be supported soon, I'm looking for an alternative function to use---probably something that's
being used in linux. What does linux use by the way to read passwords from console (without them being echoed)?
If I'd implement my own getpass, I wouldn't be sure whether it would be thread safe since I haven't programmed threads. I wouldn't
know too whether it would be more efficient than the current getpass.
A solution would be to grab the source for the getpass function and cut and paste it to my code and modify it as I want so no issues
regarding linking my code against future libraries that wouldn't support getpass. However, I think it would be better to reuse
whatever alternative there is. (e.g. the one that is used in linux if indeed it doesn't use getpass anymore.)
Legacy code issues and functions being obsoleted are really surprising for me. Now, I'm paranoid over some functions that I might
still be using but are already legacy code. I thought only java deprecates functions.
Any hints and suggestions? :)
-- Kindly CC me in the replies since I'm not part of the mailing list. :)