aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/ssvm.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/ssvm.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/ssvm.c')
-rw-r--r--src/svm/ssvm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/svm/ssvm.c b/src/svm/ssvm.c
index e56e6b4523d..c04982de85a 100644
--- a/src/svm/ssvm.c
+++ b/src/svm/ssvm.c
@@ -13,10 +13,12 @@
* limitations under the License.
*/
#include "ssvm.h"
+#include "svm_common.h"
int
ssvm_master_init (ssvm_private_t * ssvm, u32 master_index)
{
+ svm_main_region_t *smr = svm_get_root_rp ()->data_base;
int ssvm_fd;
u8 *ssvm_filename;
u8 junk = 0;
@@ -47,6 +49,11 @@ ssvm_master_init (ssvm_private_t * ssvm, u32 master_index)
return SSVM_API_ERROR_CREATE_FAILURE;
}
+ if (fchmod (ssvm_fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) < 0)
+ clib_unix_warning ("ssvm segment chmod");
+ if (fchown (ssvm_fd, smr->uid, smr->gid) < 0)
+ clib_unix_warning ("ssvm segment chown");
+
if (lseek (ssvm_fd, ssvm->ssvm_size, SEEK_SET) < 0)
{
clib_unix_warning ("lseek");