Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@JeremyKuhne
Copy link
Member

  • Properly account for dos device paths
  • Remove unused path helpers
  • Remove all validation for extended paths
  • Recognize \??\ syntax
  • Handle device paths that get normalized

@stephentoub, @ianhays, @ramarag, @Priya91, @terrajobst, @weshaggard

@JeremyKuhne
Copy link
Member Author

Side notes:

This should hopefully either fix or allow fixing usage of pipes with "bad" path characters (but valid pipe characters). \\.\pipe\foo:pipe is valid. I'll follow up with an issue to create tests for pipes with characters that are bad for filenames but good for pipe names.

This also will allow access to alternate data streams with device syntax. We'll still block with "standard" paths. (There isn't an efficient way to block them and not prevent access to valid device paths.)

&& path[0] == '\\'
&& (path[1] == '\\' || path[1] == '?')
&& path[2] == '?'
&& path[3] == '\\';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess the method is misnamed then? Based on your comments I'd assume a path like //?/C:/ is considered extended, but not normalized, hence will not skip normalization.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will return true for \??\... is that desired?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is only for device paths that have "extended" behavior (e.g. they skip normalization and length checks). They have to be either \\?\ or \??\ exactly (can't have forward seps).

- Properly account for dos device paths
- Remove unused path helpers
- Remove all validation for extended paths
- Recognize \??\ syntax
- Handle device paths that get normalized
@JeremyKuhne
Copy link
Member Author

I've removed the "copy" constructors for StringBuffer and updated.

JeremyKuhne added a commit that referenced this pull request Mar 12, 2016
@JeremyKuhne JeremyKuhne merged commit 17018f7 into dotnet:master Mar 12, 2016
@JeremyKuhne
Copy link
Member Author

Validated coverage and got signoff from @stephentoub offline.

@JeremyKuhne JeremyKuhne deleted the DevicePath branch June 17, 2016 22:49
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
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.

7 participants