Permalink
Browse files

Various minor fixes

  • Loading branch information...
1 parent 96f87df commit 5204440ecd24b32cb2e6cf31f1dd2d3cf72c8adc @cstigler cstigler committed Sep 28, 2014
Showing with 3 additions and 9 deletions.
  1. +1 −1 AppController.m
  2. +2 −1 CheckupMain.m
  3. +0 −7 HelperMain.m
View
@@ -562,7 +562,7 @@ - (void)installBlock {
&authorizationRef);
if(status) {
- NSLog(@"ERROR: Failed to authorize block, start.");
+ NSLog(@"ERROR: Failed to authorize block start.");
self.addingBlock = false;
[self refreshUserInterface];
return;
View
@@ -18,11 +18,12 @@ int main(int argc, char* argv[]) {
exit(EX_NOPERM);
}
+ registerDefaults(getuid());
+
NSDictionary* curDictionary = [NSDictionary dictionaryWithContentsOfFile: SelfControlLockFilePath];
NSDate* blockStartedDate = curDictionary[@"BlockStartedDate"];
NSTimeInterval blockDuration = [curDictionary[@"BlockDuration"] intValue];
-
if(blockStartedDate == nil || [[NSDate distantFuture] isEqualToDate: blockStartedDate] || blockDuration < 1) {
// The lock file seems to be broken. Try defaults.
NSLog(@"WARNING: Lock file unreadable or invalid");
View
@@ -60,13 +60,6 @@ int main(int argc, char* argv[]) {
if(!([curLockDict[@"HostBlacklist"] count] <= 0))
domainList = curLockDict[@"HostBlacklist"];
- // You'll see this pattern several times in this file. The two resets and
- // set of euid to the controlling UID are necessary in order to successfully
- // return the NSUserDefaults object for the controlling user. Also note that
- // the defaults object cannot be simply kept in a variable and repeatedly
- // referred to, the resets will invalidate it. For now, we're just re-registering
- // the default settings, since they don't carry over from the main application.
- // TODO: Factor this code out into a function
registerDefaults(controllingUID);
NSDictionary* defaults = getDefaultsDict(controllingUID);
if(!domainList) {

0 comments on commit 5204440

Please sign in to comment.