Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dav files namespace should use the user in request for deciding the layout #1215

Closed
ishank011 opened this issue Oct 2, 2020 · 0 comments · Fixed by #1401
Closed

Dav files namespace should use the user in request for deciding the layout #1215

ishank011 opened this issue Oct 2, 2020 · 0 comments · Fixed by #1401
Assignees
Labels
bug Something isn't working

Comments

@ishank011
Copy link
Contributor

h.FilesHandler = new(WebDavHandler)
if err := h.FilesHandler.init(c.FilesNamespace); err != nil {
return err
}
h.FilesHomeHandler = new(WebDavHandler)
if err := h.FilesHomeHandler.init(c.WebdavNamespace); err != nil {
return err
}

For the incoming /dav/files/userID requests, we have different namespaces depending on whether the request is for the logged-in user's namespace or not. Since in the storage drivers, we specify the layout depending only on the logged in user, this works in the first condition. However, when a user wants to access another user's namespace when the storage provider depends on the logged in user's namespace, it fails.

For example, consider the following case. The owncloud fs uses a layout
{{substr 0 1 .Id.OpaqueId}}/{{.Id.OpaqueId}} The user einstein sends a request /dav/files/marie, which should be allowed. However, based on the current way we apply the layout, there's no way in which this can be translated to /m/marie/

func applyLayout(ctx context.Context, ns string) string {
return templates.WithUser(ctxuser.ContextMustGetUser(ctx), ns)
}

It can only use the details of the user in context. This needs to be changed to handle such requests. @butonic @PVince81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants