mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-23 10:54:17 +00:00
Monotone-Parent: 9710b121b6d2a9cb6c458ece855761137e8fb6dc
Monotone-Revision: 0500c2697b10470788d9a9fc3204a2b0df84dc8d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-21T21:16:03 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2007-06-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* Main/sogod.m (main): prevent SOGo from running as root.
|
||||
|
||||
2007-06-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoUser.m ([SOGoUser
|
||||
|
||||
+23
-9
@@ -19,6 +19,8 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <unistd.h>
|
||||
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSTimeZone.h>
|
||||
|
||||
@@ -31,21 +33,33 @@ main (int argc, char **argv, char **env)
|
||||
NSString *tzName;
|
||||
NSUserDefaults *ud;
|
||||
NSAutoreleasePool *pool;
|
||||
int rc;
|
||||
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
||||
if (getuid() > 0)
|
||||
{
|
||||
rc = 0;
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
||||
#endif
|
||||
[NGBundleManager defaultBundleManager];
|
||||
[NGBundleManager defaultBundleManager];
|
||||
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
tzName = [ud stringForKey: @"SOGoServerTimeZone"];
|
||||
if (!tzName)
|
||||
tzName = @"Canada/Eastern";
|
||||
[NSTimeZone setDefaultTimeZone: [NSTimeZone timeZoneWithName: tzName]];
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
tzName = [ud stringForKey: @"SOGoServerTimeZone"];
|
||||
if (!tzName)
|
||||
tzName = @"Canada/Eastern";
|
||||
[NSTimeZone setDefaultTimeZone: [NSTimeZone timeZoneWithName: tzName]];
|
||||
|
||||
WOWatchDogApplicationMain (@"SOGo", argc, (void *) argv);
|
||||
WOWatchDogApplicationMain (@"SOGo", argc, (void *) argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog (@"Don't run SOGo as root!");
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
[pool release];
|
||||
return 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user