open-vault/vendor/github.com/lib/pq/ssl_permissions.go
Jeff Mitchell 6ebf1cf713 Bump deps
2017-01-04 16:47:38 -05:00

17 lines
387 B
Go

// +build !windows
package pq
import "os"
// sslCertificatePermissions checks the permissions on user-supplied certificate
// files. The key file should have very little access.
//
// libpq does not check key file permissions on Windows.
func sslCertificatePermissions(cert, key os.FileInfo) {
kmode := key.Mode()
if kmode != kmode&0600 {
panic(ErrSSLKeyHasWorldPermissions)
}
}