From: Jeff Layton <jlayton@redhat.com>
To: eparis@redhat.com, viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-audit@redhat.com,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 6/9] audit: remove dirlen argument to audit_compare_dname_path
Date: Tue, 26 Jun 2012 12:35:34 -0400 [thread overview]
Message-ID: <1340728537-25599-7-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1340728537-25599-1-git-send-email-jlayton@redhat.com>
All the callers set this to NULL now.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
kernel/audit.h | 3 +--
kernel/audit_watch.c | 2 +-
kernel/auditfilter.c | 6 +-----
kernel/auditsc.c | 4 ++--
4 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/kernel/audit.h b/kernel/audit.h
index 276ca88..ee31316 100644
--- a/kernel/audit.h
+++ b/kernel/audit.h
@@ -77,8 +77,7 @@ static inline int audit_hash_ino(u32 ino)
extern int audit_match_class(int class, unsigned syscall);
extern int audit_comparator(const u32 left, const u32 op, const u32 right);
extern int parent_len(const char *path);
-extern int audit_compare_dname_path(const char *dname, const char *path,
- int *dirlen);
+extern int audit_compare_dname_path(const char *dname, const char *path);
extern struct sk_buff * audit_make_reply(int pid, int seq, int type,
int done, int multi,
const void *payload, int size);
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
index e683869..44f3b31 100644
--- a/kernel/audit_watch.c
+++ b/kernel/audit_watch.c
@@ -265,7 +265,7 @@ static void audit_update_watch(struct audit_parent *parent,
/* Run all of the watches on this parent looking for the one that
* matches the given dname */
list_for_each_entry_safe(owatch, nextw, &parent->watches, wlist) {
- if (audit_compare_dname_path(dname, owatch->path, NULL))
+ if (audit_compare_dname_path(dname, owatch->path))
continue;
/* If the update involves invalidating rules, do the inode-based
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 29b167b..f9c48d0 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -1230,8 +1230,7 @@ int parent_len(const char *path)
/* Compare given dentry name with last component in given path,
* return of 0 indicates a match. */
-int audit_compare_dname_path(const char *dname, const char *path,
- int *dirlen)
+int audit_compare_dname_path(const char *dname, const char *path)
{
int dlen, plen;
const char *p;
@@ -1260,9 +1259,6 @@ int audit_compare_dname_path(const char *dname, const char *path,
p++;
}
- /* return length of path's directory component */
- if (dirlen)
- *dirlen = p - path;
return strncmp(p, dname, dlen);
}
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index e9f8b60..34d7ab2 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2232,7 +2232,7 @@ void __audit_inode_child(const struct inode *parent,
continue;
if (n->ino == parent->i_ino &&
- !audit_compare_dname_path(dname, n->name, NULL)) {
+ !audit_compare_dname_path(dname, n->name)) {
found_parent = n->name;
goto add_names;
}
@@ -2245,7 +2245,7 @@ void __audit_inode_child(const struct inode *parent,
/* strcmp() is the more likely scenario */
if (!strcmp(dname, n->name) ||
- !audit_compare_dname_path(dname, n->name, NULL)) {
+ !audit_compare_dname_path(dname, n->name)) {
if (inode)
audit_copy_inode(n, dentry, inode);
else
--
1.7.7.6
next prev parent reply other threads:[~2012-06-26 16:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 16:35 [PATCH v4 0/9] audit: overhaul audit_names handling to allow for retrying on path-based syscalls Jeff Layton
2012-06-26 16:35 ` [PATCH v4 1/9] audit: remove unnecessary NULL ptr checks from do_path_lookup Jeff Layton
2012-06-26 16:35 ` [PATCH v4 2/9] audit: pass in dentry to audit_copy_inode wherever possible Jeff Layton
2012-06-26 16:35 ` [PATCH v4 3/9] audit: reverse arguments to audit_inode_child Jeff Layton
2012-06-26 16:35 ` [PATCH v4 4/9] audit: add a new "type" field to audit_names struct Jeff Layton
2012-06-26 16:35 ` [PATCH v4 5/9] audit: set the name_len in audit_inode for parent lookups Jeff Layton
2012-06-26 16:35 ` Jeff Layton [this message]
2012-06-26 16:35 ` [PATCH v4 7/9] audit: make audit_compare_dname_path use parent_len helper Jeff Layton
2012-06-26 16:35 ` [PATCH v4 8/9] audit: optimize audit_compare_dname_path Jeff Layton
2012-06-26 16:35 ` [PATCH v4 9/9] audit: overhaul __audit_inode_child to accomodate retrying Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340728537-25599-7-git-send-email-jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=eparis@redhat.com \
--cc=linux-audit@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).