Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

on Windows, diskCacheRoot doesn't start with / #7

Closed
wants to merge 1 commit into from

Conversation

ghazel
Copy link
Contributor

@ghazel ghazel commented Jun 2, 2012

Pretty obvious, Windows paths don't start with /

@jech
Copy link
Owner

jech commented Jun 5, 2012

Pretty obvious, Windows paths don't start with /

You can merge this Pull Request by running:

git pull https://github.com/ghazel/polipo win_path

Hmm, I'm afraid that this introduces a security hole. You should check
for the disk entry being of the form

X:/XXX

-- Juliusz

@ghazel
Copy link
Contributor Author

ghazel commented Jun 5, 2012

Hm, would just returning if PathIsRelative(diskCacheRoot->string[0]) cover it?

@jech
Copy link
Owner

jech commented Jun 5, 2012

The opposite, but yes, I think so.

Reference:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb773660(v=vs.85).aspx

@ghazel
Copy link
Contributor Author

ghazel commented Jun 5, 2012

Opposite? The functions seem to return if diskCacheRoot->string[0] != '/' meaning "root is not absolute", right? So the Windows equivalent would be:

     if(diskCacheRoot == NULL ||
        diskCacheRoot->length <= 0 || PathIsRelative(diskCacheRoot->string[0]))

@jech
Copy link
Owner

jech commented Jun 12, 2012

My bad. Greg, could you please fix that? It is a potential security hole.

--jch

@jech jech mentioned this pull request May 14, 2014
@jech
Copy link
Owner

jech commented May 14, 2014

Fixed by 2005534.

@jech jech closed this May 14, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants