From: Don Zickus <dzickus@redhat.com>
To: linux-bluetooth@vger.kernel.org
Cc: luiz.von.dentz@intel.com, mkasik@redhat.com,
Don Zickus <dzickus@redhat.com>
Subject: [PATCH 1/3] obexd: Allow CreateFolder to create a directory
Date: Thu, 30 Jun 2016 17:01:27 -0400 [thread overview]
Message-ID: <1467320489-127890-2-git-send-email-dzickus@redhat.com> (raw)
In-Reply-To: <1467320489-127890-1-git-send-email-dzickus@redhat.com>
When the remote device sends the 'CreateFolder' command, obexd
first tries to verify the path in ftp_setpath(). Because we are
creating a new directory, the verify_path() is expected to fail (it does
not exist yet; ENOENT).
Trap that special case and cause the function to fail directly to the
create directory path.
This patch is from Marek Kasik <mkasik@redhat.com>.
---
obexd/plugins/ftp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/obexd/plugins/ftp.c b/obexd/plugins/ftp.c
index a906527..3ee18a6 100644
--- a/obexd/plugins/ftp.c
+++ b/obexd/plugins/ftp.c
@@ -278,6 +278,8 @@ int ftp_setpath(struct obex_session *os, void *user_data)
DBG("Fullname: %s", fullname);
err = verify_path(fullname);
+ if (err == -ENOENT)
+ goto not_found;
if (err < 0)
goto done;
--
1.8.3.1
next prev parent reply other threads:[~2016-06-30 21:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 21:01 [PATCH 0/3] obexd fixes Don Zickus
2016-06-30 21:01 ` Don Zickus [this message]
2016-06-30 21:01 ` [PATCH 2/3] obexd: Return dummy_data instead of int in phonebook-dummy Don Zickus
2016-06-30 21:01 ` [PATCH 3/3] obexd: Add a detailed failure message for exchanging business cards Don Zickus
2016-06-30 21:35 ` Bastien Nocera
2016-06-30 22:47 ` Don Zickus
2016-07-04 12:07 ` [PATCH 0/3] obexd fixes Luiz Augusto von Dentz
2016-07-05 14:39 ` Don Zickus
2016-07-06 16:21 ` Don Zickus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467320489-127890-2-git-send-email-dzickus@redhat.com \
--to=dzickus@redhat.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.von.dentz@intel.com \
--cc=mkasik@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).