Received: (qmail 44456 invoked by uid 501); 1 Feb 2002 18:49:04 -0000 Message-Id: <20020201184904.44455.qmail@apache.org> Date: 1 Feb 2002 18:49:04 -0000 From: rodrigo campos Reply-To: camposr@uol.com.br To: submit@bugz.apache.org Subject: faulty perl script X-Send-Pr-Version: 3.110 >Number: 9686 >Category: mod_rewrite >Synopsis: faulty perl script >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: apache >Arrival-Date: Fri Feb 01 10:50:00 PST 2002 >Closed-Date: Wed Feb 06 11:03:52 PST 2002 >Last-Modified: Wed Feb 06 11:03:52 PST 2002 >Originator: camposr@uol.com.br >Release: 1.3.x >Organization: >Environment: apache site >Description: The perl script used to generate an ndbm file listed as an example at mod_rewrite documentation page does not treat comment and 'all space' correctly lines due to the fact that the s metacharacter is not escaped the use of dbmopen is deprecated dbmopen does not regenerate all records, creating an "always append" condition >How-To-Repeat: look at http://httpd.apache.org/docs/mod/mod_rewrite.html right after the RewriteMap directive >Fix: #!/path/to/bin/perl ## ## txt2dbm -- convert txt map to dbm format ## use NDBM_File; use Fcntl; ($txtmap, $dbmmap) = @ARGV; open(TXT, "<$txtmap"); tie (%DB, 'NDBM_File', $dbmmap,O_RDWR|O_TRUNC|O_CREAT, 0644); while () { next if (m|^\s*#.*| or m|^\s*$|); $DB{$1} = $2 if (m|^\s*(\S+)\s+(\S+)$|); } untie %DB; close(TXT) >Release-Note: >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: slive State-Changed-When: Wed Feb 6 11:03:52 PST 2002 State-Changed-Why: Thanks. We have made your changes along with a couple others suggested by someone on the docs list. The new version will be in the next release. >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]