summaryrefslogtreecommitdiff
path: root/log
diff options
context:
space:
mode:
Diffstat (limited to 'log')
-rw-r--r--log/logd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/log/logd.c b/log/logd.c
index 5d6c458..594b1e0 100644
--- a/log/logd.c
+++ b/log/logd.c
@@ -260,13 +260,13 @@ main(int argc, char **argv)
ubus_auto_connect(&conn);
p = getpwnam("logd");
if (p) {
- if (setuid(p->pw_uid) < 0) {
- fprintf(stderr, "setuid() failed: %s\n", strerror(errno));
+ if (setgid(p->pw_gid) < 0) {
+ fprintf(stderr, "setgid() failed: %s\n", strerror(errno));
exit(1);
}
- if (setgid(p->pw_gid) < 0) {
- fprintf(stderr, "setgid() failed: %s\n", strerror(errno));
+ if (setuid(p->pw_uid) < 0) {
+ fprintf(stderr, "setuid() failed: %s\n", strerror(errno));
exit(1);
}
}