Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Jul 23, 2025

Summary

We need to save the previous state - here the password - so that if the update fails we can revert the shown state.
This happens e.g. if you have the password policy app and try to add an insecure password.

To reproduce (with password policy):

  1. Create new link share
  2. enable password protection
  3. use insecure password like 1234
  4. save share

Now you see that the update failed, but the password protection is still enabled. This happened because password and newPassword were misused. password was already set when newPassword was not saved so we could not know to what we need to reset when the update failed.

Checklist

@susnux susnux added this to the Nextcloud 32 milestone Jul 23, 2025
@susnux susnux requested a review from a team as a code owner July 23, 2025 11:00
@susnux susnux added the bug label Jul 23, 2025
@susnux susnux removed the request for review from a team July 23, 2025 11:00
@susnux susnux added the 3. to review Waiting for reviews label Jul 23, 2025
@susnux susnux requested review from artonge, skjnldsv and szaimen July 23, 2025 11:00
@susnux
Copy link
Contributor Author

susnux commented Jul 23, 2025

/backport to stable31

@susnux
Copy link
Contributor Author

susnux commented Jul 23, 2025

/backport to stable30

@susnux susnux requested review from leftybournes and nfebe and removed request for artonge July 23, 2025 11:01
@susnux susnux force-pushed the fix/sharing-restore-on-failure branch from 3dcfc18 to a0ffce8 Compare July 23, 2025 11:56
@susnux
Copy link
Contributor Author

susnux commented Jul 23, 2025

/compile

Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code make sense, did not test though

@nextcloud-command nextcloud-command requested a review from a team as a code owner July 23, 2025 12:03
susnux and others added 2 commits July 23, 2025 17:07
We need to save the previous state - here the password - so that if the
update fails we can revert the shown state.
This happens e.g. if you have the password policy app and try to add an
unsecure password.

To reproduce (with password policy):
1. Create new link share
2. enable password protection
3. use insecure password like `1234`
4. save share

Now you see that the update failed, but the password protection is still
enabled. This happened because `password` and `newPassword` were
misused. `password` was already set when `newPassword` was not saved so
we could not know to what we need to reset when the update failed.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@susnux susnux force-pushed the fix/sharing-restore-on-failure branch from cfbdd96 to 1fbce91 Compare July 23, 2025 15:07
@susnux susnux merged commit 0d07542 into master Jul 23, 2025
132 of 135 checks passed
@susnux susnux deleted the fix/sharing-restore-on-failure branch July 23, 2025 16:30
@skjnldsv skjnldsv mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants