Bug 47885 - init script gawk "\.so" should be "\\.so"
Summary: init script gawk "\.so" should be "\\.so"
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: apache
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-08 21:46 UTC by Tim Waugh
Modified: 2007-04-18 16:34 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-08-10 14:32:33 UTC
Embargoed:


Attachments (Terms of Use)
Here's the fix (285 bytes, patch)
2001-07-08 21:46 UTC, Tim Waugh
no flags Details | Diff

Description Tim Waugh 2001-07-08 21:46:31 UTC
apache-1.3.20-5                                                          

Description of Problem:
[root@turmoil piranha]# service httpd start
Starting httpd: awk: cmd. line:1: warning: escape sequence `\.' treated 
as plain `.'
                                                           [  OK  ]

How Reproducible:
100%

Steps to Reproduce:
1. service httpd start

Actual Results:
Error message

Expected Results:
No error message

Additional Information:
It's an initscript bug, which triggers a warning from the newer gawk 
package.

Comment 1 Tim Waugh 2001-07-08 21:46:54 UTC
Created attachment 23007 [details]
Here's the fix

Comment 2 Gerald Teschl 2001-07-09 16:04:41 UTC
Maybe even better:
--- httpd.orig  Mon Jul  9 17:48:12 2001
+++ httpd       Mon Jul  9 18:06:52 2001
@@ -30,14 +30,12 @@
 # Change the major functions into functions.
 moduleargs() {
        moduledir=/usr/lib/apache
-       moduleargs=`
        /usr/bin/find ${moduledir} -type f -perm -0100 -name "*.so" | awk '{\
                gsub(".*/","");\
                gsub("^mod_","");\
                gsub("^lib","");\
-               gsub("\.so$","");\
-               print "-DHAVE_" toupper($0)}'`
-       echo ${moduleargs}
+               gsub("\\.so$","");\
+               print "-DHAVE_" toupper($0)}'
 }
 start() {
        echo -n $"Starting $prog: "

Comment 3 Glen Foster 2001-07-13 22:06:18 UTC
This defect considered MUST-FIX for Fairfax gold-release.

Comment 4 Michal Jaegermann 2001-07-22 00:24:38 UTC
Actually this fix is of "so-so" kind (as is the subject of this report).
Instead of abusing automatic conversions by awk of strings into
regexps, when strings are used in such role, one should really use
regexps and write /\.so$/, and similar for all first arguments of gsub.

Such "silent conversion" has its surprises and "\." escape is indeed
not valid _in a string_!  This form /\.so$/ is valid.  See for yourself.

Comment 5 Pekka Savola 2001-07-22 19:52:03 UTC
Also see #46221 in public rawhide section.


Comment 6 Nalin Dahyabhai 2001-08-06 21:57:03 UTC
Ah, thanks for the clarifications on awk syntax.  This should be resolved in
apache-1.3.20-10, coming soon to Raw Hide.

Comment 7 Tim Waugh 2001-08-10 14:32:29 UTC
Works for me.



Note You need to log in before you can comment on or make changes to this bug.