aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-01-04 20:29:05 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-01-04 20:29:05 +0100
commit959e402ca97a0bb18ba2ad208a6d6cd1b6a91153 (patch)
treeb45fab0d4501dee9ad014c969a16346124e38d0a /account.go
parent9166b6a2acd2c6b42c3b09f054b2a6588758b2bf (diff)
Create*File
Diffstat (limited to 'account.go')
-rw-r--r--account.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/account.go b/account.go
index ccaf8ff..3fa1ae7 100644
--- a/account.go
+++ b/account.go
@@ -6,8 +6,6 @@ import (
"encoding/base64"
"io"
"net/mail"
- "os"
- "path"
"strings"
"github.com/square/go-jose"
@@ -91,11 +89,7 @@ func KeyAuthorization(s Thumber, token string) (string, error) {
}
func (a *Account) Save(fname string) error {
- if err := os.MkdirAll(path.Dir(fname), 0700); err != nil {
- return err
- }
- flags := os.O_WRONLY | os.O_CREATE | os.O_TRUNC
- fd, err := os.OpenFile(fname, flags, 0600)
+ fd, err := CreateKeyFile(fname)
if err != nil {
return err
}