summaryrefslogtreecommitdiff
path: root/src/libimcv/imv/imv_policy_manager.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-09-01 17:21:25 +0200
committerYves-Alexis Perez <corsac@corsac.net>2017-09-01 17:21:25 +0200
commit11d6b62db969bdd808d0f56706cb18f113927a31 (patch)
tree8aa7d8fb611c3da6a3523cb78a082f62ffd0dac8 /src/libimcv/imv/imv_policy_manager.c
parentbba25e2ff6c4a193acb54560ea4417537bd2954e (diff)
downloadvyos-strongswan-11d6b62db969bdd808d0f56706cb18f113927a31.tar.gz
vyos-strongswan-11d6b62db969bdd808d0f56706cb18f113927a31.zip
New upstream version 5.6.0
Diffstat (limited to 'src/libimcv/imv/imv_policy_manager.c')
-rw-r--r--src/libimcv/imv/imv_policy_manager.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libimcv/imv/imv_policy_manager.c b/src/libimcv/imv/imv_policy_manager.c
index b730f8c41..1988873e9 100644
--- a/src/libimcv/imv/imv_policy_manager.c
+++ b/src/libimcv/imv/imv_policy_manager.c
@@ -130,6 +130,31 @@ static bool iterate_enforcements(database_t *db, int device_id, int session_id,
case IMV_WORKITEM_DIR_META:
arg_int = dir;
break;
+ case IMV_WORKITEM_SWID_TAGS:
+ /* software [identifier] inventory by default */
+ arg_int = 0;
+
+ /* software identifiers only? */
+ if (device_id && strchr(argument, 'R'))
+ {
+ /* get last EID in order to set earliest EID */
+ e2 = db->query(db,
+ "SELECT eid FROM swid_events where device == ? "
+ "ORDER BY eid DESC", DB_UINT, device_id, DB_INT);
+ if (e2)
+ {
+ if (e2->enumerate(e2, &arg_int))
+ {
+ arg_int++;
+ }
+ else
+ {
+ arg_int = 1;
+ }
+ e2->destroy(e2);
+ }
+ }
+ break;
default:
arg_int = 0;
}