summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2016-07-10 13:16:53 -0500
committerAdriana Kobylak <anoo@us.ibm.com>2016-07-10 13:22:10 -0500
commit87e080b537aff3fd22ec56ef72660937bed38422 (patch)
tree94b480faa7b36be1f5c75bd85bb812362cdf63da
parentf75b87815d28cc5368d00a0c2d612158399822cc (diff)
downloadphosphor-host-ipmid-87e080b537aff3fd22ec56ef72660937bed38422.tar.gz
phosphor-host-ipmid-87e080b537aff3fd22ec56ef72660937bed38422.zip
Add support to load versioned libraries
Linux libraries, including the ipmi plugins, can be versioned, with suffix .so.* Add support in ipmid to find and load versioned libraries. There seems to not be an issue if ipmid loads the same library twice (a non-versioned and versioned) as with the cases where a symlink .so points to a .so.* library. Change-Id: I96d73e90dfec01c1a830dab4e6c20797b6130528 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--ipmid.C10
-rw-r--r--ipmid.H4
2 files changed, 11 insertions, 3 deletions
diff --git a/ipmid.C b/ipmid.C
index 374ede2..960f5dc 100644
--- a/ipmid.C
+++ b/ipmid.C
@@ -305,8 +305,14 @@ int handler_select(const struct dirent *entry)
char dname_copy[4] = {0};
// We want to avoid checking for everything and isolate to the ones having
- // .so in them.
- if(strstr(entry->d_name, IPMI_PLUGIN_EXTN))
+ // .so.* or .so in them.
+ // Check for versioned libraries .so.*
+ if(strstr(entry->d_name, IPMI_PLUGIN_SONAME_EXTN))
+ {
+ return 1;
+ }
+ // Check for non versioned libraries .so
+ else if(strstr(entry->d_name, IPMI_PLUGIN_EXTN))
{
// It is possible that .so could be anywhere in the string but unlikely
// But being careful here. Get the base address of the string, move
diff --git a/ipmid.H b/ipmid.H
index 679392d..f465072 100644
--- a/ipmid.H
+++ b/ipmid.H
@@ -12,6 +12,8 @@ ipmi_ret_t ipmi_netfn_router(const ipmi_netfn_t, const ipmi_cmd_t, ipmi_request_
// Plugin libraries need to _end_ with .so
#define IPMI_PLUGIN_EXTN ".so"
+// Plugin libraries can be versioned with suffix .so.*
+#define IPMI_PLUGIN_SONAME_EXTN ".so."
// The BT FIFO in the AST2400 can only handle 64 bytes.
// Can only allow 63 because the BT interface still
@@ -22,4 +24,4 @@ extern FILE *ipmiio, *ipmidbus, *ipmicmddetails;
int set_sensor_dbus_state_s(uint8_t , const char *, const char *);
int set_sensor_dbus_state_y(uint8_t , const char *, const uint8_t);
-#endif \ No newline at end of file
+#endif
OpenPOWER on IntegriCloud