public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] obexd: reject to accept file when replying any error message
@ 2025-06-30 13:54 Chengyi Zhao
  2025-06-30 14:35 ` Paul Menzel
  2025-06-30 15:33 ` bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Chengyi Zhao @ 2025-06-30 13:54 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: stable, Chengyi Zhao

For security reasons, it will reject the file when the obex
agent replies with any error message, and accept the file
when the obex agent replies with the new file name.
---
 obexd/src/manager.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 5a6fd9b4b..cecf9f90a 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -658,6 +658,8 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
 				agent->new_name = g_strdup(slash + 1);
 			agent->new_folder = g_strndup(name, slash - name);
 		}
+
+		agent->auth_reject = FALSE;
 	}
 
 	dbus_message_unref(reply);
@@ -703,7 +705,7 @@ int manager_request_authorization(struct obex_transfer *transfer,
 	dbus_message_unref(msg);
 
 	agent->auth_pending = TRUE;
-	agent->auth_reject  = FALSE;
+	agent->auth_reject  = TRUE;
 	got_reply = FALSE;
 
 	/* Catches errors before authorization response comes */
-- 
2.20.1


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

end of thread, other threads:[~2025-06-30 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 13:54 [PATCH] obexd: reject to accept file when replying any error message Chengyi Zhao
2025-06-30 14:35 ` Paul Menzel
2025-06-30 15:33 ` bluez.test.bot

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