[
https://issues.apache.org/jira/browse/ZOOKEEPER-5124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Kyle Purtell updated ZOOKEEPER-5124:
-------------------------------------------
Description:
On a chrooted handle, the C client would add the chroot to the client path
before it validated the path. The check then ran on the full path only, so a
path that did not start with "/" would be silently accepted. (!) Also,
{{sub_string}} would remove the chroot from server paths by length only rather
than path component boundaries, producing incorrect results.
The fix requires {{prepend_chroot}} return NULL for a NULL, empty, or relative
client path on a chrooted handle. The {{isValidPath}} check of the caller will
then return {{ZBADARGUMENTS}} as expected. `sub_string` should remove the
chroot only on a path component boundary and return other paths unchanged. Sync
config should use {{zoo_awgetconfig}} with a completion.
was:
On a chrooted handle, the C client would add the chroot to the client path
before it validated the path. The check then ran on the full path only, so a
path that did not start with "/" would be silently accepted. (!) Also,
`sub_string` removed the chroot from server paths by length only.
The fix requires `prepend_chroot` return NULL for a NULL, empty, or relative
client
path on a chrooted handle. The `isValidPath` check of the caller will then
return ZBADARGUMENTS as expected. `sub_string` should remove the chroot only on
a path component boundary and return other paths unchanged. Sync config should
use
`zoo_awgetconfig` with a completion.
> (C client) Chroot path validation fails to isolate namespaces
> -------------------------------------------------------------
>
> Key: ZOOKEEPER-5124
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-5124
> Project: ZooKeeper
> Issue Type: Bug
> Components: c client
> Reporter: Andrew Kyle Purtell
> Assignee: Andrew Kyle Purtell
> Priority: Major
>
> On a chrooted handle, the C client would add the chroot to the client path
> before it validated the path. The check then ran on the full path only, so a
> path that did not start with "/" would be silently accepted. (!) Also,
> {{sub_string}} would remove the chroot from server paths by length only
> rather than path component boundaries, producing incorrect results.
> The fix requires {{prepend_chroot}} return NULL for a NULL, empty, or
> relative client path on a chrooted handle. The {{isValidPath}} check of the
> caller will then return {{ZBADARGUMENTS}} as expected. `sub_string` should
> remove the chroot only on a path component boundary and return other paths
> unchanged. Sync config should use {{zoo_awgetconfig}} with a completion.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)