Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here's my current structure:

script.py
apps/
|-generated-folder-1/
  |- [files]
|- generated-folder-2/
  |- [files]
|- generated-folder-3/
  |- [files]

How do I set up permissions so that script.py (which is kicked off via a POST; I can't really use sudo or anything like that) has permissions to create new folders and modify anything inside those folders, however the files inside each folder are 100% sandboxed?

Each generated folder is a git checkout (done by script.py), from random people. I do my best to ensure no rogue files will be checked out, but I'm worried it's potentially possible a .php file or something might slip past me. In that case, I don't want it to have the ability to touch anything outside its own folder.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

If script.py does not run with root permissions, you could simply change the owner of the folders you do not want changed...

If there are more complicated requirements, let script.py only write to a staging area and have another script do a vetted copy...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.