Repository navigation
Conversation
|
AI-assisted review on behalf of @anmolnar Thanks for this. I traced the three fixes against
I did not build or run the tests. A few points, none blocking:
|
…espaces On a chrooted handle, the C client added the chroot to the client path before it validated the path. The check then incorrectly considered the full path, so a path that did not start with "/" would be silently accepted. Also, sub_string removed the chroot from server paths by length only rather than at path component boundaries. prepend_chroot now returns NULL for a NULL, empty, or relative client path on a chrooted handle. The isValidPath check of the caller then returns ZBADARGUMENTS, as on a plain handle. sub_string removes the chroot path only on a path component boundary and returns other paths unchanged. Sync config reads now use zoo_awgetconfig with a completion to standardize handling on one path. New tests in Zookeeper_simpleSystem: testChrootPathValidation, testChrootGetConfig, and testChrootServerPathMapping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndle Address review feedback: - Read the config with zoo_agetconfig in testChrootGetConfig, and check that the result matches the sync read. - Add TestReconfigServer::testChrootConfigWatch. It sets a config watch on a chrooted handle, runs a reconfig, and checks the event type and path. It also checks that the client logs no chroot path error. - Return ZSYSTEMERROR when prepend_chroot fails to allocate. - Share one helper between zoo_wget and zoo_wgetconfig. - Document the /zookeeper chroot case in sub_string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6f1d0c9 to
9637431
Compare
|
Reply from Claude Code (an AI assistant), on behalf of @apurtell. @anmolnar Thanks for the review. Addressed in 9637431:
All C client tests pass on Linux with OpenSSL 3.2+, when #2510 is applied for the test certificates. |
On a chrooted handle, the C client added the chroot to the client path before it validated the path. The check then incorrectly considered the full path, so a path that did not start with "/" would be silently accepted. Also,
sub_stringremoved the chroot from server paths by length only rather than at path component boundaries.prepend_chrootnow returns NULL for a NULL, empty, or relative client path on a chrooted handle. The caller then returnsZBADARGUMENTS, as on a plain handle, orZSYSTEMERRORif the allocation failed.sub_stringremoves the chroot path only on a path component boundary and returns other paths unchanged. Sync config reads now usezoo_awgetconfigwith a completion to standardize handling on one path.On a chrooted handle, a sequential create of
/used to create a sibling of the chroot node. It now creates a child of the chroot node.New tests in
Zookeeper_simpleSystem:testChrootPathValidation,testChrootGetConfig, andtestChrootServerPathMapping. New testTestReconfigServer::testChrootConfigWatchchecks a config watch event on a chrooted handle after a reconfig.