summaryrefslogtreecommitdiffstats
path: root/patches/source/wpa_supplicant
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/wpa_supplicant')
-rw-r--r--patches/source/wpa_supplicant/0001-Add-os_exec-helper-to-run-external-programs.patch99
-rw-r--r--patches/source/wpa_supplicant/0002-wpa_cli-Use-os_exec-for-action-script-execution.patch59
-rw-r--r--patches/source/wpa_supplicant/README.slackware55
-rw-r--r--patches/source/wpa_supplicant/fi.epitest.hostap.WPASupplicant.service4
-rw-r--r--patches/source/wpa_supplicant/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch61
-rw-r--r--patches/source/wpa_supplicant/slack-desc18
-rw-r--r--patches/source/wpa_supplicant/wpa_gui.pngbin0 -> 5124 bytes
-rwxr-xr-xpatches/source/wpa_supplicant/wpa_supplicant.SlackBuild272
-rw-r--r--patches/source/wpa_supplicant/wpa_supplicant.defconfig27
9 files changed, 595 insertions, 0 deletions
diff --git a/patches/source/wpa_supplicant/0001-Add-os_exec-helper-to-run-external-programs.patch b/patches/source/wpa_supplicant/0001-Add-os_exec-helper-to-run-external-programs.patch
new file mode 100644
index 000000000..95ed09da5
--- /dev/null
+++ b/patches/source/wpa_supplicant/0001-Add-os_exec-helper-to-run-external-programs.patch
@@ -0,0 +1,99 @@
+--- ./src/utils/os_win32.c.orig 2010-09-07 10:43:39.000000000 -0500
++++ ./src/utils/os_win32.c 2014-12-07 14:27:02.070038369 -0600
+@@ -220,3 +220,9 @@
+
+ return s - src - 1;
+ }
++
++
++int os_exec(const char *program, const char *arg, int wait_completion)
++{
++ return -1;
++}
+--- ./src/utils/os.h.orig 2010-09-07 10:43:39.000000000 -0500
++++ ./src/utils/os.h 2014-12-07 14:27:02.065038369 -0600
+@@ -475,6 +475,15 @@
+ */
+ size_t os_strlcpy(char *dest, const char *src, size_t siz);
+
++/**
++ * os_exec - Execute an external program
++ * @program: Path to the program
++ * @arg: Command line argument string
++ * @wait_completion: Whether to wait until the program execution completes
++ * Returns: 0 on success, -1 on error
++ */
++int os_exec(const char *program, const char *arg, int wait_completion);
++
+
+ #ifdef OS_REJECT_C_LIB_FUNCTIONS
+ #define malloc OS_DO_NOT_USE_malloc
+--- ./src/utils/os_unix.c.orig 2010-09-07 10:43:39.000000000 -0500
++++ ./src/utils/os_unix.c 2014-12-07 14:27:37.815040567 -0600
+@@ -14,6 +14,8 @@
+
+ #include "includes.h"
+
++#include <sys/wait.h>
++
+ #include "os.h"
+
+ #ifdef WPA_TRACE
+@@ -435,3 +437,57 @@
+ }
+
+ #endif /* WPA_TRACE */
++
++
++int os_exec(const char *program, const char *arg, int wait_completion)
++{
++ pid_t pid;
++ int pid_status;
++
++ pid = fork();
++ if (pid < 0) {
++ perror("fork");
++ return -1;
++ }
++
++ if (pid == 0) {
++ /* run the external command in the child process */
++ const int MAX_ARG = 30;
++ char *_program, *_arg, *pos;
++ char *argv[MAX_ARG + 1];
++ int i;
++
++ _program = os_strdup(program);
++ _arg = os_strdup(arg);
++
++ argv[0] = _program;
++
++ i = 1;
++ pos = _arg;
++ while (i < MAX_ARG && pos && *pos) {
++ while (*pos == ' ')
++ pos++;
++ if (*pos == '\0')
++ break;
++ argv[i++] = pos;
++ pos = os_strchr(pos, ' ');
++ if (pos)
++ *pos++ = '\0';
++ }
++ argv[i] = NULL;
++
++ execv(program, argv);
++ perror("execv");
++ os_free(_program);
++ os_free(_arg);
++ exit(0);
++ return -1;
++ }
++
++ if (wait_completion) {
++ /* wait for the child process to complete in the parent */
++ waitpid(pid, &pid_status, 0);
++ }
++
++ return 0;
++}
diff --git a/patches/source/wpa_supplicant/0002-wpa_cli-Use-os_exec-for-action-script-execution.patch b/patches/source/wpa_supplicant/0002-wpa_cli-Use-os_exec-for-action-script-execution.patch
new file mode 100644
index 000000000..efa19800c
--- /dev/null
+++ b/patches/source/wpa_supplicant/0002-wpa_cli-Use-os_exec-for-action-script-execution.patch
@@ -0,0 +1,59 @@
+From c5f258de76dbb67fb64beab39a99e5c5711f41fe Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <jouni@qca.qualcomm.com>
+Date: Mon, 6 Oct 2014 17:25:52 +0300
+Subject: [PATCH 2/3] wpa_cli: Use os_exec() for action script execution
+
+Use os_exec() to run the action script operations to avoid undesired
+command line processing for control interface event strings. Previously,
+it could have been possible for some of the event strings to include
+unsanitized data which is not suitable for system() use. (CVE-2014-3686)
+
+Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
+---
+ wpa_supplicant/wpa_cli.c | 25 ++++++++-----------------
+ 1 file changed, 8 insertions(+), 17 deletions(-)
+
+diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
+index 18b9b77..fe30b41 100644
+--- a/wpa_supplicant/wpa_cli.c
++++ b/wpa_supplicant/wpa_cli.c
+@@ -3159,28 +3159,19 @@ static int str_match(const char *a, const char *b)
+ static int wpa_cli_exec(const char *program, const char *arg1,
+ const char *arg2)
+ {
+- char *cmd;
++ char *arg;
+ size_t len;
+ int res;
+- int ret = 0;
+
+- len = os_strlen(program) + os_strlen(arg1) + os_strlen(arg2) + 3;
+- cmd = os_malloc(len);
+- if (cmd == NULL)
+- return -1;
+- res = os_snprintf(cmd, len, "%s %s %s", program, arg1, arg2);
+- if (res < 0 || (size_t) res >= len) {
+- os_free(cmd);
++ len = os_strlen(arg1) + os_strlen(arg2) + 2;
++ arg = os_malloc(len);
++ if (arg == NULL)
+ return -1;
+- }
+- cmd[len - 1] = '\0';
+-#ifndef _WIN32_WCE
+- if (system(cmd) < 0)
+- ret = -1;
+-#endif /* _WIN32_WCE */
+- os_free(cmd);
++ os_snprintf(arg, len, "%s %s", arg1, arg2);
++ res = os_exec(program, arg, 1);
++ os_free(arg);
+
+- return ret;
++ return res;
+ }
+
+
+--
+1.9.1
+
diff --git a/patches/source/wpa_supplicant/README.slackware b/patches/source/wpa_supplicant/README.slackware
new file mode 100644
index 000000000..7ab40a289
--- /dev/null
+++ b/patches/source/wpa_supplicant/README.slackware
@@ -0,0 +1,55 @@
+=================================================
+How do I get my card to use WPA-PSK in Slackware?
+=================================================
+
+First off: wpa_supplicant REQUIRES the AP to broadcast the SSID. When the AP
+hides its SSID, all you will get out of wpa_supplicant is the message:
+"No suitable AP found"
+
+Also, read the MADwifi FAQ (http://madwifi.sourceforge.net/dokuwiki/doku.php)
+since it contains a wealth of information.
+
+This being said, you'll have to do the following (as root):
+Edit the file named /etc/wpa_supplicant.conf and add these lines:
+
+network={
+ scan_ssid=0
+ proto=WPA
+ key_mgmt=WPA-PSK
+ pairwise=CCMP TKIP
+ group=CCMP TKIP WEP104 WEP40
+}
+
+Then execute:
+
+/usr/sbin/wpa_passphrase YOURSSID passphrase
+
+with the SSID of your AP and the passphrase you've entered in its WPA-PSK configuration. You'll receive an output, which looks like this:
+
+network={
+ ssid="YOURSSID"
+ #psk="passphrase"
+
+psk=66a4bfb03de5656cf26cfa03a116097546046f4aea11ee044b841171207d8308
+}
+
+Copy the three lines within the network-tag into your own entry in wpa_supplicant.conf and change the permissions after you've finished editing:
+
+chmod 640 /etc/wpa_supplicant.conf
+
+To get your network device up and running, execute:
+
+### /usr/sbin/wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -iath0 -Dmadwifi ###
+### you don't have to run the above command by hand, because it will ###
+### be executed by the rc.inet1 command that you run: ###
+
+/etc/rc.d/rc.inet1 ath0_start
+
+In case you want to see the wpa_supplicant in action, start it on the command line before enabling the wireless device, by running:
+/usr/sbin/wpa_supplicant -dw -c/etc/wpa_supplicant.conf -iath0 -Dmadwifi
+The terminal where you've started the wpa_supplicant should now show the communication between your wlan card and the AP. If you got everything up and running you can let Slackware's init script take over by killing wpa_supplicant and running:
+
+/etc/rc.d/rc.inet1 ath0_restart
+
+Studying the wpa_supplicant README is also highly recommended for further insight!
+
diff --git a/patches/source/wpa_supplicant/fi.epitest.hostap.WPASupplicant.service b/patches/source/wpa_supplicant/fi.epitest.hostap.WPASupplicant.service
new file mode 100644
index 000000000..e8b4250b4
--- /dev/null
+++ b/patches/source/wpa_supplicant/fi.epitest.hostap.WPASupplicant.service
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=fi.epitest.hostap.WPASupplicant
+Exec=/usr/sbin/wpa_supplicant -u
+User=root
diff --git a/patches/source/wpa_supplicant/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch b/patches/source/wpa_supplicant/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch
new file mode 100644
index 000000000..4c5002003
--- /dev/null
+++ b/patches/source/wpa_supplicant/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch
@@ -0,0 +1,61 @@
+From b80b5639935d37b95d00f86b57f2844a9c775f57 Mon Sep 17 00:00:00 2001
+From: Dan Williams <dcbw@redhat.com>
+Date: Fri, 17 Dec 2010 15:56:01 +0200
+Subject: [PATCH] dbus: Emit property changed events when adding/removing BSSes
+
+The supplicant was not emitting property changed events when the BSSs
+property changed.
+
+Signed-off-by: Dan Williams <dcbw@redhat.com>
+(cherry picked from commit 1e6288df6b07a353a9246b77e0de2a840b5f2c72)
+---
+ wpa_supplicant/dbus/dbus_new.c | 6 ++++++
+ wpa_supplicant/dbus/dbus_new.h | 1 +
+ 2 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
+index bdfbbac..c66640a 100644
+--- a/wpa_supplicant/dbus/dbus_new.c
++++ b/wpa_supplicant/dbus/dbus_new.c
+@@ -691,6 +691,10 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
+ wpas_dbus_getter_current_network;
+ prop = "CurrentNetwork";
+ break;
++ case WPAS_DBUS_PROP_BSSS:
++ getter = (WPADBusPropertyAccessor) wpas_dbus_getter_bsss;
++ prop = "BSSs";
++ break;
+ default:
+ wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
+ __func__, property);
+@@ -1199,6 +1203,7 @@ int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
+ }
+
+ wpas_dbus_signal_bss_removed(wpa_s, bss_obj_path);
++ wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSSS);
+
+ return 0;
+ }
+@@ -1263,6 +1268,7 @@ int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
+ }
+
+ wpas_dbus_signal_bss_added(wpa_s, bss_obj_path);
++ wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSSS);
+
+ return 0;
+
+diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
+index 80ea98c..9cdefcb 100644
+--- a/wpa_supplicant/dbus/dbus_new.h
++++ b/wpa_supplicant/dbus/dbus_new.h
+@@ -30,6 +30,7 @@ enum wpas_dbus_prop {
+ WPAS_DBUS_PROP_STATE,
+ WPAS_DBUS_PROP_CURRENT_BSS,
+ WPAS_DBUS_PROP_CURRENT_NETWORK,
++ WPAS_DBUS_PROP_BSSS,
+ };
+
+ enum wpas_dbus_bss_prop {
+--
+1.7.4-rc1
+
diff --git a/patches/source/wpa_supplicant/slack-desc b/patches/source/wpa_supplicant/slack-desc
new file mode 100644
index 000000000..4313b3783
--- /dev/null
+++ b/patches/source/wpa_supplicant/slack-desc
@@ -0,0 +1,18 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+ |-----handy-ruler------------------------------------------------------|
+wpa_supplicant: wpa_supplicant (WPA/WPA2/IEEE 802.1X Supplicant)
+wpa_supplicant:
+wpa_supplicant: wpa_supplicant is a WPA Supplicant for Linux with support for WPA and
+wpa_supplicant: WPA2 (IEEE 802.11i / RSN). Supplicant is the IEEE 802.1X/WPA
+wpa_supplicant: component that is used in the client stations. It implements key
+wpa_supplicant: negotiation with a WPA Authenticator and it controls the roaming and
+wpa_supplicant: IEEE 802.11 authentication/association of the wlan driver.
+wpa_supplicant:
+wpa_supplicant: More info: http://hostap.epitest.fi/wpa_supplicant/
+wpa_supplicant:
+wpa_supplicant:
diff --git a/patches/source/wpa_supplicant/wpa_gui.png b/patches/source/wpa_supplicant/wpa_gui.png
new file mode 100644
index 000000000..a72f35691
--- /dev/null
+++ b/patches/source/wpa_supplicant/wpa_gui.png
Binary files differ
diff --git a/patches/source/wpa_supplicant/wpa_supplicant.SlackBuild b/patches/source/wpa_supplicant/wpa_supplicant.SlackBuild
new file mode 100755
index 000000000..a3588deed
--- /dev/null
+++ b/patches/source/wpa_supplicant/wpa_supplicant.SlackBuild
@@ -0,0 +1,272 @@
+#!/bin/sh
+
+# Copyright 2004-2008 Eric Hameleers, Eindhoven, NL
+# Copyright 2008-2014 Patrick J. Volkerding, Sebeka, MN, USA
+# Permission to use, copy, modify, and distribute this software for
+# any purpose with or without fee is hereby granted, provided that
+# the above copyright notice and this permission notice appear in all
+# copies.
+#
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# -----------------------------------------------------------------------------
+
+PKGNAM=wpa_supplicant
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-4_slack13.37}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+DOCS="ChangeLog ../COPYING README README-WPS *.txt examples wpa_supplicant.conf.sample"
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "arm" ]; then
+ SLKCFLAGS="-O2 -march=armv4 -mtune=xscale"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "armel" ]; then
+ SLKCFLAGS="-O2 -march=armv4t"
+ LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+# Support for some of the wireless drivers needs the header files of those
+# drivers.
+# Change these *_INCLUDES variables to where _your_ driver include directory
+# is located. If any of these directories is found, support for the driver
+# will be added to wpa_supplicant.
+# My madwifi package for Slackware installs the headers here:
+MADWIFI_INCLUDES="/usr/include/madwifi"
+HERMES_INCLUDES=""
+BROADCOM_INCLUDES=""
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+if ! [ -f $CWD/${PKGNAM}.defconfig ]; then
+ echo "Could not find ${PKGNAM}.defconfig!"
+ exit 1
+fi
+
+cd $TMP
+rm -rf ${PKGNAM}-${VERSION}
+tar xvf $CWD/${PKGNAM}-${VERSION}.tar.?z* || exit 1
+cd ${PKGNAM}-${VERSION}
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+#sed -i -e \
+# "s/^#define VERSION_STR \"\(.*\)\"/#define VERSION_STR \"\1_$VERSION\"/" \
+# src/common/version.h
+
+zcat $CWD/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch.gz | patch -p1 --verbose || exit 1
+
+zcat $CWD/0001-Add-os_exec-helper-to-run-external-programs.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/0002-wpa_cli-Use-os_exec-for-action-script-execution.patch.gz | patch -p1 --verbose || exit 1
+
+# The source code has been re-organized:
+cd wpa_supplicant
+
+# Create the configuration file for building wpa_supplicant:
+cat $CWD/${PKGNAM}.defconfig > .config
+if [ ! -z $MADWIFI_INCLUDES -a -d $MADWIFI_INCLUDES ]; then
+ echo "Adding madwifi driver (Atheros) support"
+ cat <<-EOT >> .config
+ CONFIG_DRIVER_MADWIFI=y
+ CFLAGS += -I${MADWIFI_INCLUDES}
+ EOT
+fi
+if [ ! -z $HERMES_INCLUDES -a -d $HERMES_INCLUDES ]; then
+ echo "Adding hermes driver (Agere) support"
+ cat <<-EOT >> .config
+ CONFIG_DRIVER_HERMES=y
+ CFLAGS += -I${HERMES_INCLUDES}
+ EOT
+fi
+if [ ! -z $BROADCOM_INCLUDES -a -d $BROADCOM_INCLUDES ]; then
+ echo "Adding broadcom driver support"
+ cat <<-EOT >> .config
+ CONFIG_DRIVER_BROADCOM=y
+ CFLAGS += -I${BROADCOM_INCLUDES}
+ EOT
+fi
+make $NUMJOBS || make || exit 1
+
+# Build the Qt4 GUI client
+make wpa_gui-qt4 || exit 1
+
+# Make man pages if needed
+( cd doc/docbook
+ if ! ls *.? >/dev/null 2>&1 ; then
+ make man
+ fi
+)
+
+# Do not build the developer docs:
+#PATH=".:$PATH" make docs
+
+# This goes into the doc directory later on:
+cp wpa_supplicant.conf wpa_supplicant.conf.sample
+
+# Install binaries:
+mkdir -p $PKG/usr/sbin $PKG/usr/bin
+cp wpa_supplicant wpa_passphrase wpa_cli $PKG/usr/sbin/
+cp wpa_gui-qt4/wpa_gui $PKG/usr/bin/
+
+# Install dbus configuration file:
+mkdir -p $PKG/etc/dbus-1/system.d/
+cp dbus/dbus-wpa_supplicant.conf \
+ $PKG/etc/dbus-1/system.d/dbus-wpa_supplicant.conf
+
+# This file should actually be shipped with Slackware's wpa_supplicant
+# package, but since we missed it there (just kidding), we'll do it here:
+mkdir -p $PKG/usr/share/dbus-1/system-services
+install -m644 dbus/{fi.epitest.hostap.WPASupplicant.service,fi.w1.wpa_supplicant1.service} \
+ $PKG/usr/share/dbus-1/system-services/
+sed -e 's#Exec=/sbin/wpa_supplicant#Exec=/usr/sbin/wpa_supplicant#g' \
+ -i $PKG/usr/share/dbus-1/system-services/*.service
+
+# Install a .desktop file for wpa_gui:
+mkdir -p $PKG/usr/share/applications
+cat <<EOT > $PKG/usr/share/applications/wpa_gui.desktop
+[Desktop Entry]
+Name=wpa_gui
+Comment[en]=Wpa_supplicant management
+Exec=kdesu wpa_gui
+Icon=wpa_gui
+Type=Application
+Categories=Qt;Network;
+EOT
+
+# The icon used for the menu (converted from the wpa_gui.svg in the source)
+mkdir -p $PKG/usr/share/pixmaps
+cp -a $CWD/wpa_gui.png $PKG/usr/share/pixmaps/
+
+# Install man pages:
+for m in 5 8; do
+ mkdir -p $PKG/usr/man/man${m}
+ cp doc/docbook/*.${m} $PKG/usr/man/man${m}/
+done
+
+# Install a default configuration file:
+mkdir -p $PKG/etc
+cat <<-_EOT_ > $PKG/etc/wpa_supplicant.conf.new
+ # See /usr/doc/${PKGNAM}-${VERSION}/wpa_supplicant.conf.sample
+ # for many more options that you can use in this file.
+
+ # This line enables the use of wpa_cli which is used by rc.wireless
+ # if possible (to check for successful association)
+ ctrl_interface=/var/run/wpa_supplicant
+ # By default, only root (group 0) may use wpa_cli
+ ctrl_interface_group=0
+ eapol_version=1
+ ap_scan=1
+ fast_reauth=1
+ #country=US
+
+ # WPA protected network, supply your own ESSID and WPAPSK here:
+ network={
+ scan_ssid=0
+ ssid="your_essid_here"
+ proto=WPA RSN
+ key_mgmt=WPA-PSK
+ pairwise=CCMP TKIP
+ group=CCMP TKIP WEP104 WEP40
+ psk=your_64_char_psk_here
+ priority=10
+ }
+
+ # Plaintext connection (no WPA, no IEEE 802.1X),
+ # nice for hotel/airport types of WiFi network.
+ network={
+ key_mgmt=NONE
+ priority=0
+ }
+ _EOT_
+
+# Create the 'doinst.sh' script:
+mkdir -p $PKG/install 2>/dev/null
+cat <<EOINS > $PKG/install/doinst.sh
+# Handle the incoming configuration files:
+config() {
+ for infile in \$1; do
+ NEW="\$infile"
+ OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r \$OLD ]; then
+ mv \$NEW \$OLD
+ elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then
+ # toss the redundant copy
+ rm \$NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+ done
+}
+config etc/wpa_supplicant.conf.new
+
+EOINS
+
+# Add the documentation:
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a $DOCS $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a $CWD/README.slackware $PKG/usr/doc/${PKGNAM}-${VERSION}/
+chmod -R a-w $PKG/usr/doc/$PKGNAM-$VERSION/*
+chown -R root:root $PKG/usr/doc/$PKGNAM-$VERSION/*
+
+# This should only be read/write by root:
+chmod 600 $PKG/etc/wpa_supplicant.conf.new
+
+# Compress the man page(s):
+find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
+
+# Strip binaries:
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Add a package description:
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+if [ -f $CWD/doinst.sh ]; then
+ cat $CWD/doinst.sh >> $PKG/install/doinst.sh
+fi
+
+# Build the package:
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/${PKGNAM}-${VERSION}-${ARCH}-${BUILD}.txz
+
diff --git a/patches/source/wpa_supplicant/wpa_supplicant.defconfig b/patches/source/wpa_supplicant/wpa_supplicant.defconfig
new file mode 100644
index 000000000..2c530fdc2
--- /dev/null
+++ b/patches/source/wpa_supplicant/wpa_supplicant.defconfig
@@ -0,0 +1,27 @@
+CONFIG_DRIVER_HOSTAP=y
+CONFIG_DRIVER_NDISWRAPPER=y
+CONFIG_DRIVER_ATMEL=y
+CONFIG_DRIVER_IPW=y
+CONFIG_DRIVER_RALINK=y
+CONFIG_DRIVER_WEXT=y
+CONFIG_DRIVER_NL80211=y
+CONFIG_DRIVER_WIRED=y
+CONFIG_IEEE8021X_EAPOL=y
+CONFIG_EAP_MD5=y
+CONFIG_EAP_MSCHAPV2=y
+CONFIG_EAP_TLS=y
+CONFIG_EAP_PEAP=y
+CONFIG_EAP_TTLS=y
+CONFIG_EAP_GTC=y
+CONFIG_EAP_OTP=y
+CONFIG_EAP_LEAP=y
+CONFIG_WPS=y
+CONFIG_PKCS12=y
+CONFIG_SMARTCARD=y
+CONFIG_CTRL_IFACE=y
+CONFIG_READLINE=y
+CONFIG_BACKEND=file
+CONFIG_PEERKEY=y
+CONFIG_CTRL_IFACE_DBUS=y
+CONFIG_CTRL_IFACE_DBUS_NEW=y
+CONFIG_CTRL_IFACE_DBUS_INTRO=y