0

I work with OS X, Snow Leopard and need to allow users to make copies of files (templates) located in a read-only repository for subsequent editing.

The repository is located on a separate physical drive mounted to the OS X boot volume.

As this is a shared computer in a school environment, all users access the machine via a single login ("user_local").

Whether using POSIX permissions or ACLs, the use case requires the file permissions to change from "read" to "read write" as they get copied to the "user_local" home directory.

Googling around has not yielded anything that would indicate that this is possible via the Snow Leopard permission system.

Question 1:
Is this in fact possible via the permission system?
If so, how?

Question 2:
If not possible, how would one go about solving this problem?
I imagine this to be a fairly common use case so there must be a workable solution for it out there.

Thanks.

2 Answers 2

0

What I would probably do if presented this is to write a little bash script. You can use the cp command to copy the file. cp link The chmod command will allow you to change the permissions. chmod link You should be able to set up a cron job to run every night or whenever you needed. Make sure when running the script you have fallen into sudo -s or sudo in front of every command. There is a way to lock the file on ubuntu so you aren't required to enter sudo or sudo -s but I can't think about it off the top of my head.

0

If you make the original templates read/write but not writeable by the local_user, then both Finder drag copy and cp will preserve the original file permissions, but not owner.

So if the original template files have permissions like:

-rw-r--r--   1 root  wheel  ... rw-file
-r--r--r--   1 root  wheel  ... ro-file

When some unprivileged local_user copies those file into their own dir they will become:

-rw-r--r--  1 local_user  staff  ... Documents/rw-file
-r--r--r--  1 local_user  staff  ... Documents/ro-file

See that the 'rw-' attributes of root-owned file "rw-file" were preserved even though the owner changed in the new copies.

1
  • Works as advertised. So simple too, not sure what I did wrong in the first place. In any case, thanks for taking the time to answer. Mar 20, 2012 at 9:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .