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

Function sys_rctl_remove_rule

freebsd/kern/kern_rctl.c:1922–1953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1920}
1921
1922int
1923sys_rctl_remove_rule(struct thread *td, struct rctl_remove_rule_args *uap)
1924{
1925 struct rctl_rule *filter;
1926 char *inputstr;
1927 int error;
1928
1929 if (!racct_enable)
1930 return (ENOSYS);
1931
1932 error = priv_check(td, PRIV_RCTL_REMOVE_RULE);
1933 if (error != 0)
1934 return (error);
1935
1936 error = rctl_read_inbuf(&inputstr, uap->inbufp, uap->inbuflen);
1937 if (error != 0)
1938 return (error);
1939
1940 sx_slock(&allproc_lock);
1941 error = rctl_string_to_rule(inputstr, &filter);
1942 free(inputstr, M_RCTL);
1943 if (error != 0) {
1944 sx_sunlock(&allproc_lock);
1945 return (error);
1946 }
1947
1948 error = rctl_rule_remove(filter);
1949 rctl_rule_release(filter);
1950 sx_sunlock(&allproc_lock);
1951
1952 return (error);
1953}
1954
1955/*
1956 * Update RCTL rule list after credential change.

Callers

nothing calls this directly

Calls 6

rctl_read_inbufFunction · 0.85
rctl_string_to_ruleFunction · 0.85
rctl_rule_removeFunction · 0.85
rctl_rule_releaseFunction · 0.85
priv_checkFunction · 0.70
freeFunction · 0.70

Tested by

no test coverage detected