1
0
mirror of https://github.com/rancher/os.git synced 2025-07-05 02:56:13 +00:00

Correct permissions on home directory

This commit is contained in:
Josh Curl 2016-08-16 16:25:01 -07:00
parent 6abdeb34d6
commit 65468736df
No known key found for this signature in database
GPG Key ID: 82B504B9BCCFA677

View File

@ -29,19 +29,23 @@ type symlink struct {
func Main() { func Main() {
cfg := config.LoadConfig() cfg := config.LoadConfig()
if err := os.MkdirAll(rancherHome, 2755); err != nil { if _, err := os.Stat(rancherHome); os.IsNotExist(err) {
if err := os.MkdirAll(rancherHome, 0755); err != nil {
log.Error(err) log.Error(err)
} }
if err := os.Chown(rancherHome, 1100, 1100); err != nil { if err := os.Chown(rancherHome, 1100, 1100); err != nil {
log.Error(err) log.Error(err)
} }
}
if err := os.MkdirAll(dockerHome, 2755); err != nil { if _, err := os.Stat(dockerHome); os.IsNotExist(err) {
if err := os.MkdirAll(dockerHome, 0755); err != nil {
log.Error(err) log.Error(err)
} }
if err := os.Chown(dockerHome, 1101, 1101); err != nil { if err := os.Chown(dockerHome, 1101, 1101); err != nil {
log.Error(err) log.Error(err)
} }
}
password := config.GetCmdline("rancher.password") password := config.GetCmdline("rancher.password")
cmd := exec.Command("chpasswd") cmd := exec.Command("chpasswd")