/* Forward check. */
tq_foreach_fwd(&userspecs, us) {
tq_foreach_fwd(&us->users, m) {
- if (m->type == USERALIAS) {
- if (find_alias(m->name, m->type) == NULL) {
+ if (m->type == ALIAS) {
+ alias_seqno++;
+ if (find_alias(m->name, USERALIAS) == NULL) {
warningx("%s: User_Alias `%s' referenced but not defined",
strict ? "Error" : "Warning", m->name);
error++;
}
tq_foreach_fwd(&us->privileges, priv) {
tq_foreach_fwd(&priv->hostlist, m) {
- if (m->type == HOSTALIAS) {
- if (find_alias(m->name, m->type) == NULL) {
+ if (m->type == ALIAS) {
+ alias_seqno++;
+ if (find_alias(m->name, HOSTALIAS) == NULL) {
warningx("%s: Host_Alias `%s' referenced but not defined",
strict ? "Error" : "Warning", m->name);
error++;
}
tq_foreach_fwd(&priv->cmndlist, cs) {
tq_foreach_fwd(&cs->runasuserlist, m) {
- if (m->type == RUNASALIAS) {
- if (find_alias(m->name, m->type) == NULL) {
+ if (m->type == ALIAS) {
+ alias_seqno++;
+ if (find_alias(m->name, RUNASALIAS) == NULL) {
warningx("%s: Runas_Alias `%s' referenced but not defined",
strict ? "Error" : "Warning", m->name);
error++;
}
}
}
- if ((m = cs->cmnd)->type == CMNDALIAS) {
- if (find_alias(m->name, m->type) == NULL) {
+ if ((m = cs->cmnd)->type == ALIAS) {
+ alias_seqno++;
+ if (find_alias(m->name, CMNDALIAS) == NULL) {
warningx("%s: Cmnd_Alias `%s' referenced but not defined",
strict ? "Error" : "Warning", m->name);
error++;
/* Reverse check (destructive) */
tq_foreach_fwd(&userspecs, us) {
tq_foreach_fwd(&us->users, m) {
- if (m->type == USERALIAS)
- (void) alias_remove(m->name, m->type);
+ if (m->type == ALIAS)
+ (void) alias_remove(m->name, USERALIAS);
}
tq_foreach_fwd(&us->privileges, priv) {
tq_foreach_fwd(&priv->hostlist, m) {
- if (m->type == HOSTALIAS)
- (void) alias_remove(m->name, m->type);
+ if (m->type == ALIAS)
+ (void) alias_remove(m->name, HOSTALIAS);
}
tq_foreach_fwd(&priv->cmndlist, cs) {
tq_foreach_fwd(&cs->runasuserlist, m) {
- if (m->type == RUNASALIAS)
- (void) alias_remove(m->name, m->type);
+ if (m->type == ALIAS)
+ (void) alias_remove(m->name, RUNASALIAS);
}
- if ((m = cs->cmnd)->type == CMNDALIAS)
- (void) alias_remove(m->name, m->type);
+ if ((m = cs->cmnd)->type == ALIAS)
+ (void) alias_remove(m->name, CMNDALIAS);
}
}
}