I think something along those lines would work. I'd suggest using the term "delimiter" like the other error message, e.g.: "empty component or misplaced '@' or '#' delimiter".
--matt On Mon, Jan 28, 2019 at 2:20 AM Damian Wojslaw <[email protected]> wrote: > 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 <https://openzfs.topicbox.com/latest>* / openzfs-developer / see > discussions <https://openzfs.topicbox.com/groups/developer> + participants > <https://openzfs.topicbox.com/groups/developer/members> + delivery options > <https://openzfs.topicbox.com/groups/developer/subscription> Permalink > <https://openzfs.topicbox.com/groups/developer/T8b60648741044cac-M1a93bd664a6d47beb7210cbc> > > ------------------------------------------ openzfs: openzfs-developer Permalink: https://openzfs.topicbox.com/groups/developer/T8b60648741044cac-Mdb66765862971242bec60092 Delivery options: https://openzfs.topicbox.com/groups/developer/subscription
