diff options
author | Rom Lemarchand | 2013-01-11 16:56:44 -0600 |
---|---|---|
committer | Rom Lemarchand | 2013-01-28 15:12:37 -0600 |
commit | cfb5ec3c283bb0fd5a99d6ed282a508be309d291 (patch) | |
tree | 7a043ee4378c8b9b85cc84996703712c978f7a79 /logwrapper | |
parent | 611f5b4b938f2ffcf2a2e71a847e4fd12587ca4b (diff) | |
download | platform-system-core-cfb5ec3c283bb0fd5a99d6ed282a508be309d291.tar.gz platform-system-core-cfb5ec3c283bb0fd5a99d6ed282a508be309d291.tar.xz platform-system-core-cfb5ec3c283bb0fd5a99d6ed282a508be309d291.zip |
logwrap: remove unnecessary call to setuid/setgid
Android allows all users to write to log.
The setuid/setgid call is unneeded and could cause unintended
side effects when called from daemons or programs that need
to run as root.
Change-Id: I3bdb26eaa4363ef037615e45a1a5cb1ceb4088f3
Diffstat (limited to 'logwrapper')
-rw-r--r-- | logwrapper/logwrap.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/logwrapper/logwrap.c b/logwrapper/logwrap.c index 09f8b814c..ef457def5 100644 --- a/logwrapper/logwrap.c +++ b/logwrapper/logwrap.c | |||
@@ -262,12 +262,6 @@ int logwrap(int argc, char* argv[], int *status) { | |||
262 | 262 | ||
263 | signal_fd_write = sockets[0]; | 263 | signal_fd_write = sockets[0]; |
264 | 264 | ||
265 | // switch user and group to "log" | ||
266 | // this may fail if we are not root, | ||
267 | // but in that case switching user/group is unnecessary | ||
268 | setgid(AID_LOG); | ||
269 | setuid(AID_LOG); | ||
270 | |||
271 | rc = parent(argv[0], parent_ptty, sockets[1], pid, status); | 265 | rc = parent(argv[0], parent_ptty, sockets[1], pid, status); |
272 | } | 266 | } |
273 | 267 | ||