#128 Allow principal to be set during start-tracking
Merged 4 years ago by rcritten. Opened 4 years ago by rcritten.
rcritten/certmonger track_principal  into  master

file modified
+11 -2
@@ -1575,6 +1575,7 @@ 

  		  char *cpass, char *cpassfile,

  		  char *ca, char *profile, char *issuer,

  		  char *ms_template_spec,

+ 		  char **principal,

  		  char *precommand, char *postcommand,

  		  char **anchor_dbs, char **anchor_files,

  		  int is_ca, int path_length,
@@ -1583,8 +1584,8 @@ 

  {

  	DBusMessage *req, *rep;

  	int i;

- 	struct cm_tdbusm_dict param[30];

- 	const struct cm_tdbusm_dict *params[30];

+ 	struct cm_tdbusm_dict param[31];

+ 	const struct cm_tdbusm_dict *params[31];

  	dbus_bool_t b;

  	const char *capath;

  	char *p;
@@ -1756,6 +1757,13 @@ 

  		params[i] = &param[i];

  		i++;

  	}

+ 	if (principal != NULL) {

+ 		param[i].key = CM_DBUS_PROP_TEMPLATE_PRINCIPAL;

+ 		param[i].value_type = cm_tdbusm_dict_as;

+ 		param[i].value.as = principal;

+ 		params[i] = &param[i];

+ 		i++;

+ 	}

  	if (issuer != NULL) {

  		param[i].key = CM_DBUS_PROP_TEMPLATE_ISSUER;

  		param[i].value_type = cm_tdbusm_dict_s;
@@ -2436,6 +2444,7 @@ 

  						 cpass, cpassfile,

  						 ca, profile, issuer,

  						 ms_template_spec,

+ 						 principal,

  						 precommand, postcommand,

  						 anchor_dbs, anchor_files,

  						 is_ca, path_length,

It was previously silently dropped by start-tracking.

This is handy in an IPA environment for tracking certificates
that don't have the principal encoded into the certificate
itself.

https://pagure.io/certmonger/issue/127

Pull-Request has been merged by rcritten

4 years ago
Metadata