MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ACLStringHasSpaces

Function ACLStringHasSpaces

src/acl.cpp:208–213  ·  view source on GitHub ↗

Return 1 if the specified string contains spaces or null characters. * We do this for usernames and key patterns for simpler rewriting of * ACL rules, presentation on ACL list, and to avoid subtle security bugs * that may arise from parsing the rules in presence of escapes. * The function returns 0 if the string has no spaces. */

Source from the content-addressed store, hash-verified

206 * that may arise from parsing the rules in presence of escapes.
207 * The function returns 0 if the string has no spaces. */
208int ACLStringHasSpaces(const char *s, size_t len) {
209 for (size_t i = 0; i < len; i++) {
210 if (isspace(s[i]) || s[i] == 0) return 1;
211 }
212 return 0;
213}
214
215/* Given the category name the command returns the corresponding flag, or
216 * zero if there is no match. */

Callers 4

ACLSetUserFunction · 0.85
ACLLoadConfiguredUsersFunction · 0.85
ACLLoadFromFileFunction · 0.85
aclCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected