Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Only substitute / for \ when the target platform is Windows #1234

Open
1 task done
ProofOfKeags opened this issue Feb 18, 2022 · 0 comments
Open
1 task done
Assignees
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

Comments

@ProofOfKeags
Copy link
Contributor

ProofOfKeags commented Feb 18, 2022

Prerequisites

  • I have searched for existing issues that already report this problem, without success.

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

  1. Create a backup
  2. Create a CIFS drive with a \ in the name on either Linux or Mac
  3. Put the information for that drive into the EmbassyOS dialog
  4. Save
  5. Notice that it fails to mount

Anything 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

@ProofOfKeags ProofOfKeags added Bug Something isn't working UI Issues pertaining to any of the embassy-served web applications startd Issues pertaining to startd itself P3 - Eventual Things of low consequence to ignore labels Feb 18, 2022
@MattDHill MattDHill added this to the 0.4.0 milestone Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants