This queue is for tickets about the Apache-Htpasswd CPAN distribution.

Report information
The Basics
Id:
8560
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
william [...] knowmad.com
Cc:
AdminCc:

BugTracker
Severity:
Wishlist
Broken in:
1.5.8
Fixed in:
(no value)



Subject: Does module create a new passwd file if none exists?
Hi Kevin, Thanks for such a useful module. I'm try to do some testing where a passwd file does not yet exist. My tests are failing with the error that the file or directory cannot be found (no such file or directory). I found that simply creating an empty file is sufficient for my tests to pass. It would be nice if there were a way to have A::Htpasswd handle this. Here's all the code it required: # # If the password file does not exist, create it unless (-e $passwd_file) { open (PASS, ">$passwd_file") || die "Unable to open $passwd_file: $!"; close PASS; } Thanks, William
Hi, I'll consider this. I have always wanted the module to only modify the file, not worry about creating it, ownership, permissions, etc... Mainly so the application using it has to deal with that, and not the module. I don't want tainted data being passed to the module, and it creating a file which it shouldn't because the app isn't scrubbing the input properly. I'd rather the app open security holes, rather than the module. Cheers, Kevin [guest - Mon Nov 22 12:19:16 2004]:
Show quoted text
> Hi Kevin, > > Thanks for such a useful module. I'm try to do some testing where a > passwd file does not yet exist. My tests are failing with the error > that the file or directory cannot be found (no such file or > directory). > > I found that simply creating an empty file is sufficient for my tests > to pass. It would be nice if there were a way to have A::Htpasswd > handle this. Here's all the code it required: > > # > # If the password file does not exist, create it > unless (-e $passwd_file) { > open (PASS, ">$passwd_file") || die "Unable to open $passwd_file: > $!"; > close PASS; > } > > > Thanks, > William
On Mon Nov 22 12:50:01 2004, KMELTZ wrote:
Show quoted text
> Hi, > > I'll consider this. I have always wanted the module to only modify the
Damn. Doesn't exist yet :(
Show quoted text
> file, not worry about creating it, ownership, permissions, etc... Mainly > so the application using it has to deal with that, and not the module. I > don't want tainted data being passed to the module, and it creating a > file which it shouldn't because the app isn't scrubbing the input > properly. I'd rather the app open security holes, rather than the module. > > Cheers, > Kevin > > [guest - Mon Nov 22 12:19:16 2004]: >
> > Hi Kevin, > > > > Thanks for such a useful module. I'm try to do some testing where a > > passwd file does not yet exist. My tests are failing with the error > > that the file or directory cannot be found (no such file or > > directory). > > > > I found that simply creating an empty file is sufficient for my tests > > to pass. It would be nice if there were a way to have A::Htpasswd > > handle this. Here's all the code it required: > > > > # > > # If the password file does not exist, create it > > unless (-e $passwd_file) { > > open (PASS, ">$passwd_file") || die "Unable to open $passwd_file: > > $!"; > > close PASS; > > } > > > > > > Thanks, > > William
> >


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.