do not call vc_new_s_context() when COMPAT API is not available
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 6 Apr 2004 08:44:09 +0000 (08:44 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 6 Apr 2004 08:44:09 +0000 (08:44 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1425 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/rpm-fake-resolver.c
util-vserver/src/rpm-fake.c

index a87e6ec..a89ee30 100644 (file)
@@ -251,9 +251,14 @@ activateContext(xid_t xid, bool in_ctx)
   }
   else if (vc_isSupported(vcFEATURE_MIGRATE))
       Evc_migrate_context(xid);
-  else 
+  else {
+#ifdef VC_ENABLE_API_COMPAT
     Evc_new_s_context(xid, 0, S_CTX_INFO_LOCK);
-    //Evc_new_s_context(args.ctx, ~(VC_CAP_SETGID|VC_CAP_SETUID), S_CTX_INFO_LOCK);
+#else
+    WRITE_MSG(2, ENSC_WRAPPERS_PREFIX "can not change context: migrate kernel feature missing and 'compat' API disabled\n");
+    exit(wrapper_exit_code);
+#endif
+  }
 }
 
 int main(int argc, char * argv[])
index fecdb8e..6386d42 100644 (file)
@@ -527,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);