]> granicus.if.org Git - apache/commitdiff
Use ap_strchr instead of strchr and get the constness right.
authorRoy T. Fielding <fielding@apache.org>
Fri, 17 Jan 2003 04:42:43 +0000 (04:42 +0000)
committerRoy T. Fielding <fielding@apache.org>
Fri, 17 Jan 2003 04:42:43 +0000 (04:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98304 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_authn_dbm.c
modules/aaa/mod_authz_dbm.c
modules/aaa/mod_authz_host.c

index 164e032f24b01ab899508c76d6b8c32f519f25e4..0547cb77f61066c25f0771402a7c5835ba8dd626 100644 (file)
@@ -175,7 +175,7 @@ static authn_status check_dbm_pw(request_rec *r, const char *user,
         return AUTH_USER_NOT_FOUND;
     }
 
-    colon_pw = strchr(dbm_password, ':');
+    colon_pw = ap_strchr(dbm_password, ':');
     if (colon_pw) {
         *colon_pw = '\0';
     }
@@ -213,7 +213,7 @@ static authn_status get_dbm_realm_hash(request_rec *r, const char *user,
         return AUTH_USER_NOT_FOUND;
     }
 
-    colon_hash = strchr(dbm_hash, ':');
+    colon_hash = ap_strchr(dbm_hash, ':');
     if (colon_hash) {
         *colon_hash = '\0';
     }
index 3f4b0b9d180b5fed3ff00487d3c32b9ad50ef5bc..759b80ae2f5c28743abec594cee0fa96a4335e43 100644 (file)
@@ -156,7 +156,7 @@ static apr_status_t get_dbm_grp(request_rec *r, char *key1, char *key2,
                                 char *dbmgrpfile, char *dbtype,
                                 const char ** out)
 {
-    char *grp_colon;
+    char *grp_colon, *val;
     apr_status_t retval;
     apr_dbm_t *f;
 
@@ -168,20 +168,23 @@ static apr_status_t get_dbm_grp(request_rec *r, char *key1, char *key2,
     }
 
     /* Try key2 only if key1 failed */
-    if (!(*out = get_dbm_entry_as_str(r->pool, f, key1))) {
-        *out = get_dbm_entry_as_str(r->pool, f, key2);
+    if (!(val = get_dbm_entry_as_str(r->pool, f, key1))) {
+        val = get_dbm_entry_as_str(r->pool, f, key2);
     }
 
     apr_dbm_close(f);
 
-    if (*out && (grp_colon = strchr(*out, ':')) != NULL) {
-        char *grp_colon2 = strchr(++grp_colon, ':');
+    if (val && (grp_colon = ap_strchr(val, ':')) != NULL) {
+        char *grp_colon2 = ap_strchr(++grp_colon, ':');
 
         if (grp_colon2) {
             *grp_colon2 = '\0';
         }
         *out = grp_colon;
     }
+    else {
+        *out = val;
+    }
 
     return retval;
 }
index c6a53ae161862059a384a2cc431edcd85127cc9f..554ab990f7a40b2afb97677a8c49a5d4127b2b6d 100644 (file)
@@ -173,7 +173,7 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from,
     else if (!strcasecmp(where, "all")) {
         a->type = T_ALL;
     }
-    else if ((s = strchr(where, '/'))) {
+    else if ((s = ap_strchr(where, '/'))) {
         *s++ = '\0';
         rv = apr_ipsubnet_create(&a->x.ip, where, s, cmd->pool);
         if(APR_STATUS_IS_EINVAL(rv)) {