ObjFW
OFSandbox.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
3  * Jonathan Schleifer <js@heap.zone>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFObject.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
21 @class OFArray OF_GENERIC(ObjectType);
22 
29 {
30  bool _allowsStdIO, _allowsReadingFiles, _allowsWritingFiles;
31  bool _allowsCreatingFiles, _allowsCreatingSpecialFiles;
32  bool _allowsTemporaryFiles, _allowsIPSockets, _allowsMulticastSockets;
33  bool _allowsChangingFileAttributes, _allowsFileOwnerChanges;
34  bool _allowsFileLocks, _allowsUNIXSockets, _allowsDNS;
35  bool _allowsUserDatabaseReading, _allowsFileDescriptorSending;
36  bool _allowsFileDescriptorReceiving, _allowsTape, _allowsTTY;
37  bool _allowsProcessOperations, _allowsExec, _allowsProtExec;
38  bool _allowsSetTime, _allowsPS, _allowsVMInfo;
39  bool _allowsChangingProcessRights, _allowsPF, _allowsAudio, _allowsBPF;
40 }
41 
43 @property (nonatomic) bool allowsStdIO;
44 
46 @property (nonatomic) bool allowsReadingFiles;
47 
49 @property (nonatomic) bool allowsWritingFiles;
50 
52 @property (nonatomic) bool allowsCreatingFiles;
53 
55 @property (nonatomic) bool allowsCreatingSpecialFiles;
56 
58 @property (nonatomic) bool allowsTemporaryFiles;
59 
61 @property (nonatomic) bool allowsIPSockets;
62 
64 @property (nonatomic) bool allowsMulticastSockets;
65 
67 @property (nonatomic) bool allowsChangingFileAttributes;
68 
70 @property (nonatomic) bool allowsFileOwnerChanges;
71 
73 @property (nonatomic) bool allowsFileLocks;
74 
76 @property (nonatomic) bool allowsUNIXSockets;
77 
79 @property (nonatomic) bool allowsDNS;
80 
82 @property (nonatomic) bool allowsUserDatabaseReading;
83 
85 @property (nonatomic) bool allowsFileDescriptorSending;
86 
88 @property (nonatomic) bool allowsFileDescriptorReceiving;
89 
91 @property (nonatomic) bool allowsTape;
92 
94 @property (nonatomic) bool allowsTTY;
95 
97 @property (nonatomic) bool allowsProcessOperations;
98 
100 @property (nonatomic) bool allowsExec;
103 @property (nonatomic) bool allowsProtExec;
106 @property (nonatomic) bool allowsSetTime;
109 @property (nonatomic) bool allowsPS;
112 @property (nonatomic) bool allowsVMInfo;
115 @property (nonatomic) bool allowsChangingProcessRights;
118 @property (nonatomic) bool allowsPF;
121 @property (nonatomic) bool allowsAudio;
124 @property (nonatomic) bool allowsBPF;
129 + (instancetype)sandbox;
130 
131 #ifdef OF_HAVE_PLEDGE
132 
137 - (OFString *)pledgeString;
138 #endif
139 @end
140 
141 OF_ASSUME_NONNULL_END
bool allowsExec
Definition: OFSandbox.h:101
bool allowsCreatingSpecialFiles
Definition: OFSandbox.h:56
bool allowsIPSockets
Definition: OFSandbox.h:62
A class which describes a sandbox for the application.
Definition: OFSandbox.h:28
bool allowsFileDescriptorReceiving
Definition: OFSandbox.h:89
bool allowsSetTime
Definition: OFSandbox.h:107
bool allowsTemporaryFiles
Definition: OFSandbox.h:59
A class for handling strings.
Definition: OFString.h:114
bool allowsVMInfo
Definition: OFSandbox.h:113
bool allowsFileLocks
Definition: OFSandbox.h:74
bool allowsReadingFiles
Definition: OFSandbox.h:47
instancetype sandbox()
Create a new, autorelease OFSandbox.
Definition: OFSandbox.m:51
bool allowsWritingFiles
Definition: OFSandbox.h:50
bool allowsPS
Definition: OFSandbox.h:110
bool allowsChangingProcessRights
Definition: OFSandbox.h:116
bool allowsTTY
Definition: OFSandbox.h:95
bool allowsDNS
Definition: OFSandbox.h:80
bool allowsTape
Definition: OFSandbox.h:92
A protocol for the creation of copies.
Definition: OFObject.h:912
bool allowsProtExec
Definition: OFSandbox.h:104
bool allowsChangingFileAttributes
Definition: OFSandbox.h:68
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
bool allowsMulticastSockets
Definition: OFSandbox.h:65
bool allowsStdIO
Definition: OFSandbox.h:44
bool allowsAudio
Definition: OFSandbox.h:122
An abstract class for storing objects in an array.
Definition: OFArray.h:89
bool allowsCreatingFiles
Definition: OFSandbox.h:53
bool allowsUNIXSockets
Definition: OFSandbox.h:77
bool allowsPF
Definition: OFSandbox.h:119
bool allowsFileDescriptorSending
Definition: OFSandbox.h:86
bool allowsProcessOperations
Definition: OFSandbox.h:98
bool allowsFileOwnerChanges
Definition: OFSandbox.h:71
bool allowsUserDatabaseReading
Definition: OFSandbox.h:83
bool allowsBPF
Definition: OFSandbox.h:125