From bfa53046b91b1ff91f0ad7f8156a19697bc63580 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Tue, 9 Nov 2021 10:06:09 +0100 Subject: [PATCH 1/2] Fix share type for public links --- api/share_manager_owncloud/share_manager_owncloud.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/share_manager_owncloud/share_manager_owncloud.go b/api/share_manager_owncloud/share_manager_owncloud.go index 7e373a4..aa57eba 100644 --- a/api/share_manager_owncloud/share_manager_owncloud.go +++ b/api/share_manager_owncloud/share_manager_owncloud.go @@ -570,7 +570,7 @@ func (sm *shareManager) getDBShare(ctx context.Context, accountID, id string) (* permissions int ) - query := "SELECT coalesce(uid_owner, '') as uid_owner, coalesce(share_with, '') as share_with, coalesce(fileid_prefix, '') as fileid_prefix, coalesce(item_source, '') as item_source, stime, permissions, share_type FROM oc_share WHERE (share_type=2 OR item_type <> 'file') AND (orphan = 0 or orphan IS NULL) AND (uid_owner=? OR uid_initiator=?) and id=?" + query := "SELECT coalesce(uid_owner, '') as uid_owner, coalesce(share_with, '') as share_with, coalesce(fileid_prefix, '') as fileid_prefix, coalesce(item_source, '') as item_source, stime, permissions, share_type FROM oc_share WHERE (share_type=3 OR item_type <> 'file') AND (orphan = 0 or orphan IS NULL) AND (uid_owner=? OR uid_initiator=?) and id=?" if err := sm.db.QueryRow(query, accountID, accountID, id).Scan(&uidOwner, &shareWith, &prefix, &itemSource, &stime, &permissions, &shareType); err != nil { if err == sql.ErrNoRows { return nil, api.NewError(api.FolderShareNotFoundErrorCode) @@ -583,7 +583,7 @@ func (sm *shareManager) getDBShare(ctx context.Context, accountID, id string) (* } func (sm *shareManager) getDBShares(ctx context.Context, accountID, filterByFileID string) ([]*dbShare, error) { - query := "SELECT id, coalesce(uid_owner, '') as uid_owner, coalesce(share_with, '') as share_with, coalesce(fileid_prefix, '') as fileid_prefix, coalesce(item_source, '') as item_source, stime, permissions, share_type FROM oc_share WHERE (share_type=2 OR item_type <> 'file') AND (orphan = 0 OR orphan IS NULL) AND (uid_owner=? OR uid_initiator=?) AND (share_type=? OR share_type=?) " + query := "SELECT id, coalesce(uid_owner, '') as uid_owner, coalesce(share_with, '') as share_with, coalesce(fileid_prefix, '') as fileid_prefix, coalesce(item_source, '') as item_source, stime, permissions, share_type FROM oc_share WHERE item_type <> 'file' AND (orphan = 0 OR orphan IS NULL) AND (uid_owner=? OR uid_initiator=?) AND (share_type=? OR share_type=?) " params := []interface{}{accountID, accountID, 0, 1} if filterByFileID != "" { prefix, itemSource := splitFileID(filterByFileID) From 73f6a8516649f93bc6c2f28b0756d2373bfe5b46 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Tue, 9 Nov 2021 10:06:45 +0100 Subject: [PATCH 2/2] revad: v0.0.55 --- revad/revad.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/revad/revad.spec b/revad/revad.spec index fd3397a..f3182f9 100644 --- a/revad/revad.spec +++ b/revad/revad.spec @@ -4,7 +4,7 @@ Name: revad Summary: REVA is a gRPC backend server for CERNBox -Version: 0.0.54 +Version: 0.0.55 Release: 1%{?dist} License: AGPLv3 BuildRoot: %{_tmppath}/%{name}-buildroot @@ -53,6 +53,8 @@ rm -rf %buildroot/ %config(noreplace) /etc/revad/revad.yaml %changelog +* Tue Nov 09 2021 Ishank Arora 0.0.55 +- Fix share type for public links * Tue Nov 09 2021 Ishank Arora 0.0.54 - Filter file shares when listing shares created by user * Wed Oct 27 2021 Ishank Arora 0.0.53