Storing file permissions in Subversion repository

前端 未结 12 1304
情话喂你
情话喂你 2020-12-01 20:57

How do you store file permissions in a repository? A few files need to be read-only to stop a third party program from trashing it but after checking out of the repository t

12条回答
  •  青春惊慌失措
    2020-12-01 21:01

    Since this wasn't fully said in previous responses yet. I hate to resurrect zombied threads though.

    Since adding permission support for SVN would have to accommodate multiple OS's and permission types, NFS, POSIX, ARWED, and RACF

    This would make SVN bloated, possibly clash with conflicting permission types like NFS and POSIX, or open up possible exploits/security vulnerabilities.

    There are a couple of workarounds. pre-commit, post-commit, start-commit are the more commonly used, and are a part of the Subversion system. But will allow you to control the permissions with what ever programming language you like.

    The system I implemented is what I call a packager, that validates the committed files of the working copy, then parses a metadata file, which lists out the default permissions desired for files/folders, and any changes to them you also desire.

    Owner, Group, Folders, Files
    default:  www-user 750 640
    /path/to/file:  non-www 770 770
    /path/to/file2:   700 700
    

    You can also expand upon this and allow things such as automated moving, renaming them, tagging revision by types, like alpha, beta, release candidate, release

    As far as supporting clients to checkout your repository files with permissions attached to them. You are better off looking into creating an installer of your package and offering that as a resource.

    Imagine people setting their repositories with an executable in it set with permissions of root:www-user 4777

提交回复
热议问题