Skip to content

Commit 59a1746

Browse files
author
Felipe Zimmerle
committed
Using real server signature on status call
On Apache platform the server signature can be replaced using the SecServerSignature directive. Status call was using the signature informed by this directive instead of using the original one. As reported at #702.
1 parent 8305600 commit 59a1746

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

apache2/mod_security2.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ char DSOLOCAL *chroot_dir = NULL;
5454

5555
char DSOLOCAL *new_server_signature = NULL;
5656

57-
static char *real_server_signature = NULL;
57+
char DSOLOCAL *real_server_signature = NULL;
5858

5959
char DSOLOCAL *guardianlog_name = NULL;
6060

apache2/modsecurity.h

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ typedef struct msc_parm msc_parm;
133133
#define FATAL_ERROR "ModSecurity: Fatal error (memory allocation or unexpected internal error)!"
134134

135135
extern DSOLOCAL char *new_server_signature;
136+
extern DSOLOCAL char *real_server_signature;
136137
extern DSOLOCAL char *chroot_dir;
137138

138139
extern module AP_MODULE_DECLARE_DATA security2_module;

apache2/msc_status_engine.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,7 @@ int DSOLOCAL msc_beacon_string (char *beacon_string, int beacon_string_max_len)
349349
#endif
350350
libxml = LIBXML_DOTTED_VERSION;
351351
modsec = MODSEC_VERSION;
352-
#ifdef WIN32
353-
apache = "IIS";
354-
#else
355-
apache = apache_get_server_version();
356-
#endif
352+
apache = real_server_signature;
357353

358354
/* 6 represents: strlen("(null)") */
359355
beacon_string_len = (modsec ? strlen(modsec) : 6) +

0 commit comments

Comments
 (0)