Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 47885

Summary: init script gawk "\.so" should be "\\.so"
Product: [Retired] Red Hat Linux Reporter: Tim Waugh <twaugh>
Component: apacheAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-08-10 14:32:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Here's the fix none

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.