summaryrefslogtreecommitdiffstats
path: root/logwrapper
diff options
context:
space:
mode:
authorRom Lemarchand <romlem@google.com>2013-01-14 14:11:01 -0800
committerRom Lemarchand <romlem@google.com>2013-01-28 13:11:32 -0800
commit611f5b4b938f2ffcf2a2e71a847e4fd12587ca4b (patch)
tree4992df2c91076bfbd1ce6e319ba688bd4acc81ed /logwrapper
parent0cc2cab6af2635e3293b3611a4c0982061dbb935 (diff)
downloadsystem_core-611f5b4b938f2ffcf2a2e71a847e4fd12587ca4b.zip
system_core-611f5b4b938f2ffcf2a2e71a847e4fd12587ca4b.tar.gz
system_core-611f5b4b938f2ffcf2a2e71a847e4fd12587ca4b.tar.bz2
logwrap: fix off by 1 argument error
Fix off by 1 argument parsing error in liblogwrap. Change-Id: I79832ae338a71c445f9f616d780c577826874386
Diffstat (limited to 'logwrapper')
-rw-r--r--logwrapper/logwrap.c4
-rw-r--r--logwrapper/logwrapper.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/logwrapper/logwrap.c b/logwrapper/logwrap.c
index 9cd3fe4..09f8b81 100644
--- a/logwrapper/logwrap.c
+++ b/logwrapper/logwrap.c
@@ -227,7 +227,7 @@ int logwrap(int argc, char* argv[], int *status) {
dup2(child_ptty, 2);
close(child_ptty);
- child(argc - 1, &argv[1]);
+ child(argc, argv);
fatal("This should never happen\n");
return -1;
} else {
@@ -268,7 +268,7 @@ int logwrap(int argc, char* argv[], int *status) {
setgid(AID_LOG);
setuid(AID_LOG);
- rc = parent(argv[1], parent_ptty, sockets[1], pid, status);
+ rc = parent(argv[0], parent_ptty, sockets[1], pid, status);
}
close(sockets[0]);
diff --git a/logwrapper/logwrapper.c b/logwrapper/logwrapper.c
index 4f1bff9..e647b4d 100644
--- a/logwrapper/logwrapper.c
+++ b/logwrapper/logwrapper.c
@@ -59,7 +59,7 @@ int main(int argc, char* argv[]) {
usage();
}
- rc = logwrap(argc, argv, &status);
+ rc = logwrap(argc - 1, &argv[1], &status);
if (!rc) {
if (WIFEXITED(status))
rc = WEXITSTATUS(status);