openhpi2 / Open-HPI-base

Open HPI is an open source implementation of the SA Forum's Hardware Platform Interface (HPI). HPI provides an abstracted interface to managing computer hardware, typically for chassis and rack based servers
0 stars 1 forks source link

disable MD5 in net-snmp will trigger a compile error in openhpi #2605

Closed openhpi2 closed 8 years ago

openhpi2 commented 9 years ago

After disabling MD5 in net-snmp (--disable-md5) we were unable to compile openhpi anymore.

This is because openhpi has no conditional inclusion for this net-snmp functions. The attached patch adds this "#ifndef DISABLE_MD5" condition that gets triggerd via the net-snmp includes.

Reported by: abergmann101

openhpi2 commented 9 years ago

Looks like "#ifndef NETSNMP_DISABLE_MD5" is needed instead of "#ifndef DISABLE_MD5" as that is in the patch uploaded in couple of places. Please confirm.

Original comment by: dr_mohan

openhpi2 commented 9 years ago

There is a "# define DISABLEMD5 NETSNMPDISABLEMD5" in net-snmp that gets triggered via "#ifdef NETSNMPDISABLEMD5". So we can use either NETSNMP_DISABLE_MD5 or DISABLE_MD5 here.

Original comment by: abergmann101

openhpi2 commented 9 years ago

Alexander: you could have just copied my patch from the sle12 update :p

attached my patch for completeness.

Original comment by: darix

openhpi2 commented 8 years ago

When there is no authtype is defined in config file authtype is NULL so !authtype succeeds and the MD5 code is entered as !g_ascii_strncasecmp(authtype, "MD5", sizeof("MD5") is not needed. So the default is MD5

if authtype is defined in openhpi.conf file, it enters the appropriate one MD5, SHA or undefined.

In case MD5 is disabled, new default needs to be SHA. Also if someone specifies MD5 as archtype when MD5 is disabled then we need to give an error with enough information for the user.

I am not a snmp_bc plugin guy. Need to send a mail to the blade center folks to review the patch. Hope some one from snmp_bc who will come forward to review the patch. Could you please review the new patch?

Original comment by: dr_mohan

openhpi2 commented 8 years ago

Alexander / Darix,

Could you please review and test my patch in your environment and see if it fixes your compile problem? We could go ahead and checkin if it works ok. I did not hear from snmp_bc plugin experts.

Thanks Mohan

Original comment by: dr_mohan

openhpi2 commented 8 years ago

Hi Mohan,

I've reviewed your patch and tested it in our build environment. Everything looks fine from my side. https://build.opensuse.org/package/show/home:abergmann:branches:systemsmanagement/openhpi

Thanks, Alex~

Original comment by: abergmann101

openhpi2 commented 8 years ago

Original comment by: dr_mohan

openhpi2 commented 8 years ago

Fixed with checkin #7670

Original comment by: dr_mohan