From cff10996b7c7e5242e1deeacf33be6fb6d530b87 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 29 Jun 2007 21:55:16 +0000 Subject: [PATCH] Monotone-Parent: a0f68502f87ffdb7d7c28d10cb89869cca34487f Monotone-Revision: fdc4bd260e9bdf3cb16b0dd44f5aaacdc7cff37f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-29T21:55:16 Monotone-Branch: ca.inverse.sogo --- Main/sogod.m | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Main/sogod.m b/Main/sogod.m index 3dfb7920c..fc8583034 100644 --- a/Main/sogod.m +++ b/Main/sogod.m @@ -21,11 +21,12 @@ #import -#import +#import +#import #import +#import -#import -#import "common.h" +#import int main (int argc, char **argv, char **env) @@ -37,27 +38,24 @@ main (int argc, char **argv, char **env) pool = [NSAutoreleasePool new]; + rc = -1; + if (getuid() > 0) { - rc = 0; #if LIB_FOUNDATION_LIBRARY [NSProcessInfo initializeWithArguments: argv count: argc environment: env]; #endif - [NGBundleManager defaultBundleManager]; - ud = [NSUserDefaults standardUserDefaults]; + rc = 0; tzName = [ud stringForKey: @"SOGoServerTimeZone"]; if (!tzName) - tzName = @"Canada/Eastern"; - [NSTimeZone setDefaultTimeZone: [NSTimeZone timeZoneWithName: tzName]]; - + tzName = @"UTC"; + [NSTimeZone setDefaultTimeZone: + [NSTimeZone timeZoneWithName: tzName]]; WOWatchDogApplicationMain (@"SOGo", argc, (void *) argv); } else - { - NSLog (@"Don't run SOGo as root!"); - rc = -1; - } + NSLog (@"Don't run SOGo as root!"); [pool release];