scm-svn-plugin does not handle modified paths on pre-receive hooks

Anonymous avatarAnonymous created an issue

Good Morning Sebastian,

I'm having some problems with this plugin. When I set a rule in the repository, it works only when an unauthorized user adds something at the repositorie, but when the same user modifies something, does not work. I'm using SCM Manager 1.22.

Take a look at the attachment.

Thanks!

Comments (8)

  1. Anonymous
    • Create a new repository sandbox
    • Make checkout with ADM user
    • Commit trunk folder with ADM user
    • Create two xml users (sandbox_1 and sandbox_2)
    • Add on permissions tab: sandbox_1 - WRITE sandbox_2 - WRITE
    • Add on Write Path Protection tab: Enable = true; Path trunk / * - sandbox_1
    • Add something at the trunk path on repository with sandbox_2 user
    • Modify something at the trunk path on repository with sandbox_2 user
  2. Sebastian Sdorra

    I could not reproduce this issue. Here a my steps:

    # create a new svn repository
    $ scm-cli-client create-repository -t svn -n issues/353
    ID:             F2O16rjcc2
    Name:           issues/353
    Type:           svn
    E-Mail:
    Description:
    Public:         false
    Archived:       false
    Creation-Date:  2013-03-25 15:54:11
    Last-Modified:
    URL:            http://localhost:8081/scm/svn/issues/353
    Permissions:
    
    # checkout and create a trunk folder as scmadmin
    $ svn --username scmadmin co http://localhost:8081/scm/svn/issues/353
    Checked out revision 0.
    
    $ cd 353
    
    $ svn mkdir trunk
    A         trunk
    
    $ svn --username scmadmin commit -m 'create trunk folder'
    Adding         trunk
    
    Committed revision 1.
    
    # create user sandbox_1
    $ scm-cli-client create-user -n sandbox_1 -d "Sandbox One" -p sandbox
    Name:           sandbox_1
    Display Name:   Sandbox One
    Type:           xml
    E-Mail:
    Active:         false
    Administrator:  false
    Creation-Date:
    Last-Modified:
    
    # create user sandbox_2
    $ scm-cli-client create-user -n sandbox_2 -d "Sandbox Two" -p sandbox
    Name:           sandbox_2
    Display Name:   Sandbox Two
    Type:           xml
    E-Mail:
    Active:         false
    Administrator:  false
    Creation-Date:
    Last-Modified:
    
    # add write permission for sandbox_1
    $ scm-cli-client add-permission F2O16rjcc2 -n sandbox_1 -t WRITE
    ID:             F2O16rjcc2
    Name:           issues/353
    Type:           svn
    E-Mail:
    Description:
    Public:         false
    Archived:       false
    Creation-Date:  2013-03-25 15:54:11
    Last-Modified:
    URL:            http://localhost:8081/scm/svn/issues/353
    Permissions:
      WRITE - sandbox_1 (Group: false)
    
    # add write permission for sandbox_2  
    $ scm-cli-client add-permission F2O16rjcc2 -n sandbox_2 -t WRITE
    ID:             F2O16rjcc2
    Name:           issues/353
    Type:           svn
    E-Mail:
    Description:
    Public:         false
    Archived:       false
    Creation-Date:  2013-03-25 15:54:11
    Last-Modified:  2013-03-25 15:58:58
    URL:            http://localhost:8081/scm/svn/issues/353
    Permissions:
      WRITE - sandbox_1 (Group: false)
      WRITE - sandbox_2 (Group: false)
    
    # open browser and add pathwp permissions
    # properties from repository.xml:
    # <properties>
    #   <item>
    #     <key>pathwp.permissions</key>
    #     <value>[trunk/*,sandbox_1]</value>
    #   </item>
    #   <item>
    #     <key>pathwp.enabled</key>
    #     <value>true</value>
    #   </item>
    # </properties>
    
    $ echo a > trunk/a.txt
    
    $ svn add trunk/a.txt
    
    # try to commit trunk/a.txt as sandbox_2: failed
    $ svn --username sandbox_2 commit -m 'added a as sandbox_2'
    Authentication realm: <http://localhost:8081> SONIA :: SCM Manager
    Password for 'sandbox_2':
    Adding         trunk/a.txt
    Transmitting file data .svn: E200015: Commit failed (details follow):
    svn: E200015: svn: E200015: not enough permissions
    
    # try to commit trunk/a.txt as sandbox_1: success
    $ svn --username sandbox_1 commit -m 'added a as sandbox_1'
    Authentication realm: <http://localhost:8081> SONIA :: SCM Manager
    Password for 'sandbox_1':
    Adding         trunk/a.txt
    Transmitting file data .
    Committed revision 2.
    
  3. Anonymous

    Could you try to modify same already existing file into repository with user sandbox_2?

  4. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.