@@ -26,10 +26,11 @@ #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 @@ -74,10 +75,22 @@ { OFArray OF_GENERIC(OFString*) *arguments = [OFApplication arguments]; id 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();