MCPcopy Create free account
hub / github.com/F-Stack/f-stack / parse_rules

Function parse_rules

freebsd/security/mac_portacl/mac_portacl.c:240–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240static int
241parse_rules(char *string, struct rulehead *head)
242{
243 struct rule *new;
244 char *element;
245 int error;
246
247 error = 0;
248 while ((element = strsep(&string, ",")) != NULL) {
249 if (strlen(element) == 0)
250 continue;
251 error = parse_rule_element(element, &new);
252 if (error)
253 goto out;
254 TAILQ_INSERT_TAIL(head, new, r_entries);
255 }
256out:
257 if (error != 0)
258 toast_rules(head);
259 return (error);
260}
261
262/*
263 * rule_printf() and rules_to_string() are unused currently because they rely

Callers 1

sysctl_rulesFunction · 0.85

Calls 3

strsepFunction · 0.85
parse_rule_elementFunction · 0.85
toast_rulesFunction · 0.85

Tested by

no test coverage detected