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

Deleting Calendar Sharing #33216

Closed
georgeoftown opened this issue Oct 18, 2018 · 6 comments · Fixed by #33245
Closed

Deleting Calendar Sharing #33216

georgeoftown opened this issue Oct 18, 2018 · 6 comments · Fixed by #33245
Assignees
Labels

Comments

@georgeoftown
Copy link

Steps to reproduce

  1. Create a Group
  2. Create a Calendar
  3. Share calendar to a group
  4. Update Owncloud (you need to update the dav app as well)

Expected behaviour

Calendar still be shared

MariaDB [ownCloud]> select * from oc_dav_shares;
+----+-------------------------------+----------+--------+------------+-----------+
| id | principaluri                  | type     | access | resourceid | publicuri |
+----+-------------------------------+----------+--------+------------+-----------+
|  2 | principals/users/name.surname | calendar |      2 |      12397 | NULL      |
|  6 | principals/groups/group.prueba     | calendar |      2 |      12398 | NULL      |
+----+-------------------------------+----------+--------+------------+-----------+

Actual behaviour

Delete calendar sharing

MariaDB [ownCloud]> select * from oc_dav_shares;
+----+-------------------------------+----------+--------+------------+-----------+
| id | principaluri                  | type     | access | resourceid | publicuri |
+----+-------------------------------+----------+--------+------------+-----------+
|  2 | principals/users/name.surname | calendar |      2 |      12397 | NULL      |
+----+-------------------------------+----------+--------+------------+-----------+

Server configuration

Operating system:
Debian 9.5
Web server:
Apache/2.4.25
Database:
mysql Ver 15.1 Distrib 10.1.26-MariaDB
PHP version:
PHP 7.0.30-0+deb9u1
ownCloud version: (see ownCloud admin page)
10.0.10
Updated from an older ownCloud or fresh install:
4.5
Where did you install ownCloud from:
Repo
Signing status (ownCloud 9.0 and above):
Disabled

Log of update (second line is problem)

2018-10-17T01:22:23+00:00 Repair step: Remove invalid calendar and addressbook shares
2018-10-17T01:22:23+00:00 Repair info:  ... for principal 'principals/groups/group.prueba'
2018-10-17T01:22:23+00:00 Repair info:  ... for principal 'principals/users/XXX YYYY ZZZZZ'
2018-10-17T01:22:23+00:00 Repair info:  ... for principal 'principals/users/AAA BBBB CCCCCCC DDDD'
2018-10-17T01:22:23+00:00 Repair info:  ... for principal 'principals/users/GGGGG HHHHH IIIIII'
2018-10-17T01:22:23+00:00 Updated <dav> to 0.4.0

Function that causes the problem

file:

$p = $this->principalBackend->getPrincipalByPath($principaluri);

Quick Patch
add new line 81

73     public function run(IOutput $output) {
74         $query = $this->connection->getQueryBuilder();
75         $result = $query->selectDistinct('principaluri')
76             ->from('dav_shares')
77             ->execute();
78
79         while ($row = $result->fetch()) {
80             $principaluri = $row['principaluri'];
81             if (!strncmp($principaluri,"principals/groups",17)) continue;
82             $p = $this->principalBackend->getPrincipalByPath($principaluri);
83             if ($p === null) {
84                 $output->info(" ... for principal '$principaluri'");
85                 $this->deleteSharesForPrincipal($principaluri);
86             }
87         }
88
89         $result->closeCursor();
90     }
@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #165 (Delete or update share calendar ), #27274 (delete), #13813 (User can delete shared calendar), #16877 (Shared calendar can be deleted also by shared user), and #8561 (restoring deleted shares).

@DeepDiver1975
Copy link
Member

Does the group exist?

principals/groups/group.prueba

@georgeoftown
Copy link
Author

Does the group exist?

principals/groups/group.prueba

Yes, the group exist, and the calendar too(before and after), "only" delete the sharing

@DeepDiver1975
Copy link
Member

Here is the fix: #33245

@DeepDiver1975
Copy link
Member

Will Close after backport

DeepDiver1975 added a commit that referenced this issue Nov 6, 2018
…dc9b8213f30c6511ca83

[stable10] fixes #33216 - lookup in group principal backend as well
@DeepDiver1975
Copy link
Member

Issue has been fixed - will be shipped with the next release.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants