linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ v3 06/15] gdbus: Implement DBus.Properties.Set method
Date: Fri, 07 Sep 2012 13:19:04 -0700	[thread overview]
Message-ID: <1347049144.21200.130.camel@aeonflux> (raw)
In-Reply-To: <CABBYNZJhaZkixESrBAjaczGpFgysB8CKv12FFw2fLhBG-h-1yg@mail.gmail.com>

Hi Luiz,

> >> >> Contrary to Get() and GetAll(), Set is asynchronous so we pass on the
> >> >> DBusMessage so user is able to create the response. It's the only use of
> >> >> this parameter.
> >> >> ---
> >> >>  gdbus/gdbus.h  |  7 +++++++
> >> >>  gdbus/object.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
> >> >>  2 files changed, 64 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
> >> >> index b2e78c4..3e4aa16 100644
> >> >> --- a/gdbus/gdbus.h
> >> >> +++ b/gdbus/gdbus.h
> >> >> @@ -31,6 +31,8 @@ extern "C" {
> >> >>  #include <dbus/dbus.h>
> >> >>  #include <glib.h>
> >> >>
> >> >> +typedef enum GDBusPropertySetReturn GDBusPropertySetReturn;
> >> >> +
> >> >>  typedef enum GDBusMethodFlags GDBusMethodFlags;
> >> >>  typedef enum GDBusSignalFlags GDBusSignalFlags;
> >> >>  typedef enum GDBusPropertyFlags GDBusPropertyFlags;
> >> >> @@ -69,6 +71,10 @@ typedef DBusMessage * (* GDBusMethodFunction) (DBusConnection *connection,
> >> >>  typedef gboolean (*GDBusPropertyGetter)(const GDBusPropertyTable *property,
> >> >>                                       DBusMessageIter *iter, void *data);
> >> >>
> >> >> +typedef DBusMessage *(*GDBusPropertySetter)(const GDBusPropertyTable *property,
> >> >> +                                     DBusMessageIter *value,
> >> >> +                                     DBusMessage *msg, void *data);
> >> >> +
> >> >
> >> > I am not really happy with this. We just need a unique handle here since
> >> > the return value is either success or an error. I rather don't send
> >> > messages around for no other reason to create the error.
> >> >
> >> > Inside the authorization code I am using GDBusPendingReply as unique
> >> > token. What about using the same approach?
> >>
> >> It would be perfect, but Im afraid sometimes the properties can have
> >> restriction on which sender can set them, so perhaps we need to add
> >> the name of the sender as parameter in addiction to just the handle?
> >
> > that should be done through the same security handling we have for the
> > method calls. Don't try to invent something new.
> 
> Im afraid you will have to go in detail what you want here, the
> security table seems to be meant for checking privileges in a method
> level while we can probably extend it for properties and have
> privileges also in the properties table, but the security table seems
> to be global not per interface.

you can specify unique integer identifiers as security label to each
method. We could extend that to each property. The security label is
used to pick which security callback to call.

Regards

Marcel



  reply	other threads:[~2012-09-07 20:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-18  6:50 [PATCH BlueZ v3 00/15] gdbus: DBus.Properties + ObjectManager Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 01/15] gdbus: Move typedefs up Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 02/15] gdbus: Define macros to add annotations Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 03/15] gdbus: Add skeleton of DBus.Properties interface Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 04/15] gdbus: Implement DBus.Properties.Get method Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 05/15] gdbus: Implement DBus.Properties.GetAll method Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 06/15] gdbus: Implement DBus.Properties.Set method Lucas De Marchi
2012-09-06 20:01   ` Marcel Holtmann
2012-09-06 21:31     ` Luiz Augusto von Dentz
2012-09-07  5:49       ` Marcel Holtmann
2012-09-07  8:35         ` Luiz Augusto von Dentz
2012-09-07 20:19           ` Marcel Holtmann [this message]
2012-09-10 13:42             ` Luiz Augusto von Dentz
2012-09-12  3:34     ` Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 07/15] gdbus: Add properties into Introspectable interface Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 08/15] gdbus: Add support for org.freedesktop.DBus.ObjectManager interface Lucas De Marchi
2012-08-18 18:25   ` Vinicius Costa Gomes
2012-08-20  7:12     ` Luiz Augusto von Dentz
2012-08-18  6:50 ` [PATCH BlueZ v3 09/15] gdbus: Group interface changes to reduce the amount of signals emitted Lucas De Marchi
2012-08-18 18:28   ` Vinicius Costa Gomes
2012-08-20  7:14     ` Luiz Augusto von Dentz
2012-08-18  6:50 ` [PATCH BlueZ v3 10/15] gdbus: Only export ObjectManager interface on root path Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 11/15] gdbus: Integrates ObjectManager with Properties interface Lucas De Marchi
2012-08-18  6:50 ` [PATCH BlueZ v3 12/15] gdbus: Simplify code for appending properties Lucas De Marchi
2012-08-18  6:51 ` [PATCH BlueZ v3 13/15] gdbus: Implement PropertiesChanged signal Lucas De Marchi
2012-08-18 18:14   ` Vinicius Costa Gomes
2012-08-20 13:38     ` Lucas De Marchi
2012-08-18  6:51 ` [PATCH BlueZ v3 14/15] control: Use DBus.Properties Lucas De Marchi
2012-08-18  6:51 ` [PATCH BlueZ v3 15/15] audio: device: " Lucas De Marchi
2012-08-20  7:56 ` [PATCH BlueZ v3 00/15] gdbus: DBus.Properties + ObjectManager Luiz Augusto von Dentz
2012-08-20 13:51   ` Lucas De Marchi

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=1347049144.21200.130.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=luiz.dentz@gmail.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).