Skip to content

Read-only share permissions should not include 'W' #16492

Closed

Description

@ckamm

From client bug owncloud/client#3244.

Steps to reproduce

  1. Share a file FOO as re-sharable but read-only with another user u2.

  2. Check the file permissions as u2 with

    curl -u u2:PWD -X PROPFIND 'http://SERVERremote.php/webdav/FOO' | grep -o 'permissions.*perm'

Expected behaviour

The permissions should be SR or SRDNV, definitely not include W.

Actual behaviour

The permissions are SRDNVW.

Server configuration

Operating system: ubuntu 14.04
Web server: nginx
Database: sqlite
PHP version: 5.5.9-1ubuntu4.9

ownCloud version: Tested with 8.0.2.0 and 8.0.3.4

Updated from an older ownCloud or fresh install: updated

List of activated apps:
Activity 1.2.0
Deleted files 0.6.2
First Run Wizard 1.1
Mail Template Editor 0.1
PDF Viewer 0.7
Pictures 0.6.0
Share Files 0.6.1
Text Editor 0.4
Updater 0.4
Versions 1.0.5
Video Viewer 0.1.3

Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: no

Activity

  1. PVince81 commented on May 21, 2015

    @PVince81
    Contributor

    Tested the following:

    1. Login as "root" (the admin user)
    2. Create a user "user1"
    3. Login as "user1"
    4. Create a file "file.txt" with some contents
    5. Share "file.txt" with "root" and uncheck "can edit"
    6. Create a folder "folder"
    7. Share "folder" with "root" and uncheck "can edit"
    8. On the CLI:
      % curl -X PROPFIND -H "Content-Type: text/xml" --data-binary "@propfind.txt" http://root:admin@localhost/owncloud/remote.php/webdav/file.txt | xmllint --format -
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   738  100   507  100   231   2162    985 --:--:-- --:--:-- --:--:--  2157
    <?xml version="1.0" encoding="utf-8"?>
    <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
      <d:response>
        <d:href>/owncloud/remote.php/webdav/file.txt</d:href>
        <d:propstat>
          <d:prop>
            <oc:id>00000016ocdpnglx0uwt</oc:id>
            <oc:permissions>SRDNV</oc:permissions>
            <d:getlastmodified>Thu, 21 May 2015 09:26:57 GMT</d:getlastmodified>
            <d:getetag>"0939690575ae8a910274191ef2b9f131"</d:getetag>
          </d:prop>
          <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
      </d:response>
    </d:multistatus>
    
    1. Same with "folder":
      % curl -X PROPFIND -H "Content-Type: text/xml" --data-binary "@propfind.txt" http://root:admin@localhost/owncloud/remote.php/webdav/folder | xmllint --format -
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   718  100   487  100   231   1921    911 --:--:-- --:--:-- --:--:--  1924
    <?xml version="1.0" encoding="utf-8"?>
    <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
      <d:response>
        <d:href>/owncloud/remote.php/webdav/folder/</d:href>
        <d:propstat>
          <d:prop>
            <oc:id>00000017ocdpnglx0uwt</oc:id>
            <oc:permissions>SRDNV</oc:permissions>
            <d:getlastmodified>Thu, 21 May 2015 09:27:07 GMT</d:getlastmodified>
            <d:getetag>"555da4eba70e8"</d:getetag>
          </d:prop>
          <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
      </d:response>
    </d:multistatus>
    

    (the propfind.txt contains oc:permissions, as it is not the default any more).

    This is on 8.1 / master (896130b)

    Next up: check 8.0.3

  2. PVince81 commented on May 21, 2015

    @PVince81
    Contributor

    Aha, on 8.0.3 the folder has no "W" permission, but the file has a "W".

    This is indeed a bug.

    How bad does this mess up the client ? (to evaluate severity)

  3. PVince81 commented on May 21, 2015

    @PVince81
    Contributor

    Also broken on 7.0.5.

  4. added this to the milestone on May 21, 2015
  5. PVince81 commented on May 21, 2015

    @PVince81
    Contributor

    Well, as it is fixed on 8.1, we need to decide whether to backport @karlitschek
    But first need to find what piece of code fixed that issue.

  6. karlitschek commented on May 21, 2015

    @karlitschek
    Contributor

    I think we should definitely back port this. 👍

  7. PVince81 commented on May 21, 2015

    @PVince81
    Contributor

    Ok, I'll try and find the piece of code that fixes it in 8.1.

  8. self-assigned this
    on May 21, 2015
  9. PVince81 commented on May 21, 2015

    @PVince81
    Contributor

    Here it is: #15063

    I'll prepare a backport PR for stable8.

  10. PVince81 commented on May 21, 2015

    @PVince81
    Contributor

    Backport PR is here: #16496

  11. modified the milestones: , on May 26, 2015
  12. schiessle commented on May 28, 2015

    @schiessle
    Contributor

    backport was merged. #16496

  13. locked as resolved and limited conversation to collaborators on Aug 11, 2019
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