Modify

Opened 15 years ago

Closed 12 years ago

Last modified 10 years ago

#5689 closed defect (fixed)

empty path input corrupts svnauthz => trac aborts

Reported by: A.Visser@… Owned by: Ryan J Ollos
Priority: normal Component: SvnAuthzAdminPlugin
Severity: normal Keywords:
Cc: Ryan J Ollos Trac Release: 0.11

Description

If "Add a new Subversion path." is invoked without entering a path, an empty path is appended to svnauthz which causes trac to abort. So the project administrator can't undo the mistake, the empty path has to be removed manually by the system administrator.

Attachments (0)

Change History (6)

comment:1 Changed 15 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; anonymous removed

comment:2 Changed 14 years ago by Ryan J Ollos

#6265 was closed as a duplicate.

comment:3 Changed 14 years ago by laurent.foynard@…

I made a Q&D solution to solve this problem : edit the "admin_ui.py" file and in the method "_add_path" just before the "try" add the following lines :

if not path :
    return {}

Finally the method looks like this :

    def _add_path(self, req):
        path = req.args.get('path')
        repository = None
        tmppath = req.args.get('path') 
    if ":" in tmppath: 
        repository, path = tmppath.split(":") 
        repository = repository.strip() 
        path = path.strip() 
    else: 
        repository = self.authz_module 
        path = tmppath.strip() 
        if not path :
            return {}
        try:
            self.authz.add_path(Path(path, [], repository))
        return {}
        except Exception, e:
            return {'addpath_error' :  e}

comment:4 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

(In [11873]) Fixes #5689:

  • Added checks for non-empty group and path before attempting to add them. A warning is added if either are empty.
  • Extracted code to a method _get_authz.
  • Corrected tabs and indentation.

comment:5 Changed 10 years ago by Ryan J Ollos

Owner: changed from Kis Gergely to Ryan J Ollos

comment:6 Changed 10 years ago by Ryan J Ollos

#10546 closed as a duplicate.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
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.