This patch makes to run tlm-client utility as normal user instead of
ROOT privilege. That functionality is necessary to test for switching
users as application privilege. What if launching tlm daemon itself,
ROOT privilege is still necessary.
Change-Id: I705a7a92c090bf53106cd0d1ef1762d633884f50
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
const gchar *bin_path = TLM_BIN_DIR;
+ if (geteuid() != 0) {
+ WARN("ROOT privilege users can launch tlm daemon");
+ return FALSE;
+ }
+
#ifdef ENABLE_DEBUG
const gchar *env_val = g_getenv("TLM_BIN_DIR");
if (env_val)
return EXIT_FAILURE;
}
- if (geteuid() != 0) {
- WARN("test-client can only be run with ROOT privileges");
+ if (run_tlm_daemon && !_setup_daemon()) {
_free_tlm_user (user);
return EXIT_FAILURE;
}
- if (run_tlm_daemon)
- _setup_daemon ();
-
if (is_user_login_op) {
_handle_user_login (user);
} else if (is_user_logout_op) {