Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
access, esfilter: reindex calls fix, fixes #2462
  • Loading branch information
perexg committed Nov 10, 2014
1 parent dc39920 commit 7c00e47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/access.c
Expand Up @@ -843,6 +843,7 @@ access_entry_create(const char *uuid, htsmsg_t *conf)
TAILQ_INSERT_TAIL(&access_entries, ae, ae_link);
} else {
TAILQ_INSERT_TAIL(&access_entries, ae, ae_link);
access_entry_reindex();
}

if (ae->ae_username == NULL)
Expand All @@ -854,8 +855,6 @@ access_entry_create(const char *uuid, htsmsg_t *conf)
if (TAILQ_FIRST(&ae->ae_ipmasks) == NULL)
access_set_prefix_default(ae);

access_entry_reindex();

return ae;
}

Expand Down Expand Up @@ -1357,6 +1356,7 @@ access_init(int createdefault, int noacl)
(void)access_entry_create(f->hmf_name, m);
}
htsmsg_destroy(c);
access_entry_reindex();
}

if(TAILQ_FIRST(&access_entries) == NULL) {
Expand Down
6 changes: 5 additions & 1 deletion src/esfilter.c
Expand Up @@ -180,8 +180,9 @@ esfilter_create
TAILQ_INSERT_SORTED(&esfilters[esf->esf_class], esf, esf_link, esfilter_cmp);
} else {
TAILQ_INSERT_TAIL(&esfilters[esf->esf_class], esf, esf_link);
esfilter_reindex(esf->esf_class);
}
if (!conf)
esfilter_reindex(esf->esf_class);
if (save)
esfilter_class_save((idnode_t *)esf);
return esf;
Expand Down Expand Up @@ -1045,6 +1046,9 @@ esfilter_init(void)
esfilter_create(-1, f->hmf_name, e, 0);
}
htsmsg_destroy(c);

for (i = 0; i <= ESF_CLASS_LAST; i++)
esfilter_reindex(i);
}

void
Expand Down

0 comments on commit 7c00e47

Please sign in to comment.