Fix bug in group handling 95/36095/1 accepted/tizen_3.0.2015.q1_common accepted/tizen_common accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen tizen_3.0.2015.q1_common tizen_3.0.2015.q2_common accepted/tizen/3.0.2015.q1/common/20150317.132302 accepted/tizen/common/20150316.134730 accepted/tizen/mobile/20150326.005123 accepted/tizen/tv/20150324.014516 accepted/tizen/wearable/20150323.005719 submit/tizen_3.0.2015.q1_common/20150316.105130 submit/tizen_3.0.2015.q1_common/20150316.112029 submit/tizen_common/20150316.105034 submit/tizen_common/20150316.111955 submit/tizen_mobile/20150325.000000 submit/tizen_tv/20150320.000001 submit/tizen_wearable/20150320.000000
authorJosé Bollo <jose.bollo@open.eurogiciel.org>
Mon, 2 Mar 2015 09:32:23 +0000 (10:32 +0100)
committerJosé Bollo <jose.bollo@open.eurogiciel.org>
Mon, 2 Mar 2015 09:32:23 +0000 (10:32 +0100)
The function tzplatform_getgid expects the id of a variable
matching a user name, not a group name.

The group set here will now be the group of the current userr.,
It is valid because the mode set using chmod is 0777.

Change-Id: Ie1afde4f08fd1a9cc8a37199611194d4bfea6ae3
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
src/usb_accessory_private.c

index 4b51739..ec7a9d5 100644 (file)
@@ -236,9 +236,9 @@ int ipc_noti_client_init(void)
                return -1;
        }
 
-       ret = chown(ACC_SOCK_PATH,tzplatform_getuid(TZ_USER_NAME),tzplatform_getgid(TZ_SYS_USER_GROUP));
+       ret = chown(ACC_SOCK_PATH,tzplatform_getuid(TZ_USER_NAME),tzplatform_getgid(TZ_USER_NAME));
        if (ret < 0) {
-               USB_LOG("FAIL: chown(ACC_SOCK_PATH, tzplatform_getuid(TZ_USER_NAME),tzplatform_getgid(TZ_SYS_USER_GROUP))");
+               USB_LOG("FAIL: chown(ACC_SOCK_PATH, tzplatform_getuid(TZ_USER_NAME),tzplatform_getgid(TZ_USER_NAME))");
                close(sock_local);
                return -1;
        }