package/xerces: add enable network option
authorJared Bents <jared.bents@rockwellcollins.com>
Wed, 20 May 2020 22:28:50 +0000 (17:28 -0500)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 21 May 2020 13:42:42 +0000 (15:42 +0200)
Update to add the option to compile xerces with network
enabled by default so it can be unselected to compile
without network support.

When network support is enabled the Network Accessor feature
will decode schema urls and if they don't appear as localhost
or local files, it will open a stream (socket) session with
the remote server. In an embedded setting having the option to
disable this allows:
 * cleaner audit logging
 * smaller security attack surface
 * less library dependencies
 * no behind the scenes failed session attempts

Signed-off-by: Jared Bents <jared.bents@rockwellcollins.com>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/xerces/Config.in
package/xerces/xerces.mk

index 2edc4346b5192574ac671766cdcc7c52abbfc6bf..a9b102bd5ea83decbe5b326e4e43c827ad4866ae 100644 (file)
@@ -6,5 +6,15 @@ config BR2_PACKAGE_XERCES
 
          http://xerces.apache.org/xerces-c/
 
+if BR2_PACKAGE_XERCES
+
+config BR2_PACKAGE_XERCES_ENABLE_NETWORK
+       bool "Enable network support"
+       default y
+       help
+         Enable network support in xerces
+
+endif
+
 comment "xerces-c++ needs a toolchain w/ C++, wchar"
        depends on !(BR2_INSTALL_LIBSTDCPP && BR2_USE_WCHAR)
index c75a8b0d35232a20a467e1059f60ce70b213bfc1..ae42b1e62f73a30a299218d64de7b9939338d15c 100644 (file)
@@ -31,12 +31,16 @@ XERCES_CONF_ENV += LIBS=-liconv
 XERCES_DEPENDENCIES += libiconv
 endif
 
+ifeq ($(BR2_PACKAGE_XERCES_ENABLE_NETWORK),y)
 ifeq ($(BR2_PACKAGE_LIBCURL),y)
 XERCES_CONF_OPTS += -Dnetwork-accessor=curl
 XERCES_DEPENDENCIES += libcurl
 else
 XERCES_CONF_OPTS += -Dnetwork-accessor=socket
 endif
+else
+XERCES_CONF_OPTS += -Dnetwork=OFF
+endif
 
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
 XERCES_CONF_OPTS += -Dthreads=ON