Skip to content

Commit 2fd45f8

Browse files
authored
Merge pull request owasp-modsecurity#3146 from eduar-hte/seclang-scanner-nounistd
Update to seclang-scanner changes introduced by Windows support
2 parents 37776fd + 5a543d9 commit 2fd45f8

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ build/ltoptions.m4
1111
build/ltsugar.m4
1212
build/ltversion.m4
1313
build/lt~obsolete.m4
14+
build/win32/build
15+
build/win32/CMakeUserPresets.json
1416
compile
1517
config.guess
1618
config.log
1719
config.status
1820
config.sub
21+
config.h.in~
1922
configure
23+
configure~
2024
depcomp
25+
modsecurity.pc
2126
.deps
2227
.libs
2328
.dirstamp

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ Details on distribution specific builds can be found in our Wiki:
7171

7272
### Windows
7373

74-
Windows build is not ready yet.
75-
74+
Windows build information can be found [here](build/win32/README.md).
7675

7776
## Dependencies
7877

build/win32/docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ WORKDIR C:\
5656
RUN cmd.exe /C md %SRC_DIR%
5757

5858
# libModSecurity
59-
WORKDIR C:\src
59+
WORKDIR ${SCR_DIR}
6060

6161
ARG MOD_SECURITY_TAG=v3/master
6262
RUN git clone -c advice.detachedHead=false --depth 1 --branch %MOD_SECURITY_TAG% https://github.com/owasp-modsecurity/ModSecurity.git

src/parser/seclang-scanner.cc

+5-8
Original file line numberDiff line numberDiff line change
@@ -4900,13 +4900,14 @@ static std::stack<int> YY_PREVIOUS_STATE;
49004900
// The location of the current token.
49014901
#line 4902 "seclang-scanner.cc"
49024902
#define YY_NO_INPUT 1
4903+
#define YY_NO_UNISTD_H 1
49034904

49044905
#line 494 "seclang-scanner.ll"
49054906
// Code run each time a pattern is matched.
49064907
# define YY_USER_ACTION driver.loc.back()->columns (yyleng);
49074908

4908-
#line 4909 "seclang-scanner.cc"
49094909
#line 4910 "seclang-scanner.cc"
4910+
#line 4911 "seclang-scanner.cc"
49104911

49114912
#define INITIAL 0
49124913
#define EXPECTING_ACTION_PREDICATE_VARIABLE 1
@@ -4952,11 +4953,7 @@ static std::stack<int> YY_PREVIOUS_STATE;
49524953
* The user has a chance to override it with an option.
49534954
*/
49544955
/* %if-c-only */
4955-
#ifndef WIN32
49564956
#include <unistd.h>
4957-
#else
4958-
#include <io.h>
4959-
#endif
49604957
/* %endif */
49614958
/* %if-c++-only */
49624959
/* %endif */
@@ -5232,7 +5229,7 @@ YY_DECL
52325229
// Code run each time yylex is called.
52335230
driver.loc.back()->step();
52345231

5235-
#line 5232 "seclang-scanner.cc"
5232+
#line 5233 "seclang-scanner.cc"
52365233

52375234
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
52385235
{
@@ -8338,7 +8335,7 @@ YY_RULE_SETUP
83388335
#line 1340 "seclang-scanner.ll"
83398336
ECHO;
83408337
YY_BREAK
8341-
#line 8338 "seclang-scanner.cc"
8338+
#line 8339 "seclang-scanner.cc"
83428339

83438340
case YY_END_OF_BUFFER:
83448341
{
@@ -8960,7 +8957,7 @@ static void yy_load_buffer_state (void)
89608957

89618958
/* %if-c-only */
89628959

8963-
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
8960+
b->yy_is_interactive = 0;
89648961

89658962
/* %endif */
89668963
/* %if-c++-only */

src/parser/seclang-scanner.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static std::stack<int> YY_PREVIOUS_STATE;
7373

7474
// The location of the current token.
7575
%}
76-
%option noyywrap nounput batch debug noinput
76+
%option noyywrap nounput batch debug noinput nounistd never-interactive
7777

7878

7979

0 commit comments

Comments
 (0)