Modify

Opened 5 years ago

Closed 2 years ago

#5689 closed defect (fixed)

empty path input corrupts svnauthz => trac aborts

Reported by: A.Visser@… Owned by: kisg
Priority: normal Component: SvnAuthzAdminPlugin
Severity: normal Keywords:
Cc: rjollos 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 (4)

comment:1 Changed 5 years ago by rjollos

  • Cc rjollos added

comment:2 Changed 4 years ago by rjollos

#6265 was closed as a duplicate.

comment:3 Changed 3 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 2 years ago by rjollos

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

(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.

Add Comment

Modify Ticket

Action
as closed .
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.