Change remote working directory: cd
(self, arg)
| 356 | |
| 357 | # ------------------------[ cd <path> ]------------------------------- |
| 358 | def do_cd(self, arg): |
| 359 | "Change remote working directory: cd <path>" |
| 360 | if not self.cpath(arg) or self.dir_exists(self.rpath(arg)): |
| 361 | if re.match("^[\." + c.SEP + "]+$", self.cpath(arg)): |
| 362 | output().raw("*** Congratulations, path traversal found ***") |
| 363 | output().chitchat("Consider setting 'traversal' instead of 'cd'.") |
| 364 | self.set_cwd(arg) |
| 365 | else: |
| 366 | print("Failed to change directory.") |
| 367 | |
| 368 | # set current working directory |
| 369 | def set_cwd(self, cwd=""): |