core icon indicating copy to clipboard operation
core copied to clipboard

Editing files shared with LDAP Group hangs browsers

Open cantlep opened this issue 13 years ago • 15 comments

I'm only testing this with 2 users, 2 different browsers (Sharer on Safari, sharee on Chrome) and 1 text file.

Owncloud latest - 5.0.0 MySQL LDAP Users

If I create a text file, I can manipulate it within the Owncloud web interface without issue. i.e. I can edit it, save it, make more edits, re-save it, etc and it's all good.

However, if I share the file with a LDAP Group, it doesn't function so well. I allowed a group edit permissions on the file, they made an update and hit save (As far as the file on the filesystem was concerned, it was updated) but the button in the web interface just hung on "saving" and never completed. After leaving the page and going to the front "Files" page, the page reported (using the yellow information bar) that "you have unsaved edits, click to go back".

After that, the web interface hung for both of us. The browsers both had to be shut down and re-opened.

Please note - Sharing works fine with LDAP users, it seems the issue is Group related only!

cantlep avatar Mar 14 '13 12:03 cantlep

@blizzz

BernhardPosselt avatar Mar 14 '13 13:03 BernhardPosselt

Thanks for the report, I can reproduce it.

blizzz avatar Mar 18 '13 23:03 blizzz

I tracked it down. Seems to be a thingy with files_sharing.

@MTGap: https://github.com/owncloud/core/blob/master/apps/files_sharing/lib/updater.php#L44 will retrieve always the same users, including the uidOwner. I.e. we end up in an infinite loop. Looking for your insights.

blizzz avatar Mar 19 '13 00:03 blizzz

I don't quite see how that is an infinite loop. I'm switching the owner of the shares to the $user in the loop.

It may not be perfect if there is a unique target share for a user in a group or a duplicate user & group share, but I don't see how it's an infinite loop. Is the getUsersItemShared method wrong?

MTGap avatar Mar 19 '13 04:03 MTGap

The file owner is also in the group the file is shared with and will always be retrieved again within $users via the highlighted method. Maybe it's good enough to check w wwhether he is included and kick him out of the array.

Michael Gapczynski [email protected] wrote:

I don't quite see how that is an infinite loop. I'm switching the owner of the shares to the $user in the loop.

It may not be perfect if there is a unique target share for a user in a group or a duplicate user & group share, but I don't see how it's an infinite loop. Is the getUsersItemShared method wrong?


Reply to this email directly or view it on GitHub: https://github.com/owncloud/core/issues/2299#issuecomment-15097148

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

blizzz avatar Mar 19 '13 08:03 blizzz

@MTGap this issue is not related to LDAP, it is a problem with sharing within groups. Try this:

  1. Create: "user1" as member of group "localgroup"
  2. Create: "user2" as member of group "localgroup"
  3. Login as user1
  4. Create an empty file
  5. Click on "Share", share with group "localgroup" You will see that nothing happens. The browser will hang. The server does not send any reply. Happens for me in most recent stable5 branch (without LDAP).

P.S.: Nothing noteworthy is written to the log.

P.P.S.: But this seems to be broken somewhere else..

blizzz avatar Mar 19 '13 11:03 blizzz

Obviously i breaks somewhere in the tiny method getItems in https://github.com/owncloud/core/blob/master/lib/public/share.php#L653 Unfortunately I don't have the time atm to rummage through this, supposely you have a better view of what is going on there. Looks like some infinite loop is triggered there somewhere.

That method is called from https://github.com/owncloud/core/blob/master/lib/public/share.php#L283.

cc/fyi @schiesbn

blizzz avatar Mar 19 '13 11:03 blizzz

I think I remember removing the check for the current user believing it was not necessary. I can't quite remember. Could you try that @blizzz or @schiesbn I'm a little busy?

MTGap avatar Mar 19 '13 14:03 MTGap

ehem, try what exactly?

blizzz avatar Mar 19 '13 17:03 blizzz

Maybe it's good enough to check whether he is included and kick him out of the array.

Add an if inside the foreach to not do anything for the file owner. For both correctFolders and the shareHook.

MTGap avatar Mar 19 '13 17:03 MTGap

Ah. No, currently, with latest stable5, i get the freeze when only sharing a file to a group from a user within a group. The freeze is triggered now somewhere in this method https://github.com/owncloud/core/blob/master/lib/public/share.php#L653 (unlike before when i was able to do this using LDAP users and LDAP groups). I do not know where exactly the freeze is caused, only that it is somewhere in this method. However, I honestly do not understand what is going on there.

blizzz avatar Mar 19 '13 17:03 blizzz

@MTGap update: today (no code changes or whatever, just a reboot inbetween) the behaviour described in https://github.com/owncloud/core/issues/2299#issuecomment-15108848 cannot be reproduced anymore. But the original problem with solely local users and groups.

blizzz avatar Mar 20 '13 10:03 blizzz

@MTGap adding the ifs works for me. But this looks more like a hack than a solution. Why does getUsersItemShared() returns the owner in the first place?

schiessle avatar Mar 20 '13 11:03 schiessle

@blizzz Is this resolved for ldap users/groups?

MTGap avatar Apr 08 '13 00:04 MTGap

@MTGap this was not limited to LDAP users, but to Sharing in general.

At least for me this was fixed.

blizzz avatar Apr 11 '13 14:04 blizzz