15 #include <linux/magic.h>
20 #include <linux/sched.h>
21 #include <linux/slab.h>
36 memcpy(*buffer, str, namelen);
40 #define CHROOT_NSCONNECT (PATH_CHROOT_REL | PATH_CHROOT_NSCONNECT)
56 static int d_namespace_path(
struct path *
path,
char *
buf,
int buflen,
72 strncmp(*name,
"/sys/", 5) == 0) {
76 return prepend(name, *name - buf,
"/proc", 5);
84 get_fs_root(
current->fs, &root);
85 res =
__d_path(path, &root, buf, buflen);
96 if (!res || IS_ERR(res)) {
102 error = PTR_ERR(res);
117 if (d_unlinked(path->
dentry) && path->
dentry->d_inode &&
161 static int get_name_to_buffer(
struct path *
path,
int flags,
char *buffer,
165 int error = d_namespace_path(path, buffer, size - adjust, name, flags);
167 if (!error && (flags &
PATH_IS_DIR) && (*name)[1] !=
'\0')
172 strcpy(&buffer[size - 2],
"/");
176 *info =
"Failed name lookup - deleted entry";
177 else if (error == -
ESTALE)
178 *info =
"Failed name lookup - disconnected path";
180 *info =
"Failed name lookup - name too long";
182 *info =
"Failed name lookup";
207 int aa_path_name(
struct path *path,
int flags,
char **buffer,
const char **name,
222 error = get_name_to_buffer(path, flags, buf, size, &str, info);