Skip to content
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

Do not mistake COM0 for a reserved file name #2473

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

dscho
Copy link
Member

@dscho dscho commented Jan 14, 2020

This fixes #2470.

In 4dc42c6 (mingw: refuse paths containing reserved names,
2019-12-21), we started disallowing file names that are reserved, e.g.
`NUL`, `CONOUT$`, etc.

This included `COM<n>` where `<n>` is a digit. Unfortunately, this
includes `COM0` but only `COM1`, ..., `COM9` are reserved, according to
the official documentation, `COM0` is mentioned in the "NT Namespaces"
section but it is explicitly _omitted_ from the list of reserved names:
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

Tests corroborate this: it is totally possible to write a file called
`com0.c` on Windows 10, but not `com1.c`.

So let's tighten the code to disallow only the reserved `COM<n>` file
names, but to allow `COM0` again.

This fixes git-for-windows#2470.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho added this to the Next release milestone Jan 14, 2020
@dscho dscho merged commit 8f03c5e into git-for-windows:master Jan 16, 2020
@dscho dscho deleted the com0-is-not-a-reserved-name branch January 16, 2020 09:54
git-for-windows-ci pushed a commit that referenced this pull request Jan 16, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 16, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 16, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 17, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 17, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 17, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 17, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 22, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 22, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 22, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 22, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Jan 23, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 24, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 24, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Jan 24, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Jan 24, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 27, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 27, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 27, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Jan 28, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 29, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Jan 29, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 7, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 7, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 7, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Apr 8, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Apr 8, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 8, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Apr 8, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Apr 8, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Apr 9, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 14, 2020
Do not mistake `COM0` for a reserved file name
derrickstolee pushed a commit to microsoft/git that referenced this pull request Apr 14, 2020
…rved-name

Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 14, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Apr 17, 2020
Do not mistake `COM0` for a reserved file name
dscho added a commit that referenced this pull request Apr 18, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 20, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 20, 2020
Do not mistake `COM0` for a reserved file name
derrickstolee pushed a commit to microsoft/git that referenced this pull request Apr 20, 2020
…rved-name

Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request Apr 24, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request May 1, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request May 9, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request May 15, 2020
Do not mistake `COM0` for a reserved file name
git-for-windows-ci pushed a commit that referenced this pull request May 29, 2020
Do not mistake `COM0` for a reserved file name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot add file COM0.c or checkout branch containing COM0.c file
1 participant