Le dimanche, 16 février 2020, 10.32:22 h CET Jouni Malinen a écrit : > On Sat, Feb 15, 2020 at 11:02:50PM +0100, Didier 'OdyX' Raboud wrote: > > I'm trying to get eapol_test built by default in Debian [0,1] and it seems > > that some minor parts don't build in current Debian sid's GCC, so here > > comes a quick patch to make these to correctly. They're just printf > > reformatting. > > > > Looking forward to integrate these in wpasupplicant! > > Thanks. What's the error (or warning?) from gcc that breaks this? cc -c -o wpa_supplicant.o -g -O2 -fdebug-prefix-map=/home/didier/hack/wpasupplicant=. -fstack-protector-strong -Wformat -Werror=format-security -MMD -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -I/home/didier/hack/wpasupplicant/src -I/home/didier/hack/wpasupplicant/src/utils -DGIT_VERSION_STR_POSTFIX=\"-debian/2%2.9+git20200213+877d9a0-1-3-g1c103e5af+\" -Werror -DEAPOL_TEST -DCONFIG_HT_OVERRIDES -DCONFIG_VHT_OVERRIDES -DCONFIG_BACKEND_FILE -DCONFIG_IEEE80211R -DCONFIG_SAE -DCONFIG_DPP -DCONFIG_OWE -DCONFIG_TDLS -DCONFIG_PMKSA_CACHE_EXTERNAL -DCONFIG_IBSS_RSN -DCONFIG_NO_VLAN -DCONFIG_P2P -DCONFIG_WIFI_DISPLAY -DCONFIG_HS20 -DCONFIG_INTERWORKING -DCONFIG_DRIVER_WIRED -DCONFIG_DRIVER_MACSEC_LINUX -DCONFIG_DRIVER_NL80211 -DCONFIG_DRIVER_NL80211_QCA -DCONFIG_DRIVER_NONE -I/usr/include/libnl3 -DCONFIG_LIBNL3_ROUTE -DCONFIG_DRIVER_WEXT -DCONFIG_WIRELESS_EXTENSION -DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MD5 -DEAP_MSCHAPv2 -DEAP_GTC -DEAP_OTP -DEAP_SIM -DEAP_LEAP -DEAP_PSK -DEAP_AKA -DEAP_AKA_PRIME -DEAP_FAST -DEAP_PAX -DEAP_SAKE -DEAP_GPSK -DEAP_GPSK_SHA256 -DEAP_PWD -DEAP_EKE -DCONFIG_WPS -DEAP_WSC -DCONFIG_WPS_NFC -DCONFIG_WPS_OOB -DCONFIG_WPS_ER -DCONFIG_WPS_UPNP -DCONFIG_WPS_REG_DISABLE_OPEN -DEAP_IKEV2 -DEAP_TNC -DCONFIG_MACSEC -DIEEE8021X_EAPOL -DCONFIG_AP -DCONFIG_NO_RADIUS -DCONFIG_NO_ACCOUNTING -DCONFIG_NO_VLAN -DEAP_SERVER -DEAP_SERVER_IDENTITY -DCONFIG_IEEE80211N -DCONFIG_IEEE80211AC -DNEED_AP_MLME -DEAP_SERVER_WSC -DCONFIG_NO_RADIUS -DCONFIG_ACS -DPCSC_FUNCS -I/usr/include/PCSC -DPKCS12_FUNCS -DCONFIG_SMARTCARD -DCONFIG_TLSV11 -DCONFIG_TLSV12 -DEAP_TLS_OPENSSL -DTLS_DEFAULT_CIPHERS=\""DEFAULT@SECLEVEL=1"\" -DCONFIG_DES -DCONFIG_SHA256 -DCONFIG_HMAC_SHA256_KDF -DCONFIG_HMAC_SHA384_KDF -DCONFIG_HMAC_SHA512_KDF -DCONFIG_SHA384 -DCONFIG_SHA512 -DALL_DH_GROUPS -DCONFIG_ECC -DCONFIG_GETRANDOM -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DCONFIG_CTRL_IFACE_DBUS_NEW -DCONFIG_CTRL_IFACE_DBUS_INTRO -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -DCONFIG_SME -DCONFIG_DEBUG_SYSLOG -DLOG_HOSTAPD="LOG_DAEMON" -DCONFIG_DEBUG_LINUX_TRACING -DCONFIG_DEBUG_FILE -DCONFIG_DELAYED_MIC_ERROR_REPORT -DCONFIG_BGSCAN_SIMPLE -DCONFIG_BGSCAN_LEARN -DCONFIG_BGSCAN -DCONFIG_AUTOSCAN_EXPONENTIAL -DCONFIG_AUTOSCAN_PERIODIC -DCONFIG_AUTOSCAN -DCONFIG_GAS_SERVER -DCONFIG_GAS -DCONFIG_OFFCHANNEL -DCONFIG_JSON -DCONFIG_FST wpa_supplicant.c wpa_supplicant.c: In function ‘wpa_supplicant_init’: wpa_supplicant.c:6821:24: error: unknown conversion type character ‘+’ in format [-Werror=format=] 6821 | wpa_printf(MSG_DEBUG, "wpa_supplicant v" VERSION_STR); | ^~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors … and … cc -c -o eapol_test.o -g -O2 -fdebug-prefix-map=/home/didier/hack/wpasupplicant=. -fstack-protector-strong -Wformat -Werror=format-security -MMD -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -I/home/didier/hack/wpasupplicant/src -I/home/didier/hack/wpasupplicant/src/utils -DGIT_VERSION_STR_POSTFIX=\"-debian/2%2.9+git20200213+877d9a0-1-3-g1c103e5af+\" -Werror -DEAPOL_TEST -DCONFIG_HT_OVERRIDES -DCONFIG_VHT_OVERRIDES -DCONFIG_BACKEND_FILE -DCONFIG_IEEE80211R -DCONFIG_SAE -DCONFIG_DPP -DCONFIG_OWE -DCONFIG_TDLS -DCONFIG_PMKSA_CACHE_EXTERNAL -DCONFIG_IBSS_RSN -DCONFIG_NO_VLAN -DCONFIG_P2P -DCONFIG_WIFI_DISPLAY -DCONFIG_HS20 -DCONFIG_INTERWORKING -DCONFIG_DRIVER_WIRED -DCONFIG_DRIVER_MACSEC_LINUX -DCONFIG_DRIVER_NL80211 -DCONFIG_DRIVER_NL80211_QCA -DCONFIG_DRIVER_NONE -I/usr/include/libnl3 -DCONFIG_LIBNL3_ROUTE -DCONFIG_DRIVER_WEXT -DCONFIG_WIRELESS_EXTENSION -DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MD5 -DEAP_MSCHAPv2 -DEAP_GTC -DEAP_OTP -DEAP_SIM -DEAP_LEAP -DEAP_PSK -DEAP_AKA -DEAP_AKA_PRIME -DEAP_FAST -DEAP_PAX -DEAP_SAKE -DEAP_GPSK -DEAP_GPSK_SHA256 -DEAP_PWD -DEAP_EKE -DCONFIG_WPS -DEAP_WSC -DCONFIG_WPS_NFC -DCONFIG_WPS_OOB -DCONFIG_WPS_ER -DCONFIG_WPS_UPNP -DCONFIG_WPS_REG_DISABLE_OPEN -DEAP_IKEV2 -DEAP_TNC -DCONFIG_MACSEC -DIEEE8021X_EAPOL -DCONFIG_AP -DCONFIG_NO_RADIUS -DCONFIG_NO_ACCOUNTING -DCONFIG_NO_VLAN -DEAP_SERVER -DEAP_SERVER_IDENTITY -DCONFIG_IEEE80211N -DCONFIG_IEEE80211AC -DNEED_AP_MLME -DEAP_SERVER_WSC -DCONFIG_NO_RADIUS -DCONFIG_ACS -DPCSC_FUNCS -I/usr/include/PCSC -DPKCS12_FUNCS -DCONFIG_SMARTCARD -DCONFIG_TLSV11 -DCONFIG_TLSV12 -DEAP_TLS_OPENSSL -DTLS_DEFAULT_CIPHERS=\""DEFAULT@SECLEVEL=1"\" -DCONFIG_DES -DCONFIG_SHA256 -DCONFIG_HMAC_SHA256_KDF -DCONFIG_HMAC_SHA384_KDF -DCONFIG_HMAC_SHA512_KDF -DCONFIG_SHA384 -DCONFIG_SHA512 -DALL_DH_GROUPS -DCONFIG_ECC -DCONFIG_GETRANDOM -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DCONFIG_CTRL_IFACE_DBUS_NEW -DCONFIG_CTRL_IFACE_DBUS_INTRO -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -DCONFIG_SME -DCONFIG_DEBUG_SYSLOG -DLOG_HOSTAPD="LOG_DAEMON" -DCONFIG_DEBUG_LINUX_TRACING -DCONFIG_DEBUG_FILE -DCONFIG_DELAYED_MIC_ERROR_REPORT -DCONFIG_BGSCAN_SIMPLE -DCONFIG_BGSCAN_LEARN -DCONFIG_BGSCAN -DCONFIG_AUTOSCAN_EXPONENTIAL -DCONFIG_AUTOSCAN_PERIODIC -DCONFIG_AUTOSCAN -DCONFIG_GAS_SERVER -DCONFIG_GAS -DCONFIG_OFFCHANNEL -DCONFIG_JSON -DCONFIG_FST eapol_test.c eapol_test.c: In function ‘main’: eapol_test.c:1393:11: error: unknown conversion type character ‘+’ in format [-Werror=format=] 1393 | printf("eapol_test v" VERSION_STR "\n"); | ^~~~~~~~~~~~~~ cc1: all warnings being treated as errors It might be because in the Debian package's development case, VERSION_STR ends up being "v2.10-devel-debian/2%2.9+git20200213+877d9a0-1-3-g3bd59207c+". > > Fix printf calls for eapol_test build > > > > Origin: vendor > > Author: Didier Raboud <odyx@xxxxxxxxxx> > > Last-Update: 2020-02-15 > > Could you please read the top level CONTRIBUTIONS file (*) and provide a > Signed-off-by: line for the commit message so that I can apply this? > > (*) http://w1.fi/cgit/hostap/plain/CONTRIBUTIONS Oh sure, thanks for the pointer. New patch (this time based off the git repository) attached. > > --- a/wpa_supplicant/wpa_supplicant.c > > +++ b/wpa_supplicant/wpa_supplicant.c > > - wpa_printf(MSG_DEBUG, "wpa_supplicant v" VERSION_STR); > > + wpa_printf(MSG_DEBUG, "wpa_supplicant v%s", VERSION_STR); > > This looks strange.. VERSION_STR is a define for a string.. Has gcc > really stopped allowing string constants from being concatenated in this > manner? Sounds like an excessive approach for avoiding printf format > issues.. I'm by far not a C nor GCC specialist, sorry. I can just observe that under my compilation conditions, eapol_test cannot be built without a patch along the lines of my patch proposal. Regards, OdyX
>From cf780d0741ad59a74880dbfcd18524bef7bec601 Mon Sep 17 00:00:00 2001 From: Didier Raboud <odyx@xxxxxxxxxx> Date: Sun, 16 Feb 2020 16:14:54 +0100 Subject: [PATCH] Fix printf calls in eapol_test build Signed-off-by: Didier Raboud <odyx@xxxxxxxxxx> --- wpa_supplicant/eapol_test.c | 2 +- wpa_supplicant/wpa_supplicant.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c index 53d75853b..f59a2a1fb 100644 --- a/wpa_supplicant/eapol_test.c +++ b/wpa_supplicant/eapol_test.c @@ -1390,7 +1390,7 @@ int main(int argc, char *argv[]) eapol_test.ctrl_iface = 1; break; case 'v': - printf("eapol_test v" VERSION_STR "\n"); + printf("eapol_test v%s\n",VERSION_STR); return 0; case 'W': wait_for_monitor++; diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 24a7a28e2..0e46a6d87 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -6818,7 +6818,7 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params) wpa_debug_timestamp = global->params.wpa_debug_timestamp = params->wpa_debug_timestamp; - wpa_printf(MSG_DEBUG, "wpa_supplicant v" VERSION_STR); + wpa_printf(MSG_DEBUG, "wpa_supplicant v%s", VERSION_STR); if (eloop_init()) { wpa_printf(MSG_ERROR, "Failed to initialize event loop"); -- 2.25.0
Attachment:
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap