オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Contents of /trunk/1.7.x/ccs-patch/security/ccsecurity/internal.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 732 - (show annotations) (download) (as text)
Tue Nov 27 11:03:23 2007 UTC (16 years, 6 months ago) by kumaneko
Original Path: trunk/1.5.x/ccs-patch/include/linux/ccs_common.h
File MIME type: text/x-chdr
File size: 21995 byte(s)


1 /*
2 * include/linux/ccs_common.h
3 *
4 * Common functions for SAKURA and TOMOYO.
5 *
6 * Copyright (C) 2005-2007 NTT DATA CORPORATION
7 *
8 * Version: 1.5.2-pre 2007/11/27
9 *
10 * This file is applicable to both 2.4.30 and 2.6.11 and later.
11 * See README.ccs for ChangeLog.
12 *
13 */
14
15 #ifndef _LINUX_CCS_COMMON_H
16 #define _LINUX_CCS_COMMON_H
17
18 #include <linux/string.h>
19 #include <linux/mm.h>
20 #include <linux/utime.h>
21 #include <linux/file.h>
22 #include <linux/smp_lock.h>
23 #include <linux/module.h>
24 #include <linux/init.h>
25 #include <linux/slab.h>
26 #include <linux/poll.h>
27 #include <asm/uaccess.h>
28 #include <stdarg.h>
29 #include <linux/delay.h>
30 #include <linux/version.h>
31 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
32 #include <linux/kmod.h>
33 #endif
34
35 #ifndef __user
36 #define __user
37 #endif
38
39 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
40 typedef _Bool bool;
41 #endif
42
43 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
44 #define mutex semaphore
45 #define mutex_init(mutex) init_MUTEX(mutex)
46 #define mutex_lock(mutex) down(mutex)
47 #define mutex_unlock(mutex) up(mutex)
48 #define mutex_lock_interruptible(mutex) down_interruptible(mutex)
49 #define DEFINE_MUTEX(mutexname) DECLARE_MUTEX(mutexname)
50 #endif
51
52 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
53 #define container_of(ptr, type, member) ({ \
54 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
55 (type *)( (char *)__mptr - offsetof(type,member) );})
56 #endif
57
58 #if 0
59
60 #define list1_head list_head
61 #define LIST1_HEAD_INIT LIST_HEAD_INIT
62 #define LIST1_HEAD LIST_HEAD
63 #define INIT_LIST1_HEAD INIT_LIST_HEAD
64 #define list1_entry list_entry
65 #define list1_for_each list_for_each
66 #define list1_for_each_entry list_for_each_entry
67 #define list1_for_each_cookie(pos, cookie, head) \
68 for ((cookie) || ((cookie) = (head)), pos = (cookie)->next; \
69 prefetch(pos->next), pos != (head) || ((cookie) = NULL); \
70 (cookie) = pos, pos = pos->next)
71 static inline void list1_add_tail_mb(struct list1_head *new,
72 struct list1_head *head)
73 {
74 struct list_head *prev = head->prev;
75 struct list_head *next = head;
76 new->next = next;
77 new->prev = prev;
78 mb(); /* Avoid out-of-order execution. */
79 next->prev = new;
80 prev->next = new;
81 }
82
83 #else /////////////////////////////////////////////////////////////////////////
84
85 struct list1_head {
86 struct list1_head *next;
87 };
88
89 #define LIST1_HEAD_INIT(name) { &(name) }
90 #define LIST1_HEAD(name) struct list1_head name = LIST1_HEAD_INIT(name)
91
92 static inline void INIT_LIST1_HEAD(struct list1_head *list)
93 {
94 list->next = list;
95 }
96
97 /**
98 * list1_entry - get the struct for this entry
99 * @ptr: the &struct list1_head pointer.
100 * @type: the type of the struct this is embedded in.
101 * @member: the name of the list1_struct within the struct.
102 */
103 #define list1_entry(ptr, type, member) container_of(ptr, type, member)
104
105 /**
106 * list1_for_each - iterate over a list
107 * @pos: the &struct list1_head to use as a loop cursor.
108 * @head: the head for your list.
109 */
110 #define list1_for_each(pos, head) \
111 for (pos = (head)->next; prefetch(pos->next), pos != (head); \
112 pos = pos->next)
113
114 /**
115 * list1_for_each_entry - iterate over list of given type
116 * @pos: the type * to use as a loop cursor.
117 * @head: the head for your list.
118 * @member: the name of the list1_struct within the struct.
119 */
120 #define list1_for_each_entry(pos, head, member) \
121 for (pos = list1_entry((head)->next, typeof(*pos), member); \
122 prefetch(pos->member.next), &pos->member != (head); \
123 pos = list1_entry(pos->member.next, typeof(*pos), member))
124
125 /**
126 * list1_for_each_cookie - iterate over a list with cookie.
127 * @pos: the &struct list1_head to use as a loop cursor.
128 * @cookie: the &struct list1_head to use as a cookie.
129 * @head: the head for your list.
130 *
131 * Same with list_for_each except that this primitive uses cookie
132 * so that we can continue iteration.
133 */
134 #define list1_for_each_cookie(pos, cookie, head) \
135 for ((cookie) || ((cookie) = (head)), pos = (cookie)->next; \
136 prefetch(pos->next), pos != (head) || ((cookie) = NULL); \
137 (cookie) = pos, pos = pos->next)
138
139 /**
140 * list_add_tail_mb - add a new entry with memory barrier.
141 * @new: new entry to be added.
142 * @head: list head to add it before.
143 *
144 * Same with list_add_tail_rcu() except that this primitive uses mb()
145 * so that we can traverse forwards using list_for_each() and
146 * list_for_each_cookie().
147 */
148 static inline void list1_add_tail_mb(struct list1_head *new,
149 struct list1_head *head)
150 {
151 struct list1_head *pos = head;
152 new->next = head;
153 mb(); /* Avoid out-of-order execution. */
154 while (pos->next != head)
155 pos = pos->next;
156 pos->next = new;
157 }
158
159 #endif
160
161 struct mini_stat {
162 uid_t uid;
163 gid_t gid;
164 ino_t ino;
165 };
166 struct dentry;
167 struct vfsmount;
168 struct obj_info {
169 bool validate_done;
170 bool path1_valid;
171 bool path1_parent_valid;
172 bool path2_parent_valid;
173 struct dentry *path1_dentry;
174 struct vfsmount *path1_vfsmnt;
175 struct dentry *path2_dentry;
176 struct vfsmount *path2_vfsmnt;
177 struct mini_stat path1_stat;
178 /* I don't handle path2_stat for rename operation. */
179 struct mini_stat path1_parent_stat;
180 struct mini_stat path2_parent_stat;
181 };
182
183 struct path_info {
184 const char *name;
185 u32 hash; /* = full_name_hash(name, strlen(name)) */
186 u16 total_len; /* = strlen(name) */
187 u16 const_len; /* = const_part_length(name) */
188 bool is_dir; /* = strendswith(name, "/") */
189 bool is_patterned; /* = PathContainsPattern(name) */
190 u16 depth; /* = PathDepth(name) */
191 };
192
193 #define CCS_MAX_PATHNAME_LEN 4000
194
195 struct path_group_member {
196 struct list1_head list;
197 const struct path_info *member_name;
198 bool is_deleted;
199 };
200
201 struct path_group_entry {
202 struct list1_head list;
203 const struct path_info *group_name;
204 struct list1_head path_group_member_list;
205 };
206
207 struct in6_addr;
208 struct address_group_member {
209 struct list1_head list;
210 union {
211 u32 ipv4; /* Host byte order */
212 const struct in6_addr *ipv6; /* Network byte order */
213 } min, max;
214 bool is_deleted;
215 bool is_ipv6;
216 };
217
218 struct address_group_entry {
219 struct list1_head list;
220 const struct path_info *group_name;
221 struct list1_head address_group_member_list;
222 };
223
224 /*
225 * TOMOYO uses the following structures.
226 * Memory allocated for these structures are never kfree()ed.
227 * Since no locks are used for reading, assignment must be performed atomically.
228 */
229
230 /************************* The structure for domains. *************************/
231
232 struct condition_list;
233
234 struct acl_info {
235 struct list1_head list;
236 const struct condition_list *cond;
237 u8 type;
238 bool is_deleted;
239 } __attribute__((__packed__));
240
241 struct domain_info {
242 struct list1_head list;
243 struct list1_head acl_info_list;
244 const struct path_info *domainname; /* Name of this domain. Never NULL. */
245 u8 profile; /* Profile to use. */
246 u8 is_deleted; /* Delete flag. */
247 bool quota_warned; /* Quota warnning done flag. */
248 };
249
250 #define MAX_PROFILES 256
251
252 struct file_acl_record {
253 struct acl_info head; /* type = TYPE_FILE_ACL */
254 u8 perm;
255 bool u_is_group;
256 union {
257 const struct path_info *filename; /* Pointer to single pathname. */
258 const struct path_group_entry *group; /* Pointer to pathname group. */
259 } u;
260 };
261
262 struct argv0_acl_record {
263 struct acl_info head; /* type = TYPE_ARGV0_ACL */
264 const struct path_info *filename; /* Pointer to single pathname. */
265 const struct path_info *argv0; /* strrchr(argv[0], '/') + 1 */
266 };
267
268 struct env_acl_record {
269 struct acl_info head; /* type = TYPE_ENV_ACL */
270 const struct path_info *env; /* environment variable */
271 };
272
273 struct capability_acl_record {
274 struct acl_info head; /* type = TYPE_CAPABILITY_ACL */
275 u16 capability;
276 };
277
278 struct signal_acl_record {
279 struct acl_info head; /* type = TYPE_SIGNAL_ACL */
280 u16 sig;
281 const struct path_info *domainname; /* Pointer to destination pattern. */
282 };
283
284 struct single_acl_record {
285 struct acl_info head; /* type = TYPE_* */
286 bool u_is_group;
287 union {
288 const struct path_info *filename; /* Pointer to single pathname. */
289 const struct path_group_entry *group; /* Pointer to pathname group. */
290 } u;
291 };
292
293 struct double_acl_record {
294 struct acl_info head; /* type = TYPE_RENAME_ACL or TYPE_LINK_ACL */
295 bool u1_is_group;
296 bool u2_is_group;
297 union {
298 const struct path_info *filename1; /* Pointer to single pathname. */
299 const struct path_group_entry *group1; /* Pointer to pathname group. */
300 } u1;
301 union {
302 const struct path_info *filename2; /* Pointer to single pathname. */
303 const struct path_group_entry *group2; /* Pointer to pathname group. */
304 } u2;
305 };
306
307 #define IP_RECORD_TYPE_ADDRESS_GROUP 0
308 #define IP_RECORD_TYPE_IPv4 1
309 #define IP_RECORD_TYPE_IPv6 2
310
311 struct ip_network_acl_record {
312 struct acl_info head; /* type = TYPE_IP_NETWORK_ACL */
313 u8 operation_type;
314 u8 record_type; /* IP_RECORD_TYPE_* */
315 union {
316 struct {
317 u32 min; /* Start of IPv4 address range. Host endian. */
318 u32 max; /* End of IPv4 address range. Host endian. */
319 } ipv4;
320 struct {
321 const struct in6_addr *min; /* Start of IPv6 address range. Big endian. */
322 const struct in6_addr *max; /* End of IPv6 address range. Big endian. */
323 } ipv6;
324 const struct address_group_entry *group; /* Pointer to address group. */
325 } u;
326 u16 min_port; /* Start of port number range. */
327 u16 max_port; /* End of port number range. */
328 };
329
330 /************************* Keywords for ACLs. *************************/
331
332 #define KEYWORD_ADDRESS_GROUP "address_group "
333 #define KEYWORD_ADDRESS_GROUP_LEN (sizeof(KEYWORD_ADDRESS_GROUP) - 1)
334 #define KEYWORD_AGGREGATOR "aggregator "
335 #define KEYWORD_AGGREGATOR_LEN (sizeof(KEYWORD_AGGREGATOR) - 1)
336 #define KEYWORD_ALIAS "alias "
337 #define KEYWORD_ALIAS_LEN (sizeof(KEYWORD_ALIAS) - 1)
338 #define KEYWORD_ALLOW_ARGV0 "allow_argv0 "
339 #define KEYWORD_ALLOW_ARGV0_LEN (sizeof(KEYWORD_ALLOW_ARGV0) - 1)
340 #define KEYWORD_ALLOW_CAPABILITY "allow_capability "
341 #define KEYWORD_ALLOW_CAPABILITY_LEN (sizeof(KEYWORD_ALLOW_CAPABILITY) - 1)
342 #define KEYWORD_ALLOW_CHROOT "allow_chroot "
343 #define KEYWORD_ALLOW_CHROOT_LEN (sizeof(KEYWORD_ALLOW_CHROOT) - 1)
344 #define KEYWORD_ALLOW_ENV "allow_env "
345 #define KEYWORD_ALLOW_ENV_LEN (sizeof(KEYWORD_ALLOW_ENV) - 1)
346 #define KEYWORD_ALLOW_MOUNT "allow_mount "
347 #define KEYWORD_ALLOW_MOUNT_LEN (sizeof(KEYWORD_ALLOW_MOUNT) - 1)
348 #define KEYWORD_ALLOW_NETWORK "allow_network "
349 #define KEYWORD_ALLOW_NETWORK_LEN (sizeof(KEYWORD_ALLOW_NETWORK) - 1)
350 #define KEYWORD_ALLOW_PIVOT_ROOT "allow_pivot_root "
351 #define KEYWORD_ALLOW_PIVOT_ROOT_LEN (sizeof(KEYWORD_ALLOW_PIVOT_ROOT) - 1)
352 #define KEYWORD_ALLOW_READ "allow_read "
353 #define KEYWORD_ALLOW_READ_LEN (sizeof(KEYWORD_ALLOW_READ) - 1)
354 #define KEYWORD_ALLOW_SIGNAL "allow_signal "
355 #define KEYWORD_ALLOW_SIGNAL_LEN (sizeof(KEYWORD_ALLOW_SIGNAL) - 1)
356 #define KEYWORD_DELETE "delete "
357 #define KEYWORD_DELETE_LEN (sizeof(KEYWORD_DELETE) - 1)
358 #define KEYWORD_DENY_AUTOBIND "deny_autobind "
359 #define KEYWORD_DENY_AUTOBIND_LEN (sizeof(KEYWORD_DENY_AUTOBIND) - 1)
360 #define KEYWORD_DENY_REWRITE "deny_rewrite "
361 #define KEYWORD_DENY_REWRITE_LEN (sizeof(KEYWORD_DENY_REWRITE) - 1)
362 #define KEYWORD_DENY_UNMOUNT "deny_unmount "
363 #define KEYWORD_DENY_UNMOUNT_LEN (sizeof(KEYWORD_DENY_UNMOUNT) - 1)
364 #define KEYWORD_FILE_PATTERN "file_pattern "
365 #define KEYWORD_FILE_PATTERN_LEN (sizeof(KEYWORD_FILE_PATTERN) - 1)
366 #define KEYWORD_INITIALIZE_DOMAIN "initialize_domain "
367 #define KEYWORD_INITIALIZE_DOMAIN_LEN (sizeof(KEYWORD_INITIALIZE_DOMAIN) - 1)
368 #define KEYWORD_KEEP_DOMAIN "keep_domain "
369 #define KEYWORD_KEEP_DOMAIN_LEN (sizeof(KEYWORD_KEEP_DOMAIN) - 1)
370 #define KEYWORD_NO_INITIALIZE_DOMAIN "no_initialize_domain "
371 #define KEYWORD_NO_INITIALIZE_DOMAIN_LEN (sizeof(KEYWORD_NO_INITIALIZE_DOMAIN) - 1)
372 #define KEYWORD_NO_KEEP_DOMAIN "no_keep_domain "
373 #define KEYWORD_NO_KEEP_DOMAIN_LEN (sizeof(KEYWORD_NO_KEEP_DOMAIN) - 1)
374 #define KEYWORD_PATH_GROUP "path_group "
375 #define KEYWORD_PATH_GROUP_LEN (sizeof(KEYWORD_PATH_GROUP) - 1)
376 #define KEYWORD_SELECT "select "
377 #define KEYWORD_SELECT_LEN (sizeof(KEYWORD_SELECT) - 1)
378 #define KEYWORD_UNDELETE "undelete "
379 #define KEYWORD_UNDELETE_LEN (sizeof(KEYWORD_UNDELETE) - 1)
380
381 #define KEYWORD_USE_PROFILE "use_profile "
382
383 #define KEYWORD_MAC_FOR_CAPABILITY "MAC_FOR_CAPABILITY::"
384 #define KEYWORD_MAC_FOR_CAPABILITY_LEN (sizeof(KEYWORD_MAC_FOR_CAPABILITY) - 1)
385
386 #define ROOT_NAME "<kernel>" /* A domain definition starts with <kernel> . */
387 #define ROOT_NAME_LEN (sizeof(ROOT_NAME) - 1)
388
389 /************************* Index numbers for Access Controls. *************************/
390
391 #define CCS_PROFILE_COMMENT 0 /* profile.conf */
392 #define CCS_TOMOYO_MAC_FOR_FILE 1 /* domain_policy.conf */
393 #define CCS_TOMOYO_MAC_FOR_ARGV0 2 /* domain_policy.conf */
394 #define CCS_TOMOYO_MAC_FOR_ENV 3 /* domain_policy.conf */
395 #define CCS_TOMOYO_MAC_FOR_NETWORK 4 /* domain_policy.conf */
396 #define CCS_TOMOYO_MAC_FOR_SIGNAL 5 /* domain_policy.conf */
397 #define CCS_SAKURA_DENY_CONCEAL_MOUNT 6
398 #define CCS_SAKURA_RESTRICT_CHROOT 7 /* system_policy.conf */
399 #define CCS_SAKURA_RESTRICT_MOUNT 8 /* system_policy.conf */
400 #define CCS_SAKURA_RESTRICT_UNMOUNT 9 /* system_policy.conf */
401 #define CCS_SAKURA_RESTRICT_PIVOT_ROOT 10 /* system_policy.conf */
402 #define CCS_SAKURA_RESTRICT_AUTOBIND 11 /* system_policy.conf */
403 #define CCS_TOMOYO_MAX_ACCEPT_ENTRY 12
404 #define CCS_TOMOYO_MAX_GRANT_LOG 13
405 #define CCS_TOMOYO_MAX_REJECT_LOG 14
406 #define CCS_TOMOYO_VERBOSE 15
407 #define CCS_ALLOW_ENFORCE_GRACE 16
408 #define CCS_SLEEP_PERIOD 17 /* profile.conf */
409 #define CCS_TOMOYO_ALT_EXEC 18 /* profile.conf */
410 #define CCS_MAX_CONTROL_INDEX 19
411
412 /************************* Index numbers for updates counter. *************************/
413
414 #define CCS_UPDATES_COUNTER_SYSTEM_POLICY 0
415 #define CCS_UPDATES_COUNTER_DOMAIN_POLICY 1
416 #define CCS_UPDATES_COUNTER_EXCEPTION_POLICY 2
417 #define CCS_UPDATES_COUNTER_PROFILE 3
418 #define CCS_UPDATES_COUNTER_QUERY 4
419 #define CCS_UPDATES_COUNTER_MANAGER 5
420 #define CCS_UPDATES_COUNTER_GRANT_LOG 6
421 #define CCS_UPDATES_COUNTER_REJECT_LOG 7
422 #define MAX_CCS_UPDATES_COUNTER 8
423
424 /************************* The structure for /proc interfaces. *************************/
425
426 struct io_buffer {
427 int (*read) (struct io_buffer *);
428 struct mutex read_sem;
429 int (*write) (struct io_buffer *);
430 struct mutex write_sem;
431 int (*poll) (struct file *file, poll_table *wait);
432 struct list1_head *read_var1; /* The position currently reading from. */
433 struct list1_head *read_var2; /* Extra variables for reading. */
434 struct domain_info *write_var1; /* The position currently writing to. */
435 int read_step; /* The step for reading. */
436 char *read_buf; /* Buffer for reading. */
437 int read_eof; /* EOF flag for reading. */
438 int read_avail; /* Bytes available for reading. */
439 int readbuf_size; /* Size of read buffer. */
440 char *write_buf; /* Buffer for writing. */
441 int write_avail; /* Bytes available for writing. */
442 int writebuf_size; /* Size of write buffer. */
443 };
444
445 /************************* PROTOTYPES *************************/
446
447 char *InitAuditLog(int *len);
448 void *ccs_alloc(const size_t size);
449 char *print_ipv6(char *buffer, const int buffer_len, const struct in6_addr *ip);
450 const char *GetAltExec(void);
451 const char *GetEXE(void);
452 const char *GetLastName(const struct domain_info *domain);
453 const char *GetMSG(const bool is_enforce);
454 const char *acltype2keyword(const unsigned int acl_type);
455 const char *capability2keyword(const unsigned int capability);
456 const char *network2keyword(const unsigned int operation);
457 const struct condition_list *FindOrAssignNewCondition(const char *condition);
458 int AddAddressGroupPolicy(char *data, const bool is_delete);
459 int AddAggregatorPolicy(char *data, const bool is_delete);
460 int AddAliasPolicy(char *data, const bool is_delete);
461 int AddArgv0Policy(char *data, struct domain_info *domain, const struct condition_list *condition, const bool is_delete);
462 int AddCapabilityPolicy(char *data, struct domain_info *domain, const struct condition_list *condition, const bool is_delete);
463 int AddChrootPolicy(char *data, const bool is_delete);
464 int AddDomainACL(struct domain_info *domain, struct acl_info *acl);
465 int AddDomainInitializerPolicy(char *data, const bool is_not, const bool is_delete);
466 int AddDomainKeeperPolicy(char *data, const bool is_not, const bool is_delete);
467 int AddEnvPolicy(char *data, struct domain_info *domain, const struct condition_list *condition, const bool is_delete);
468 int AddFilePolicy(char *data, struct domain_info *domain, const struct condition_list *condition, const bool is_delete);
469 int AddGloballyReadablePolicy(char *data, const bool is_delete);
470 int AddGloballyUsableEnvPolicy(char *env, const bool is_delete);
471 int AddMountPolicy(char *data, const bool is_delete);
472 int AddNetworkPolicy(char *data, struct domain_info *domain, const struct condition_list *condition, const bool is_delete);
473 int AddNoRewritePolicy(char *pattern, const bool is_delete);
474 int AddNoUmountPolicy(char *data, const bool is_delete);
475 int AddPathGroupPolicy(char *data, const bool is_delete);
476 int AddPatternPolicy(char *data, const bool is_delete);
477 int AddPivotRootPolicy(char *data, const bool is_delete);
478 int AddReservedPortPolicy(char *data, const bool is_delete);
479 int AddSignalPolicy(char *data, struct domain_info *domain, const struct condition_list *condition, const bool is_delete);
480 int CCS_CloseControl(struct file *file);
481 int CCS_OpenControl(const int type, struct file *file);
482 int CCS_PollControl(struct file *file, poll_table *wait);
483 int CCS_ReadControl(struct file *file, char __user *buffer, const int buffer_len);
484 int CCS_WriteControl(struct file *file, const char __user *buffer, const int buffer_len);
485 int CanSaveAuditLog(const bool is_granted);
486 int CheckCondition(const struct condition_list *condition, struct obj_info *obj_info);
487 int CheckSupervisor(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
488 int DelDomainACL(struct acl_info *ptr);
489 int DeleteDomain(char *data);
490 int DumpCondition(struct io_buffer *head, const struct condition_list *ptr);
491 bool IsCorrectDomain(const unsigned char *domainname, const char *function);
492 bool IsCorrectPath(const char *filename, const int start_type, const int pattern_type, const int end_type, const char *function);
493 bool IsDomainDef(const unsigned char *buffer);
494 int PathMatchesToPattern(const struct path_info *pathname0, const struct path_info *pattern0);
495 int PollGrantLog(struct file *file, poll_table *wait);
496 int PollRejectLog(struct file *file, poll_table *wait);
497 int ReadAddressGroupPolicy(struct io_buffer *head);
498 int ReadAggregatorPolicy(struct io_buffer *head);
499 int ReadAliasPolicy(struct io_buffer *head);
500 int ReadCapabilityStatus(struct io_buffer *head);
501 int ReadChrootPolicy(struct io_buffer *head);
502 int ReadDomainInitializerPolicy(struct io_buffer *head);
503 int ReadDomainKeeperPolicy(struct io_buffer *head);
504 int ReadGloballyReadablePolicy(struct io_buffer *head);
505 int ReadGloballyUsableEnvPolicy(struct io_buffer *head);
506 int ReadGrantLog(struct io_buffer *head);
507 int ReadMountPolicy(struct io_buffer *head);
508 int ReadNoRewritePolicy(struct io_buffer *head);
509 int ReadNoUmountPolicy(struct io_buffer *head);
510 int ReadPathGroupPolicy(struct io_buffer *head);
511 int ReadPatternPolicy(struct io_buffer *head);
512 int ReadPivotRootPolicy(struct io_buffer *head);
513 int ReadRejectLog(struct io_buffer *head);
514 int ReadReservedPortPolicy(struct io_buffer *head);
515 int SetCapabilityStatus(const char *data, unsigned int value, const unsigned int profile);
516 int WriteAuditLog(char *log, const bool is_granted);
517 int acltype2paths(const unsigned int acl_type);
518 int io_printf(struct io_buffer *head, const char *fmt, ...) __attribute__ ((format(printf, 2, 3)));
519 struct domain_info *FindDomain(const char *domainname);
520 struct domain_info *FindOrAssignNewDomain(const char *domainname, const u8 profile);
521 struct domain_info *UndeleteDomain(const char *domainname0);
522 bool CheckCCSAccept(const unsigned int index, struct domain_info * const domain);
523 bool CheckCCSEnforce(const unsigned int index);
524 unsigned int CheckCCSFlags(const unsigned int index);
525 bool CheckDomainQuota(struct domain_info * const domain);
526 bool TomoyoVerboseMode(void);
527 void UpdateCounter(const unsigned char index);
528 void ccs_free(const void *p);
529 void fill_path_info(struct path_info *ptr);
530
531 static inline bool pathcmp(const struct path_info *a, const struct path_info *b)
532 {
533 return a->hash != b->hash || strcmp(a->name, b->name);
534 }
535
536 extern struct list1_head domain_list;
537
538 #endif

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26