use $(LIBENSCVECTOR) instead of libensc_vector.a
[util-vserver.git] / util-vserver / src / setattr.c
index b7665a6..4513ac9 100644 (file)
@@ -44,11 +44,20 @@ CMDLINE_OPTIONS[] = {
   { "hide",        no_argument, 0, CMD_HIDE  },
   { "barrier",     no_argument, 0, CMD_BARRIER },
   { "~iunlink",    no_argument, 0, CMD_UNSET_IMMU  },
+  { "!iunlink",    no_argument, 0, CMD_UNSET_IMMU  },
   { "~immu",       no_argument, 0, CMD_UNSET_IMMU  },
+  { "!immu",       no_argument, 0, CMD_UNSET_IMMU  },
   { "~admin",      no_argument, 0, CMD_UNSET_ADMIN },
+  { "!admin",      no_argument, 0, CMD_UNSET_ADMIN },
   { "~watch",      no_argument, 0, CMD_UNSET_WATCH },
+  { "!watch",      no_argument, 0, CMD_UNSET_WATCH },
   { "~hide",       no_argument, 0, CMD_UNSET_HIDE  },
+  { "!hide",       no_argument, 0, CMD_UNSET_HIDE  },
   { "~barrier",    no_argument, 0, CMD_UNSET_BARRIER },
+  { "!barrier",    no_argument, 0, CMD_UNSET_BARRIER },
+  { "iunlink-but-not-immutable",   no_argument, 0, CMD_IMMUX },
+  { "~iunlink-but-not-immutable",  no_argument, 0, CMD_UNSET_IMMUX },
+  { "!iunlink-but-not-immutable",  no_argument, 0, CMD_UNSET_IMMUX },
   { 0,0,0,0 }
 };
 
@@ -60,7 +69,7 @@ showHelp(int fd, char const *cmd, int res)
   WRITE_MSG(fd, "Usage:  ");
   WRITE_STR(fd, cmd);
   WRITE_MSG(fd,
-           " [-Rx] [--[~]iunlink] [--[~]admin] [--[~]watch] [--[~]hide] [--[~]barrier] [--] <file>+\n\n"
+           " [-Rx] [--[~](iunlink|admin|watch|hide|barrier|iunlink-but-not-immutable)]* [--] <file>+\n\n"
            " Options:\n"
            "   -R  ...  recurse through directories\n"
            "   -x  ...  do not cross filesystems\n\n"
@@ -92,14 +101,12 @@ fixupParams(struct Arguments * args, int argc)
 }
 
 bool
-handleFile(char const *name, char const * display_name,
-          struct stat const *exp_st)
+handleFile(char const *name, char const * display_name)
 {
-  int rc = vc_set_iattr_compat(name, exp_st->st_dev, exp_st->st_ino,
-                              0,
-                              global_args->set_mask & ~global_args->del_mask,
-                              global_args->set_mask |  global_args->del_mask,
-                              &exp_st->st_mode);
+  int rc = vc_set_iattr(name,
+                       0,
+                       global_args->set_mask & ~global_args->del_mask,
+                       global_args->set_mask |  global_args->del_mask);
 
   if (rc==-1) {
     perror(display_name);