diff options
author | John Crispin <blogic@openwrt.org> | 2015-03-28 15:41:58 +0100 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-03-28 18:35:21 +0100 |
commit | 91da63d3d3fd680c805dd1a1b78df5b8731a8173 (patch) | |
tree | ec9a568a398ae536ccf7ac89a23942a60ef25c98 /service | |
parent | 74d835463e05e5761f6f5271e487f299f29d3f07 (diff) | |
download | unitd-91da63d3d3fd680c805dd1a1b78df5b8731a8173.tar unitd-91da63d3d3fd680c805dd1a1b78df5b8731a8173.zip |
properly handle return codes
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'service')
-rw-r--r-- | service/instance.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/service/instance.c b/service/instance.c index 8d2001a..f5b61fa 100644 --- a/service/instance.c +++ b/service/instance.c @@ -283,8 +283,10 @@ instance_run(struct service_instance *in, int _stdout, int _stderr) } if (in->uid || in->gid) { - setuid(in->uid); - setgid(in->gid); + if (setuid(in->uid) || setgid(in->gid)) { + ERROR("failed to set uid:%d, gid:%d\n", in->uid, in->gid); + exit(127); + } } execvp(argv[0], argv); exit(127); |