FreeBSD Bugzilla – Attachment 231490 Details for
Bug 261522
emulators/virtualbox-ose: Place vbox/networks.conf in the right place (hier(7))
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch as described in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261522#c3
vboxnetworks.patch (text/plain), 4.40 KB, created by
Michael Gmelin
on 2022-02-01 10:51:26 UTC
(
hide
)
Description:
Patch as described in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261522#c3
Filename:
MIME Type:
Creator:
Michael Gmelin
Created:
2022-02-01 10:51:26 UTC
Size:
4.40 KB
patch
obsolete
>diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile >index 019e4d7929..72c77a4c69 100644 >--- a/emulators/virtualbox-ose/Makefile >+++ b/emulators/virtualbox-ose/Makefile >@@ -2,6 +2,7 @@ > > PORTNAME= virtualbox-ose > PORTVERSION= 6.1.32 >+PORTREVISION= 1 > CATEGORIES= emulators > MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ > DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} >@@ -307,11 +308,14 @@ post-patch: > ${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \ > ${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk > .endif >+.if ${LOCALBASE} != "/usr/local" > @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ > ${WRKSRC}/Config.kmk ${WRKSRC}/configure \ > ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \ > ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \ >+ ${WRKSRC}/src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp \ > ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py >+.endif > @${REINPLACE_CMD} \ > -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ > -e 's|SUPPYTHONLIBS=.*|SUPPYTHONLIBS="${PYTHON_VERSION}${PYTHON_ABIVER}"|' \ >@@ -321,9 +325,11 @@ post-patch: > ${WRKSRC}/src/VBox/Runtime/Makefile.kmk > @${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk > .endif >+.if ${VBOX_DIR} != "/usr/local/lib/virtualbox" || ${PREFIX} != "/usr/local" > @${REINPLACE_CMD} -e 's|/usr/local/lib/virtualbox|${VBOX_DIR}|' \ > -e 's|/usr/local|${PREFIX}|' \ > ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh >+.endif > @${REINPLACE_CMD} \ > -e 's|^versions =.*|versions = ["${PYTHON_VER}${PYTHON_ABIVER}"]|' \ > ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py >diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp >new file mode 100644 >index 0000000000..4bf9aff0db >--- /dev/null >+++ b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp >@@ -0,0 +1,45 @@ >+--- src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp.orig 2022-01-13 18:57:40 UTC >++++ src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp >+@@ -737,7 +737,8 @@ int Adapter::doIOCtl(unsigned long iCmd, VBOXNETADPREQ >+ * Global config file implementation * >+ *********************************************************************************************************************************/ >+ >+-#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "/etc/vbox/networks.conf" >++#define VBOX_GLOBAL_NETWORK_CONFIG_PATH1 "/usr/local/etc/vbox/networks.conf" >++#define VBOX_GLOBAL_NETWORK_CONFIG_PATH2 "/etc/vbox/networks.conf" >+ #define VBOXNET_DEFAULT_IPV4MASK "255.255.255.0" >+ >+ class NetworkAddress >+@@ -964,9 +965,17 @@ bool GlobalNetworkPermissionsConfig::forbids(const cha >+ >+ bool GlobalNetworkPermissionsConfig::forbids(NetworkAddress& address) >+ { >+- FILE *fp = fopen(VBOX_GLOBAL_NETWORK_CONFIG_PATH, "r"); >++ bool path2 = false; >++ FILE *fp = fopen(VBOX_GLOBAL_NETWORK_CONFIG_PATH1, "r"); >++ >+ if (!fp) >+ { >++ path2 = true; >++ fp = fopen(VBOX_GLOBAL_NETWORK_CONFIG_PATH2, "r"); >++ } >++ >++ if (!fp) >++ { >+ if (verbose) >+ fprintf(stderr, "Info: matching against default '%s' => %s\n", address.defaultNetwork(), >+ address.matches(address.defaultNetwork()) ? "MATCH" : "no match"); >+@@ -985,11 +994,11 @@ bool GlobalNetworkPermissionsConfig::forbids(NetworkAd >+ { >+ if (!address.isValidString(pszToken)) >+ { >+- fprintf(stderr, "Warning: %s(%d) invalid network '%s'\n", VBOX_GLOBAL_NETWORK_CONFIG_PATH, line, pszToken); >++ fprintf(stderr, "Warning: %s(%d) invalid network '%s'\n", path2 ? VBOX_GLOBAL_NETWORK_CONFIG_PATH2 : VBOX_GLOBAL_NETWORK_CONFIG_PATH1, line, pszToken); >+ continue; >+ } >+ if (verbose) >+- fprintf(stderr, "Info: %s(%d) matching against '%s' => %s\n", VBOX_GLOBAL_NETWORK_CONFIG_PATH, line, pszToken, >++ fprintf(stderr, "Info: %s(%d) matching against '%s' => %s\n", path2 ? VBOX_GLOBAL_NETWORK_CONFIG_PATH2 : VBOX_GLOBAL_NETWORK_CONFIG_PATH1, line, pszToken, >+ address.matches(pszToken) ? "MATCH" : "no match"); >+ if (address.matches(pszToken)) >+ return false;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 261522
:
231393
|
231490
|
232367