{ NULL, 0, 0 },
};
-#if HAVE_LIBCAP
static struct caps_opt caps_opt[] = {
+#if HAVE_LIBCAP
{ "chown", CAP_CHOWN },
{ "dac_override", CAP_DAC_OVERRIDE },
{ "dac_read_search", CAP_DAC_READ_SEARCH },
#ifdef CAP_BLOCK_SUSPEND
{ "block_suspend", CAP_BLOCK_SUSPEND },
#endif
-};
-#else
-static struct caps_opt caps_opt[] = {};
#endif
+};
static int run_buffer(char *buffer)
{
char *ptr = NULL;
size_t i;
int capid = -1;
+ size_t end = sizeof(caps_opt)/sizeof(caps_opt[0]);
if (!strcmp(cap, "none"))
return -2;
- for (i = 0; i < sizeof(caps_opt)/sizeof(caps_opt[0]); i++) {
+ for (i = 0; i < end; i++) {
if (strcmp(cap, caps_opt[i].name))
continue;