Skip to content

Incorrect check for Windows (case sensitivity) #953

Closed

Description

@brianfromoregon

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

Activity

  1. brianfromoregon commented on Jan 21, 2020

    @brianfromoregon
    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]
    
    
  2. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jan 27, 2020
  3. MartijnWoudstra commented on Mar 24, 2020

    @MartijnWoudstra

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions