From: Jean-Benoit MARTIN Date: Mon, 10 Feb 2014 15:50:08 +0000 (+0100) Subject: remove hardcoded path for multiuser support X-Git-Tag: submit/tizen_common/20140521.163740^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F54%2F16454%2F1;p=platform%2Fcore%2Fapi%2Fusb-accessory.git remove hardcoded path for multiuser support Bug-Tizen: PTREL-307 Change-Id: Id5cdb4af1e3e44e1d44092acf3154be370170e07 Signed-off-by: Jean-Benoit MARTIN --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c2c6b62..19d4cf1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) -SET(dependents "dlog vconf capi-base-common aul") +SET(dependents "dlog vconf capi-base-common aul libtzplatform-config") SET(pc_dependents "capi-base-common") INCLUDE(FindPkgConfig) diff --git a/packaging/capi-system-usb-accessory.spec b/packaging/capi-system-usb-accessory.spec index 3f6cfd9..4ae939a 100644 --- a/packaging/capi-system-usb-accessory.spec +++ b/packaging/capi-system-usb-accessory.spec @@ -13,6 +13,8 @@ BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(libtzplatform-config) + %description A USB accessory library in TIZEN C API. diff --git a/src/usb_accessory_private.c b/src/usb_accessory_private.c index 289992f..4b51739 100644 --- a/src/usb_accessory_private.c +++ b/src/usb_accessory_private.c @@ -17,6 +17,8 @@ #include "usb_accessory_private.h" +#include + #define NUM_ACC_INFO_SEPARATOR 5 static void show_acc_info(struct usb_accessory_s *accessory) @@ -234,9 +236,9 @@ int ipc_noti_client_init(void) return -1; } - ret = chown(ACC_SOCK_PATH, 5000, 5000); + ret = chown(ACC_SOCK_PATH,tzplatform_getuid(TZ_USER_NAME),tzplatform_getgid(TZ_SYS_USER_GROUP)); if (ret < 0) { - USB_LOG("FAIL: chown(ACC_SOCK_PATH, 5000, 5000)"); + USB_LOG("FAIL: chown(ACC_SOCK_PATH, tzplatform_getuid(TZ_USER_NAME),tzplatform_getgid(TZ_SYS_USER_GROUP))"); close(sock_local); return -1; }