[Bug 58304] New: Unexpected Warnings from Macro Use in 2.4

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 58304] New: Unexpected Warnings from Macro Use in 2.4

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

            Bug ID: 58304
           Summary: Unexpected Warnings from Macro Use in 2.4
           Product: Apache httpd-2
           Version: 2.4.16
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
          Assignee: [hidden email]
          Reporter: [hidden email]

Starting with 2.4.12 and still existing in 2.4.16, when using a Macro
definition for virtual hosts, I get repeated warnings to stdout that the macro
variables are undefined every time apache is started or during a syntax check:

root@dedi2:/home/tbrowde# apachectl -t
[Sun Aug 30 16:39:35.097827 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${PROJECT} is not defined
[Sun Aug 30 16:39:35.097911 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${TLD} is not defined
[Sun Aug 30 16:39:35.098007 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${PROJECT} is not defined
[Sun Aug 30 16:39:35.098021 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${TLD} is not defined
[Sun Aug 30 16:39:35.098562 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${PROJECT} is not defined
[Sun Aug 30 16:39:35.098575 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${TLD} is not defined
[Sun Aug 30 16:39:35.098889 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${PROJECT} is not defined
[Sun Aug 30 16:39:35.098904 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${TLD} is not defined
Syntax OK

I am using three macros that are defined in the httpd.conf file as follows:

<Macro VHOST_NONTLS ${PROJECT} ${TLD}>
  <VirtualHost *:80>
    ServerName  ${PROJECT}.${TLD}
    ServerAlias *.${PROJECT}.${TLD}
    DocumentRoot /home/web-server/${PROJECT}.${TLD}/public
  </VirtualHost>
</Macro>
Use VHOST_NONTLS niceville.pm          org
UndefMacro VHOST_NONTLS

<Macro VHOST_FREE_CERT_TLS ${PROJECT} ${TLD}>
  <VirtualHost *:80>
    ServerName  ${PROJECT}.${TLD}
    ServerAlias *.${PROJECT}.${TLD}
    # enforce ssl/tls
    Redirect Permanent / https://${PROJECT}.${TLD}/
  </VirtualHost>
</Macro>
Use VHOST_FREE_CERT_TLS  computertechnwf  org
UndefMacro VHOST_FREE_CERT_TLS

<Macro VHOST_WILDCARD_TLS ${PROJECT} ${TLD}>
  <VirtualHost *:80>
    ServerName  ${PROJECT}.${TLD}
    ServerAlias *.${PROJECT}.${TLD}
    # enforce ssl/tls
    Redirect Permanent / https://${PROJECT}.${TLD}/
  </VirtualHost>
  # ...
</Macro>
Use VHOST_WILDCARD_TLS highlandsprings61     org
UndefMacro VHOST_WILDCARD_TLS

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Tom Browder <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

--- Comment #1 from Marc Stern <[hidden email]> ---
${VAR} is interpreted as a defined variable
(http://httpd.apache.org/docs/2.4/mod/core.html#define). It's equivalent to
%{VAR}.

mod_macro uses the syntax $var but also ${var}, which is mandatory if you want
the variable to be a part of a string, like in "${var}abc".
The syntax clashes with the Define directive, so it should be changed. Ans
%{var} clashes with mod_rewrite.

This doe not only give a warning but could lead to a real mismatch between
something defined as a local parameter and somebody else defining it at a
global level as a defined config variable.

To make interpolation not clash with another module, we should use another
character (instead of an existing one or on top of?) like &{var}.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

--- Comment #2 from Marc Stern <[hidden email]> ---
Created attachment 34013
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34013&action=edit
Add warning about syntax clash

In case a macro argument uses the syntax ${...}, adds a warning that it clashes
with the 'Define' directive

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Marc Stern <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.4.16                      |2.4.20

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Marc Stern <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.4.20                      |2.5-HEAD
                 OS|Linux                       |All
           Hardware|PC                          |All

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Christophe JAILLET <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Core                        |mod_macro

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Ryan Ollos <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]