summaryrefslogtreecommitdiff
path: root/source3/lib/access.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-10-22 23:38:18 +0000
committerJeremy Allison <jra@samba.org>2003-10-22 23:38:18 +0000
commit2710c35e549bb7775a8efe3265b105e594ad26ba (patch)
treebb72b0ffdf54c716dca54fbe5a22f3ef7c510a52 /source3/lib/access.c
parentbca9e7d3258058594daaaedd2518fcb2c793ded0 (diff)
downloadsamba-2710c35e549bb7775a8efe3265b105e594ad26ba.tar.gz
samba-2710c35e549bb7775a8efe3265b105e594ad26ba.tar.bz2
samba-2710c35e549bb7775a8efe3265b105e594ad26ba.zip
Put strcasecmp/strncasecmp on the banned list (except for needed calls
in iconv.c and nsswitch/). Using them means you're not thinking about multibyte at all and I really want to discourage that. Jeremy. (This used to be commit 5c050a735f86927c7ef2a98b6f3a56abe39e4674)
Diffstat (limited to 'source3/lib/access.c')
-rw-r--r--source3/lib/access.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/lib/access.c b/source3/lib/access.c
index a874c8b1e2..62414726fb 100644
--- a/source3/lib/access.c
+++ b/source3/lib/access.c
@@ -71,7 +71,7 @@ static BOOL string_match(const char *tok,const char *s, char *invalid_char)
if (tok[0] == '.') { /* domain: match last fields */
if ((str_len = strlen(s)) > (tok_len = strlen(tok))
- && strcasecmp(tok, s + str_len - tok_len) == 0)
+ && strequal(tok, s + str_len - tok_len))
return (True);
} else if (tok[0] == '@') { /* netgroup: look it up */
#ifdef HAVE_NETGROUP
@@ -107,14 +107,14 @@ static BOOL string_match(const char *tok,const char *s, char *invalid_char)
DEBUG(0,("access: netgroup support is not configured\n"));
return (False);
#endif
- } else if (strcasecmp(tok, "ALL") == 0) { /* all: match any */
+ } else if (strequal(tok, "ALL")) { /* all: match any */
return (True);
- } else if (strcasecmp(tok, "FAIL") == 0) { /* fail: match any */
+ } else if (strequal(tok, "FAIL")) { /* fail: match any */
return (FAIL);
- } else if (strcasecmp(tok, "LOCAL") == 0) { /* local: no dots */
- if (strchr_m(s, '.') == 0 && strcasecmp(s, "unknown") != 0)
+ } else if (strequal(tok, "LOCAL")) { /* local: no dots */
+ if (strchr_m(s, '.') == 0 && !strequal(s, "unknown"))
return (True);
- } else if (!strcasecmp(tok, s)) { /* match host name or address */
+ } else if (!strequal(tok, s)) { /* match host name or address */
return (True);
} else if (tok[(tok_len = strlen(tok)) - 1] == '.') { /* network */
if (strncmp(tok, s, tok_len) == 0)
@@ -175,7 +175,7 @@ static BOOL list_match(const char **list,const char *item,
*/
for (; *list ; list++) {
- if (strcasecmp(*list, "EXCEPT") == 0) /* EXCEPT: give up */
+ if (strequal(*list, "EXCEPT")) /* EXCEPT: give up */
break;
if ((match = (*match_fn) (*list, item))) /* True or FAIL */
break;
@@ -183,7 +183,7 @@ static BOOL list_match(const char **list,const char *item,
/* Process exceptions to True or FAIL matches. */
if (match != False) {
- while (*list && strcasecmp(*list, "EXCEPT"))
+ while (*list && !strequal(*list, "EXCEPT"))
list++;
for (; *list; list++) {
@@ -275,8 +275,8 @@ static BOOL only_ipaddrs_in_list(const char** list)
for (; *list ; list++) {
/* factor out the special strings */
- if (!strcasecmp(*list, "ALL") || !strcasecmp(*list, "FAIL") ||
- !strcasecmp(*list, "EXCEPT")) {
+ if (strequal(*list, "ALL") || strequal(*list, "FAIL") ||
+ strequal(*list, "EXCEPT")) {
continue;
}