Open DrYak opened 2 years ago
References for this topic at FSO:
Answer: Not really, because there are too many corner cases when this may go wrong and setting an udisk
display name is only of little use, as you already found out.
Other caveats:
udisk
's PARTNAME (wherever that comes from; I would have to look that up) is user-supplied data, which may be (ab)used by an attacker to inject special characters, escape sequences etc. Hence they should be filtered properly, rsp. check if the mechanisms employed do that, otherwise perform the filtering expilcitly.Hence I am not considering to include this into mount-sdcard
.
But a separate tool may be created, which queries these pretty names, then sets the UDISKS_NAME and a symbolic link to the mount-point, utilising one of these pretty names. The order of this evaluation also has to be well considered and these considerations along with their conclusions have to be documented.
As udev
deals with devices, not mount-points, this may be hard or even infeasible to achieve this via udev rules. Implementing this as a shell script seems to be adequate. Would need further investigation.
External references:
Given the number of "Why does Sailfish OS mounts cards as hash instead of nickname?" bug reports on Sailfish forum, you might be interested to include the following snippet among your udev rules: