summaryrefslogtreecommitdiffstats
path: root/src/svm/svm.c
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2017-08-31 15:54:11 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-09-06 22:35:52 +0000
commit19296116be4754e43751399e25f5206cafc70c1f (patch)
tree0ae1ef925398cab98a8d910d94776db38e0ec6fd /src/svm/svm.c
parent91f3e744a37b9f6f3c87ac45e54142f16fd2d3d5 (diff)
Set uid/gid on ssvm segment file.
Change-Id: I482bb9654f4dfe240bace5c2b61056cfd04cf018 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/svm/svm.c')
-rw-r--r--src/svm/svm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/svm/svm.c b/src/svm/svm.c
index 14c5bd9b2aa..f97803cd7af 100644
--- a/src/svm/svm.c
+++ b/src/svm/svm.c
@@ -471,7 +471,7 @@ svm_map_region (svm_map_region_args_t * a)
if (svm_fd >= 0)
{
- if (fchmod (svm_fd, 0770) < 0)
+ if (fchmod (svm_fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) < 0)
clib_unix_warning ("segment chmod");
/* This turns out to fail harmlessly if the client starts first */
if (fchown (svm_fd, a->uid, a->gid) < 0)
@@ -774,6 +774,8 @@ svm_region_init_internal (svm_map_region_args_t * a)
vec_validate (mp, 0);
mp->name_hash = hash_create_string (0, sizeof (uword));
mp->root_path = a->root_path ? format (0, "%s%c", a->root_path, 0) : 0;
+ mp->uid = a->uid;
+ mp->gid = a->gid;
rp->data_base = mp;
svm_pop_heap (oldheap);
}