cleanups
[util-vserver.git] / util-vserver / src / rpm-fake.c
index 1fadadb..6386d42 100644 (file)
@@ -195,9 +195,10 @@ setupContext(xid_t xid, char const **xid_str)
       l = utilvserver_fmt_uint(buf+sizeof("rpm-fake.so #")-1, getppid());
       Evc_set_vhi_name(rc, vcVHI_CONTEXT, buf, sizeof("rpm-fake.so #")+l-1);
 
-      caps.ccaps = ~0;
-      caps.cmask = ~0;
-      caps.bcaps = ~vc_get_securecaps();
+      caps.ccaps = ~0ull;
+      caps.cmask = ~0ull;
+      caps.bcaps = ~vc_get_insecurecaps();
+      caps.bmask = ~0ull;
       Evc_set_ccaps(rc, &caps);
       
        // context will be activated later...
@@ -526,13 +527,17 @@ endpwent()
 static int
 execvWorker(char const *path, char * const argv[])
 {
-  int          res;
+  int          res = -1;
 
   if (vc_isSupported(vcFEATURE_MIGRATE))
     res = vc_migrate_context(ctx);
   else
+#ifdef VC_ENABLE_API_COMPAT  
     res = vc_new_s_context(ctx,caps,flags);
-  
+#else
+    WRITE_MSG(2, ENSC_WRAPPERS_PREFIX "can not change context: migrate kernel feature missing and 'compat' API disabled\n");
+#endif
+    
   if (res!=-1)
     res=execv_func(path, argv);