VPP-1299: Reset uid/gid on shared memory segment if client starts first.
[vpp.git] / src / svm / svm.c
index afba54e..7d98fbe 100644 (file)
@@ -652,6 +652,10 @@ svm_map_region (svm_map_region_args_t * a)
          return (0);
        }
 
+      /* Reset ownership in case the client started first */
+      if (fchown (svm_fd, a->uid, a->gid) < 0)
+       clib_unix_warning ("segment chown [ok if client starts first]");
+
       time_left = 20;
       while (1)
        {