Chown directories, not just files
This commit is contained in:
parent
3f6b0ce44c
commit
07b1876954
|
@ -373,6 +373,9 @@ func (fs *Filesystem) chownDirectory(path string) error {
|
||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Chown the directory itself.
|
||||||
|
os.Chown(cleaned, config.Get().System.User.Uid, config.Get().System.User.Gid)
|
||||||
|
|
||||||
files, err := ioutil.ReadDir(cleaned)
|
files, err := ioutil.ReadDir(cleaned)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
|
@ -387,6 +390,7 @@ func (fs *Filesystem) chownDirectory(path string) error {
|
||||||
fs.chownDirectory(p)
|
fs.chownDirectory(p)
|
||||||
}(filepath.Join(cleaned, f.Name()))
|
}(filepath.Join(cleaned, f.Name()))
|
||||||
} else {
|
} else {
|
||||||
|
// Chown the file.
|
||||||
os.Chown(filepath.Join(cleaned, f.Name()), fs.Configuration.User.Uid, fs.Configuration.User.Gid)
|
os.Chown(filepath.Join(cleaned, f.Name()), fs.Configuration.User.Uid, fs.Configuration.User.Gid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user