Opened 14 years ago

SvnAuthzAdmin path calculations incorrect on Windows

Reported by: Owned by: Chris Heller Ryan J Ollos normal SvnAuthzAdminPlugin normal 0.11

Description

SvnAuthzAdminPlugin uses Python's url2pathname() function to go from the current URL to the relative path in the svn authz file format.

The svn authz format is always with URL or Unix style paths ('/' instead of '\'), so when using this plugin on Windows, the path calculations are incorrect.

comment:1 Changed 14 years ago by Chris Heller

What I did to get around this issue is to add the following at the top of the admin_ui.py file.

import sys
is_windows = sys.platform.startswith('win')
del sys

def url2localpathname(url):
"""
Fix up paths returned by url2pathname so that authz format is correct
on Windows as well as *nix flavors
"""
localpath = url2pathname(url)
if is_windows:
localpath = localpath.replace('\\', '/')
return localpath


and then change all other references to url2pathname to use the newly defined url2localpathname

comment:2 follow-up:  3 Changed 13 years ago by rupert thurner

Owner: changed from Kis Gergely to rupert thurner new → assigned

would you mind creating a patch please?

Changed 11 years ago by Sergio Talens-Oliag

Patch to replace url2pathname and pathname2url by quote and unquote

comment:3 in reply to:  2 Changed 11 years ago by Sergio Talens-Oliag

would you mind creating a patch please?

I've created a different patch replacing the use of url2pathname and pathname2url by quote and unquote, as that is what is needed to process the svnauth paths (in UNIX systems the functions url2pathname and pathname2url are equivalent to quote and unquote and the svnauth file uses UNIX like paths, so we don't need to use the system dependent functions).

comment:4 Changed 9 years ago by Ryan J Ollos

Owner: changed from rupert thurner to Ryan J Ollos

comment:5 Changed 3 years ago by Ryan J Ollos

Status: assigned → new

Modify Ticket

Change Properties