Commit 4d680695 authored by David Smith's avatar David Smith Committed by david

A little paranoia, courtesy of the lkml

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9860 b35dd754-fafc-0310-a699-88a17e54d16e
parent da0b49de
...@@ -128,7 +128,9 @@ int main(int inArgsCount, char * const inArgs[]) ...@@ -128,7 +128,9 @@ int main(int inArgsCount, char * const inArgs[])
int err = GetPathToSelf(&selfPath); int err = GetPathToSelf(&selfPath);
const char* correctPath = "/Library/PreferencePanes/Openfire.prefPane/Contents/MacOS/HelperTool"; const char* correctPath = "/Library/PreferencePanes/Openfire.prefPane/Contents/MacOS/HelperTool";
if(err == 0 && strncmp(correctPath, selfPath, strlen(correctPath)) == 0) { if(err == 0 && strncmp(correctPath, selfPath, strlen(correctPath)) == 0) {
setuid(0); //if setuid somehow fails, it's unsafe to continue
if(setuid(0) != 0)
return;
if(inArgs[1] && strlen(inArgs[1]) == strlen("boot") && strncmp("boot", inArgs[1], strlen("boot")) == 0) { if(inArgs[1] && strlen(inArgs[1]) == strlen("boot") && strncmp("boot", inArgs[1], strlen("boot")) == 0) {
toggleStartOpenfireAtBoot(); toggleStartOpenfireAtBoot();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment