summaryrefslogtreecommitdiffstats
path: root/src/config.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/config.c
parentba3afc50b3819694f009adc6db5a966f524242f6 (diff)
downloadfastd-6b9c59efc9db4aa710d7c243d566973006020d42.tar
fastd-6b9c59efc9db4aa710d7c243d566973006020d42.zip
Refactor handling of platforms without user/group settings (Android)
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/config.c b/src/config.c
index 86e7df6..d0d1d52 100644
--- a/src/config.c
+++ b/src/config.c
@@ -383,14 +383,10 @@ bool fastd_config_read(const char *filename, fastd_peer_group_t *peer_group, fas
/** Loads information about the configured user and group */
static void configure_user(void) {
+#ifdef USE_USER
conf.uid = getuid();
conf.gid = getgid();
-#ifdef __ANDROID__
- if (conf.user || conf.group) {
- exit_error("config error: setting user/group is not supported on Android");
- }
-#else
if (conf.user) {
struct passwd pwd, *pwdr;
size_t bufspace = 1024;
@@ -683,9 +679,12 @@ void fastd_config_release(void) {
free(conf.status_socket);
#endif
+#ifdef USE_USER
free(conf.user);
free(conf.group);
free(conf.groups);
+#endif
+
free(conf.ifname);
free(conf.secret);
free(conf.protocol_config);