[PATCH obexd] client: Fix pbap_select using absolute path with known locations

Subsystems: the rest

STALE5048d

3 messages, 2 authors, 2012-10-08 · open the first message on its own page

[PATCH obexd] client: Fix pbap_select using absolute path with known locations

From: Ludek Finstrle <hidden>
Date: 2012-08-09 16:07:33

pbap_select has to use absolute path with known location to support
repeatable pbap_select calls. In other way the second call fails.
---
 client/pbap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/client/pbap.c b/client/pbap.c
index 48dbac1..d8c39e5 100644
--- a/client/pbap.c
+++ b/client/pbap.c
@@ -232,14 +232,14 @@ static gchar *build_phonebook_path(const char *location, const char *item)
 
 	if (!g_ascii_strcasecmp(location, "INT") ||
 			!g_ascii_strcasecmp(location, "INTERNAL"))
-		path = g_strdup("telecom");
+		path = g_strdup("/telecom");
 	else if (!g_ascii_strncasecmp(location, "SIM", 3)) {
 		if (strlen(location) == 3)
 			tmp = g_strdup("SIM1");
 		else
 			tmp = g_ascii_strup(location, 4);
 
-		path = g_build_filename(tmp, "telecom", NULL);
+		path = g_build_filename("/", tmp, "telecom", NULL);
 		g_free(tmp);
 	} else
 		return NULL;
-- 
1.7.1

Re: [PATCH obexd] client: Fix pbap_select using absolute path with known locations

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2012-08-10 11:28:27

Hi Ludek,

On Thu, Aug 9, 2012 at 7:07 PM, Ludek Finstrle [off-list ref] wrote:
quoted hunk
pbap_select has to use absolute path with known location to support
repeatable pbap_select calls. In other way the second call fails.
---
 client/pbap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/client/pbap.c b/client/pbap.c
index 48dbac1..d8c39e5 100644
--- a/client/pbap.c
+++ b/client/pbap.c
@@ -232,14 +232,14 @@ static gchar *build_phonebook_path(const char *location, const char *item)

        if (!g_ascii_strcasecmp(location, "INT") ||
                        !g_ascii_strcasecmp(location, "INTERNAL"))
-               path = g_strdup("telecom");
+               path = g_strdup("/telecom");
        else if (!g_ascii_strncasecmp(location, "SIM", 3)) {
                if (strlen(location) == 3)
                        tmp = g_strdup("SIM1");
                else
                        tmp = g_ascii_strup(location, 4);

-               path = g_build_filename(tmp, "telecom", NULL);
+               path = g_build_filename("/", tmp, "telecom", NULL);
                g_free(tmp);
        } else
                return NULL;
--
1.7.1
Applied, thanks.


-- 
Luiz Augusto von Dentz

Re: [PATCH obexd] client: Fix pbap_select using absolute path with known locations

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2012-10-08 12:47:13

Hi Ludek,

On Fri, Aug 10, 2012 at 1:28 PM, Luiz Augusto von Dentz
[off-list ref] wrote:
Hi Ludek,

On Thu, Aug 9, 2012 at 7:07 PM, Ludek Finstrle [off-list ref] wrote:
quoted
pbap_select has to use absolute path with known location to support
repeatable pbap_select calls. In other way the second call fails.
---
 client/pbap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/client/pbap.c b/client/pbap.c
index 48dbac1..d8c39e5 100644
--- a/client/pbap.c
+++ b/client/pbap.c
@@ -232,14 +232,14 @@ static gchar *build_phonebook_path(const char *location, const char *item)

        if (!g_ascii_strcasecmp(location, "INT") ||
                        !g_ascii_strcasecmp(location, "INTERNAL"))
-               path = g_strdup("telecom");
+               path = g_strdup("/telecom");
        else if (!g_ascii_strncasecmp(location, "SIM", 3)) {
                if (strlen(location) == 3)
                        tmp = g_strdup("SIM1");
                else
                        tmp = g_ascii_strup(location, 4);

-               path = g_build_filename(tmp, "telecom", NULL);
+               path = g_build_filename("/", tmp, "telecom", NULL);
                g_free(tmp);
        } else
                return NULL;
--
1.7.1
Applied, thanks.
This doesn't a regression with some phones e.g. iphone5, the problem
is not really the path as this is handled by obc_session_setpath, but
we should not use absolute in the name as in pull_phonebook.

-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help