[bug]: Only substitute /
for \
when the target platform is Windows
#1234
Labels
Bug
Something isn't working
P3 - Eventual
Things of low consequence to ignore
startd
Issues pertaining to startd itself
UI
Issues pertaining to any of the embassy-served web applications
Milestone
Prerequisites
EmbassyOS Version
075e68c
Device
Laptop/Desktop
Device OS
Linux
Device OS Version
Ubuntu 21.04
Browser
Brave
Browser Version
1.19.92
Current Behavior
Right now we do a full character substitution changing
\
's to/
's when putting a path into the CIFS creation dialog. This will break the edge case where users may create a folder with a\
in it on Linux or Mac (which is valid) and they will be unable to use the share they created.Expected Behavior
Ideally we want to only perform this substitution if the target drive is hosted on Windows, for which this substitution is always safe, and unambiguous. We do not, at present, have a means of telling EmbassyOS any information about the OS of the target drive. We should put this into the dialog. Ideally, it should also be persisted with the rest of the CIFS information so that upon edit, it need not be re-inputted.
Finally, if we go as far as persisting it, we need not actually perform the substitution on the FE at all. At that point, we can know at mount time that the drive is on windows and perform the substitution. This means that we only have to do the substitution oncce (on mount), as opposed to twice (once on the FE on save, and once on the FE on read).
Steps to Reproduce
\
in the name on either Linux or MacAnything else?
It is invalid to use either
/
or\
in file names on Windows. It is invalid to use/
in file names on Mac or Linux. This is what makes the substitution safe (and invertible) on Windows. But it is not safe on the other two platforms because it eliminates certain files from being used. It is also not invertible on the other platforms.https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN
The text was updated successfully, but these errors were encountered: