Skip to content

Remove share permissions on mount points failure #13306

Closed

Description

I'm working with Owncloud 7.0.4.2

The file lib/private/files/view.php generates the following error when a user without share permissions but with a file or a folder shared with him views his filesystem root.

PHP Undefined variable: content at [...]/lib/private/files/view.php#1030

The error is generated when Owncloud tries to remove share permissions for the file. Looks like a bad copy-paste issue ;)
I would replace this line (view.php, line 1030)
$content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE;
with this one
$rootEntry['permissions'] = $rootEntry['permissions'] & ~\OCP\PERMISSION_SHARE;

It's not such a problem for me because I do not allow resharing, it just fills my log file with errors. However, it could be a problem for other people if some of their users have more rights than expected.

Activity

  1. PVince81 commented on Jan 14, 2015

    @PVince81
    Contributor

    Would you like to send a pull request to contribute this change ?

    CC @schiesbn who added the line

  2. PVince81 commented on Jul 31, 2015

    @PVince81
    Contributor

    I wonder if this is even the correct behavior.
    If I remember well it might not even be necessary to remove the share permission here as it will be masked later.

    Maybe @icewind1991 remembers it?

    Else your fix seems valid.

  3. self-assigned this
    on Aug 7, 2015
  4. PVince81 commented on Aug 7, 2015

    @PVince81
    Contributor

    Steps to reproduce

    1. Create two users "user1" and "user2"
    2. Add "user1" to a new group "group1"
    3. Go to admin page
    4. Enable "disable sharing for groups" and select "group1" for the exclusion
    5. Login as "user2"
    6. Share folder "test" with "user1"
    7. Login as "user1"
    8. Make sure to delete all files like "welcome.txt" and only leave the "test" folder (this is to make sure that $content is not defined)

    Result:

    {"reqId":"q3Kk1SpdkQ+3W9zS9KXe","remoteAddr":"127.0.0.1","app":"PHP","message":"Undefined variable: content at \/srv\/www\/htdocs\/owncloud\/lib\/private\/files\/view.php#1357","level":3,"time":"2015-08-07T13:46:44+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/ajax\/list.php?dir=%2F&sort=name&sortdirection=asc"}
    
  5. PVince81 commented on Aug 7, 2015

    @PVince81
    Contributor

    Fix is here #18124

  6. added this to the milestone on Aug 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions