Description of problem: stratisd does not recognize special character for pool_name while creating pool Version-Release number of selected component (if applicable): stratis --version 3.4.1 How reproducible: always Steps to Reproduce: 1.setup multipath and stratis 2.[root@storageqe-25 ~]# ls /dev/mapper/ 360a98000324669436c2b45666c567858 rhel_storageqe--25-swap 360a98000324669436c2b45666c56785a stratis-1-private-b6f55aa3552743a7bcdb5748daf98901-flex-mdv 360a98000324669436c2b45666c567861 stratis-1-private-b6f55aa3552743a7bcdb5748daf98901-flex-thindata 360a98000324669436c2b45666c567863 stratis-1-private-b6f55aa3552743a7bcdb5748daf98901-flex-thinmeta control stratis-1-private-b6f55aa3552743a7bcdb5748daf98901-physical-originsub rhel_storageqe--25-home stratis-1-private-b6f55aa3552743a7bcdb5748daf98901-thinpool-pool rhel_storageqe--25-root 3.[root@storageqe-25 ~]# stratis pool create !@#$^&*()(*&+_ /dev/mapper/360a98000324669436c2b45666c567858 -bash: !@#: event not found 4.[root@storageqe-25 ~]# stratis pool create *&+_ /dev/mapper/360a98000324669436c2b45666c567858 -bash: +_: command not found 5.[root@storageqe-25 ~]# stratis pool create aaa*&+_ /dev/mapper/360a98000324669436c2b45666c567858 -bash: +_: command not found 6.[root@storageqe-25 ~]# stratis pool create aaa*&48548654+_ /dev/mapper/360a98000324669436c2b45666c567858[1] 256252 -bash: 48548654+_: command not found 7.[root@storageqe-25 ~]# stratis pool create aaa*&48548654 /dev/mapper/360a98000324669436c2b45666c567858 [1] 256315 -bash: 48548654: command not found Actual results: stratisd does not recognize special character for pool_name while creating pool Expected results: stratisd can recognize special character for pool_name while creating pool Additional info: [root@storageqe-25 ~]# stratis pool create -h usage: stratis pool create [-h] [--key-desc KEY_DESC] [--clevis {nbde,tang,tpm2}] [--tang-url TANG_URL] [--no-overprovision] [--trust-url | --thumbprint THUMBPRINT] pool_name blockdevs [blockdevs ...] positional arguments: pool_name Name of new pool blockdevs Create the pool using these block devs [root@storageqe-25 ~]# stratis --version 3.4.1
We do reject some pool names, for various reasons. But what I see right here is bash not being able to parse your command line in the way that you intend it to be understood. In general, it is interpreting the "&" in what you intend to be the pool name as a command instruction. Surround the pool names with quotation marks, and likely bash will interpret them as intended and pass them to stratis-cli.
There is no related information in man page. Is it fesible to add naming rules for fool name in man page?
It would not be a high priority. If the format of the name is unacceptable, stratisd will return an error with some explanation: $ stratis pool create "aaa*&48548654" /dev/mapper/360a98000324669436c2b45666c567858 Execution failed: stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: 1: Name contains characters not allowed in udev symlinks: aaa*&48548654.
So is this a bug?
I would test again with escape sequences in the shell, to ensure that the special characters make it into the pool name: (Example from stratis-3.5 in Fedora 37, but try it in RHEL 9:) $ sudo stratis pool create dollarsign\$name /dev/vdb1 Execution failed: stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: 1: Name contains characters not allowed in udev symlinks: dollarsign$name. $ sudo stratis pool create ampersand\&name /dev/vdb1Execution failed: stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: 1: Name contains characters not allowed in udev symlinks: ampersand&name. It may be the case that most of those characters are already filtered out by stratisd commit 394dda53a598 ("Add regex to exclude characters filtered by udev"). However, note that UTF-8 characters should work: $ sudo stratis pool create 水池1 /dev/vdb1 $ stratis pool list Name Total / Used / Free Properties UUID Alerts 水池1 8.00 GiB / 526.31 MiB / 7.49 GiB ~Ca,~Cr, Op c3483467-8f36-4a51-bcdb-1ad588e71d18 WS001 $ stratis pool explain WS001 Every device belonging to the pool has been fully allocated. To increase the allocable space, add additional data devices to the pool. (This is an 8 GiB test device on a virtual machine, so the "WS001" alert is expected to appear.)
I don't think it is a bug. We place some restrictions on the characters allowed in a pool name, but they are few and motivated by practical machine limits. Also, we return reasonably good error messages when the name contains unsupported characters as shown in the example.