I'm looking at tissue 8155:
https://github.com/zfsonlinux/zfs/issues/8155
zfs create - error message for @ or # in name improvement
The issue raised is that if dataset name starts with @ or # zfs create
returns error message "empty component in name" while the same
characters in the middle of dataset name return "delimiter not expected
here" error message.
I was wondering if simply expanding the original message to read "empty
component or illegal character in name" would be sufficient. It's the
least cost way to implement it.
The check happens in
https://github.com/zfsonlinux/zfs/blob/master/module/zcommon/zfs_namecheck.c
in entity_namecheck().
With zfs create tank/@test the check falls through to check in line 248:
/* Zero-length components are not allowed */
if (start == end) {
if (why)
*why = NAME_ERR_EMPTY_COMPONENT;
return (-1);
}
and this is the error returned to calling function zfs_validate_name()
in libzfs_dataset.c
At the same time I think reworking the check so that both zfs create
tank/te@st and tank/@test would be caught by the same if in
zfs_validate_name().
What are your thought?
Regards
Damian Wojsław
------------------------------------------
openzfs: openzfs-developer
Permalink:
https://openzfs.topicbox.com/groups/developer/T8b60648741044cac-M1a93bd664a6d47beb7210cbc
Delivery options: https://openzfs.topicbox.com/groups/developer/subscription