Skip to content

Commit

Permalink
fix share path when listing a specific share
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed Jul 23, 2021
1 parent adceeb2 commit 100fc11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-share-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix share path when listing a specific share

The file path and target of shares where missing the share jail path when a specific share was listed.

https://github.com/cs3org/reva/pull/1918
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,11 @@ func (h *Handler) getShare(w http.ResponseWriter, r *http.Request, shareID strin
response.WriteOCSError(w, r, response.MetaServerError.StatusCode, "error mapping share data", err)
}
h.mapUserIds(ctx, client, share)
if share.State == ocsStateAccepted {
// Needed because received shares can be jailed in a folder in the users home
share.FileTarget = path.Join(h.sharePrefix, path.Base(info.Path))
share.Path = path.Join(h.sharePrefix, path.Base(info.Path))
}

response.WriteOCSSuccess(w, r, []*conversions.ShareData{share})
}
Expand Down

0 comments on commit 100fc11

Please sign in to comment.