From: Sebastian Harl Date: Sat, 17 Jan 2015 00:08:06 +0000 (+0100) Subject: frontend/store: Fixed parsing of STORE attribute commands. X-Git-Tag: sysdb-0.7.0~54 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1402704fbf2c5c59db72b37d995c079e3ec7edf9;p=sysdb.git frontend/store: Fixed parsing of STORE attribute commands. In this case, the object type is a bit-wise OR of the parent type and the attribute type. --- diff --git a/src/frontend/store.c b/src/frontend/store.c index 7285b34..cb87ed4 100644 --- a/src/frontend/store.c +++ b/src/frontend/store.c @@ -124,16 +124,15 @@ sdb_fe_store(sdb_conn_t *conn) } return sdb_fe_store_metric(conn, &metric); } - case SDB_ATTRIBUTE: - { - sdb_proto_attribute_t attr; - if (sdb_proto_unmarshal_attribute(buf, len, &attr) < 0) { - sdb_strbuf_sprintf(conn->errbuf, - "STORE: Failed to unmarshal attribute object"); - return -1; - } - return sdb_fe_store_attribute(conn, &attr); + } + if (type & SDB_ATTRIBUTE) { + sdb_proto_attribute_t attr; + if (sdb_proto_unmarshal_attribute(buf, len, &attr) < 0) { + sdb_strbuf_sprintf(conn->errbuf, + "STORE: Failed to unmarshal attribute object"); + return -1; } + return sdb_fe_store_attribute(conn, &attr); } sdb_log(SDB_LOG_ERR, "frontend: Invalid object type %d for "