-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urlapi: UNC paths in file: URLs on Windows #7366
Conversation
Congratulations 🎉. DeepCode analyzed your code in 3.084 seconds and we found no issues. Enjoy a moment of no bugs ☀️. 👉 View analysis in DeepCode’s Dashboard | Configure the bot👉 The DeepCode service and API will be deprecated in August, 2021. Here is the information how to migrate. Thank you for using DeepCode 🙏 ❤️ !If you are using our plugins, you might be interested in their successors: Snyk's JetBrains plugin and Snyk's VS Code plugin. |
And does it with this change? There's no test case updates in this PR, which probably explains the test failures on Windows. Shouldn't |
Yes, it does. I tested it locally in my environment using windows shared paths like file://192.168.1.25/shared/path/...
I should look at the broken tests. Perhaps the tests expecting the previous CURLUE_MALFORMED_INPUT fail now.
Perhaps yes, should be updated. |
b0c8b6b
to
6468e00
Compare
This seems to have broken test 2080 on many windows builds? |
*** 17,22 ****
--- 17,26 ----
<server>
none
</server>
+ <!-- valid UNC path on win32 -->
+ <features>
+ !Win32
+ </features>
<name>
config file with overly long option
</name> Where am I wrong? |
You mean invalid ? Why is that an invalid URL? It seems to match the syntax. The test case will never actually use the URL for anything but the parsing of the URL should succeed... |
|
Hm, wrong of me, the URL parser fails (and should fail) on the URL already without your PR... The test case assumes it! |
You should not disable test 2080 on Windows. You're just hiding a problem as it should work on there too. |
Right, although |
Is it possible to make a conditional errorcode? <errorcode>
3
</errorcode> I can add a test data test7366 for Windows based on test 2080 with <errorcode>
0
</errorcode> |
You should rather modify the URL so that it fails the same independently of operating system! |
I will look what URL in the test can be suitable. I am afraid, a new URL will get a different code flow than expected with using |
Why? You just have to make the URL parse fail consistently on all platforms. How about perhaps adding a white space? |
Good idea! Whitespaces may be disallowed in file-host names in UNC path, so |
28a49ec
to
5e7bc09
Compare
Lovely! How about adding a few tests of this to lib1560.c as well within |
I will do it soon. Regular DOS or Windows file URIs with vertical line characters in the drive letter construct. For example:
@bagder, would you like cURL to support such URIs? The top web browsers support such file: URIs. |
To my knowledge users haven't asked for this - I can't recall anyone at least. Neither UNC paths nor support for |
- file://host.name/path/file.txt is a valid UNC path \\host.name\path\files.txt to a non-local file transformed into URI (RFC 8089 Appendix E.3) - UNC paths on other OSs must be smb: URLs
Thanks! |
file://host.name/path/file.txt is a valid UNC path \host.name\path\files.txt
to a non-local file transformed into URI (RFC 8089 Appendix E.3)
UNC paths on other OSs must be smb: URLs
file://host.name/path/file.txt is working in browsers, should work in cURL also