Modify

Opened 18 years ago

Closed 18 years ago

Last modified 16 years ago

#520 closed enhancement (fixed)

Missing crypt support on non-Windows systems

Reported by: ximon.eighteen@… Owned by: Matt Good
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.9

Description

From 'man htpasswd' on Linux:

-m Use MD5 encryption for passwords. On Windows, Netware and TPF, this is the default.

-d Use crypt() encryption for passwords. The default on all platforms but Windows, Netware and TPF. Though possibly supported by htpasswd on all platforms, it is not supported by the httpd server on Windows, Netware and TPF.

The attached patch implements system crypt checking in case the existing MD5 check doesn't match the given password.

Tested with Apache 2.2.2, Python 2.4.3, Trac 0.9.6 and AccountManagerPlugin for 0.9.

Attachments (1)

crypt-support.patch (1.4 KB) - added by ximon.eighteen@… 18 years ago.
Patch implementing crypt support for password verification against htpasswd file

Download all attachments as: .zip

Change History (4)

Changed 18 years ago by ximon.eighteen@…

Attachment: crypt-support.patch added

Patch implementing crypt support for password verification against htpasswd file

comment:1 Changed 18 years ago by ximon.eighteen@…

Okay, so in the attached patch returning False from the dummy crypt implementation was not what I really intended to do, but I forgot to change it. You get the point. I'd actually love to see from a real Python programmer what the proper is of dealing with the fact that the crypt Python package is marked as 'Unix' only.

comment:2 Changed 18 years ago by Matt Good

Status: newassigned
Type: defectenhancement

Catching the ImportError is the recommended way to check for the presence of the crypt module. Your Python intuition is strong already :)

I'll probably change the "return False" to throw an error in the case where you try to use crypt passwords on a Windows system, but the patch looks good.

comment:3 Changed 18 years ago by Matt Good

Resolution: fixed
Status: assignedclosed

(In [1041]) add support for crypt passwords in htpasswd files on Unix-like platforms (fixes #520) thanks for the patch

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matt Good.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.