2 * security/tomoyo/realpath.h
4 * Get the canonicalized absolute pathnames. The basis for TOMOYO.
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
8 * Version: 2.2.0 2009/04/01
12 #ifndef _SECURITY_TOMOYO_REALPATH_H
13 #define _SECURITY_TOMOYO_REALPATH_H
16 struct tomoyo_path_info;
17 struct tomoyo_io_buffer;
19 /* Convert binary string to ascii string. */
20 int tomoyo_encode(char *buffer, int buflen, const char *str);
22 /* Returns realpath(3) of the given pathname but ignores chroot'ed root. */
23 int tomoyo_realpath_from_path2(struct path *path, char *newname,
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.
31 char *tomoyo_realpath(const char *pathname);
33 * Same with tomoyo_realpath() except that it doesn't follow the final symlink.
35 char *tomoyo_realpath_nofollow(const char *pathname);
36 /* Same with tomoyo_realpath() except that the pathname is already solved. */
37 char *tomoyo_realpath_from_path(struct path *path);
39 /* Check memory quota. */
40 bool tomoyo_memory_ok(void *ptr);
43 * Keep the given name on the RAM.
44 * The RAM is shared, so NEVER try to modify or kfree() the returned name.
46 const struct tomoyo_path_info *tomoyo_save_name(const char *name);
48 /* Check for memory usage. */
49 int tomoyo_read_memory_counter(struct tomoyo_io_buffer *head);
51 /* Set memory quota. */
52 int tomoyo_write_memory_quota(struct tomoyo_io_buffer *head);
54 /* Initialize realpath related code. */
55 void __init tomoyo_realpath_init(void);
57 #endif /* !defined(_SECURITY_TOMOYO_REALPATH_H) */