omapi-perl

If you are using omapi-perl-0.5.2, you might want to fix a segmentation fault in CORE.xs with the following patch:

Index: CORE.xs
===================================================================
--- CORE.xs     (revision 120)
+++ CORE.xs     (revision 127)
@@ -180,27 +180,27 @@
       }
 
        if (status != ISC_R_SUCCESS) {
-            fprintf (stderr, "Unable to open object (%d)\n", status);
+            fprintf (stderr, "Unable to open object (%s)\n", isc_result_totext (status));
            free (RETVAL);
            RETVAL = NULL;
-        }
-
-        status = dhcpctl_wait_for_completion (*RETVAL, &waitrc);
-        if (status == ISC_R_SUCCESS) {
-            if ((waitrc != ISC_R_SUCCESS) && (waitrc != ISC_R_NOTFOUND)) {
-                fprintf (stderr, "wait returned an error (%s)\n", isc_result_totext (waitrc));
-                free (RETVAL);
-                RETVAL = NULL;
-            } else if ((waitrc == ISC_R_NOTFOUND) && (strncasecmp (flag, "DELETE", 7) != 0)) {
-                // fprintf (stderr, "object not found\n");
-                free (RETVAL);
-                RETVAL = NULL;
-            }
        } else {
-            fprintf (stderr, "Unable to issue a wait (%d)\n", status);
-            free (RETVAL);
-            RETVAL = NULL;
-        }
+           status = dhcpctl_wait_for_completion (*RETVAL, &waitrc);
+           if (status == ISC_R_SUCCESS) {
+               if ((waitrc != ISC_R_SUCCESS) && (waitrc != ISC_R_NOTFOUND)) {
+                   fprintf (stderr, "wait returned an error (%s)\n", isc_result_totext (waitrc));
+                   free (RETVAL);
+                   RETVAL = NULL;
+               } else if ((waitrc == ISC_R_NOTFOUND) && (strncasecmp (flag, "DELETE", 7) != 0)) {
+                   // fprintf (stderr, "object not found\n");
+                   free (RETVAL);
+                   RETVAL = NULL;
+               }
+           } else {
+               fprintf (stderr, "Unable to issue a wait (%s)\n", isc_result_totext (status));
+               free (RETVAL);
+               RETVAL = NULL;
+           }
+       }
 
    OUTPUT: RETVAL
Copyright © 2024 Christof Chen