rpms/bluez/devel bluez-fix-sdp-copy-for-strings-with-nulls.patch, NONE, 1.1 bluez.spec, 1.46, 1.47
Bastien Nocera
hadess at fedoraproject.org
Mon Mar 9 15:29:01 UTC 2009
Author: hadess
Update of /cvs/pkgs/rpms/bluez/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32528
Modified Files:
bluez.spec
Added Files:
bluez-fix-sdp-copy-for-strings-with-nulls.patch
Log Message:
* Mon Mar 09 2009 - Bastien Nocera <bnocera at redhat.com> - 4.32-6
- Fix sdp_copy_record(), so records are properly exported through D-Bus
bluez-fix-sdp-copy-for-strings-with-nulls.patch:
--- NEW FILE bluez-fix-sdp-copy-for-strings-with-nulls.patch ---
diff --git a/lib/sdp.c b/lib/sdp.c
index 896c5eb..66e65ca 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -97,6 +97,7 @@ static uint128_t bluetooth_base_uuid = {
#define SDP_MAX_ATTR_LEN 65535
static sdp_data_t *sdp_copy_seq(sdp_data_t *data);
+static int sdp_attr_add_new_with_length(sdp_record_t *rec, uint16_t attr, uint8_t dtd, const void *value, uint32_t len);
/* Message structure. */
struct tupla {
@@ -1381,7 +1382,7 @@ static void sdp_copy_pattern(void *value, void *udata)
sdp_pattern_add_uuid(rec, uuid);
}
-static void *sdp_data_value(sdp_data_t *data)
+static void *sdp_data_value(sdp_data_t *data, uint32_t *len)
{
void *val = NULL;
@@ -1435,6 +1436,8 @@ static void *sdp_data_value(sdp_data_t *data)
case SDP_URL_STR32:
case SDP_TEXT_STR32:
val = data->val.str;
+ if (len)
+ *len = data->unitSize - 1;
break;
case SDP_ALT8:
case SDP_ALT16:
@@ -1457,7 +1460,7 @@ static sdp_data_t *sdp_copy_seq(sdp_data_t *data)
sdp_data_t *datatmp;
void *value;
- value = sdp_data_value(tmp);
+ value = sdp_data_value(tmp, NULL);
datatmp = sdp_data_alloc_with_length(tmp->dtd, value,
tmp->unitSize);
@@ -1477,10 +1480,14 @@ static void sdp_copy_attrlist(void *value, void *udata)
sdp_data_t *data = value;
sdp_record_t *rec = udata;
void *val;
+ uint32_t len = 0;
- val = sdp_data_value(data);
+ val = sdp_data_value(data, &len);
- sdp_attr_add_new(rec, data->attrId, data->dtd, val);
+ if (!len)
+ sdp_attr_add_new(rec, data->attrId, data->dtd, val);
+ else
+ sdp_attr_add_new_with_length(rec, data->attrId, data->dtd, val, len);
}
sdp_record_t *sdp_copy_record(sdp_record_t *rec)
@@ -2068,6 +2075,17 @@ int sdp_attr_add_new(sdp_record_t *rec, uint16_t attr, uint8_t dtd,
return -1;
}
+static int sdp_attr_add_new_with_length(sdp_record_t *rec, uint16_t attr, uint8_t dtd,
+ const void *value, uint32_t len)
+{
+ sdp_data_t *d = sdp_data_alloc_with_length(dtd, value, len);
+ if (d) {
+ sdp_attr_replace(rec, attr, d);
+ return 0;
+ }
+ return -1;
+}
+
/*
* Set the information attributes of the service
* pointed to by rec. The attributes are
Index: bluez.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bluez/devel/bluez.spec,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- bluez.spec 6 Mar 2009 01:06:07 -0000 1.46
+++ bluez.spec 9 Mar 2009 15:28:31 -0000 1.47
@@ -1,7 +1,7 @@
Summary: Bluetooth utilities
Name: bluez
Version: 4.32
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPLv2+
Group: Applications/System
Source: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.gz
@@ -14,6 +14,8 @@
Patch2: bluez-try-utf8-harder.patch
# http://thread.gmane.org/gmane.linux.bluez.kernel/1688
Patch3: bluez-sdp-xml-with-nulls.patch
+# http://thread.gmane.org/gmane.linux.bluez.kernel/1688/focus=1708
+Patch4: bluez-fix-sdp-copy-for-strings-with-nulls.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://www.bluez.org/
@@ -102,6 +104,7 @@
%patch1 -p0 -b .oui
%patch2 -p1 -b .non-utf8-name
%patch3 -p1 -b .nulls-in-sdp-text
+%patch4 -p1 -b .more-nulls-in-sdp-text
%build
%configure --enable-cups --enable-hid2hci --enable-dfutool --enable-tools --enable-bccmd --enable-gstreamer --enable-hidd --enable-pand --enable-dund
@@ -194,6 +197,9 @@
%{_libdir}/alsa-lib/*.so
%changelog
+* Mon Mar 09 2009 - Bastien Nocera <bnocera at redhat.com> - 4.32-6
+- Fix sdp_copy_record(), so records are properly exported through D-Bus
+
* Fri Mar 06 2009 - Bastien Nocera <bnocera at redhat.com> - 4.32-5
- Fix SDP parsing to XML when it contains NULLs
More information about the scm-commits
mailing list