mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
Automated merge of 'dev' into 'next'
* dev: audit: fix suffixed '/' filename matching
This commit is contained in:
commit
8bea8f86f7
@ -1319,13 +1319,20 @@ int audit_compare_dname_path(const struct qstr *dname, const char *path, int par
|
|||||||
if (pathlen < dlen)
|
if (pathlen < dlen)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
parentlen = parentlen == AUDIT_NAME_FULL ? parent_len(path) : parentlen;
|
if (parentlen == AUDIT_NAME_FULL)
|
||||||
if (pathlen - parentlen != dlen)
|
parentlen = parent_len(path);
|
||||||
return 1;
|
|
||||||
|
|
||||||
p = path + parentlen;
|
p = path + parentlen;
|
||||||
|
|
||||||
return strncmp(p, dname->name, dlen);
|
/* handle trailing slashes */
|
||||||
|
pathlen -= parentlen;
|
||||||
|
while (p[pathlen - 1] == '/')
|
||||||
|
pathlen--;
|
||||||
|
|
||||||
|
if (pathlen != dlen)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return memcmp(p, dname->name, dlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
int audit_filter(int msgtype, unsigned int listtype)
|
int audit_filter(int msgtype, unsigned int listtype)
|
||||||
|
Loading…
Reference in New Issue
Block a user