@@ -18,10 +18,11 @@ #include "config.h" #import "OFApplication.h" #import "OFArray.h" #import "OFDNSResolver.h" +#import "OFSandbox.h" #import "OFStdIOStream.h" @interface OFDNS: OFObject @end @@ -57,10 +58,22 @@ of_dns_resource_record_class_t recordClass = OF_DNS_RESOURCE_RECORD_CLASS_ANY; of_dns_resource_record_type_t recordType = OF_DNS_RESOURCE_RECORD_TYPE_ALL; OFDNSResolver *resolver; + +#ifdef OF_HAVE_SANDBOX + OFSandbox *sandbox = [[OFSandbox alloc] init]; + @try { + [sandbox setAllowsStdIO: true]; + [sandbox setAllowsDNS: true]; + + [OFApplication activateSandbox: sandbox]; + } @finally { + [sandbox release]; + } +#endif if ([arguments count] < 1 || [arguments count] > 4) { [of_stderr writeFormat: @"Usage: %@ host [type [class [server]]]\n", [OFApplication programName]];