DBG("");
-#ifdef TIZEN_PATCH
- conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-#else
conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
-#endif
if (!conn)
return -EIO;
#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);
dbus_error_init(&derr);
-#ifdef TIZEN_PATCH
- conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, CLIENT_SERVICE, &derr);
-#else
conn = g_dbus_setup_bus(DBUS_BUS_SESSION, CLIENT_SERVICE, &derr);
-#endif
if (dbus_error_is_set(&derr) == TRUE) {
error("%s: %s", derr.name, derr.message);
dbus_error_free(&derr);
DBG("");
-#ifdef TIZEN_PATCH
- conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-#else
conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
-#endif
if (!conn)
return -EIO;
int err;
DBG("");
-#ifdef TIZEN_PATCH
- conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-#else
conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
-#endif
if (!conn)
return -EIO;
session->refcount = 1;
session->channel = channel;
-#ifdef TIZEN_PATCH
- session->conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-#else
session->conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
-#endif
if (session->conn == NULL) {
session_free(session);
return NULL;
DBG("");
-#ifdef TIZEN_PATCH
- conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-#else
conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
-#endif
if (!conn)
return -EIO;
g_obex_cancel_transfer(transfer->xfer);
transfer->xfer = 0;
-#ifndef TIZEN_PATCH
if (callback) {
GError *err;
callback->data);
g_error_free(err);
}
-#endif
}
static DBusMessage *obc_transfer_cancel(DBusConnection *connection,
transfer->path = g_strdup_printf("%s/transfer%ju",
TRANSFER_BASEPATH, counter++);
-#ifdef TIZEN_PATCH
- transfer->conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-#else
transfer->conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
-#endif
if (transfer->conn == NULL) {
obc_transfer_free(transfer);
return NULL;
+* Tue Aug 21 2012 - wu zheng <wu.zheng@intel.con> - 0.44
+- Changed system dbus to session bus, so that obex can run on IVI.
+
* Wed May 30 03:17:39 UTC 2012 - Lin Yang <lin.a.yang@intel.con> - 0.44
- Clean up spec file for packaging
DBG("");
dbus_error_init(&err);
-#ifdef TIZEN_PATCH
- connection = g_dbus_setup_bus(DBUS_BUS_SYSTEM, OPENOBEX_SERVICE, &err);
-#else
connection = g_dbus_setup_bus(DBUS_BUS_SESSION, OPENOBEX_SERVICE,
&err);
-#endif
if (connection == NULL) {
if (dbus_error_is_set(&err) == TRUE) {
fprintf(stderr, "%s\n", err.message);