Skip to content

fix: Public link with multiple mounts - #63241

Open
SystemKeeper wants to merge 2 commits into
masterfrom
fix/noid/public-link-with-multiple-mounts
Open

fix: Public link with multiple mounts#63241
SystemKeeper wants to merge 2 commits into
masterfrom
fix/noid/public-link-with-multiple-mounts

Conversation

@SystemKeeper

@SystemKeeper SystemKeeper commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When multiple mounts with different permissions are available to access a file, a public link for such a file might access the wrong (non-shareable) node and show a 404 instead of the file.
Question generally would be if it makes sense to extract that code (e.g. getFirstShareableNodeById or a separate class to resolve these types of nodes).

The test was created with help of AI, which pointed out that a similar exists at

if (!$resource->getNode()->isShareable()) {
throw new InteractionRestrictedException('Node is not shareable.', $this->l10n->t('You are not allowed to share "%s".', [$resource->getNode()->getName()]));
}
and the check should probably use getNodePermissions there. This seems 34+ only, the fix here is also < 34.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
@SystemKeeper SystemKeeper changed the title Fix/noid/public link with multiple mounts fix: Public link with multiple mounts Aug 14, 2026
@SystemKeeper SystemKeeper self-assigned this Aug 14, 2026
@SystemKeeper SystemKeeper added bug 3. to review Waiting for reviews feature: sharing feature: dav php Pull requests that update Php code labels Aug 14, 2026
@SystemKeeper SystemKeeper added this to the Nextcloud 35 milestone Aug 14, 2026
@SystemKeeper
SystemKeeper force-pushed the fix/noid/public-link-with-multiple-mounts branch from f31eefb to 4c9ecf6 Compare August 14, 2026 10:58
@SystemKeeper
SystemKeeper marked this pull request as ready for review August 14, 2026 10:58
@SystemKeeper
SystemKeeper requested a review from a team as a code owner August 14, 2026 10:58
@SystemKeeper
SystemKeeper requested review from Altahrim, icewind1991, leftybournes and provokateurin and removed request for a team August 14, 2026 10:58
@SystemKeeper

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@SystemKeeper

Copy link
Copy Markdown
Contributor Author

/backport to stable33

@SystemKeeper

Copy link
Copy Markdown
Contributor Author

/backport to stable32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants