#include <glib.h>
#include <gdbus.h>
-#ifdef TIZEN_PATCH
-#include <sys/types.h>
-#include <grp.h>
-#include <pwd.h>
-#include <unistd.h>
-#endif
#include "log.h"
#include "manager.h"
g_option_context_free(context);
-#ifdef TIZEN_PATCH
- if (getuid() == 0) {
- /* current user is 'root' */
- #define INHOUSE_USER "app"
- #define INHOUSE_GROUP "app"
- #define BUFFER_SIZE 200
-
- char buffer[BUFFER_SIZE] = {0};
-
- struct group gr;
- struct group *gr_result;
- struct passwd pw;
- struct passwd *pw_result;
-
- if (getpwnam_r(INHOUSE_USER, &pw, buffer, BUFFER_SIZE, &pw_result) != 0) {
- DBG("Failed to find user '%s'.", INHOUSE_USER);
- }
-
- memset(buffer, 0x00, BUFFER_SIZE);
-
- if (getgrnam_r(INHOUSE_GROUP, &gr, buffer, BUFFER_SIZE, &gr_result) != 0) {
- DBG("Failed to find group '%s'.", INHOUSE_GROUP);
- }
-
- if (pw_result && gr_result) {
- DBG("Found user '%s' (UID %lu) and group '%s' (GID %lu).",
- INHOUSE_USER, (unsigned long) pw.pw_uid,
- INHOUSE_GROUP, (unsigned long) gr.gr_gid);
-
- if (pw.pw_gid != gr.gr_gid)
- DBG("GID of user '%s' and of group '%s' don't match.", INHOUSE_USER, INHOUSE_GROUP);
-
- if (initgroups(INHOUSE_USER, gr.gr_gid) != 0)
- DBG("Failed to change group list");
-
- if(setgid(gr.gr_gid) != 0)
- DBG("[ERR] fail to execute setgid().\n");
-
- if(setuid(pw.pw_uid) != 0)
- DBG("[ERR] fail to execute setuid().\n");
- }
- }
-#endif
event_loop = g_main_loop_new(NULL, FALSE);
__obex_log_init("obex-client", option_debug, !option_stderr);