Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] nginx: Harden patches for using pkg-config
@ 2017-12-18 22:59 Ignacy Gawędzki
  2017-12-19 10:10 ` [Buildroot] [PATCH v2 0/1] " Ignacy Gawędzki
  2017-12-19 10:10 ` [Buildroot] [PATCH v2 1/1] " Ignacy Gawędzki
  0 siblings, 2 replies; 6+ messages in thread
From: Ignacy Gawędzki @ 2017-12-18 22:59 UTC (permalink / raw)
  To: buildroot

Don't simply remove "-I" from the output of pkg-config --cflags-only-I
but match the -I argument more generally.

Signed-off-by: Ignacy Gaw?dzki <ignacy.gawedzki@green-communications.fr>
---
 package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch | 5 +++--
 package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch b/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
index b315909c34..7022694714 100644
--- a/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
+++ b/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
@@ -15,13 +15,14 @@ diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf
 index 3a0f37b..3c2a60e 100644
 --- a/auto/lib/libxslt/conf
 +++ b/auto/lib/libxslt/conf
-@@ -12,8 +12,8 @@
+@@ -12,9 +12,9 @@
                        #include <libxslt/xsltInternals.h>
                        #include <libxslt/transform.h>
                        #include <libxslt/xsltutils.h>"
 -    ngx_feature_path="/usr/include/libxml2"
 -    ngx_feature_libs="-lxml2 -lxslt"
-+    ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I libxslt|sed 's/-I//g')"
++    ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I libxslt|
++			 sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
 +    ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs libxslt)"
      ngx_feature_test="xmlParserCtxtPtr    ctxt = NULL;
                        xsltStylesheetPtr   sheet = NULL;
diff --git a/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch b/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch
index 0c94890625..04e103c444 100644
--- a/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch
+++ b/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch
@@ -15,13 +15,14 @@ diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
 index 39d9602..995c6f3 100644
 --- a/auto/lib/openssl/conf
 +++ b/auto/lib/openssl/conf
-@@ -58,8 +58,8 @@ else
+@@ -58,9 +58,9 @@ else
          ngx_feature_name="NGX_OPENSSL"
          ngx_feature_run=no
          ngx_feature_incs="#include <openssl/ssl.h>"
 -        ngx_feature_path=
 -        ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
-+        ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|sed 's/-I//g')"
++        ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|
++			     sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
 +        ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl)"
          ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
          . auto/feature
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 0/1] nginx: Harden patches for using pkg-config
  2017-12-18 22:59 [Buildroot] [PATCH 1/1] nginx: Harden patches for using pkg-config Ignacy Gawędzki
@ 2017-12-19 10:10 ` Ignacy Gawędzki
  2017-12-19 10:10 ` [Buildroot] [PATCH v2 1/1] " Ignacy Gawędzki
  1 sibling, 0 replies; 6+ messages in thread
From: Ignacy Gawędzki @ 2017-12-19 10:10 UTC (permalink / raw)
  To: buildroot

Hi again,

A second attempt, fixing the chunk ranges.  It appears recountdiff,
which is probably used by Emacs in diff mode, interprets the signature
separator line "-- " as a line removal and fixes the ranges wrong.

A fixed patch with fixed ranges follows.

Cheers,

Ignacy

Ignacy Gaw?dzki (1):
  nginx: Harden patches for using pkg-config

 package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch | 5 +++--
 package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 1/1] nginx: Harden patches for using pkg-config
  2017-12-18 22:59 [Buildroot] [PATCH 1/1] nginx: Harden patches for using pkg-config Ignacy Gawędzki
  2017-12-19 10:10 ` [Buildroot] [PATCH v2 0/1] " Ignacy Gawędzki
@ 2017-12-19 10:10 ` Ignacy Gawędzki
  2017-12-19 12:43   ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Ignacy Gawędzki @ 2017-12-19 10:10 UTC (permalink / raw)
  To: buildroot

Don't simply remove "-I" from the output of pkg-config --cflags-only-I
but match the -I argument more generally.

Signed-off-by: Ignacy Gaw?dzki <ignacy.gawedzki@green-communications.fr>
---
 package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch | 5 +++--
 package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch b/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
index b315909c34..103f90b305 100644
--- a/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
+++ b/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
@@ -15,13 +15,14 @@ diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf
 index 3a0f37b..3c2a60e 100644
 --- a/auto/lib/libxslt/conf
 +++ b/auto/lib/libxslt/conf
