Bug 10221 - htpasswd overwrites existing file
Summary: htpasswd overwrites existing file
Status: CLOSED DUPLICATE of bug 10422
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: support (show other bugs)
Version: 2.0.39
Hardware: All All
: P1 critical (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-25 15:49 UTC by Mike Soules
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments
Fix for "-c -n" conflict, respect "-c", not add again on update, add newline for output (3.21 KB, patch)
2002-06-27 11:50 UTC, Jon Noack
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Soules 2002-06-25 15:49:14 UTC
I'm a new user to Apache so I hope this is just something I'm doing wrong.  
I've created a user password file with the -c option, and when trying to add 
new users, it just overwrites the existing file and my previous user 
disappears.  I have patched due to the "-c and -n options conflict" error but 
am not sure whether or not this is the source of the problem.
Comment 1 Mike Soules 2002-06-25 15:53:09 UTC
Just to clarify, when I add additional users, I'm not using the -c option.
Comment 2 Jon Noack 2002-06-27 11:50:58 UTC
Created attachment 2206 [details]
Fix for "-c -n" conflict, respect "-c", not add again on update, add newline for output
Comment 3 Jon Noack 2002-06-27 11:54:21 UTC
The patch I uploaded fixes several things:

1) Resolve the "-c and -n options conflict" error
2) Respect "-c" and actually truncate file
3) On update actually set "found" so record doesn't get added again
4) Add a newline to the record before writing it to the file
Comment 4 Jon Noack 2002-06-27 16:42:02 UTC
Should be under support component on all platforms and all OSs.  Also, the 
priority is High and the severity is Critical, as htpasswd will overwrite 
passwords in existing files, resulting in loss of data.
Comment 5 Cliff Woolley 2002-07-02 19:54:46 UTC

*** This bug has been marked as a duplicate of 10422 ***