summaryrefslogtreecommitdiffstats
path: root/security/tomoyo/file.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-05-17 10:12:46 +0900
committerJames Morris <jmorris@namei.org>2010-08-02 15:33:39 +1000
commitc3ef1500ec833890275172c7d063333404b64d60 (patch)
tree2453368e521a1f7a00098eef06afbedb8404503d /security/tomoyo/file.c
parent17fcfbd9d45b57f38d40e31f9d28db53f4af5c88 (diff)
TOMOYO: Split files into some pieces.
security/tomoyo/common.c became too large to read. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/file.c')
-rw-r--r--security/tomoyo/file.c62
1 files changed, 2 insertions, 60 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c
index c629cb4e2c6..c13806937dc 100644
--- a/security/tomoyo/file.c
+++ b/security/tomoyo/file.c
@@ -1,12 +1,9 @@
/*
* security/tomoyo/file.c
*
- * Implementation of the Domain-Based Mandatory Access Control.
- *
- * Copyright (C) 2005-2009 NTT DATA CORPORATION
- *
- * Version: 2.2.0 2009/04/01
+ * Pathname restriction functions.
*
+ * Copyright (C) 2005-2010 NTT DATA CORPORATION
*/
#include "common.h"
@@ -100,61 +97,6 @@ bool tomoyo_compare_number_union(const unsigned long value,
}
/**
- * tomoyo_init_request_info - Initialize "struct tomoyo_request_info" members.
- *
- * @r: Pointer to "struct tomoyo_request_info" to initialize.
- * @domain: Pointer to "struct tomoyo_domain_info". NULL for tomoyo_domain().
- *
- * Returns mode.
- */
-int tomoyo_init_request_info(struct tomoyo_request_info *r,
- struct tomoyo_domain_info *domain)
-{
- memset(r, 0, sizeof(*r));
- if (!domain)
- domain = tomoyo_domain();
- r->domain = domain;
- r->mode = tomoyo_check_flags(domain, TOMOYO_MAC_FOR_FILE);
- return r->mode;
-}
-
-static void tomoyo_warn_log(struct tomoyo_request_info *r, const char *fmt, ...)
- __attribute__ ((format(printf, 2, 3)));
-/**
- * tomoyo_warn_log - Print warning or error message on console.
- *
- * @r: Pointer to "struct tomoyo_request_info".
- * @fmt: The printf()'s format string, followed by parameters.
- */
-static void tomoyo_warn_log(struct tomoyo_request_info *r, const char *fmt, ...)
-{
- int len = PAGE_SIZE;
- va_list args;
- char *buffer;
- if (!tomoyo_verbose_mode(r->domain))
- return;
- while (1) {
- int len2;
- buffer = kmalloc(len, GFP_NOFS);
- if (!buffer)
- return;
- va_start(args, fmt);
- len2 = vsnprintf(buffer, len - 1, fmt, args);
- va_end(args);
- if (len2 <= len - 1) {
- buffer[len2] = '\0';
- break;
- }
- len = len2 + 1;
- kfree(buffer);
- }
- printk(KERN_WARNING "TOMOYO-%s: Access %s denied for %s\n",
- r->mode == TOMOYO_CONFIG_ENFORCING ? "ERROR" : "WARNING",
- buffer, tomoyo_get_last_name(r->domain));
- kfree(buffer);
-}
-
-/**
* tomoyo_path2keyword - Get the name of single path operation.
*
* @operation: Type of operation.