aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/realpath.h
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-02-10 19:42:40 -0500
committerJames Morris <jmorris@namei.org>2010-02-14 17:00:18 -0500
commit76bb0895d038be7bcdb6ccfcd2dd7deb30371d6b (patch)
tree5948c68b08561deb20d155853faed475a15a4235 /security/tomoyo/realpath.h
parentbf24fb016c861b7f52be0c36c4cedd3e89afa2e2 (diff)
TOMOYO: Merge headers.
Gather structures and constants scattered around security/tomoyo/ directory. This is for preparation for adding garbage collector since garbage collector needs to know structures and constants which TOMOYO uses. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/realpath.h')
-rw-r--r--security/tomoyo/realpath.h76
1 files changed, 0 insertions, 76 deletions
diff --git a/security/tomoyo/realpath.h b/security/tomoyo/realpath.h
deleted file mode 100644
index b94cb512adb5..000000000000
--- a/security/tomoyo/realpath.h
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * security/tomoyo/realpath.h
3 *
4 * Get the canonicalized absolute pathnames. The basis for TOMOYO.
5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 *
8 * Version: 2.2.0 2009/04/01
9 *
10 */
11
12#ifndef _SECURITY_TOMOYO_REALPATH_H
13#define _SECURITY_TOMOYO_REALPATH_H
14
15struct path;
16struct tomoyo_path_info;
17struct tomoyo_io_buffer;
18
19/* Convert binary string to ascii string. */
20int tomoyo_encode(char *buffer, int buflen, const char *str);
21
22/* Returns realpath(3) of the given pathname but ignores chroot'ed root. */
23int tomoyo_realpath_from_path2(struct path *path, char *newname,
24 int newname_len);
25
26/*
27 * Returns realpath(3) of the given pathname but ignores chroot'ed root.
28 * These functions use kzalloc(), so the caller must call kfree()
29 * if these functions didn't return NULL.
30 */
31char *tomoyo_realpath(const char *pathname);
32/*
33 * Same with tomoyo_realpath() except that it doesn't follow the final symlink.
34 */
35char *tomoyo_realpath_nofollow(const char *pathname);
36/* Same with tomoyo_realpath() except that the pathname is already solved. */
37char *tomoyo_realpath_from_path(struct path *path);
38
39/* Check memory quota. */
40bool tomoyo_memory_ok(void *ptr);
41
42/*
43 * Keep the given name on the RAM.
44 * The RAM is shared, so NEVER try to modify or kfree() the returned name.
45 */
46const struct tomoyo_path_info *tomoyo_get_name(const char *name);
47
48/* Check for memory usage. */
49int tomoyo_read_memory_counter(struct tomoyo_io_buffer *head);
50
51/* Set memory quota. */
52int tomoyo_write_memory_quota(struct tomoyo_io_buffer *head);
53
54/* Initialize realpath related code. */
55void __init tomoyo_realpath_init(void);
56
57/*
58 * tomoyo_name_entry is a structure which is used for linking
59 * "struct tomoyo_path_info" into tomoyo_name_list .
60 */
61struct tomoyo_name_entry {
62 struct list_head list;
63 atomic_t users;
64 struct tomoyo_path_info entry;
65};
66
67static inline void tomoyo_put_name(const struct tomoyo_path_info *name)
68{
69 if (name) {
70 struct tomoyo_name_entry *ptr =
71 container_of(name, struct tomoyo_name_entry, entry);
72 atomic_dec(&ptr->users);
73 }
74}
75
76#endif /* !defined(_SECURITY_TOMOYO_REALPATH_H) */