You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dario <da...@who.net> on 2001/06/07 16:16:28 UTC

[PATCH] Making htpasswd read passwd from stdin

Hello,

This patch to htpasswd.c makes it read the user password from stdin instead
of from the command line or prompting the user for it interactively. This is
useful for applications that need to update a user password noninteractively
and do not want to risk someone seeing the new password in the command line
using a program like ps.

Instead of using the option -b to make htpasswd use the password given at
the command line, you would use -B, and the program would then read up to
512 characters from stdin (using a safe fgets). The program will error out,
though, if the password is longer than 256 characters (the default max).

The patch file (diff'ed against the 1.3.20 version) is available at
http://www.bem-vindo.com/patch.txt

Regards,
Dario Gomes



Re: [PATCH] Making htpasswd read passwd from stdin

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Dario" <da...@who.net>
Sent: Thursday, June 07, 2001 7:16 AM


> Hello,
> 
> This patch to htpasswd.c makes it read the user password from stdin instead
> of from the command line or prompting the user for it interactively. This is
> useful for applications that need to update a user password noninteractively
> and do not want to risk someone seeing the new password in the command line
> using a program like ps.

Agreed, that's ugly.

> Instead of using the option -b to make htpasswd use the password given at
> the command line, you would use -B, and the program would then read up to
> 512 characters from stdin (using a safe fgets). The program will error out,
> though, if the password is longer than 256 characters (the default max).
> 
> The patch file (diff'ed against the 1.3.20 version) is available at
> http://www.bem-vindo.com/patch.txt

+1 from here (without looking at the patch, answering mail offline right now.
Should serve a warning to always include the text of the patch in the email :-)