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

cannot move/rename an accepted shared resource outside of shares folder #2141

Closed
kiranparajuli589 opened this issue Jun 9, 2021 · 7 comments

Comments

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Jun 9, 2021

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce

Steps to reproduce the behavior:

  1. create two users uu1 and uu2
  2. share a file lorem.txt with uu2 using uu1 with edit permission
  3. accept the incoming share for uu2
  4. move the /Shares/lorem.txt to /Shares/lorem-renamed.txt
    Request is successful
    
  5. move the file /Shares/lorem-renamed.txt to /lorem.txt

Expected behavior

FIles move should be successful with HTTP status 201

close the issue if this is not the expected behavior for ocis

Actual behavior

MOVE request fails with status 400 and no content
Screenshot from 2021-06-09 12-48-31

```console curl -k -u uu2:uu2 -X MOVE https://localhost:9200/remote.php/webdav/Shares/SharedPostMAN.feature -H 'Destination: https://localhost:9200/remote.php/webdav/SharedPostMAN.feature' -v * Trying 127.0.0.1:9200... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 9200 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): * TLSv1.3 (IN), TLS handshake, Certificate (11): * TLSv1.3 (IN), TLS handshake, CERT verify (15): * TLSv1.3 (IN), TLS handshake, Finished (20): * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.3 (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 * ALPN, server did not agree to a protocol * Server certificate: * subject: O=Acme Corp; CN=OCIS * start date: Jun 4 12:31:40 2021 GMT * expire date: Jun 4 12:31:40 2022 GMT * issuer: O=Acme Corp; CN=OCIS * SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway. * Server auth using Basic with user 'uu2' > MOVE /remote.php/webdav/Shares/SharedPostMAN.feature HTTP/1.1 > Host: localhost:9200 > Authorization: Basic dXUyOnV1Mg== > User-Agent: curl/7.68.0 > Accept: */* > Destination: https://localhost:9200/remote.php/webdav/SharedPostMAN.feature > * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * Mark bundle as not supporting multiuse < HTTP/1.1 400 Bad Request < Access-Control-Allow-Origin: * < Content-Length: 0 < Content-Security-Policy: default-src 'none'; < Date: Wed, 09 Jun 2021 07:10:59 GMT < Vary: Origin < X-Content-Type-Options: nosniff < X-Download-Options: noopen < X-Frame-Options: SAMEORIGIN < X-Permitted-Cross-Domain-Policies: none < X-Robots-Tag: none < X-Xss-Protection: 1; mode=block < ```

Setup

export OCIS_URL=https://localhost:9200                     6s   12:42:27
export STORAGE_HOME_DRIVER=ocis                         
export STORAGE_USERS_DRIVER=ocis
export STORAGE_DRIVER_OCIS_ROOT=/tmp/ocis/storage/users
export STORAGE_DRIVER_LOCAL_ROOT=/tmp/ocis/local/root
export STORAGE_METADATA_ROOT=/tmp/ocis/metadata
export STORAGE_DRIVER_OWNCLOUD_DATADIR=/tmp/ocis/owncloud/data
export STORAGE_HOME_DATA_SERVER_URL=http://localhost:9155/data
export STORAGE_USERS_DATA_SERVER_URL=http://localhost:9158/data
export STORAGE_SHARING_USER_JSON_FILE=/tmp/ocis/shares.json
export PROXY_ENABLE_BASIC_AUTH=true
export WEB_UI_CONFIG=$HOME/www/ocConfigs/config.json
export IDP_IDENTIFIER_REGISTRATION_CONF=$HOME/www/ocConfigs/idp.yml
export OCIS_LOG_LEVEL=error
export SETTINGS_DATA_PATH=/tmp/ocis/settings

curl -k -u admin:admin https://localhost:9200/status.php | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   197  100   197    0     0  13133      0 --:--:-- --:--:-- --:--:-- 13133
{
  "installed": true,
  "maintenance": false,
  "needsDbUpgrade": false,
  "version": "10.0.9.5",
  "versionstring": "10.0.9",
  "edition": "community",
  "productname": "ownCloud"
}

Additional context

Relates issue is covered in test here

@dpakach
Copy link
Contributor

dpakach commented Jun 9, 2021

The problem is not with moving outside but move in general IMO
Using the UI I cannot even rename a shared file

@dpakach
Copy link
Contributor

dpakach commented Jun 9, 2021

also Related #2146

@dpakach dpakach changed the title cannot move an accepted shared resouce outside of shares folder cannot move/rename an accepted shared resouce outside of shares folder Jun 9, 2021
@kiranparajuli589
Copy link
Contributor Author

kiranparajuli589 commented Jun 10, 2021

@dpakach renaming the shared file inside the shared folder is possible if only the sharee has edit permission.

@kiranparajuli589
Copy link
Contributor Author

kiranparajuli589 commented Jun 10, 2021

update:

  • renaming shared file for sharee inside shares folder is only possible for ocis started with ocis storage driver
  • renaming does not work with owcloud storage driver

@phil-davis phil-davis changed the title cannot move/rename an accepted shared resouce outside of shares folder cannot move/rename an accepted shared resource outside of shares folder Jun 10, 2021
@pmaier1
Copy link
Contributor

pmaier1 commented Aug 11, 2021

This is expected behavior in oCIS (difference to how oC 10 handles the case). Please adjust the tests and remove from expected failures.

@phil-davis
Copy link
Contributor

Some of the test adjustments may have already been done. @dpakach please get someone to have a look - I remember that we recently looked at this related to other issues/discussions.

@phil-davis
Copy link
Contributor

Tests have been adjusted/skipped as appropriate. The defined-correct behavior on oCIS is that received shares are "jailed" inside the "Shares" folder and cannot be moved outside the "Shares" folder.

Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants