summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorINSUN PYO <insun.pyo@samsung.com>2017-03-27 21:53:16 +0900
committerHyotaek Shim <hyotaek.shim@samsung.com>2017-06-12 09:12:55 +0000
commit900aae625f1041adc95ed8cee6733f3bccda8b7a (patch)
tree5c3bd9e771f83d190a131f833ac658854fb46d94 /bus
parent95e80db362a20bd127d3d34c920bb0e9e573ec30 (diff)
downloaddbus-900aae625f1041adc95ed8cee6733f3bccda8b7a.tar.gz
dbus-900aae625f1041adc95ed8cee6733f3bccda8b7a.tar.bz2
dbus-900aae625f1041adc95ed8cee6733f3bccda8b7a.zip
cynara: add exception code for cynara_session_id retrivingsubmit/tizen/20170622.043014accepted/tizen/unified/20170629.085739
If client exit as soon as async call, cynara_session_from_pid return null. cynara_session_from_pid checks /proc/pid to verify client id. ===== reproduce ===== su - owner dbus-send --type=method_call --system --dest=org.tizen.system.deviced /Org/Tizen/System/DeviceD/Display org.tizen.system.deviced.display.CustomBrightness ===================== Signed-off-by: INSUN PYO <insun.pyo@samsung.com> Change-Id: Ic313e9d4f9531135865824d8512b9eb1ac6f4c9e
Diffstat (limited to 'bus')
-rw-r--r--bus/connection.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bus/connection.c b/bus/connection.c
index 050bf8e0..1939da73 100644
--- a/bus/connection.c
+++ b/bus/connection.c
@@ -1063,6 +1063,11 @@ const char *bus_connection_get_cynara_session_id (DBusConnection *connection)
unsigned long pid;
if (dbus_connection_get_unix_process_id(connection, &pid))
d->cynara_session_id = cynara_session_from_pid(pid);
+
+ /* If client exits as soon as async call, cynara_session_from_pid() returns null.
+ cynara_session_from_pid checks /proc/pid to verify process */
+ if (d->cynara_session_id == NULL)
+ asprintf (&d->cynara_session_id, "/proc/%ld", pid);
}
return d->cynara_session_id;
}