Bug 24734 - Unable to use empty vars assigned in .htaccess
Summary: Unable to use empty vars assigned in .htaccess
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_env (show other bugs)
Version: 2.0.48
Hardware: All other
: P3 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2003-11-16 00:18 UTC by Markus Julen
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Julen 2003-11-16 00:18:36 UTC
It's no longer possible to set empty variables in the .htaccess files.
mod_env sets them, but #printenv (mod_include) crashes and #echo (mod_include) treats them as 
not defined - prints "(none)"

possible solution:

diff -rc org/modules/metadata/mod_env.c patched/modules/metadata/mod_env.c
*** org/modules/metadata/mod_env.c      Sun Nov 16 00:16:45 2003
--- patched/modules/metadata/mod_env.c  Sun Nov 16 00:17:30 2003
***************
*** 158,164 ****
      /* name is mandatory, value is optional.  no value means
       * set the variable to an empty string
       */
!     apr_table_setn(sconf->vars, name, value);
  
      return NULL;
  }
--- 158,168 ----
      /* name is mandatory, value is optional.  no value means
       * set the variable to an empty string
       */
!     if (value != NULL) {
!         apr_table_setn(sconf->vars, name, value);
!     } else {
!         apr_table_setn(sconf->vars, name, "");
!     }
  
      return NULL;
  }
Comment 1 Jeff Trawick 2003-11-16 22:53:06 UTC
just curious: when you say "It's no longer possible" you're comparing 1.3 with
2.0.48, right?
Comment 2 Markus Julen 2003-11-17 09:36:55 UTC
Yes, it works with 1.3 (1.3.26 was the latest I checked it on).

It doesn't work with 2.0.47 and .48 in .htaccess files (mod_env), but setting it in an html file works 
(mod_include).
Comment 3 Jeff Trawick 2003-11-19 00:19:30 UTC
Thanks for the response.  I expect to commit the fix in next 24h or so.
Comment 4 Jeff Trawick 2003-11-21 03:52:30 UTC
Thanks for your efforts!  The fix is now in Apache 2.1-dev and has been proposed
for merging into the stable branch (2.0.next).
Comment 5 Jeff Trawick 2003-12-04 06:49:09 UTC
now merged into stable branch for 2.0.49