1001 NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:currentPath traverseLink:YES]; |
1001 NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:currentPath traverseLink:YES]; |
1002 unsigned long perms = [fileAttributes filePosixPermissions]; |
1002 unsigned long perms = [fileAttributes filePosixPermissions]; |
1003 NSString *octalString = [NSString stringWithFormat:@"%o",perms]; |
1003 NSString *octalString = [NSString stringWithFormat:@"%o",perms]; |
1004 NSNumber *fileOwner = [fileAttributes fileOwnerAccountID]; |
1004 NSNumber *fileOwner = [fileAttributes fileOwnerAccountID]; |
1005 |
1005 |
1006 if ( (![octalString isEqualToString:@"744"]) || (![fileOwner isEqualToNumber:[NSNumber numberWithInt:0]])) { |
1006 if ( (![octalString isEqualToString:@"755"]) || (![fileOwner isEqualToNumber:[NSNumber numberWithInt:0]])) { |
1007 NSLog(@"File %@ has permissions: %@, is owned by %@ and needs repair...\n",currentPath,octalString,fileOwner); |
1007 NSLog(@"File %@ has permissions: %@, is owned by %@ and needs repair...\n",currentPath,octalString,fileOwner); |
1008 return YES; |
1008 return YES; |
1009 } |
1009 } |
1010 } |
1010 } |
1011 |
1011 |