Make SWID directory where tags are stored configurable

This commit is contained in:
Andreas Steffen
2013-09-05 12:25:02 +02:00
parent 9b8137fdd3
commit ae32172619
5 changed files with 14 additions and 7 deletions
+3
View File
@@ -970,6 +970,9 @@ Send open listening ports without being prompted
.BR libimcv.plugins.imv-scanner.remediation_uri .BR libimcv.plugins.imv-scanner.remediation_uri
URI pointing to scanner remediation instructions URI pointing to scanner remediation instructions
.TP .TP
.BR libimcv.plugins.imc-swid.swid_directory "[$(prefix)/share]"
Directory where SWID tags are located
.TP
.BR libimcv.plugins.imc-test.additional_ids " [0]" .BR libimcv.plugins.imc-test.additional_ids " [0]"
Number of additional IMC IDs Number of additional IMC IDs
.TP .TP
+2 -1
View File
@@ -21,7 +21,8 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \ -I$(top_srcdir)/src/libstrongswan \
-I$(top_srcdir)/src/libtncif \ -I$(top_srcdir)/src/libtncif \
-I$(top_srcdir)/src/libimcv \ -I$(top_srcdir)/src/libimcv \
-I$(top_srcdir)/src/libpts -I$(top_srcdir)/src/libpts \
-DSWID_DIRECTORY=\"${prefix}/share\"
AM_CFLAGS = \ AM_CFLAGS = \
-rdynamic -rdynamic
+5 -1
View File
@@ -155,6 +155,7 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
u_int8_t flags; u_int8_t flags;
u_int32_t request_id, eid_epoch; u_int32_t request_id, eid_epoch;
swid_inventory_t *swid_inventory; swid_inventory_t *swid_inventory;
char *swid_directory;
bool full_tags; bool full_tags;
type = attr->get_type(attr); type = attr->get_type(attr);
@@ -178,8 +179,11 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
} }
full_tags = (flags & TCG_SWID_ATTR_REQ_FLAG_R) == 0; full_tags = (flags & TCG_SWID_ATTR_REQ_FLAG_R) == 0;
swid_directory = lib->settings->get_str(lib->settings,
"libimcv.plugins.imc-swid.swid_directory",
SWID_DIRECTORY);
swid_inventory = swid_inventory_create(full_tags); swid_inventory = swid_inventory_create(full_tags);
if (!swid_inventory->collect(swid_inventory)) if (!swid_inventory->collect(swid_inventory, swid_directory))
{ {
swid_inventory->destroy(swid_inventory); swid_inventory->destroy(swid_inventory);
attr = swid_error_create(TCG_SWID_ERROR, request_id, attr = swid_error_create(TCG_SWID_ERROR, request_id,
+2 -4
View File
@@ -30,8 +30,6 @@
typedef struct private_swid_inventory_t private_swid_inventory_t; typedef struct private_swid_inventory_t private_swid_inventory_t;
#define SWID_TAG_DIRECTORY "/usr/share"
/** /**
* Private data of a swid_inventory_t object. * Private data of a swid_inventory_t object.
* *
@@ -179,9 +177,9 @@ end:
} }
METHOD(swid_inventory_t, collect, bool, METHOD(swid_inventory_t, collect, bool,
private_swid_inventory_t *this) private_swid_inventory_t *this, char *directory)
{ {
return collect_tags(this, SWID_TAG_DIRECTORY); return collect_tags(this, directory);
} }
METHOD(swid_inventory_t, add, void, METHOD(swid_inventory_t, add, void,
+2 -1
View File
@@ -33,9 +33,10 @@ struct swid_inventory_t {
/** /**
* Collect the SWID tags stored on the endpoint * Collect the SWID tags stored on the endpoint
* *
* @param directory SWID directory path
* @return TRUE if successful * @return TRUE if successful
*/ */
bool (*collect)(swid_inventory_t *this); bool (*collect)(swid_inventory_t *this, char *directory);
/** /**
* Collect the SWID tags stored on the endpoint * Collect the SWID tags stored on the endpoint