[OpenWrt-Devel] ubus: potential regression in request processing

Zefir Kurtisi zefir.kurtisi at neratec.com
Tue Sep 1 05:18:01 EDT 2015


On 08/31/2015 07:19 PM, Felix Fietkau wrote:
> On 2015-08-31 19:02, Zefir Kurtisi wrote:
>> On 08/27/2015 02:17 PM, Felix Fietkau wrote:
>>> [...]
>>> This change (mostly untested) might fix the issue while still preserving
>>> processing of pending notifications, what do you think?
>>>
>>> [...]
>>
>> Thank you for the suggestion, Felix. Alas, while trying to dig deeper, I noticed
>> another recent modification that bricked my host-based test environment.
>>
>> I use to test and debug ubus based modules on host, which so far worked as
>> expected. Moving ubus and libubox to HEAD, there seem some undocumented
>> requirements introduced to get the system running again.
>>
>> Here's how to reproduce:
>> * build on host
>> * run ubusd -s /tmp/ubus.sock
>> * run examples/server -s /tmp/ubus.sock
>> => server fails to register
>>
>>
>> Must be something with access rights to directories, since the same sources work
>> on target as expected - with the only difference being run as root.
> Can't reproduce this on my host (tried on Mac OS X and Linux).
> 
> - Felix
> 
Hm, strange. Ubuntu 15.10 here, what I observe is:

* upon server registration, ubusd_create_object() calls ubusd_acl_check()
* when examples/server is run as root, ubusd_acl_check() is left early because of
	if (!cl->gid && !cl->uid)
		return 0;
* when examples/server is run as non-root
  * ubusd_acl_check() returns an error since there are no ACLs
  * registration fails with 'Failed to add object: Invalid argument'


In your tests, do you have any ACLs set? Is this the intended behaviour for the
ACL functionality, i.e. either run as root or provide correct ACLs?


Thanks,
Zefir
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list