#undef NDEBUG
[util-vserver.git] / util-vserver / lib / capabilities.c
index ad1b4f9..fcee4f0 100644 (file)
@@ -63,15 +63,14 @@ static struct {
   DECLARECAP(CAP_SYS_TTY_CONFIG,   26),
   DECLARECAP(CAP_MKNOD,            27),
   DECLARECAP(CAP_LEASE,            28),
-  DECLARECAP(CAP_OPENDEV,          29),
+  DECLARECAP(CAP_QUOTACTL,         29),
 };
   
 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;
@@ -80,8 +79,8 @@ vc_text2cap(char const *str)
 }
 
 char const *
-vc_cap2text(int bit)
+vc_cap2text(unsigned int bit)
 {
-  if (bit<0 || (size_t)bit>=sizeof(CAP2BIT)/sizeof(CAP2BIT[0])) return 0;
+  if ((size_t)bit>=sizeof(CAP2BIT)/sizeof(CAP2BIT[0])) return 0;
   return CAP2BIT[bit].id;
 }