Differences From Artifact [3f3d3563e3]:
- File utils/ofhash/OFHash.m — part of check-in [3f2b4a8941] at 2017-02-27 21:36:26 on branch trunk — Localize ofhash (user: js, size: 3981) [annotate] [blame] [check-ins using]
To Artifact [edd9d8236f]:
- File
utils/ofhash/OFHash.m
— part of check-in
[40cf53506a]
at
2017-04-09 18:22:14
on branch trunk
— Add OFSandbox
Only OpenBSD's pledge() is supported so far. (user: js, size: 4248) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #import "OFSHA1Hash.h" #import "OFSHA224Hash.h" #import "OFSHA256Hash.h" #import "OFSHA384Hash.h" #import "OFSHA512Hash.h" #import "OFStdIOStream.h" #import "OFLocalization.h" #import "OFOpenItemFailedException.h" #import "OFReadFailedException.h" @interface OFHash: OFObject @end | > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #import "OFSHA1Hash.h" #import "OFSHA224Hash.h" #import "OFSHA256Hash.h" #import "OFSHA384Hash.h" #import "OFSHA512Hash.h" #import "OFStdIOStream.h" #import "OFLocalization.h" #import "OFSandbox.h" #import "OFOpenItemFailedException.h" #import "OFReadFailedException.h" @interface OFHash: OFObject @end |
︙ | ︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | @implementation OFHash - (void)applicationDidFinishLaunching { OFArray OF_GENERIC(OFString*) *arguments = [OFApplication arguments]; id <OFCryptoHash> hash; bool first = true; int exitStatus = 0; [OFLocalization addLanguageDirectory: @LANGUAGE_DIR]; if ([arguments count] < 2) help(); if ((hash = hashForName([arguments firstObject])) == nil) | > > > > > > > > > > > > | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | @implementation OFHash - (void)applicationDidFinishLaunching { OFArray OF_GENERIC(OFString*) *arguments = [OFApplication arguments]; id <OFCryptoHash> hash; bool first = true; int exitStatus = 0; #ifdef OF_HAVE_SANDBOX OFSandbox *sandbox = [[OFSandbox alloc] init]; @try { [sandbox setAllowsStdIO: true]; [sandbox setAllowsReadingFiles: true]; [OFApplication activateSandbox: sandbox]; } @finally { [sandbox release]; } #endif [OFLocalization addLanguageDirectory: @LANGUAGE_DIR]; if ([arguments count] < 2) help(); if ((hash = hashForName([arguments firstObject])) == nil) |
︙ | ︙ |