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

kbfs filesystem not able to copy files with square brackets in name (need to be escaped) #25523

Open
vcalv opened this issue Feb 23, 2023 · 2 comments · May be fixed by #25530
Open

kbfs filesystem not able to copy files with square brackets in name (need to be escaped) #25523

vcalv opened this issue Feb 23, 2023 · 2 comments · May be fixed by #25530

Comments

@vcalv
Copy link

vcalv commented Feb 23, 2023

files with [ or ] in name need to be escaped for ls, cp, mv, but not read

It's impossible to use the results of keybase fs ls as arguments for keybase fs cp for example.

Apparently the problem only occurs in the source argument and not the destination.

The following session dump should be self-explanatory.

$ cat > file.txt
123
Test
321
$ keybase fs mkdir /keybase/public/user/test
$ keybase fs cp file.txt /keybase/public/user/test/
$ keybase fs ls /keybase/public/user/test/
file.txt
$ keybase fs read /keybase/public/user/test/file.txt
123
Test
321
$ keybase fs cp /keybase/public/user/test/file.txt '/keybase/public/user/test/file [test].txt'
$ keybase fs read '/keybase/public/user/test/file [test].txt'
123
Test
321
$ keybase fs ls /keybase/public/user/test/
file [test].txt  file.txt
$ keybase fs cp '/keybase/public/user/test/file [test].txt' '/keybase/public/user/test/file [test 2].txt'
▶ ERROR Async result not found
$ keybase fs read '/keybase/public/user/test/file [test].txt'
123
Test
321
$ keybase fs cp '/keybase/public/user/test/file [test].txt' '/keybase/public/user/''
▶ ERROR Async result not found
$ keybase fs cp '/keybase/public/user/test/file \[test\].txt' '/keybase/public/user/'
$ keybase fs read '/keybase/public/user/file [test].txt'
123
Test
321
@vcalv
Copy link
Author

vcalv commented Feb 23, 2023

This might also break keybase fs recover since these files will not be found.

@vcalv
Copy link
Author

vcalv commented Feb 26, 2023

By default source parameters are "globed" and thus files with ?*[] in the name should fail.

There should be an option to either allow not globing or have not globing be the default and specify optional globing.

I still think this has unintended consequences in keybase fs recover, although I haven't read the code yet so I might be wrong.

@vcalv vcalv linked a pull request Feb 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant