Bug 253069
Summary: | cyclic dependency from getpwnam() in log rotation code | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Directory Server | Reporter: | Ulf Weltman <ulf.weltman> | ||||||
Component: | Directory Server | Assignee: | Noriko Hosoi <nhosoi> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Viktor Ashirov <vashirov> | ||||||
Severity: | low | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 6.21 | CC: | nhosoi, nkinder, rmeggins | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2016-05-06 14:47:05 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 240316 | ||||||||
Attachments: |
|
Description
Ulf Weltman
2007-08-16 20:40:12 UTC
Created attachment 161709 [details]
cvs diff (ldapserver)
Thanks, Ulf, for reporting the problem and the suggestion to fix the bug.
Following your advice, I'm moving the getpwnam to the startup time and
introducing slapdFrontendConfig->config_set_localuser to store the copy of
"struct pw", which is reused unless localuser is reset. If you could review
the diffs, I'd appreciate it.
Fix description:
protect_db.c
-- instead of calling getpwnam, use slapdFrontendConfig->localuserinfo.
main.c
-- set slapdFrontendConfig->localuserinfo if it's NULL.
If getpwnam(localuser) fails, we can capture it here.
log.c
-- instead of calling getpwnam, use slapdFrontendConfig->localuserinfo.
libglobs.c
-- set slapdFrontendConfig->localuserinfo in config_set_localuser, as well.
slap.h
-- added localuserinfo to slapdFrontendConfig_t
Ok, but please add the new member *localuserinfo as the last member of the structure, to minimize binary incompatability. (In reply to comment #2) > Ok, but please add the new member *localuserinfo as the last member of the > structure, to minimize binary incompatability. Thanks, Rich. I've moved locauserinfo to the last of the structure. Index: slap.h =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slap.h,v retrieving revision 1.24 diff -t -w -U2 -r1.24 slap.h --- slap.h 3 Aug 2007 22:14:41 -0000 1.24 +++ slap.h 17 Aug 2007 02:03:43 -0000 @@ -1926,4 +1926,7 @@ char *ldapi_search_base_dn; /* base dn to search for mapped entries */ char *ldapi_auto_dn_suffix; /* suffix to be appended to auto gen DNs */ +#ifndef _WIN32 + struct passwd *localuserinfo; /* userinfo of localuser */ +#endif /* _WIN32 */ } slapdFrontendConfig_t; And there was some mistakes in my comment in comment #1. (sorry.) > I'm moving the getpwnam to the startup time and introducing slapdFrontendConfig->localuserinfo to store the copy of ^^^^^^^^^^^^^ "struct pw", which is reused unless localuser is reset. Created attachment 161711 [details]
cvs commit message
Reviewed by Rich (Thank you!)
Checked in into HEAD.
Wow, thanks for the fast patch!!! It looks good to me. I will apply to our 6.21 branch and spin a patch. You are welcome, Ulf. I've tested the change with verbose printout to the errors log with 1MB error log size limit + rsearch. Verified log lotations were made without any problems. But, I don't have the test env including the DS in name service switch handy... If possible, could you run the test and update us? Thank you in advance!! I have tested with ldap name service configured to point to the same server, and I caused the accept loop to print messages for the specific deadlock scenario. Looks good! Thanks a lot, Ulf! *relieved...* :) Ulf, would you consider this bug to be verified in RHDS 8.0? Yes, looks fixed to me. |