diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-07-09 22:32:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-09 22:32:18 +0800 |
commit | 36353e27e62fb848f563f1def402a45cb705a003 (patch) | |
tree | 674ff3d1bcb901b546b7051beb9a7c4a0a70aa8c /modules | |
parent | 49f9d43afefd446287b1b2475d7127d405b7a873 (diff) | |
download | gitea-36353e27e62fb848f563f1def402a45cb705a003.tar.gz gitea-36353e27e62fb848f563f1def402a45cb705a003.zip |
Do not create empty ".ssh" directory when loading config (#20289)
Creating the directory automatically is not correct.
In other places for ssh key writing (RewriteAllPrincipalKeys / appendAuthorizedKeysToFile, etc), the directory will still be created when updating the keys.
This PR will resolve the confusing and annoying problem: the dummy and empty ".ssh" directory in new git home.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 510e00e5ab..1bd9e09a7a 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -859,9 +859,7 @@ func loadFromConf(allowEmpty bool, extraConfig string) { SSH.AuthorizedPrincipalsAllow, SSH.AuthorizedPrincipalsEnabled = parseAuthorizedPrincipalsAllow(sec.Key("SSH_AUTHORIZED_PRINCIPALS_ALLOW").Strings(",")) if !SSH.Disabled && !SSH.StartBuiltinServer { - if err := os.MkdirAll(SSH.RootPath, 0o700); err != nil { - log.Fatal("Failed to create '%s': %v", SSH.RootPath, err) - } else if err = os.MkdirAll(SSH.KeyTestPath, 0o644); err != nil { + if err = os.MkdirAll(SSH.KeyTestPath, 0o644); err != nil { log.Fatal("Failed to create '%s': %v", SSH.KeyTestPath, err) } |