fix: set correct scope when user home creation is enabled

This commit is contained in:
Oleg Lobanov
2022-06-03 15:59:36 +02:00
parent d1d8e3e340
commit 02730bb9bf
12 changed files with 116 additions and 72 deletions

View File

@@ -92,11 +92,7 @@ func (u *User) Clean(baseScope string, fields ...string) error {
if u.Fs == nil {
scope := u.Scope
if !filepath.IsAbs(scope) {
scope = filepath.Join(baseScope, scope)
}
scope = filepath.Join(baseScope, filepath.Join("/", scope)) //nolint:gocritic
u.Fs = afero.NewBasePathFs(afero.NewOsFs(), scope)
}