Bug 668276

Summary: dhcp-ldap config load problem
Product: [Fedora] Fedora Reporter: Razvan <justcsdr>
Component: dhcpAssignee: Jiri Popelka <jpopelka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: jpopelka
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: dhcp-4.2.0-18.P2.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-25 16:00:19 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Razvan 2011-01-09 12:21:51 EST
Description of problem:
DHCP LDAP is not loading the configurations. The LDAP_CONFIGURATION is not defined.

Version-Release number of selected component (if applicable):
4.2.0-P2

How reproducible:
Use LDAP for storing configuration and it will fail, every time.

Additional info:
- workaround: in includes/dhcpd.h add
    #ifndef LDAP_CONFIGURATION
    #define LDAP_CONFIGURATION
    #endif
Comment 1 Jiri Popelka 2011-01-10 12:13:51 EST
We are passing -DLDAP_CONFIGURATION to the compiler when compiling dhcp, which is the equivalent of putting #define LDAP_CONFIGURATION at the top of dhcpd.h.
You can see it in build.log (e.g. https://koji.fedoraproject.org/koji/getfile?taskID=2698608&name=build.log)

Had you tried to build and use dhcp with your suggested workaroung ?
Comment 2 Jiri Popelka 2011-01-10 12:43:39 EST
But there's
#if !defined(LDAP_CONFIGURATION)
		c = EOF;
#else /* defined(LDAP_CONFIGURATION) */
		if (cfile->read_function != NULL)
			c = cfile->read_function(cfile);
		else
			c = EOF;
#endif

in common/conflex.c and that file hadn't been compiled with LDAP_CONFIGURATION defined.

Please try this scratch-build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=2712735
Comment 3 Razvan 2011-01-10 13:21:15 EST
That flag isn't passed to the compiler. It should be, but it isn't. 

The workaround is the thing that keeps my server on. I have upgraded from F13
to F14 and the DHCP server refused to start up saying that is missing some
configuration so I've downloaded the sources (yumdownloader --source dhcp) and
diff this sources with the sources from F13. From that diff I've seen this:

-               if (cfile -> read_function) {
-                       c = cfile -> read_function (cfile);
-               } else {
+#if !defined(LDAP_CONFIGURATION)
+               c = EOF;
+#else /* defined(LDAP_CONFIGURATION) */
+               if (cfile->read_function != NULL)
+                       c = cfile->read_function(cfile);
+               else

EOF was the returned code so I've put a fprintf(stderr, "HERE\n") in the #if
!defined(LDAP_CONFIGURATION), which was printed.

This is the short story. The workaround was the quick fix for the problem (I do
have a backup DHCP which is still on F13, but I don't like not to have backup).
Comment 4 Razvan 2011-01-10 14:43:04 EST
Apparently the scratch-build works.
Thank you.
Comment 5 Fedora Update System 2011-01-20 09:34:04 EST
dhcp-4.2.0-18.P2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/dhcp-4.2.0-18.P2.fc14
Comment 6 Fedora Update System 2011-01-20 14:56:15 EST
dhcp-4.2.0-18.P2.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dhcp'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/dhcp-4.2.0-18.P2.fc14
Comment 7 Fedora Update System 2011-01-25 16:00:04 EST
dhcp-4.2.0-18.P2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.