* fork being emptied and put in shortform format.
*/
+static int
+attr_namecheck(
+ uint8_t *name,
+ int length)
+{
+ return namecheck((char *)name, length, false);
+}
+
/*
* This routine just checks what security needs are for attribute values
* only called when root flag is set, otherwise these names could exist in
}
}
- /* namecheck checks for / and null terminated for file names.
- * attributes names currently follow the same rules.
- */
- if (namecheck((char *)¤tentry->nameval[0],
- currententry->namelen)) {
+ /* namecheck checks for null chars in attr names. */
+ if (attr_namecheck(currententry->nameval,
+ currententry->namelen)) {
do_warn(
_("entry contains illegal character in shortform attribute name\n"));
junkit = 1;
xfs_attr_leaf_name_local_t *local;
local = xfs_attr3_leaf_name_local(leaf, i);
- if (local->namelen == 0 || namecheck((char *)&local->nameval[0],
+ if (local->namelen == 0 || attr_namecheck(local->nameval,
local->namelen)) {
do_warn(
_("attribute entry %d in attr block %u, inode %" PRIu64 " has bad name (namelen = %d)\n"),
remotep = xfs_attr3_leaf_name_remote(leaf, i);
- if (remotep->namelen == 0 || namecheck((char *)&remotep->name[0],
+ if (remotep->namelen == 0 || attr_namecheck(remotep->name,
remotep->namelen) ||
be32_to_cpu(entry->hashval) !=
libxfs_da_hashname((unsigned char *)&remotep->name[0],