summaryrefslogtreecommitdiffstats
path: root/models/publickey.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-09-16 08:32:13 -0400
committerUnknwon <joe2010xtmf@163.com>2014-09-16 08:32:13 -0400
commitc1ceec45da8c600dea2b932127519c04484258d8 (patch)
tree38c20ad2edd3cab0c7eb0a7c7ced86ea8460b3ef /models/publickey.go
parentb162e565b3c2877d1991f905ccd1a3a567189ba6 (diff)
downloadgitea-c1ceec45da8c600dea2b932127519c04484258d8.tar.gz
gitea-c1ceec45da8c600dea2b932127519c04484258d8.zip
Fix mirror UI style and work on #475
Diffstat (limited to 'models/publickey.go')
-rw-r--r--models/publickey.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/models/publickey.go b/models/publickey.go
index 1246cffc58..dccb89362b 100644
--- a/models/publickey.go
+++ b/models/publickey.go
@@ -14,6 +14,7 @@ import (
"os/exec"
"path"
"path/filepath"
+ "runtime"
"strings"
"sync"
"time"
@@ -160,10 +161,14 @@ func saveAuthorizedKeyFile(key *PublicKey) error {
if err != nil {
return err
}
- if finfo.Mode().Perm() > 0600 {
- log.Error(4, "authorized_keys file has unusual permission flags: %s - setting to -rw-------", finfo.Mode().Perm().String())
- if err = f.Chmod(0600); err != nil {
- return err
+
+ // FIXME: following command does not support in Windows.
+ if runtime.GOOS != "windows" {
+ if finfo.Mode().Perm() > 0600 {
+ log.Error(4, "authorized_keys file has unusual permission flags: %s - setting to -rw-------", finfo.Mode().Perm().String())
+ if err = f.Chmod(0600); err != nil {
+ return err
+ }
}
}