bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getpass(3) length


From: Andreas Jaeger
Subject: Re: getpass(3) length
Date: 25 Sep 2000 07:34:01 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Channel Islands)

>>>>> David Rigel writes:

 > Hi,
 > looks like the man page for getpass(3) is not
 > accurate:
 > it says getpass stores the introduced password in a
 > static object of 128 chars length that the caller must
 > overwrite. However I've found that overwriting data
 > after the byte 124 generates a segfault. The file
 > attached shows this. Besides, it looks like getpass
 > actually supports longer strings (without crashing!!).

 > I'm really confused. Is it a man issue? Is it my
 > fault?
Read the libc info manual for the exact documentation, e.g. with 
"info libc getpass".

Btw. the manual only mentions: up to 128 characters.  You can not
count on that all the characters are allocated! - and that's your
problem.

Andries, the manual is wrong - glibc has no limit on getpass.  The
info page mentions:
     In other C libraries, `getpass' may only return the first
     `PASS_MAX' bytes of a password.  The GNU C library has no limit, so
     `PASS_MAX' is undefined.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs address@hidden
   private address@hidden
    http://www.suse.de/~aj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]