summaryrefslogtreecommitdiff
path: root/cydo.cpp
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2015-07-02 14:16:59 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2015-07-02 14:18:43 -0700
commit91e48f51ab815945273b2e7c38190d92c2f25718 (patch)
treec4d59593662cbf544067edb7c74684d8b6b79aef /cydo.cpp
parentd78cda50503c66b044150c9ced5a2a4a8c9607dd (diff)
Log arguments and parent's path to /tmp/cydia.log.
Diffstat (limited to 'cydo.cpp')
-rw-r--r--cydo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/cydo.cpp b/cydo.cpp
index 49e419a..0347c5b 100644
--- a/cydo.cpp
+++ b/cydo.cpp
@@ -18,6 +18,12 @@ void launch_data_dict_iterate(launch_data_t data, LaunchDataIterator code) {
}
int main(int argc, char *argv[]) {
+ FILE *log(fopen("/tmp/cydia.log", "a+"));
+ fprintf(log, "cydo:");
+ for (int arg(1); arg < argc; ++arg)
+ fprintf(log, " %s", argv[arg]);
+ fprintf(log, "\n");
+
auto request(launch_data_new_string(LAUNCH_KEY_GETJOBS));
auto response(launch_msg(request));
launch_data_free(request);
@@ -49,6 +55,7 @@ int main(int argc, char *argv[]) {
if (program == NULL)
return;
+ fprintf(log, "%lld %s\n", pid, program);
if (strcmp(program, "/Applications/Cydia.app/Cydia") == 0)
cydia = true;
});
@@ -58,6 +65,9 @@ int main(int argc, char *argv[]) {
return EX_NOPERM;
}
+ fflush(log);
+ fclose(log);
+
setuid(0);
setgid(0);