Close #124: Add support for Postgres as a storage solution

This commit is contained in:
TwinProduction authored and Chris committed 2021-09-10 19:01:44 -04:00
1 parent 06ef7f9efe
commit bacf7d841b
47 files changed
+7593 -244

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
//go:build !windows
// +build !windows
package pq
import "os"
// sslKeyPermissions checks the permissions on user-supplied ssl key files.
// The key file should have very little access.
//
// libpq does not check key file permissions on Windows.
func sslKeyPermissions(sslkey string) error {
info, err := os.Stat(sslkey)
if err != nil {
return err
}
if info.Mode().Perm()&0077 != 0 {
return ErrSSLKeyHasWorldPermissions
}
return nil
}