bump reva

This commit is contained in:
André Duffeck
2025-07-25 08:59:19 +02:00
committed by Christian Richter
parent b9f48edd87
commit 0f09cdd8ec
7 changed files with 112 additions and 75 deletions

View File

@@ -166,7 +166,6 @@ func (s *service) isPathAllowed(path string) bool {
func (s *service) CreateShare(ctx context.Context, req *collaboration.CreateShareRequest) (*collaboration.CreateShareResponse, error) {
log := appctx.GetLogger(ctx)
user := ctxpkg.ContextMustGetUser(ctx)
// Grants must not allow grant permissions
if HasGrantPermissions(req.GetGrant().GetPermissions().GetPermissions()) {
return &collaboration.CreateShareResponse{
@@ -174,6 +173,17 @@ func (s *service) CreateShare(ctx context.Context, req *collaboration.CreateShar
}, nil
}
// check if the grantee is a user or group
if req.GetGrant().GetGrantee().GetType() == provider.GranteeType_GRANTEE_TYPE_USER {
// check if the tenantId of the user matches the tenantId of the target user
if user.GetId().GetTenantId() != req.GetGrant().GetGrantee().GetUserId().GetTenantId() {
log.Warn().Msg("user tenantId does not match the target user tenantId, this is not supported yet")
return &collaboration.CreateShareResponse{
Status: status.NewPermissionDenied(ctx, nil, "user tenantId does not match the target user tenantId"),
}, nil
}
}
gatewayClient, err := s.gatewaySelector.Next()
if err != nil {
return nil, err

View File

@@ -183,6 +183,8 @@ func RoleFromName(name string) *Role {
return NewManagerRole()
case RoleSecureViewer:
return NewSecureViewerRole()
case RoleCoowner:
return NewCoownerRole()
default:
return NewUnknownRole()
}

View File

@@ -178,7 +178,7 @@ func (t *Tree) workScanQueue() {
}
if item.Recurse {
err = t.WarmupIDCache(item.Path, true, false)
err = t.WarmupIDCache(item.Path, true, true)
if err != nil {
log.Error().Err(err).Str("path", item.Path).Msg("failed to warmup id cache")
}
@@ -435,11 +435,18 @@ func (t *Tree) assimilate(item scanItem) error {
// compare metadata mtime with actual mtime. if it matches AND the path hasn't changed (move operation)
// we can skip the assimilation because the file was handled by us
fi, err := os.Stat(item.Path)
if err == nil && previousPath == item.Path {
if mtime.Equal(fi.ModTime()) {
return nil
}
fi, err := os.Lstat(item.Path)
if err != nil {
return err
}
if previousPath == item.Path && mtime.Equal(fi.ModTime()) {
return nil
}
if !fi.IsDir() && !fi.Mode().IsRegular() {
t.log.Trace().Str("path", item.Path).Msg("skipping non-regular file")
return nil
}
// was it moved or copied/restored with a clashing id?
@@ -783,12 +790,17 @@ func (t *Tree) WarmupIDCache(root string, assimilate, onlyDirty bool) error {
isTrash(path) ||
t.isUpload(path) ||
t.isIndex(path) {
return filepath.SkipDir
return nil
}
if t.isRootPath(path) {
return nil // ignore the root paths
}
if !info.IsDir() && !info.Mode().IsRegular() {
t.log.Trace().Str("path", path).Msg("skipping non-regular file")
return nil
}
// calculate tree sizes
if !info.IsDir() {
dir := path