audit: set the name_len in audit_inode for parent lookups
[deliverable/linux.git] / fs / namei.c
index a7ad35c66807530c6ebb831bb5601e8a581e5e27..6a92d988573fe596bda3b1e59903ce6640fccccb 100644 (file)
@@ -1973,7 +1973,7 @@ static int do_path_lookup(int dfd, const char *name,
                retval = path_lookupat(dfd, name, flags | LOOKUP_REVAL, nd);
 
        if (likely(!retval))
-               audit_inode(name, nd->path.dentry);
+               audit_inode(name, nd->path.dentry, flags & LOOKUP_PARENT);
        return retval;
 }
 
@@ -2648,7 +2648,7 @@ static int do_last(struct nameidata *nd, struct path *path,
                error = complete_walk(nd);
                if (error)
                        return error;
-               audit_inode(pathname, nd->path.dentry);
+               audit_inode(pathname, nd->path.dentry, 0);
                if (open_flag & O_CREAT) {
                        error = -EISDIR;
                        goto out;
@@ -2658,7 +2658,7 @@ static int do_last(struct nameidata *nd, struct path *path,
                error = complete_walk(nd);
                if (error)
                        return error;
-               audit_inode(pathname, dir);
+               audit_inode(pathname, dir, 0);
                goto finish_open;
        }
 
@@ -2687,7 +2687,7 @@ static int do_last(struct nameidata *nd, struct path *path,
                if (error)
                        return error;
 
-               audit_inode(pathname, dir);
+               audit_inode(pathname, dir, 0);
                error = -EISDIR;
                /* trailing slashes? */
                if (nd->last.name[nd->last.len])
@@ -2717,7 +2717,7 @@ retry_lookup:
                    !S_ISREG(file->f_path.dentry->d_inode->i_mode))
                        will_truncate = false;
 
-               audit_inode(pathname, file->f_path.dentry);
+               audit_inode(pathname, file->f_path.dentry, 0);
                goto opened;
        }
 
@@ -2734,7 +2734,7 @@ retry_lookup:
         * create/update audit record if it already exists.
         */
        if (path->dentry->d_inode)
-               audit_inode(pathname, path->dentry);
+               audit_inode(pathname, path->dentry, 0);
 
        /*
         * If atomic_open() acquired write access it is dropped now due to
@@ -2799,7 +2799,7 @@ finish_lookup:
        error = -ENOTDIR;
        if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup)
                goto out;
-       audit_inode(pathname, nd->path.dentry);
+       audit_inode(pathname, nd->path.dentry, 0);
 finish_open:
        if (!S_ISREG(nd->inode->i_mode))
                will_truncate = false;
This page took 0.036899 seconds and 5 git commands to generate.