This commit was manufactured by cvs2svn to create branch
[util-vserver.git] / util-vserver / src / reducecap.c
index 0efcb35..7124b11 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+#include "compat.h"
+
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
 #include "linuxcaps.h"
 #include "vserver.h"
 
+#ifndef CAP_QUOTACTL
+#  define CAP_QUOTACTL 29
+#endif
+
 extern int capget (struct __user_cap_header_struct *, struct __user_cap_data_struct *);
 extern int capset (struct __user_cap_header_struct *, struct __user_cap_data_struct *);
 
@@ -68,7 +77,7 @@ static void reducecap_print(struct __user_cap_data_struct *user)
                "CAP_SYS_TTY_CONFIG",
                "CAP_MKNOD",
                "CAP_LEASE",
-               "CAP_OPENDEV",
+               "CAP_QUOTACTL",
                NULL
        };
        int i;
@@ -119,7 +128,8 @@ int main (int argc, char *argv[])
                |(1<<CAP_SYS_NICE)
                |(1<<CAP_SYS_RESOURCE)
                |(1<<CAP_SYS_TIME)
-               |(1<<CAP_MKNOD);
+               |(1<<CAP_MKNOD)
+               |(1<<CAP_QUOTACTL);
        int i;
        for (i=1; i<argc; i++){
                const char *arg = argv[i];
@@ -183,6 +193,7 @@ int main (int argc, char *argv[])
                                {"--SYS_RESOURCE",CAP_SYS_RESOURCE},
                                {"--SYS_TIME",  CAP_SYS_TIME},
                                {"--MKNOD",             CAP_MKNOD},
+                               {"--QUOTACTL",          CAP_QUOTACTL},
                                {NULL,0}
                        };
                        int j;
@@ -218,7 +229,7 @@ int main (int argc, char *argv[])
                        if (show){
                                reducecap_print (&user);
                        }
-                       if (call_new_s_context(0,NULL,remove,flags)==-1){
+                       if (vc_new_s_context(-2,remove,flags)==-1){
                                perror ("new_s_context -2");
                        }else{
                                fprintf (stderr,"Executing\n");