diff --git a/kernel/audit.h b/kernel/audit.h index 163b9a5d9441b2e449fe947516b4caaf5f909f86..1038e23eb61c969affb2ba332f92bec897406f47 100644 --- a/kernel/audit.h +++ b/kernel/audit.h @@ -79,8 +79,7 @@ extern int audit_comparator(const u32 left, const u32 op, const u32 right); extern int audit_uid_comparator(kuid_t left, u32 op, kuid_t right); extern int audit_gid_comparator(kgid_t left, u32 op, kgid_t 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 1c22ec3d87bc6f24c2b33a4086cb460812e0387c..deb97c139e0c4a5ccc1666ffb438c877f2a0ff55 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 71bb13598df392ceac7bae731e211c6039ee87d2..ff4011c19b13843dd443f28ab05b5d497c63445d 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c @@ -1330,8 +1330,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; @@ -1360,9 +1359,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 b87b28947acc7b76003a1c38a708829d08cfbe59..09c7b6b4f8e69e1c98dca80200898c2ca7a26214 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -2222,7 +2222,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; } @@ -2235,7 +2235,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