Bug Description: Using ldapi, if the length of the socket file path exceeds 46 bytes it triggers a buffer overflow while reseting a connection. Reset happens at open/close/error.
Fix Description: Use a buffer sized for MAXPATHLEN
https://pagure.io/389-ds-base/issue/50581
Reviewed by: ?
Platforms tested: F30 (thanks Viktor)
Flag Day: no
Doc impact: no
This formatting looks weird?
How big is maxpathlen?
Thanks @firstyear for the review. formatting is indeed weird, side effect of my editor. I will fix this. MAXPATHLEN (via params.h) is a define for PATH_MAX /usr/include/linux/limits.h, it is 4096 bytes.
rebased onto c6a828c1abe7b11c0fc09812536d7db49e8a7e2d
LGTM
Great, seems okay to me then. Ack.
rebased onto f1a425fbb2c111359bc86367401f3a1869bfb42d
This function should be a part of a fixture. It won't work as a finalizer for the test function.
I'd rather use existing lib389 modules for that. You can get it like this:
inst = DirSrv(verbose=True, external_log=log) dse_ldif = DSEldif(inst, serverid="test_longname_deadbeef_deadbeef_deadbeef_deadbeef_deadbeef") socket_path = dse_ldif.get("cn=config", "nsslapd-ldapifilepath") inst.local_simple_allocate( serverid="test_longname_deadbeef_deadbeef_deadbeef_deadbeef_deadbeef", ldapuri=f"ldapi://{socket_path[0].replace('/', '%2f')}", password="someLongPassword_123" ) inst.ldapi_enabled = 'on' inst.ldapi_socket = socket_path inst.ldapi_autobind = 'off' inst.open()
Feel free to change hardcoded values to variables.
A search to RootDSE can be done through existing DSLdapObject:
root_dse = RootDSE(dscreate_ldapi_instance) print(root_dse.get_supported_ctrls())
Please, note, that you need this fix for my proposal to work: https://pagure.io/389-ds-base/pull-request/50587
The PR above was merged. I need to do upstream builds, but we need this fix merged first. Is this ready now?
rebased onto f1f9932e40f0be7af1011f3be6f861e9a6edbee5
The rebase is from a change proposed by @spichugi . It works like a charm but still have a minor issue that the fixture finalizer is not systematically called (for example when the server crash).
rebased onto 64f2760307902270f1955994e9667f63ba3d7686
The purpose of this last patch is to allow fixture finalizer to be called during a DS crash during fixture run.
Probably, makes sense to put test_longname_deadbeef_deadbeef_deadbeef_deadbeef_deadbeef into some variable and then reuse it
test_longname_deadbeef_deadbeef_deadbeef_deadbeef_deadbeef
Can be log.info instead of the print. (I sent it like this only for a faster example of what I had in mind)
log.info
print
Besides these two minor issues, you have my ack! Thanks!
rebased onto 4c5a4316b7933e9d65639430044ecdf325ef995a
Pull-Request has been merged by tbordaz
389-ds-base is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in 389-ds-base's github repository.
This pull request has been cloned to Github as issue and is available here: - https://github.com/389ds/389-ds-base/issues/3638
If you want to continue to work on the PR, please navigate to the github issue, download the patch from the attachments and file a new pull request.
Thank you for understanding. We apologize for all inconvenience.
Pull-Request has been closed by spichugi
Bug Description:
Using ldapi, if the length of the socket file path exceeds
46 bytes it triggers a buffer overflow while reseting a connection.
Reset happens at open/close/error.
Fix Description:
Use a buffer sized for MAXPATHLEN
https://pagure.io/389-ds-base/issue/50581
Reviewed by: ?
Platforms tested: F30 (thanks Viktor)
Flag Day: no
Doc impact: no