summaryrefslogtreecommitdiffstats
path: root/src/status.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-01-14 22:29:30 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-01-14 22:29:30 +0100
commit6b9c59efc9db4aa710d7c243d566973006020d42 (patch)
treef8da5b18b935f603b72eb37898f57a9df19369e1 /src/status.c
parentba3afc50b3819694f009adc6db5a966f524242f6 (diff)
downloadfastd-6b9c59efc9db4aa710d7c243d566973006020d42.tar
fastd-6b9c59efc9db4aa710d7c243d566973006020d42.zip
Refactor handling of platforms without user/group settings (Android)
Diffstat (limited to 'src/status.c')
-rw-r--r--src/status.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/status.c b/src/status.c
index 7505ef9..3c82e0c 100644
--- a/src/status.c
+++ b/src/status.c
@@ -203,6 +203,7 @@ void fastd_status_init(void) {
return;
}
+#ifdef USE_USER
uid_t uid = geteuid();
gid_t gid = getegid();
@@ -212,7 +213,7 @@ void fastd_status_init(void) {
if (seteuid(conf.uid) < 0)
pr_debug_errno("seteuid");
}
-
+#endif
ctx.status_fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (ctx.status_fd < 0)
@@ -242,10 +243,12 @@ void fastd_status_init(void) {
exit_errno("fastd_status_init: listen");
+#ifdef USE_USER
if (seteuid(uid) < 0)
pr_debug_errno("seteuid");
if (setegid(gid) < 0)
pr_debug_errno("setegid");
+#endif
}
/** Closes the status socket */