[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getpass documentation
From: |
Bruno Haible |
Subject: |
Re: getpass documentation |
Date: |
Fri, 16 May 2008 13:32:57 +0200 |
User-agent: |
KMail/1.5.4 |
Simon Josefsson wrote:
> This makes the gnulib 'getpass' module (not the 'getpass-gnu' module)
> rather difficult to use: how do you know whether to de-allocate the
> returned string or not? It depends on whether the system function or
> the gnulib replacement was used.
Good point.
> Another way of looking at this is that
> there is a memory leak in the gnulib 'getpass' module.
It's hard to argue this way: getpass() is not specified by a standard.
> diff --git a/doc/glibc-functions/getpass.texi
> b/doc/glibc-functions/getpass.texi
> index b805cf5..561b89c 100644
> --- a/doc/glibc-functions/getpass.texi
> +++ b/doc/glibc-functions/getpass.texi
> @@ -6,6 +6,13 @@ Gnulib module: ---
>
> Portability problems fixed by Gnulib:
> @itemize
> address@hidden
> +This implementation returns password of arbitrary length, other
> +implementations truncate it to PASS_MAX or 8 characters.
> address@hidden
> +This implementation allocate the password using malloc, other
> +implementations may return a pointer to a static buffer which must not
> +be de-allocated.
> @end itemize
>
The way you wrote it here, it is not clear which module provides "this
implementation". The "Gnulib module" field is "---"...
Can you change the "Gnulib module" field to "getpass or getpass-gnu" and
then set up a 3-way structure like in doc/posix-functions/snprintf.texi?
The goal is to make clear to the reader which module he needs if he wants
a particular portability problem fixed.
Another, minor point is: "This implementation returns password of arbitrary
length" is incorrect English syntax for me. "a password"? "passwords"?
Bruno
- getpass documentation, Simon Josefsson, 2008/05/16
- Re: getpass documentation,
Bruno Haible <=
- Re: getpass documentation, Bruno Haible, 2008/05/18
- Re: getpass documentation, Simon Josefsson, 2008/05/19
- Re: getpass documentation, Bruno Haible, 2008/05/19
- Re: getpass documentation, Jim Meyering, 2008/05/19
- Re: getpass documentation, Simon Josefsson, 2008/05/19