'From etoys2.2 of 21 September 2007 [latest update: #1789] on 21 November 2007 at 4:24:56 pm'! "Change Set: rainbowKey-bf Date: 21 November 2007 Author: Bert Freudenberg Disable sandbox and key generation if running in rainbow"! !SecurityManager methodsFor: 'initialize-release' stamp: 'bf 11/21/2007 15:49'! startUp "Attempt to load existing keys" self loadSecurityKeys. (privateKeyPair == nil and: [self isInRestrictedMode not and: [SugarLauncher isRunningInRainbow not and: [Preferences automaticKeyGeneration]]]) ifTrue:[ self loadOLPCOwnerKey. privateKeyPair == nil ifTrue: [self generateKeyPairInBackground]].! ! !SecurityManager methodsFor: 'security operations' stamp: 'bf 11/21/2007 15:50'! enterRestrictedMode "Some insecure contents was encountered. Close all doors and proceed." self isInRestrictedMode ifTrue:[^true]. (SugarLauncher isRunningInRainbow or: [Preferences securityChecksEnabled]) ifTrue: [^true]. "it's been your choice..." Preferences warnAboutInsecureContent ifTrue:[ (PopUpMenu confirm: 'You are about to load some insecure content. If you continue, access to files as well as some other capabilities will be limited.' trueChoice:'Load it anyways' falseChoice:'Do not load it') ifFalse:[ "user doesn't really want it" ^false. ]. ]. "here goes the actual restriction" self flushSecurityKeys. self disableFileAccess. self disableImageWrite. "self disableSocketAccess." FileDirectory setDefaultDirectory: self untrustedUserDirectory. ^true ! ! !SugarLauncher methodsFor: 'testing' stamp: 'bf 11/21/2007 15:51'! isRunningInRainbow "Need better test, but works for now. We cannot use dbus here" ^Smalltalk osVersion = 'linux-gnu' and: [SecurityManager default secureUserDirectory beginsWith: '/activities']! ! !SugarLauncher class methodsFor: 'testing' stamp: 'bf 11/21/2007 15:49'! isRunningInRainbow ^self current isRunningInRainbow! ! !SugarLauncher reorganize! ('running' shutDown startUp) ('commands' active: quit save share takeScreenshot welcome:) ('accessing' buddies ownerBuddy) ('dbus' dbusMessageRegistry dispatchDBusMessage: handleActivitySetActive: handleDBusIntrospect: handleTakeScreenshot: introspect runDBusService: sendDBusMessage: sendDBusMessage:onSuccess:onError: sendDBusMessage:timeout:) ('events' windowEvent:) ('datastore' createJournalEntryFor:filename:mimetype: findJournalEntries: getFilename: getFile: getProperties: handleStream:mimetype:titled: makeJournalEntryFor:filename:mimetype: propertiesFrom: resumeJournalEntry: titleFromProject: updateJournalEntry: updateJournalEntry:for:filename:mimetype:) ('presence' getSharedActivityBuddies getSharedActivityById: getSharedActivityProperties joinSharedActivity leaveSharedActivity ownerFromDBus setSharedActivityProperties: shareActivityId:bundleId:name:properties:) ('telepathy') ('testing' isRunningInRainbow isRunningInSugar isShared) !