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

Copying a folder into a sub-folder of itself creates a never ending copy of folder #4098

Closed
SagarGi opened this issue Jul 5, 2022 · 3 comments
Labels

Comments

@SagarGi
Copy link
Member

SagarGi commented Jul 5, 2022

Description

When we copy a folder into a sub-folder of itself with a COPY request, then the folder is copied into the sub-folder of itself creating a never ending copy of the folder. This is possible in case of a API request while with webUI it is not possible to copy a folder into a sub-folder of itself.

Steps to reproduce

  1. create a user user1
  2. create folder PARENT
  3. create folder CHILD inside PARENT
  4. copy the PARENT folder inside CHILD folder

Curl command to copy folder into subfolder of itself

curl -ks -uuser1:123456 -XCOPY -H "DESTINATION: https://host.docker.internal:9200/remote.php/webdav/PARENT/CHILD/PARENT"  https://host.docker.internal:9200/remote.php/webdav/PARENT -v | xmllint --format -\n

Expected behavior (on OC10)

Response on old webdav
Libxml project home page: http://xmlsoft.org/
To report bugs or get some help check: http://xmlsoft.org/bugs.html
*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to host.docker.internal (127.0.0.1) port 8080 (#0)
* Server auth using Basic with user 'user1'
> COPY /remote.php/webdav/PARENT HTTP/1.1
> Host: host.docker.internal:8080
> Authorization: Basic dXNlcjE6MTIzNDU2
> User-Agent: curl/7.68.0
> Accept: */*
> DESTINATION: http://host.docker.internal:8080/remote.php/webdav/PARENT/CHILD/PARENT
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 409 Conflict
< Date: Tue, 05 Jul 2022 08:42:06 GMT
< Server: Apache
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 0
< X-Robots-Tag: none
< X-Frame-Options: SAMEORIGIN
< X-Download-Options: noopen
< X-Permitted-Cross-Domain-Policies: none
< Set-Cookie: oc6mnl3hgxc8=7b3f0knnf5ia1blc23r5i93hrv; path=/; HttpOnly; SameSite=Strict
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Set-Cookie: oc_sessionPassphrase=83HXFPyZ752cLVHl%2FvpxzGZaI0BbQyb0iO7DWhqktkTSK9PPTymQzJcYIvNyUAwCrxXRwbfnXGsEqwZZmG8hcWAnN%2BRakHhI%2FE%2F2mmQDsbD8GYx%2BnJYzXnQMOhIy0PPK; path=/; HttpOnly; SameSite=Strict
< Content-Security-Policy: default-src 'none';
< Set-Cookie: oc6mnl3hgxc8=j6a6p0hosi2nhnbc5c48o76j2p; path=/; HttpOnly; SameSite=Strict
< Set-Cookie: cookie_test=test; expires=Tue, 05-Jul-2022 09:42:06 GMT; Max-Age=3600
< Content-Length: 263
< Content-Type: application/xml; charset=utf-8
< 
{ [263 bytes data]
* Connection #0 to host host.docker.internal left intact
(23) Failed writing body


Actual behavior (On OCIS)

This is the screenshot of behavior with old webdav when the COPY request is terminated.

Screenshot from 2022-07-05 14-23-08

NOTE

The above behavior is seen on the ocis for all old, new and spaces webdav

curl command for new webdav:

curl -ks -uuser1:123456 -XCOPY -H "DESTINATION: https://host.docker.internal:9200/remote.php/dav/files/user1/PARENT/CHILD/PARENT"  https://host.docker.internal:9200/remote.php/dav/files/user1/PARENT -v | xmllint --format -\n

curl command for spaces webdav:

curl -ks -uuser1:123456 -XCOPY -H "https://host.docker.internal:9200/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$f51af613-b2ab-4788-8fe4-c470819a311d/PARENT/CHILD/PARENT" https://host.docker.internal:9200/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$f51af613-b2ab-4788-8fe4-c470819a311d/PARENT -v | xmllint --format -\n

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OC10_VERSION = latest docker pull
OCIS_VERSION= latest docker pull

@phil-davis
Copy link
Contributor

@SagarGi is this the same sort of thing as issue #3992 ?
And #3023

And maybe it will be fixed by cs3org/reva#3009 when it is pulled into oCIS?

@SagarGi
Copy link
Member Author

SagarGi commented Jul 5, 2022

@phil-davis yes its same like the above issue you mentioned. I found out during adding the COPY scenarios. If it is to be fixed then we can remove this issue as it is already been created.

@SagarGi
Copy link
Member Author

SagarGi commented Jul 15, 2022

@SagarGi is this the same sort of thing as issue #3992 ? And #3023

And maybe it will be fixed by cs3org/reva#3009 when it is pulled into oCIS?

Tested locally and in CI and is passing. So closing this issuse.

@SagarGi SagarGi closed this as completed Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants