1
0
Fork 0
forked from forgejo/forgejo

Fix mirror UI style and work on #475

This commit is contained in:
Unknwon 2014-09-16 08:32:13 -04:00
parent b162e565b3
commit c1ceec45da
6 changed files with 15 additions and 12 deletions

View file

@ -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
}
}
}