- Update to 0.5.7 stable release

This commit is contained in:
Daniel Williams 2007-03-15 18:48:00 +00:00
parent 915fbf2903
commit 8f4015c591
5 changed files with 208 additions and 13 deletions

View File

@ -4,3 +4,4 @@ wpa_supplicant-0.5.1.tar.gz
wpa_supplicant-0.4.8.tar.gz
madwifi-headers-r1475.tar.bz2
wpa_supplicant-0.4.9.tar.gz
wpa_supplicant-0.5.7.tar.gz

View File

@ -1,2 +1,2 @@
b82289b140cc1c66db11564bde248d8a madwifi-headers-r1475.tar.bz2
98498c152cbfc388c306fd9bbf7d57d4 wpa_supplicant-0.4.9.tar.gz
bd2436392ad3c6d2513da701a12f2d27 wpa_supplicant-0.5.7.tar.gz

View File

@ -0,0 +1,187 @@
--- dbus_dict_helpers.c.array-fix 2006-12-18 12:31:11.000000000 -0500
+++ dbus_dict_helpers.c 2006-12-20 03:17:08.000000000 -0500
@@ -629,36 +629,55 @@ dbus_bool_t wpa_dbus_dict_open_read(DBus
}
+#define BYTE_ARRAY_CHUNK_SIZE 34
+#define BYTE_ARRAY_ITEM_SIZE (sizeof (char))
+
static dbus_bool_t _wpa_dbus_dict_entry_get_byte_array(
- DBusMessageIter *iter, int array_len, int array_type,
+ DBusMessageIter *iter, int array_type,
struct wpa_dbus_dict_entry *entry)
{
- dbus_uint32_t i = 0;
+ dbus_uint32_t count = 0;
dbus_bool_t success = FALSE;
- char byte;
+ char * buffer;
- /* Zero-length arrays are valid. */
- if (array_len == 0) {
- entry->bytearray_value = NULL;
- entry->array_type = DBUS_TYPE_BYTE;
- success = TRUE;
- goto done;
- }
+ entry->bytearray_value = NULL;
+ entry->array_type = DBUS_TYPE_BYTE;
- entry->bytearray_value = wpa_zalloc(array_len * sizeof(char));
- if (!entry->bytearray_value) {
+ buffer = wpa_zalloc(BYTE_ARRAY_ITEM_SIZE * BYTE_ARRAY_CHUNK_SIZE);
+ if (!buffer) {
perror("_wpa_dbus_dict_entry_get_byte_array[dbus]: out of "
"memory");
goto done;
}
- entry->array_type = DBUS_TYPE_BYTE;
- entry->array_len = array_len;
+ entry->bytearray_value = buffer;
+ entry->array_len = 0;
while (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_BYTE) {
+ char byte;
+
+ if ((count % BYTE_ARRAY_CHUNK_SIZE) == 0 && count != 0) {
+ buffer = realloc(buffer, BYTE_ARRAY_ITEM_SIZE * (count + BYTE_ARRAY_CHUNK_SIZE));
+ if (buffer == NULL) {
+ perror("_wpa_dbus_dict_entry_get_byte_array["
+ "dbus] out of memory trying to "
+ "retrieve the string array");
+ goto done;
+ }
+ }
+ entry->bytearray_value = buffer;
+
dbus_message_iter_get_basic(iter, &byte);
- entry->bytearray_value[i++] = byte;
+ entry->bytearray_value[count] = byte;
+ entry->array_len = ++count;
dbus_message_iter_next(iter);
}
+
+ /* Zero-length arrays are valid. */
+ if (entry->array_len == 0) {
+ free(entry->bytearray_value);
+ entry->strarray_value = NULL;
+ }
+
success = TRUE;
done:
@@ -666,8 +685,11 @@ done:
}
+#define STR_ARRAY_CHUNK_SIZE 8
+#define STR_ARRAY_ITEM_SIZE (sizeof (char *))
+
static dbus_bool_t _wpa_dbus_dict_entry_get_string_array(
- DBusMessageIter *iter, int array_len, int array_type,
+ DBusMessageIter *iter, int array_type,
struct wpa_dbus_dict_entry *entry)
{
dbus_uint32_t count = 0;
@@ -677,13 +699,7 @@ static dbus_bool_t _wpa_dbus_dict_entry_
entry->strarray_value = NULL;
entry->array_type = DBUS_TYPE_STRING;
- /* Zero-length arrays are valid. */
- if (array_len == 0) {
- success = TRUE;
- goto done;
- }
-
- buffer = wpa_zalloc(sizeof (char *) * 8);
+ buffer = wpa_zalloc(STR_ARRAY_ITEM_SIZE * STR_ARRAY_CHUNK_SIZE);
if (buffer == NULL) {
perror("_wpa_dbus_dict_entry_get_string_array[dbus] out of "
"memory trying to retrieve a string array");
@@ -696,18 +712,14 @@ static dbus_bool_t _wpa_dbus_dict_entry_
const char *value;
char *str;
- if ((count % 8) == 0 && count != 0) {
- char **tmp;
- tmp = realloc(buffer, sizeof(char *) * (count + 8));
- if (tmp == NULL) {
+ if ((count % STR_ARRAY_CHUNK_SIZE) == 0 && count != 0) {
+ buffer = realloc(buffer, STR_ARRAY_ITEM_SIZE * (count + STR_ARRAY_CHUNK_SIZE));
+ if (buffer == NULL) {
perror("_wpa_dbus_dict_entry_get_string_array["
"dbus] out of memory trying to "
"retrieve the string array");
- free(buffer);
- buffer = NULL;
goto done;
}
- buffer = tmp;
}
entry->strarray_value = buffer;
@@ -723,6 +735,13 @@ static dbus_bool_t _wpa_dbus_dict_entry_
entry->array_len = ++count;
dbus_message_iter_next(iter);
}
+
+ /* Zero-length arrays are valid. */
+ if (entry->array_len == 0) {
+ free(entry->strarray_value);
+ entry->strarray_value = NULL;
+ }
+
success = TRUE;
done:
@@ -734,7 +753,6 @@ static dbus_bool_t _wpa_dbus_dict_entry_
DBusMessageIter *iter_dict_val, struct wpa_dbus_dict_entry *entry)
{
int array_type = dbus_message_iter_get_element_type(iter_dict_val);
- int array_len;
dbus_bool_t success = FALSE;
DBusMessageIter iter_array;
@@ -743,20 +761,14 @@ static dbus_bool_t _wpa_dbus_dict_entry_
dbus_message_iter_recurse(iter_dict_val, &iter_array);
- array_len = dbus_message_iter_get_array_len(&iter_array);
- if (array_len < 0)
- return FALSE;
-
switch (array_type) {
case DBUS_TYPE_BYTE:
success = _wpa_dbus_dict_entry_get_byte_array(&iter_array,
- array_len,
array_type,
entry);
break;
case DBUS_TYPE_STRING:
success = _wpa_dbus_dict_entry_get_string_array(&iter_array,
- array_len,
array_type,
entry);
break;
@@ -943,9 +955,17 @@ void wpa_dbus_dict_entry_clear(struct wp
break;
case DBUS_TYPE_ARRAY:
switch (entry->array_type) {
- case DBUS_TYPE_BYTE:
- free(entry->bytearray_value);
- break;
+ case DBUS_TYPE_BYTE: {
+ free(entry->bytearray_value);
+ break;
+ }
+ case DBUS_TYPE_STRING: {
+ int i;
+ for (i = 0; i < entry->array_len; i++)
+ free (entry->strarray_value[i]);
+ free (entry->strarray_value);
+ break;
+ }
}
break;
}

View File

@ -1,4 +1,5 @@
CONFIG_CTRL_IFACE=y
CONFIG_CTRL_IFACE_DBUS=y
CONFIG_DRIVER_HOSTAP=y
//CONFIG_DRIVER_HERMES=y
CONFIG_DRIVER_MADWIFI=y

View File

@ -1,7 +1,7 @@
Summary: WPA/WPA2/IEEE 802.1X Supplicant
Name: wpa_supplicant
Epoch: 1
Version: 0.4.9
Version: 0.5.7
Release: 1%{?dist}
License: GPL
Group: System Environment/Base
@ -11,17 +11,18 @@ Source2: %{name}.conf
Source3: %{name}.init.d
Source4: %{name}.sysconfig
Source5: madwifi-headers-r1475.tar.bz2
Patch0: wpa_supplicant-ctrl-iface-ap-scan.patch
Patch1: wpa_supplicant-assoc-timeout.patch
Patch2: wpa_supplicant-driver-wext-debug.patch
Patch3: wpa_supplicant-wep-key-fix.patch
Patch4: wpa_supplicant-0.4.8-madwifi-ioctl-reorder.patch
URL: http://hostap.epitest.fi/wpa_supplicant/
Patch0: wpa_supplicant-assoc-timeout.patch
Patch1: wpa_supplicant-driver-wext-debug.patch
Patch2: wpa_supplicant-wep-key-fix.patch
# http://hostap.epitest.fi/bugz/show_bug.cgi?id=192
Patch3: wpa_supplicant-fix-deprecated-dbus-function.patch
URL: http://w1.fi/wpa_supplicant/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: qt-devel
BuildRequires: openssl-devel
BuildRequires: readline-devel
BuildRequires: dbus-devel
PreReq: chkconfig
@ -41,11 +42,10 @@ Graphical User Interface for wpa_supplicant written using QT3
%prep
%setup -q
%patch0 -p1 -b .ap-scan
%patch1 -p1 -b .assoc-timeout
%patch2 -p1 -b .driver-wext-debug
%patch3 -p1 -b .wep-key-fix
%patch4 -p1 -b .madwifi-ioctl-reorder
%patch0 -p1 -b .assoc-timeout
%patch1 -p1 -b .driver-wext-debug
%patch2 -p1 -b .wep-key-fix
%patch3 -p0 -b .fix-deprecated-dbus-functions
%build
cp %{SOURCE1} ./.config
@ -71,6 +71,8 @@ install -d %{buildroot}/%{_sbindir}
install -m 0755 -s wpa_passphrase %{buildroot}/%{_sbindir}
install -m 0755 -s wpa_cli %{buildroot}/%{_sbindir}
install -m 0755 -s wpa_supplicant %{buildroot}/%{_sbindir}
mkdir -p %{buildroot}/%{_sysconfdir}/dbus-1/system.d/
install -m 0644 dbus-wpa_supplicant.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/wpa_supplicant.conf
# gui
install -d %{buildroot}/%{_bindir}
@ -110,6 +112,7 @@ fi
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_sysconfdir}/rc.d/init.d/%{name}
%{_sysconfdir}/dbus-1/system.d/%{name}.conf
%{_sbindir}/wpa_passphrase
%{_sbindir}/wpa_supplicant
%{_sbindir}/wpa_cli
@ -123,6 +126,9 @@ fi
%{_bindir}/wpa_gui
%changelog
* Thu Mar 15 2007 Dan Williams <dcbw@redhat.com> - 0.5.7-1
- Update to 0.5.7 stable release
* Mon Oct 27 2006 Dan Williams <dcbw@redhat.com> - 0.4.9-1
- Update to 0.4.9 for WE-21 fixes, remove upstreamed patches
- Don't package doc/ because they aren't actually wpa_supplicant user documentation,