fix casper initialization for setting scripts.
MFC after: 1 week
This commit is contained in:
parent
a92526f3f1
commit
1def0a6257
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368111
@ -333,6 +333,7 @@ init_capabilities(void)
|
||||
#ifdef WITH_CASPER
|
||||
const char *const scripts[] =
|
||||
{ resolvconf_script, managedconf_script, otherconf_script };
|
||||
const char *scripts_set[nitems(scripts)];
|
||||
cap_channel_t *capcasper;
|
||||
nvlist_t *limits;
|
||||
int count;
|
||||
@ -351,9 +352,9 @@ init_capabilities(void)
|
||||
count = 0;
|
||||
for (size_t i = 0; i < nitems(scripts); i++)
|
||||
if (scripts[i] != NULL)
|
||||
count++;
|
||||
scripts_set[count++] = scripts[i];
|
||||
limits = nvlist_create(0);
|
||||
nvlist_add_string_array(limits, "scripts", scripts, count);
|
||||
nvlist_add_string_array(limits, "scripts", scripts_set, count);
|
||||
if (cap_limit_set(capscript, limits) != 0)
|
||||
return (-1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user