diff options
author | Sascha Silbe <silbe@activitycentral.com> | 2011-03-06 01:26:35 (GMT) |
---|---|---|
committer | Sascha Silbe <silbe@activitycentral.com> | 2011-03-31 21:44:58 (GMT) |
commit | a7644fcca13db182cd44378ac1402f17c023e601 (patch) | |
tree | b1f55ecb09d6d4e5f05a51a2bf1ecc2d1d1462d9 | |
parent | ad9244e31184415e73be075e9ace053fca97d2f5 (diff) |
Make sure data store checkouts are read-only
We don't want anyone to be able to alter a file that is inside the data store,
bypassing the API.
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r-- | src/carquinyol/filestore.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/carquinyol/filestore.py b/src/carquinyol/filestore.py index 7094310..0b34b69 100644 --- a/src/carquinyol/filestore.py +++ b/src/carquinyol/filestore.py @@ -133,14 +133,6 @@ class FileStore(object): else: raise - # Try to make the original file readable. This can fail if the file is - # in a FAT filesystem. - try: - os.chmod(file_path, 0604) - except OSError, e: - if e.errno != errno.EPERM: - raise - return destination_path def get_file_path(self, uid): @@ -226,7 +218,7 @@ class AsyncCopy(object): self.src_fp = os.open(self.src, os.O_RDONLY) self.dest_fp = os.open(self.dest, os.O_RDWR | os.O_TRUNC | os.O_CREAT, - 0644) + 0444) stat = os.fstat(self.src_fp) self.size = stat[6] |