public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v5] obexd: AuthorizePush: Support to return folder name for file storage
@ 2023-04-20  9:55 Guiting Shen
  2023-04-20 11:08 ` [BlueZ,v5] " bluez.test.bot
  2023-04-20 23:20 ` [PATCH BlueZ v5] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Guiting Shen @ 2023-04-20  9:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: pmenzel, Guiting Shen

The obex agent usually returns the full path by getting the default
folder and filename from the Filename property of the transfer object
which is not convenient.

The patch helps that the obex agent can return the folder name suffixed
with '/' or new full path or even null which will use the default name
if new_name is NULL and the default folder if the new_folder is NULL in
opp_chkput().
---
 doc/obex-agent-api.txt | 9 +++++----
 obexd/src/manager.c    | 7 +++++--
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/doc/obex-agent-api.txt b/doc/obex-agent-api.txt
index 3923da6df..7c720927d 100644
--- a/doc/obex-agent-api.txt
+++ b/doc/obex-agent-api.txt
@@ -46,10 +46,11 @@ Methods		void Release()
 			This method gets called when the service daemon
 			needs to accept/reject a Bluetooth object push request.
 
-			Returns the full path (including the filename) where
-			the object shall be stored. The tranfer object will
-			contain a Filename property that contains the default
-			location and name that can be returned.
+			Returns the full path (including the filename) or the
+			folder name suffixed with '/' where the object shall
+			be stored. The transfer object will contain a Filename
+			property that contains the default location and name
+			that can be returned.
 
 			Possible errors: org.bluez.obex.Error.Rejected
 			                 org.bluez.obex.Error.Canceled
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 849928603..2bb985b96 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -651,7 +651,10 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
 			agent->new_name = g_strdup(name);
 			agent->new_folder = NULL;
 		} else {
-			agent->new_name = g_strdup(slash + 1);
+			if (strlen(slash) == 1)
+				agent->new_name = NULL;
+			else
+				agent->new_name = g_strdup(slash + 1);
 			agent->new_folder = g_strndup(name, slash - name);
 		}
 	}
@@ -722,7 +725,7 @@ int manager_request_authorization(struct obex_transfer *transfer,
 
 	dbus_pending_call_unref(call);
 
-	if (!agent || !agent->new_name || agent->auth_reject)
+	if (!agent || agent->auth_reject)
 		return -EPERM;
 
 	*new_folder = agent->new_folder;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [BlueZ,v5] obexd: AuthorizePush: Support to return folder name for file storage
  2023-04-20  9:55 [PATCH BlueZ v5] obexd: AuthorizePush: Support to return folder name for file storage Guiting Shen
@ 2023-04-20 11:08 ` bluez.test.bot
  2023-04-20 23:20 ` [PATCH BlueZ v5] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2023-04-20 11:08 UTC (permalink / raw)
  To: linux-bluetooth, aarongt.shen

[-- Attachment #1: Type: text/plain, Size: 945 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=741650

---Test result---

Test Summary:
CheckPatch                    PASS      0.40 seconds
GitLint                       PASS      0.28 seconds
BuildEll                      PASS      26.38 seconds
BluezMake                     PASS      757.47 seconds
MakeCheck                     PASS      10.92 seconds
MakeDistcheck                 PASS      149.95 seconds
CheckValgrind                 PASS      240.66 seconds
CheckSmatch                   PASS      324.94 seconds
bluezmakeextell               PASS      96.89 seconds
IncrementalBuild              PASS      611.16 seconds
ScanBuild                     PASS      981.95 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ v5] obexd: AuthorizePush: Support to return folder name for file storage
  2023-04-20  9:55 [PATCH BlueZ v5] obexd: AuthorizePush: Support to return folder name for file storage Guiting Shen
  2023-04-20 11:08 ` [BlueZ,v5] " bluez.test.bot
@ 2023-04-20 23:20 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2023-04-20 23:20 UTC (permalink / raw)
  To: Guiting Shen; +Cc: linux-bluetooth, pmenzel

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 20 Apr 2023 17:55:57 +0800 you wrote:
> The obex agent usually returns the full path by getting the default
> folder and filename from the Filename property of the transfer object
> which is not convenient.
> 
> The patch helps that the obex agent can return the folder name suffixed
> with '/' or new full path or even null which will use the default name
> if new_name is NULL and the default folder if the new_folder is NULL in
> opp_chkput().
> 
> [...]

Here is the summary with links:
  - [BlueZ,v5] obexd: AuthorizePush: Support to return folder name for file storage
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d36160459404

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-20 23:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20  9:55 [PATCH BlueZ v5] obexd: AuthorizePush: Support to return folder name for file storage Guiting Shen
2023-04-20 11:08 ` [BlueZ,v5] " bluez.test.bot
2023-04-20 23:20 ` [PATCH BlueZ v5] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox