Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache2/Win32 writes files w/ unix CLF |
|
Author |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Fri 29 Aug '08 17:36 Post subject: Apache2/Win32 writes files w/ unix CLF |
|
|
Ever since I went from Apache 1.3 to 2.x I've noticed that certain files (ScriptLog and htpasswd output) are written with unix line endings.
This has caused a lot of grief. Open ScriptLog and you have one line of mess to read through, or convert file in editor and re-open and then it looks as should.
htpasswd.exe writes to separate lines but again, there is no CR/LF so when trying to read in the file with a win32 app, load entries to a list, you get one line input from the file, split on the colon and you just end up with whatever the first username is in the list and again a problem.
What can/could be done about this? Something must be able to be done because as of the last 1.3 version I used (1.3.37) the 1.3 branch wrote the proper line endings in these files.
It seems to do it proper in the normal access/error/transfer log files just the ScriptLog on htpasswd output it's been ignored.
Wish I knew enough to figure this out and not look so dumb
Gregg |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 02 Sep '08 20:15 Post subject: |
|
|
I tested on the command line
Code: |
htpasswd -nbm test test>>out.txt
htpasswd -nbm test2 test2>>out.txt
|
out.txt
Code: |
test:$apr1$o6d4.C5A$J2NN7kFNFzCBPtERaJL3p.
test2:$apr1$iFPLMAuh$m4SGmoyYdiHqpC4NGV9H11
|
Viewing the Hexeditor I found 0D 0A 0D 0D 0A after the 1st and after the second password. 0D 0A == CR LF == \r\n
So there is a double CR/LF afer eachline
using
Code: |
htpasswd -cbm out.txt test2 test2
htpasswd -bm out.txt test2 test2
|
Code: |
test:$apr1$4S1qSCdH$8n1ysYFf/wQG2cOxBP/yV0
test2:$apr1$R69Zzc9T$.ffC.gSZWqhTHJ0suTBKE0
|
There is NO 0D 0A (CR/LF). Only 0A which is only LF
For me it works with the windows pipes. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 08 Sep '08 2:37 Post subject: |
|
|
and so?
It is post the fix for the predictable salt
htpasswd from 1.3.41 works fine and it is pre-fix |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 08 Sep '08 19:45 Post subject: |
|
|
Thanks James,
Guess I'll have to
G |
|
Back to top |
|
|
|
|
|
|