2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-05 08:45:22 +00:00
Files
apparmor/kernel-patches/for-mainline/apparmor-d_path_flags.diff
Andreas Gruenbacher d6004bf65e - Update and rediff against latest git (no real actual changes except
for removing an unused variable that apparmor-percpu_path_cache.diff
  added).
2007-02-01 06:13:07 +00:00

40 lines
1.3 KiB
Diff

Index: linux-2.6/security/apparmor/main.c
===================================================================
--- linux-2.6.orig/security/apparmor/main.c
+++ linux-2.6/security/apparmor/main.c
@@ -804,6 +804,7 @@ char *aa_get_name(struct dentry *dentry,
{
char *buffer, *name;
int order = 0;
+ unsigned int pconds;
*addr = NULL;
buffer = (char *)aa_get_path(GFP_KERNEL);
@@ -813,7 +814,8 @@ char *aa_get_name(struct dentry *dentry,
goto out;
}
- name = d_path(dentry, mnt, buffer, PAGE_SIZE << order);
+ name = d_path_flags(dentry, mnt, buffer, PAGE_SIZE << order,
+ DPATH_NSROOT, &pconds);
/* check for (deleted) that d_path appends to pathnames if the dentry
* has been removed from the cache.
* The size > deleted_size and strcmp checks are redundant safe guards.
@@ -826,16 +828,6 @@ char *aa_get_name(struct dentry *dentry,
order++;
buffer = kmalloc(PAGE_SIZE << order, GFP_KERNEL);
goto retry;
- } else {
- const char deleted_str[] = " (deleted)";
- const size_t deleted_size = sizeof(deleted_str) - 1;
- size_t size;
- size = strlen(name);
- if (!IS_ROOT(dentry) && d_unhashed(dentry) &&
- size > deleted_size &&
- strcmp(name + size - deleted_size, deleted_str) == 0)
- name[size - deleted_size] = '\0';
- AA_DEBUG("%s: full_path=%s\n", __FUNCTION__, name);
}
out: