Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-2657

svnperms.py doesn't allow bracketed matches such as [^/]+/

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4.x
    • Fix Version/s: nonblocking
    • Component/s: tools
    • Labels:
      None

      Description

      svnperms.py line 17 says
      
      SECTION = re.compile(r'\[([^]]+?)(?:\s+extends\s+([^]]+))?\]')
      
      If I try to use a svnperms.conf such as the following to support a multiple 
      project repository without explicitly hard coding the project names, the lines 
      starting with brackets are treated as a section, and thus it fails.
      
      [REPOS_NAME]
      [\w\d_-]+/                                  = *(add,remove,update)
      [\w\d_-]+/trunk/                            = *(add)
      [\w\d_-]+/tags/                             = *(add)
      [\w\d_-]+/branches/                         = *(add)
      [\w\d_-]+/trunk/.+                          = *(add,remove,update)
      [\w\d_-]+/tags/REL-[\d\.]+/                 = *(add)
      [\w\d_-]+/tags/BLD-[\d\.]+/                 = *(add)
      [\w\d_-]+/tags/(PRE|POST)-[\d]+/            = *(add)
      [\w\d_-]+/branches/RB-[\d\.]+\.x/           = *(add)
      [\w\d_-]+/branches/RB-[\d\.]+\.x/.+         = *(add,remove,update)
      [\w\d_-]+/branches/BUG-[\d]+/               = *(add)
      [\w\d_-]+/branches/BUG-[\d]+/.+             = *(add,update)
      [\w\d_-]+/branches/TRY-[A-Z0-9]+-[\w\-]+/   = *(add)
      [\w\d_-]+/branches/TRY-[A-Z0-9]+-[\w\-]+/.+ = *(add,update)
      
      
      Changing line 17 to the following fixes the problem.  All I do here is anchor 
      the brackets to the beginning and end of the line, with optional white space 
      before the front bracket and after the end bracket.
      
      SECTION = re.compile(r'^\s*\[([^]]+?)(?:\s+extends\s+([^]]+))?\]\s*$')
      

      http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=58412

      Original issue reported by justinj

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              subversion-importer Subversion Importer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: