]> granicus.if.org Git - apache/commitdiff
mod_userdir: Constify and save a few bytes in the conf pool when parsing
authorGraham Leggett <minfrin@apache.org>
Mon, 13 Jun 2016 23:20:20 +0000 (23:20 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 13 Jun 2016 23:20:20 +0000 (23:20 +0000)
"UserDir" directive

Submitted by: jailletc36
Reviewed by: jim, minfrin

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1748332 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/mappers/mod_userdir.c

diff --git a/CHANGES b/CHANGES
index 1250c794b6ed330c5cc288aa498fc69388a7ddc9..e6840fb008a8436f3a3801f40f822ff8a21cbc04 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.21
 
+  *) mod_userdir: Constify and save a few bytes in the conf pool when
+     parsing the "UserDir" directive. [Christophe Jaillet]
+
   *) mod_cache: Fix (max-stale with no '=') and enforce (check
      integers after '=') Cache-Control header parsing.
      [Christophe Jaillet]
diff --git a/STATUS b/STATUS
index ef667dad321cd57d66e6493d2341e9ded9605833..2b30ef0cd30ae2048e8edafae1dcde40d063d2a3 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -114,11 +114,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_userdir: Constify and save a few bytes in the conf pool when parsing
-     "UserDir" directive
-     trunk patch: http://svn.apache.org/r1745835
-     2.4.x: trunk works
-     +1: jailletc36, jim, minfrin
 
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
index b181e278d815ae1109190f1669dcd3352956ad61..1ec0e9010d259dca56681e2a97f963b192c87655 100644 (file)
@@ -89,7 +89,7 @@ module AP_MODULE_DECLARE_DATA userdir_module;
 
 typedef struct {
     int globally_disabled;
-    char *userdir;
+    const char *userdir;
     apr_table_t *enabled_users;
     apr_table_t *disabled_users;
 } userdir_config;
@@ -137,7 +137,7 @@ static const char *set_user_dir(cmd_parms *cmd, void *dummy, const char *arg)
                                                  &userdir_module);
     char *username;
     const char *usernames = arg;
-    char *kw = ap_getword_conf(cmd->pool, &usernames);
+    char *kw = ap_getword_conf(cmd->temp_pool, &usernames);
     apr_table_t *usertable;
 
     /* Since we are a raw argument, it is possible for us to be called with
@@ -173,7 +173,7 @@ static const char *set_user_dir(cmd_parms *cmd, void *dummy, const char *arg)
          * If the first (only?) value isn't one of our keywords, just copy
          * the string to the userdir string.
          */
-        s_cfg->userdir = apr_pstrdup(cmd->pool, arg);
+        s_cfg->userdir = arg;
         return NULL;
     }
     /*
@@ -182,7 +182,7 @@ static const char *set_user_dir(cmd_parms *cmd, void *dummy, const char *arg)
      */
     while (*usernames) {
         username = ap_getword_conf(cmd->pool, &usernames);
-        apr_table_setn(usertable, username, kw);
+        apr_table_setn(usertable, username, "1");
     }
     return NULL;
 }