Handle shared/private/unbindable/slave mounts internally.
[util-vserver.git] / src / secure-mount.c
index 57fe874..3ef6edf 100644 (file)
@@ -418,6 +418,8 @@ canHandleInternal(struct MountInfo const *mnt)
   
   if (!mnt)                                 return false;
   else if ((mnt->flag & (MS_BIND|MS_MOVE))) return true;
+  else if ((mnt->flag & (MS_SHARED|MS_SLAVE|MS_PRIVATE|
+                        MS_UNBINDABLE)))   return true;
   else if (mnt->type==0)                    return false;
 
   for (i=FS+0; *i!=0; ++i)
@@ -448,8 +450,7 @@ mountSingle(struct MountInfo const *mnt, struct Options const *opt)
        return false;
       if (mount(mnt->src, ".",
                mnt->type ? mnt->type : "",
-               ((mnt->flag & ~(MS_BIND|MS_REC)) |
-               MS_REMOUNT), NULL) == -1 &&
+               (mnt->flag | MS_REMOUNT), NULL) == -1 &&
          errno != EBUSY) { /* Returned on older kernels */
        perror("secure-mount: mount()");
        return false;