This function in xfs_repair tries to make sure that if an attr
name reserved for acls exists in the root namespace, then its
value is a valid acl.
However, because it only compares up to the length of the
reserved name, superstrings may match and cause false positive
xfs_repair errors.
Ensure that both the length and the content match before
flagging it as an error.
Spotted-by: Zach Brown <zab@zabbo.net>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
void *valuep;
int clearit = 0;
- if ((strncmp(namevalue, SGI_ACL_FILE, SGI_ACL_FILE_SIZE) == 0) ||
- (strncmp(namevalue, SGI_ACL_DEFAULT,
- SGI_ACL_DEFAULT_SIZE) == 0)) {
+ if ((namelen == SGI_ACL_FILE_SIZE &&
+ strncmp(namevalue, SGI_ACL_FILE, SGI_ACL_FILE_SIZE) == 0) ||
+ (namelen == SGI_ACL_DEFAULT_SIZE &&
+ strncmp(namevalue, SGI_ACL_DEFAULT, SGI_ACL_DEFAULT_SIZE) == 0)) {
if (value == NULL) {
valuep = malloc(valuelen);
if (!valuep)