[
https://issues.apache.org/jira/browse/SLING-2211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100315#comment-13100315
]
Felix Meschberger commented on SLING-2211:
------------------------------------------
My take is to prevent this by checking that source and dest are not parent of
one another -- aka that the trees are disjoint.
Using the Workspace.copy method has the problem, that everything must be
persistet, while we try to persist at a single place (at the end).
> Potential infinite loop in the :copy operation of the POST servlet
> ------------------------------------------------------------------
>
> Key: SLING-2211
> URL: https://issues.apache.org/jira/browse/SLING-2211
> Project: Sling
> Issue Type: Bug
> Components: Servlets
> Affects Versions: Servlets Post 2.0.2, Servlets Post 2.0.4, Servlets Post
> 2.1.0
> Reporter: Jukka Zitting
>
> The following puts Sling into a loop that will only end when an
> OutOfMemoryError is caused by a too large transient space:
> $ curl -u admin:admin -F x=y http://localhost:8080/foo
> $ curl -u admin:admin -F :operation=copy -F :dest=/foo/bar
> http://localhost:8080/foo
> The solution would be to either fail early with such recursive copies or to
> use the JCR Workspace.copy() operation or a similar mechanism that copies
> only previously persisted content, so that the recursion within the transient
> space is avoided.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira