timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-20102] Directory browser cannot handle paths contain backslash on Linux #10680

Open timja opened 11 years ago

timja commented 11 years ago

We had a faulty test case that saved screenshots from Selenium tests in a hard-coded location, which happened to be "C:\Screenshots". Unsurprisingly, this didn't work properly when run on our Linux build server. It created a directory called "C:\Screenshots" in the workspace, and then files like "C:\Screenshots\XXX.png" in the workspace directory.

Obviously, we're fixing our build to not do this. However, Jenkins does not handle this case.

You can recreate this by running the following commands in a workspace:

[jenkins@build-master workspace]$ mkdir "C:\Screenshots"
[jenkins@build-master workspace]$ echo test > "C:\Screenshots\test.txt"

The output of ls -l will then contain entries like this:

drwxrwxr-x. 2 jenkins jenkins 4096 Oct 17 14:46 C:\Screenshots
rw-rw-r-. 1 jenkins jenkins 5 Oct 17 14:46 C:\Screenshots\test.txt

Attempts to navigate into the folder or view the file through the workspace browser will fail with a 404 error. Additionally, the directory will appear as just Screenshots and the file as test.txt, rather than their full names.

(Set priority to Trivial, as frankly, I don't expect this situation to come up again).


Originally reported by pmilliken, imported from: Directory browser cannot handle paths contain backslash on Linux
  • assignee: schristou
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 10 years ago

bin_ary:

I'd like to give this a try. I'm pretty junior so if someone has a fix you can take over and I'll find something else to work on.

timja commented 10 years ago

danielbeck:

Also happens with files and folders named 'foo\bar\baz', they show up as 'baz'.

timja commented 2 years ago

[Originally related to: JENKINS-25224]