From c1ceec45da8c600dea2b932127519c04484258d8 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 16 Sep 2014 08:32:13 -0400 Subject: Fix mirror UI style and work on #475 --- models/publickey.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'models/publickey.go') 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 + } } } -- cgit v1.2.3