Modify

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#520 closed enhancement (fixed)

Missing crypt support on non-Windows systems

Reported by: ximon.eighteen@… Owned by: mgood
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@… 8 years ago.
Patch implementing crypt support for password verification against htpasswd file

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by ximon.eighteen@…

Patch implementing crypt support for password verification against htpasswd file

comment:1 Changed 8 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 8 years ago by mgood

  • Status changed from new to assigned
  • Type changed from defect to enhancement

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 8 years ago by mgood

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Add Comment

Modify Ticket

Action
as closed The owner will remain mgood.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.