about summary refs log tree commit homepage
path: root/dev.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-01-19 14:09:33 -0800
committerEric Wong <normalperson@yhbt.net>2012-01-19 14:09:33 -0800
commit0789bade61b2c496476d340c286b3c1616783c79 (patch)
treea77416ca17dde6c01b8f9465d4b1f1d7c2807472 /dev.c
parentbce34e22e45d399eab309fe145db492526cce9cf (diff)
downloadcmogstored-0789bade61b2c496476d340c286b3c1616783c79.tar.gz
We don't want files to be globally readable/writable
when writing is in-progress.
Diffstat (limited to 'dev.c')
-rw-r--r--dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dev.c b/dev.c
index 1c3641a..f7727a9 100644
--- a/dev.c
+++ b/dev.c
@@ -82,6 +82,7 @@ int mog_dev_mkusage(const struct mog_dev *dev, struct mog_svc *svc)
         if (fd < 0) goto out;
         if (fstatvfs(fd, &v) < 0) goto out;
         if (emit_usage(dev, svc, fd, &v) < 0) goto out;
+        if (fchmod(fd, svc->put_perms) < 0) goto out;
 
         /* skip rename on EIO or EBADF if close() fails */
         fd = close(fd);