afb-cred: fix default values
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 3 Aug 2017 10:16:58 +0000 (12:16 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 3 Aug 2017 11:41:58 +0000 (13:41 +0200)
commit8ba97707ddb6d74b8c62631888bb0a982ab26f01
treefca5cd5bff6f2036c128d95eb9134aec95b0d282
parent04186fd953298be8b8c5673b5fcd01f0893986ff
afb-cred: fix default values

Because SO_PEERCRED returns without error even when no data
is available (tcp by example), the resulting uid is now tested.

Also, for tcp, by default avoid by default to create a default
user value. Instead, return NULL. This will allow client having
an HTTP/Websocket connection to get full rights on the binder.

Change-Id: I2defb585bf79c023e2391c2e18d6de17e5112770
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-cred.c