leonchen83/redis-rdb-cli

rst's password maybe can't contain #

cau991 opened this issue · 2 comments

cau991 commented

1. Basic information
1)source db version:3.2
2)dest db version: 5.0
3)redis-rdb-cli version: 0.9.4

redis rdb cli: v0.9.4 (3d5974f848a1b7694327c53d0bd717534cb561ae: 2023-08-16T07:01:27+0000)
home: /usr/local/redis-rdb-cli/bin/..
java version: 17.0.8.1, vendor: Azul Systems, Inc.
java home: /usr/lib/jvm/java-17-zulu-openjdk-jdk
default locale: en, platform encoding: UTF-8
os name: Linux, version: 3.10.0-1160.88.1.el7.x86_64, arch: amd64

2.Problem description
cmd like:
rst -s redis://192.168.7.87:7393?authPassword=*** -m redis://192.168.146.22:7402?authPassword=qaz#wsx -r
When dest db's pasword contain '#',ie qaz#wsx ,rst will output

java.lang.RuntimeException: failed to connect to ***.***.***.***:***, reason ERR invalid password
        at com.moilioncircle.redis.rdb.cli.cmd.XRst.getRdbVisitor(XRst.java:257)
        at com.moilioncircle.redis.rdb.cli.cmd.XRst.call(XRst.java:207)
        at com.moilioncircle.redis.rdb.cli.cmd.XRst.call(XRst.java:149)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at com.moilioncircle.redis.rdb.cli.Rst.main(Rst.java:28)

When i use redis-cli to connect dest db,it‘s’ no problem
redis-cli -h 192.168.146.22 -p 7402 -a qaz#wsx

When I change dest db's(the same instance) pasword to a pasword which do not contain '#',it will be no problem

For all seeking adventurers: URL encode your password (with all special chars!) is the answer:

eg:
redis://host:port?authPassword=this_is_a_#!=special_password to
redis://host:port?authPassword=this%5Fis%5Fa%5F%23%21%3Dspecial%5Fpassword