keybase / keybase/client

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

Open
#25,523 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
9.2k
Forks
1.3k
Avg merge
12h 58m
Merged PRs (30d)
56

Description

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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `keybase fs cp` command and reproduce the documented session using source paths containing square brackets. Trace how source arguments are parsed and compare that behavior with `keybase fs read`; done means copying bracket-containing source paths works without manual escaping while destination paths continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.