1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-17 23:59:44 +00:00

Fix get dir perm error (#761)

Co-authored-by: Heran Yang <heran.yang@seafile.com>
This commit is contained in:
feiniks
2025-05-29 11:25:53 +08:00
committed by GitHub
parent af4b73515c
commit 32ed9c6959

View File

@@ -326,7 +326,9 @@ func getSharedDirsToUser(originRepoID string, toEmail string) (map[string]string
func getDirPerm(perms map[string]string, path string) string {
tmp := path
var perm string
for tmp != "" {
// If the path is empty, filepath.Dir returns ".". If the path consists entirely of separators,
// filepath.Dir returns a single separator.
for tmp != "/" && tmp != "." && tmp != "" {
if perm, exists := perms[tmp]; exists {
return perm
}