-@@ -12,8 +12,8 @@
+@@ -12,8 +12,9 @@
                        #include <libxslt/xsltInternals.h>
                        #include <libxslt/transform.h>
                        #include <libxslt/xsltutils.h>"
 -    ngx_feature_path="/usr/include/libxml2"
 -    ngx_feature_libs="-lxml2 -lxslt"
-+    ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I libxslt|sed 's/-I//g')"
++    ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I libxslt|
++			 sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
 +    ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs libxslt)"
      ngx_feature_test="xmlParserCtxtPtr    ctxt = NULL;
                        xsltStylesheetPtr   sheet = NULL;
diff --git a/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch b/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch
index 0c94890625..0bd4d337c8 100644
--- a/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch
+++ b/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch
@@ -15,13 +15,14 @@ diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
 index 39d9602..995c6f3 100644
 --- a/auto/lib/openssl/conf
 +++ b/auto/lib/openssl/conf
-@@ -58,8 +58,8 @@ else
+@@ -58,8 +58,9 @@ else
          ngx_feature_name="NGX_OPENSSL"
          ngx_feature_run=no
          ngx_feature_incs="#include <openssl/ssl.h>"
 -        ngx_feature_path=
 -        ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
-+        ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|sed 's/-I//g')"
++        ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|
++			     sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
 +        ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl)"
          ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
          . auto/feature
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 1/1] nginx: Harden patches for using pkg-config
  2017-12-19 10:10 ` [Buildroot] [PATCH v2 1/1] " Ignacy Gawędzki
@ 2017-12-19 12:43   ` Thomas Petazzoni
  2017-12-19 12:59     ` Ignacy Gawędzki
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2017-12-19 12:43 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 19 Dec 2017 11:10:24 +0100, Ignacy Gaw?dzki wrote:
> Don't simply remove "-I" from the output of pkg-config --cflags-only-I
> but match the -I argument more generally.

OK, but why? What is this fixing?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 1/1] nginx: Harden patches for using pkg-config
  2017-12-19 12:43   ` Thomas Petazzoni
@ 2017-12-19 12:59     ` Ignacy Gawędzki
  2017-12-29 22:35       ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Ignacy Gawędzki @ 2017-12-19 12:59 UTC (permalink / raw)
  To: buildroot

On Tue, Dec 19, 2017 at 01:43:16PM +0100, thus spake Thomas Petazzoni:
> Hello,
> 
> On Tue, 19 Dec 2017 11:10:24 +0100, Ignacy Gaw?dzki wrote:
> > Don't simply remove "-I" from the output of pkg-config --cflags-only-I
> > but match the -I argument more generally.
> 
> OK, but why? What is this fixing?

Suppose that the lib has been installed in /usr/Some-Install-Location/
then pkg-config --cflags-only-I may return

  -I/usr/Some-Install-Location/include

which, piped through sed 's/-I//g' would end up being

  /usr/Somenstall-Location/include

which is probably not going to work.

-- 
Ignacy Gaw?dzki
R&D Engineer
Green Communications

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 1/1] nginx: Harden patches for using pkg-config
  2017-12-19 12:59     ` Ignacy Gawędzki
@ 2017-12-29 22:35       ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-12-29 22:35 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 19 Dec 2017 13:59:04 +0100, Ignacy Gaw?dzki wrote:
> On Tue, Dec 19, 2017 at 01:43:16PM +0100, thus spake Thomas Petazzoni:
> > Hello,
> > 
> > On Tue, 19 Dec 2017 11:10:24 +0100, Ignacy Gaw?dzki wrote:  
> > > Don't simply remove "-I" from the output of pkg-config --cflags-only-I
> > > but match the -I argument more generally.  
> > 
> > OK, but why? What is this fixing?  
> 
> Suppose that the lib has been installed in /usr/Some-Install-Location/
> then pkg-config --cflags-only-I may return
> 
>   -I/usr/Some-Install-Location/include
> 
> which, piped through sed 's/-I//g' would end up being
> 
>   /usr/Somenstall-Location/include
> 
> which is probably not going to work.

Indeed, makes total sense. I've applied your patch, after rewording the
commit log to be clearer about what is being fixed. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-29 22:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-18 22:59 [Buildroot] [PATCH 1/1] nginx: Harden patches for using pkg-config Ignacy Gawędzki
2017-12-19 10:10 ` [Buildroot] [PATCH v2 0/1] " Ignacy Gawędzki
2017-12-19 10:10 ` [Buildroot] [PATCH v2 1/1] " Ignacy Gawędzki
2017-12-19 12:43   ` Thomas Petazzoni
2017-12-19 12:59     ` Ignacy Gawędzki
2017-12-29 22:35       ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox