Add cow to setattr.
[util-vserver.git] / src / secure-mount.c
index 6dc2c41..3ca4257 100644 (file)
@@ -112,7 +112,19 @@ CMDLINE_OPTIONS[] = {
 };
 
 #ifndef MS_REC
-#  define MS_REC       0x4000
+#define MS_REC         0x4000
+#endif
+#ifndef MS_UNBINDABLE
+#define MS_UNBINDABLE  (1<<17)
+#endif
+#ifndef MS_PRIVATE
+#define MS_PRIVATE     (1<<18)
+#endif
+#ifndef MS_SLAVE
+#define MS_SLAVE       (1<<19)
+#endif
+#ifndef MS_SHARED
+#define MS_SHARED      (1<<20)
 #endif
 
 static struct FstabOption {
@@ -153,6 +165,11 @@ static struct FstabOption {
   { "noauto",     0,              0,               XFLAG_NOAUTO, false },
   { "user",       0,              0,               0, false },
   { "nouser",     0,              0,               0, false },
+  { "rec",        MS_REC,         MS_REC,          0, false },
+  { "unbindable", MS_UNBINDABLE,  MS_UNBINDABLE,   0, false },
+  { "private",    MS_PRIVATE,     MS_PRIVATE,      0, false },
+  { "slave",      MS_SLAVE,       MS_SLAVE,        0, false },
+  { "shared",     MS_SHARED,      MS_SHARED,       0, false },
 };
 
 int                    wrapper_exit_code = 1;
@@ -413,6 +430,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)
@@ -443,8 +462,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;