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

Incorrect check for Windows (case sensitivity) #953

Closed
brianfromoregon opened this issue Jan 21, 2020 · 2 comments · Fixed by #927
Closed

Incorrect check for Windows (case sensitivity) #953

brianfromoregon opened this issue Jan 21, 2020 · 2 comments · Fixed by #927
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@brianfromoregon
Copy link

brianfromoregon commented Jan 21, 2020

The value for StandardSystemProperty.OS_NAME on win10 is "Windows 10" which fails the case sensitive startsWith check

See https://github.com/googleapis/google-http-java-client/blob/master/google-http-client/src/main/java/com/google/api/client/util/store/FileDataStoreFactory.java#L55

@brianfromoregon
Copy link
Author

If I change it locally to be case insensitive, I see this (again on win10)


java.nio.file.attribute.UserPrincipalNotFoundException: null
	at sun.nio.fs.WindowsUserPrincipals.lookup(WindowsUserPrincipals.java:147) ~[?:?]
	at sun.nio.fs.WindowsFileSystem$LookupService$1.lookupPrincipalByName(WindowsFileSystem.java:244) ~[?:?]
	at com.google.api.client.util.store.FileDataStoreFactory.setPermissionsToOwnerOnlyWindows(FileDataStoreFactory.java:158) ~[main/:1.32.1]
	at com.google.api.client.util.store.FileDataStoreFactory.<init>(FileDataStoreFactory.java:71) ~[main/:1.32.1]

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 22, 2020
@chingor13 chingor13 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 27, 2020
@yoshi-automation yoshi-automation removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Jan 27, 2020
@MartijnWoudstra
Copy link

Furthermore, the .lookupPrincipalByName("OWNER@"); seems to be throwing the UserPrincipalNotFoundException

clundin25 pushed a commit to clundin25/google-http-java-client that referenced this issue Aug 11, 2022
Source-Link: googleapis/synthtool@48f8857
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:b47e411068ffc6e6990cb4e0802fbac9a4488dec7f5f424553518ba21abea208
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants