You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Shawn Matlock <ma...@odscompanies.com> on 2005/12/01 02:19:33 UTC

Unix file permissions

Can Subversion keep the assigned permissions on a file?

User1 creates restricted(mode 600) file and submits it to source control in
side of an otherwise open directory.

User2 checks out this file in another environment. The checked out file is
created with permissions whatever User2's umask is set to.

I'm hoping there's a way for the file perms to be transferred, but it seems
unlikely.



Thank you,

Shawn

Re: Unix file permissions

Posted by Paul Koning <pk...@equallogic.com>.
>>>>> "Shawn" == Shawn Matlock <ma...@odscompanies.com> writes:

 Shawn> Can Subversion keep the assigned permissions on a file?  User1
 Shawn> creates restricted(mode 600) file and submits it to source
 Shawn> control in side of an otherwise open directory.

 Shawn> User2 checks out this file in another environment. The checked
 Shawn> out file is created with permissions whatever User2's umask is
 Shawn> set to.

 Shawn> I'm hoping there's a way for the file perms to be transferred,
 Shawn> but it seems unlikely.

For that to make sense, the owner/group attributes would have to be
carried over as well.  But those can't be set to arbitrary values by
ordinary users.  So they couldn't be restored on checkout.

	 paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Unix file permissions

Posted by Andy Levy <an...@gmail.com>.
On 12/1/05, Paul Koning <pk...@equallogic.com> wrote:
> >>>>> "Shawn" == Shawn Matlock <ma...@odscompanies.com> writes:
>
>  Shawn> Can Subversion keep the assigned permissions on a file?  User1
>  Shawn> creates restricted(mode 600) file and submits it to source
>  Shawn> control in side of an otherwise open directory.
>
>  Shawn> User2 checks out this file in another environment. The checked
>  Shawn> out file is created with permissions whatever User2's umask is
>  Shawn> set to.
>
>  Shawn> I'm hoping there's a way for the file perms to be transferred,
>  Shawn> but it seems unlikely.
>
> For that to make sense, the owner/group attributes would have to be
> carried over as well.  But those can't be set to arbitrary values by
> ordinary users.  So they couldn't be restored on checkout.

All client systems (and filesystems) would need to have compatible
permissions functionality as well.  If, for some weird reason, my
working copy is on a FAT32 partition on an XP box, what would happen?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Unix file permissions

Posted by Paul Koning <pk...@equallogic.com>.
>>>>> "Shawn" == Shawn Matlock <ma...@odscompanies.com> writes:

 Shawn> Can Subversion keep the assigned permissions on a file?  User1
 Shawn> creates restricted(mode 600) file and submits it to source
 Shawn> control in side of an otherwise open directory.

 Shawn> User2 checks out this file in another environment. The checked
 Shawn> out file is created with permissions whatever User2's umask is
 Shawn> set to.

 Shawn> I'm hoping there's a way for the file perms to be transferred,
 Shawn> but it seems unlikely.

For that to make sense, the owner/group attributes would have to be
carried over as well.  But those can't be set to arbitrary values by
ordinary users.  So they couldn't be restored on checkout.

	 paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Unix file permissions

Posted by "Ph. Marek" <ph...@bmlv.gv.at>.
On Thursday 01 December 2005 19:40, Phil Endecott wrote:
> Shawn Matlock wrote:
> > Can Subversion keep the assigned permissions on a file?
>
> Your best bet is to record the permissions that you want in properties,
> i.e.
...
> Then have a script that you can run after updating that reads and
> applies the properties:
You need the meta-data branch for that.

See http://svn.collab.net/viewcvs/svn/branches/meta-data-versioning/ for
the branch; but beware, this is just the *modification* needed.
They should be applied to a current version of subversion.

So I'd suggest you get a current patch by something like
        svn diff -r 13256:HEAD 
https://svn.collab.net/repos/svn/branches/meta-data-versioning/owner-group-mode 
> /tmp/meta-data.patch
and use this patch to update your subversion source.

Or, if you're compiling a checkout of subversion, you can use "svn merge".


Depending on your exact needs fsvs might be better suited (fsvs.tigris.org, 
still in heavy development).


Regards,

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Unix file permissions

Posted by Phil Endecott <sp...@chezphil.org>.
Shawn Matlock wrote:
> Can Subversion keep the assigned permissions on a file?

Your best bet is to record the permissions that you want in properties, i.e.

$ ls -l foo
-rw-r--r-- 1 phil phil      1024 foo

$ svn propset owner phil foo
$ svn propset group phil foo
$ svn propset mode  644  foo

Then have a script that you can run after updating that reads and 
applies the properties:

#!/bin/sh

for i in *
do
   chmod `svn propget mode $i` $i
   chown `svn propget owner $i`.`svn propget group $i` $i
done


(The above is pseudo-code, don't expect it to "just work".)

Subversion does have the svn:executable property, which has set some 
sort of precident for integrating this sort of thing.  People who, for 
example, version-control their /etc files need something like this.  A 
client-side post-update hook script would work -- but a wrapper like the 
above around svn update has the same effect.

--Phil.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org