From: Kim Gunsoo Date: Tue, 5 Apr 2016 23:40:21 +0000 (+0900) Subject: Add the check routine for multi-user support. X-Git-Tag: submit/tizen/20160407.041337~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0795f20e22524c34b5a8fad5e920cd7010a60f9b;p=sdk%2Ftarget%2Fsdbd.git Add the check routine for multi-user support. - The multi-user support information is obtained from tizen-platform-config. Change-Id: I3ce38d8a0d9070d9a93784918acf7a0746a1094c Signed-off-by: Kim Gunsoo --- diff --git a/src/sdb.c b/src/sdb.c index 0fa0672..57cbcb0 100644 --- a/src/sdb.c +++ b/src/sdb.c @@ -1922,10 +1922,17 @@ static void init_capabilities(void) { // Multi-User support - // TODO: get this information from platform. - snprintf(g_capabilities.multiuser_support, sizeof(g_capabilities.multiuser_support), - "%s", DISABLED); - + // XXX: There is no clear way to determine whether multi-user support. + // Since TZ_SYS_DEFAULT_USER is set to "owner" for multi-user support, + // guess whether multiuser support through that information. + const char* sys_default_user = tzplatform_getenv(TZ_SYS_DEFAULT_USER); + if (sys_default_user != NULL && !strcmp(sys_default_user, "owner")) { + snprintf(g_capabilities.multiuser_support, sizeof(g_capabilities.multiuser_support), + "%s", ENABLED); + } else { + snprintf(g_capabilities.multiuser_support, sizeof(g_capabilities.multiuser_support), + "%s", DISABLED); + } // Window size synchronization support snprintf(g_capabilities.syncwinsz_support, sizeof(g_capabilities.syncwinsz_support),