forked from pool/libcmpiutil
Compare commits
24 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 5aaee27f8e | |||
| 474dfd2d20 | |||
| 83ff2790b8 | |||
| 65e39ebe1a | |||
|
|
6587dbb352 | ||
| e5f374ba03 | |||
|
|
64b6ea61f6 | ||
| a89c73e72a | |||
|
|
9223ebd6f0 | ||
|
|
9e574f180e | ||
|
|
6db8d4dc1f | ||
|
|
4bf786dca3 | ||
|
|
4c2aed707b | ||
|
|
720224b534 | ||
|
|
5f4b134b23 | ||
|
|
701ac9a87b | ||
|
|
df233bf40a | ||
|
|
775b481f16 | ||
|
|
ad5579ea9f | ||
|
|
49d83605f0 | ||
|
|
fbf4f5dc68 | ||
|
|
fdd67fb32b | ||
|
|
237f3606fd | ||
|
|
f270da3593 |
@@ -1,149 +0,0 @@
|
|||||||
From e37b8a2831543a6dc82a771160dd270f1e647266 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thilo Boehm <tboehm@linux.vnet.ibm.com>
|
|
||||||
Date: Thu, 8 Aug 2013 15:27:53 +0200
|
|
||||||
Subject: [PATCH 1/3] libcmpiutil: Fix endianness issues in embedded object
|
|
||||||
parsing
|
|
||||||
|
|
||||||
The auxiliary functions _set_int_prop/parse_int_property only
|
|
||||||
worked on little-endian archs as they performed an incorrect
|
|
||||||
reinterpretation of 64bit integers. Fixed by using the proper
|
|
||||||
CMPIValue union fields.
|
|
||||||
|
|
||||||
Signed-off-by: Thilo Boehm <tboehm@linux.vnet.ibm.com>
|
|
||||||
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
|
|
||||||
---
|
|
||||||
eo_parser.c | 35 ++++++++++++++++++++++-------------
|
|
||||||
eo_parser_xml.c | 49 +++++++++++++++++++++++++++++++++++++++----------
|
|
||||||
2 files changed, 61 insertions(+), 23 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/eo_parser.c b/eo_parser.c
|
|
||||||
index 36106fd..4c5b0ee 100644
|
|
||||||
--- a/eo_parser.c
|
|
||||||
+++ b/eo_parser.c
|
|
||||||
@@ -113,31 +113,40 @@ static int _set_int_prop(CMPISint64 value,
|
|
||||||
CMPIInstance *inst)
|
|
||||||
{
|
|
||||||
CMPIStatus s;
|
|
||||||
- uint64_t unsigned_val = 0;
|
|
||||||
- int64_t signed_val = 0;
|
|
||||||
+ CMPIValue val;
|
|
||||||
|
|
||||||
- switch(type) {
|
|
||||||
+ switch (type) {
|
|
||||||
case CMPI_uint64:
|
|
||||||
+ val.uint64 = (uint64_t) value;
|
|
||||||
+ break;
|
|
||||||
case CMPI_uint32:
|
|
||||||
+ val.uint32 = (uint32_t) value;
|
|
||||||
+ break;
|
|
||||||
case CMPI_uint16:
|
|
||||||
+ val.uint16 = (uint16_t) value;
|
|
||||||
+ break;
|
|
||||||
case CMPI_uint8:
|
|
||||||
- unsigned_val = (uint64_t) value;
|
|
||||||
- s = CMSetProperty(inst,
|
|
||||||
- prop,
|
|
||||||
- (CMPIValue *) &(unsigned_val),
|
|
||||||
- type);
|
|
||||||
+ val.uint8 = (uint8_t) value;
|
|
||||||
break;
|
|
||||||
case CMPI_sint64:
|
|
||||||
+ val.sint64 = (int64_t) value;
|
|
||||||
+ break;
|
|
||||||
case CMPI_sint32:
|
|
||||||
+ val.sint32 = (int32_t) value;
|
|
||||||
+ break;
|
|
||||||
case CMPI_sint16:
|
|
||||||
+ val.sint16 = (int16_t) value;
|
|
||||||
+ break;
|
|
||||||
case CMPI_sint8:
|
|
||||||
+ val.sint8 = (int8_t) value;
|
|
||||||
+ break;
|
|
||||||
default:
|
|
||||||
- signed_val = (int64_t) value;
|
|
||||||
- s = CMSetProperty(inst,
|
|
||||||
- prop,
|
|
||||||
- (CMPIValue *) &(signed_val),
|
|
||||||
- type);
|
|
||||||
+ return 0;
|
|
||||||
}
|
|
||||||
+ s = CMSetProperty(inst,
|
|
||||||
+ prop,
|
|
||||||
+ &val,
|
|
||||||
+ type);
|
|
||||||
|
|
||||||
if (s.rc == CMPI_RC_OK)
|
|
||||||
return 1;
|
|
||||||
diff --git a/eo_parser_xml.c b/eo_parser_xml.c
|
|
||||||
index c8b28cc..551a87b 100644
|
|
||||||
--- a/eo_parser_xml.c
|
|
||||||
+++ b/eo_parser_xml.c
|
|
||||||
@@ -90,11 +90,48 @@ static CMPIType parse_int_property(const char *string,
|
|
||||||
if (sign) {
|
|
||||||
int64_t _val;
|
|
||||||
ret = sscanf(string, "%" SCNi64, &_val);
|
|
||||||
- val->sint64 = _val;
|
|
||||||
+ switch (size) {
|
|
||||||
+ case 8:
|
|
||||||
+ t = CMPI_sint8;
|
|
||||||
+ val->sint8 = (int8_t) _val;
|
|
||||||
+ break;
|
|
||||||
+ case 16:
|
|
||||||
+ t = CMPI_sint16;
|
|
||||||
+ val->sint16 = (int16_t) _val;
|
|
||||||
+ break;
|
|
||||||
+ case 32:
|
|
||||||
+ t = CMPI_sint32;
|
|
||||||
+ val->sint32 = (int32_t) _val;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ case 64:
|
|
||||||
+ t = CMPI_sint64;
|
|
||||||
+ val->sint64 = (int64_t) _val;
|
|
||||||
+ break;
|
|
||||||
+ };
|
|
||||||
} else {
|
|
||||||
uint64_t _val;
|
|
||||||
ret = sscanf(string, "%" SCNu64, &_val);
|
|
||||||
- val->uint64 = _val;
|
|
||||||
+ switch (size) {
|
|
||||||
+ case 8:
|
|
||||||
+ t = CMPI_uint8;
|
|
||||||
+ val->uint8 = (uint8_t) _val;
|
|
||||||
+ break;
|
|
||||||
+ case 16:
|
|
||||||
+ t = CMPI_uint16;
|
|
||||||
+ val->uint16 = (uint16_t) _val;
|
|
||||||
+ break;
|
|
||||||
+ case 32:
|
|
||||||
+ t = CMPI_uint32;
|
|
||||||
+ val->uint32 = (uint32_t) _val;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ case 64:
|
|
||||||
+ t = CMPI_uint64;
|
|
||||||
+ val->uint64 = (uint64_t) _val;
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ };
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret != 1) {
|
|
||||||
@@ -102,14 +139,6 @@ static CMPIType parse_int_property(const char *string,
|
|
||||||
return CMPI_null;
|
|
||||||
}
|
|
||||||
|
|
||||||
- switch (size) {
|
|
||||||
- case 8: t = sign ? CMPI_sint8 : CMPI_uint8; break;
|
|
||||||
- case 16: t = sign ? CMPI_sint16 : CMPI_uint16; break;
|
|
||||||
- case 32: t = sign ? CMPI_sint32 : CMPI_uint32; break;
|
|
||||||
- default:
|
|
||||||
- case 64: t = sign ? CMPI_sint64 : CMPI_uint64; break;
|
|
||||||
- };
|
|
||||||
-
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.36.1
|
|
||||||
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
From a645d7de82aba87205ac849e65978edb6614a1d1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
|
|
||||||
Date: Thu, 23 Jun 2022 14:29:39 +0200
|
|
||||||
Subject: [PATCH 2/3] fix ARM build
|
|
||||||
|
|
||||||
---
|
|
||||||
eo_parser_xml.c | 2 +-
|
|
||||||
std_association.c | 4 ++--
|
|
||||||
std_indication.c | 2 +-
|
|
||||||
std_invokemethod.c | 2 +-
|
|
||||||
4 files changed, 5 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/eo_parser_xml.c b/eo_parser_xml.c
|
|
||||||
index 551a87b..4e34db5 100644
|
|
||||||
--- a/eo_parser_xml.c
|
|
||||||
+++ b/eo_parser_xml.c
|
|
||||||
@@ -298,7 +298,7 @@ static bool parse_array_property(const CMPIBroker *broker,
|
|
||||||
type = parse_array(broker, tstr, val_arr, &array);
|
|
||||||
if (type != CMPI_null) {
|
|
||||||
CU_DEBUG("Setting array property");
|
|
||||||
- CMSetProperty(inst, name, &array, (CMPI_ARRAY | type));
|
|
||||||
+ CMSetProperty(inst, name, (void*)&array, (CMPI_ARRAY | type));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/std_association.c b/std_association.c
|
|
||||||
index 9204628..2646722 100644
|
|
||||||
--- a/std_association.c
|
|
||||||
+++ b/std_association.c
|
|
||||||
@@ -38,9 +38,9 @@ void set_reference(struct std_assoc *assoc,
|
|
||||||
const CMPIObjectPath *target)
|
|
||||||
{
|
|
||||||
CMSetProperty(inst, assoc->source_prop,
|
|
||||||
- (CMPIValue *)&source, CMPI_ref);
|
|
||||||
+ (CMPIValue *)(void*)&source, CMPI_ref);
|
|
||||||
CMSetProperty(inst, assoc->target_prop,
|
|
||||||
- (CMPIValue *)&target, CMPI_ref);
|
|
||||||
+ (CMPIValue *)(void*)&target, CMPI_ref);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool match_op(const CMPIBroker *broker,
|
|
||||||
diff --git a/std_indication.c b/std_indication.c
|
|
||||||
index 21df1f5..eb2771e 100644
|
|
||||||
--- a/std_indication.c
|
|
||||||
+++ b/std_indication.c
|
|
||||||
@@ -402,7 +402,7 @@ CMPIStatus stdi_raise_indication(const CMPIBroker *broker,
|
|
||||||
if (s.rc != CMPI_RC_OK)
|
|
||||||
return s;
|
|
||||||
|
|
||||||
- s = CMAddArg(argsin, "TheIndication", &ind, CMPI_instance);
|
|
||||||
+ s = CMAddArg(argsin, "TheIndication", (void*)&ind, CMPI_instance);
|
|
||||||
if (s.rc != CMPI_RC_OK)
|
|
||||||
return s;
|
|
||||||
|
|
||||||
diff --git a/std_invokemethod.c b/std_invokemethod.c
|
|
||||||
index fb40c1d..10a143b 100644
|
|
||||||
--- a/std_invokemethod.c
|
|
||||||
+++ b/std_invokemethod.c
|
|
||||||
@@ -115,7 +115,7 @@ static int parse_eo_array(CMPIArray *strings_in,
|
|
||||||
}
|
|
||||||
|
|
||||||
CMSetArrayElementAt(*instances_out, i,
|
|
||||||
- (CMPIValue *)&inst,
|
|
||||||
+ (CMPIValue *)(void*)&inst,
|
|
||||||
CMPI_instance);
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.36.1
|
|
||||||
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
From 2b5f416924309f0e0e2e719c57cf07a8b4570e2f Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
|
|
||||||
Date: Thu, 23 Jun 2022 15:48:41 +0200
|
|
||||||
Subject: [PATCH 3/3] drop duplicate definition of _FORTIFY_SOURCE
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Signed-off-by: Klaus Kämpf <kkaempf@suse.de>
|
|
||||||
---
|
|
||||||
configure.ac | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 8db336e..1dfdd00 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -26,7 +26,7 @@ CC_WARNINGS="\
|
|
||||||
-Wcast-align \
|
|
||||||
-Wno-unused-value"
|
|
||||||
|
|
||||||
-CFLAGS="$CFLAGS $CC_WARNINGS -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE"
|
|
||||||
+CFLAGS="$CFLAGS $CC_WARNINGS -D_GNU_SOURCE"
|
|
||||||
|
|
||||||
AC_CONFIG_HEADER([config.h])
|
|
||||||
|
|
||||||
--
|
|
||||||
2.36.1
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:fd0d15817f0e09a588276a1892a900d967fd1c0f5bcf1ee3c7be2e41b54fda15
|
|
||||||
size 314691
|
|
||||||
Reference in New Issue
Block a user