Skip to content

No way to override - Error: pq: Private key file has group or world access. Permissions should be u=rw (0600) or less #825

@ghost

Description

I found while using Windows Subsystem for Linux, that when I tried using the Linux binary of cockroachdb, libpq didn't like my certificate files because the permissions are 777.

There should be a way to override this check for people that just want to use libpq in a test environment where permissions don't matter. I have to keep the files on the Windows partition where there are no unix based permissions so I have direct access to my files with IDEs and such.

This could also be problematic for users trying to utilize storage systems from Linux that don't use unix-like permissions, where everything presents as 777 or some arbitrary perm value.

The cockroachdb commands had an elegant solution of reading the environment variable COCKROACH_SKIP_KEY_PERMISSION_CHECK to bypass it's check:
https://github.com/cockroachdb/cockroach/blob/master/pkg/security/certificate_loader.go#L33-L41

Maybe something like this could be a viable option for libpq?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions