Skip to content

Commit

Permalink
operations: fix lsjson --encrypted when using --crypt-XXX parameters
Browse files Browse the repository at this point in the history
Before this change an `rclone lsjson --encrypted` command where
additional `--crypt-` parameters were supplied on the command line:

    rclone lsjson --crypt-description XXX --encrypted secret:

Produced an error like this:

    Failed to lsjson: ListJSON failed to load config for crypt remote: config name contains invalid characters...

This was due to an incorrect lookup of the crypt config to create the
encrypted mapping.

Fixes #7833
  • Loading branch information
ncw committed May 13, 2024
1 parent 04c6995 commit 0735f44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/operations/lsjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func newListJSON(ctx context.Context, fsrc fs.Fs, remote string, opt *ListJSONOp
lj.dirs = false
}
if opt.ShowEncrypted {
fsInfo, _, _, config, err := fs.ConfigFs(fsrc.Name() + ":" + fsrc.Root())
fsInfo, _, _, config, err := fs.ConfigFs(fs.ConfigStringFull(fsrc))
if err != nil {
return nil, fmt.Errorf("ListJSON failed to load config for crypt remote: %w", err)
}
Expand Down

0 comments on commit 0735f44

Please sign in to comment.