allow both 'CAP_xxx' and 'xxx'
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 2 Feb 2004 18:54:15 +0000 (18:54 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 2 Feb 2004 18:54:15 +0000 (18:54 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@735 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib/capabilities.c

index 02813de..0552a8b 100644 (file)
@@ -70,8 +70,7 @@ int
 vc_text2cap(char const *str)
 {
   size_t       i;
-  if (strncmp(str, "CAP_", 4)!=0) return -1;
-  str += 4;
+  if (strncmp(str, "CAP_", 4)==0) str += 4;
 
   for (i=0; i<sizeof(CAP2BIT)/sizeof(CAP2BIT[0]); ++i)
     if (strcmp(CAP2BIT[i].id+4, str)==0) return CAP2BIT[i].bit;