[PATCH] Fix new DBus API

Dan Williams dcbw at redhat.com
Thu Feb 3 11:42:40 EST 2011


On Tue, 2011-02-01 at 18:45 +0200, Jouni Malinen wrote:
> On Wed, Jan 05, 2011 at 12:08:02PM +0200, Tomasz Bursztyka wrote:
> > "psk" field, in set_network_properties(), was always getting quoted even when
> > containing a raw key (64 characters length representing the hexadecimal value
> > of the raw key).
> 
> Dan described the design here and it sounds reasonable to allow this as
> an alternative approach. However, there is something here that looks a
> bit odd to me..
> 
> > @@ -273,11 +286,12 @@ static DBusMessage * set_network_properties(DBusMessage *message,
> >  		} else if (entry.type == DBUS_TYPE_STRING) {
> > -			if (should_quote_opt(entry.key)) {
> > -				size = os_strlen(entry.str_value);
> > -				if (size <= 0)
> > -					goto error;
> > +			size = os_strlen(entry.str_value);
> > +			if (size <= 0)
> > +				goto error;
> >  
> > +			if (should_quote_opt(entry.key, size,
> > +					     entry.str_value)) {
> 
> Why is size == 0 an error? I'm not sure it was correct with the previous
> quote case either, but now any use of DBUS_TYPE_STRING would trigger an
> error if the string is empty. There are number of configuration
> parameters for which an empty string is a valid value. Am I missing
> something or how is this supposed to work for such cases?

That wasn't something I'd recognized originally; what are those
properties and what's the motivation for them?  Are these things where
just the presence of the property is important, but the actual value
isn't know at this time, or...?

Dan




More information about the HostAP mailing list