svn commit: r370760 - in head/security/wpa_supplicant: . files
John Marino
marino at FreeBSD.org
Mon Oct 13 09:33:09 UTC 2014
Author: marino
Date: Mon Oct 13 09:33:07 2014
New Revision: 370760
URL: https://svnweb.freebsd.org/changeset/ports/370760
QAT: https://qat.redports.org/buildarchive/r370760/
Log:
security/wpa_supplicant: Fix NDIS driver, privsep no longer default
The NDIS driver didn't build when privsep option was turned off. Moveover,
it didn't display the driver name correctly, so I figured out a patch
based on base's ndis driver code. Thirdly, when privsep option is turned
off, wpa_priv is not built, so let's handle that condition.
Finally, remove privsep from default options because it removes the
standard list of drivers and replaces it with privsep driver.
Added:
head/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c (contents, props changed)
Modified:
head/security/wpa_supplicant/Makefile
head/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile
Modified: head/security/wpa_supplicant/Makefile
==============================================================================
--- head/security/wpa_supplicant/Makefile Mon Oct 13 08:33:03 2014 (r370759)
+++ head/security/wpa_supplicant/Makefile Mon Oct 13 09:33:07 2014 (r370760)
@@ -2,6 +2,7 @@
PORTNAME= wpa_supplicant
PORTVERSION= 2.3
+PORTREVISION= 1
CATEGORIES= security net
MASTER_SITES= http://w1.fi/releases/
@@ -18,7 +19,6 @@ SUB_FILES= pkg-message
PLIST_FILES= sbin/wpa_supplicant \
sbin/wpa_passphrase \
sbin/wpa_cli \
- sbin/wpa_priv \
"@sample etc/wpa_supplicant.conf.sample"
PORTDOCS= README ChangeLog
@@ -35,7 +35,7 @@ OPTIONS_DEFINE= WPS WPS_ER WPS_NOREG WP
HS20 NO_ROAMING P2P TDLS
OPTIONS_DEFAULT= BSD WIRED NDIS \
TLS PEAP TTLS MD5 MSCHAPv2 GTC LEAP OTP PSK \
- WPS PKCS12 SMARTCARD IEEE80211R DEBUG_SYSLOG PRIVSEP \
+ WPS PKCS12 SMARTCARD IEEE80211R DEBUG_SYSLOG \
INTERWORKING HS20
WPS_DESC= Wi-Fi Protected Setup
@@ -99,6 +99,10 @@ CFLAGS+= -I${LOCALBASE}/include/PCSC
LDFLAGS+= -L${LOCALBASE}/lib
.endif
+.if ${PORT_OPTIONS:MPRIVSEP}
+PLIST_FILES+= sbin/wpa_priv
+.endif
+
post-patch:
${CP} ${FILESDIR}/Packet32.[ch] ${FILESDIR}/ntddndis.h \
${WRKSRC}/src/utils
@@ -150,7 +154,10 @@ post-patch:
do-install:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${BUILD_WRKSRC} && ${INSTALL_PROGRAM} wpa_supplicant wpa_cli \
- wpa_passphrase wpa_priv ${STAGEDIR}${PREFIX}/sbin)
+ wpa_passphrase ${STAGEDIR}${PREFIX}/sbin)
+.if ${PORT_OPTIONS:MPRIVSEP}
+ ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/wpa_priv ${STAGEDIR}${PREFIX}/sbin
+.endif
${INSTALL_DATA} ${BUILD_WRKSRC}/wpa_supplicant.conf \
${STAGEDIR}${PREFIX}/etc/wpa_supplicant.conf.sample
(cd ${BUILD_WRKSRC} && \
Added: head/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c Mon Oct 13 09:33:07 2014 (r370760)
@@ -0,0 +1,28 @@
+--- src/drivers/driver_ndis.c.orig 2014-10-09 14:41:31 UTC
++++ src/drivers/driver_ndis.c
+@@ -2110,7 +2110,11 @@ static int wpa_driver_ndis_get_names(str
+ dlen = dpos - desc;
+ else
+ dlen = os_strlen(desc);
+- drv->adapter_desc = dup_binstr(desc, dlen);
++ drv->adapter_desc = os_malloc(dlen + 1);
++ if (drv->adapter_desc) {
++ os_memcpy(drv->adapter_desc, desc, dlen);
++ drv->adapter_desc[dlen] = '\0';
++ }
+ os_free(b);
+ if (drv->adapter_desc == NULL)
+ return -1;
+@@ -2278,7 +2282,11 @@ static int wpa_driver_ndis_get_names(str
+ } else {
+ dlen = os_strlen(desc[i]);
+ }
+- drv->adapter_desc = dup_binstr(desc[i], dlen);
++ drv->adapter_desc = os_malloc(dlen + 1);
++ if (drv->adapter_desc) {
++ os_memcpy(drv->adapter_desc, desc[i], dlen);
++ drv->adapter_desc[dlen] = '\0';
++ }
+ os_free(names);
+ if (drv->adapter_desc == NULL)
+ return -1;
Modified: head/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile
==============================================================================
--- head/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile Mon Oct 13 08:33:03 2014 (r370759)
+++ head/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile Mon Oct 13 09:33:07 2014 (r370760)
@@ -1,11 +1,14 @@
--- wpa_supplicant/Makefile.orig 2014-10-09 14:41:31 UTC
+++ wpa_supplicant/Makefile
-@@ -97,6 +97,11 @@ OBJS += ../src/utils/os_$(CONFIG_OS).o
+@@ -97,6 +97,14 @@ OBJS += ../src/utils/os_$(CONFIG_OS).o
OBJS_p += ../src/utils/os_$(CONFIG_OS).o
OBJS_c += ../src/utils/os_$(CONFIG_OS).o
+ifdef CONFIG_DRIVER_NDIS
-+OBJS += ../src/utils/Packet32.o ../src/drivers/driver_ndis.o
++OBJS += ../src/utils/Packet32.o
++ifdef CONFIG_PRIVSEP
++OBJS += ../src/drivers/driver_ndis.o
++endif
+OBJS_priv += ../src/utils/Packet32.o
+endif
+
More information about the svn-ports-head
mailing list