Fixes to make build work after merging.
authorMargaret Wasserman <mrw@painless-security.com>
Fri, 19 Sep 2014 19:28:30 +0000 (15:28 -0400)
committerMargaret Wasserman <mrw@painless-security.com>
Fri, 19 Sep 2014 19:28:30 +0000 (15:28 -0400)
common/tr_config.c
include/tr_config.h
tid/tids.c
tr/tr_main.c

index ff92fd0..ca8520e 100644 (file)
@@ -825,10 +825,9 @@ TR_CFG_RC tr_cfg_validate (TR_CFG *trc) {
   return rc;
 }
 
-TR_CFG_RC tr_parse_config (TR_INSTANCE *tr, struct dirent **cfg_files) {
+TR_CFG_RC tr_parse_config (TR_INSTANCE *tr, int n, struct dirent **cfg_files) {
   json_t *jcfg;
   json_error_t rc;
-  int n;
 
   if ((!tr) || (!cfg_files))
     return TR_CFG_BAD_PARAMS;
@@ -915,38 +914,6 @@ TR_RP_CLIENT *tr_cfg_find_rp (TR_CFG *tr_cfg, TR_NAME *rp_gss, TR_CFG_RC *rc)
   return NULL;
 }
 
-#if 0
-json_t *tr_read_config (int n, struct dirent **cfg_files) {
-  json_t *jcfg = NULL;
-  json_t *temp = NULL;
-  json_error_t err;
-
-  if (!cfg_files)
-    return NULL;
-
-  while (n--) {
-    fprintf(stderr, "tr_read_config: Parsing %s.\n", cfg_files[n]->d_name);
-    if (NULL == (temp = json_load_file(cfg_files[n]->d_name, JSON_DISABLE_EOF_CHECK, &err))) {
-      fprintf (stderr, "tr_read_config: Error parsing config file %s.\n", cfg_files[n]->d_name);
-      return NULL;
-    }
-
-    if (!jcfg) {
-      jcfg = temp;
-    }else {
-      if (-1 == json_object_update(jcfg, temp)) {
-       fprintf(stderr, "tr_read_config: Error merging config information.\n");
-       return NULL;
-      }
-    }
-  }
-
-  fprintf(stderr, "tr_read_config: Merged configuration complete:\n%s\n", json_dumps(jcfg, 0));
-
-  return jcfg;
-}
-#endif 
-
 static int is_cfg_file(const struct dirent *dent) {
   int n;
 
index 91f877f..c467c16 100644 (file)
@@ -74,7 +74,7 @@ typedef struct tr_cfg {
 } TR_CFG;
 
 int tr_find_config_files (struct dirent ***cfg_files);
-TR_CFG_RC tr_parse_config (TR_INSTANCE *tr, struct dirent **cfg_files);
+TR_CFG_RC tr_parse_config (TR_INSTANCE *tr, int n, struct dirent **cfg_files);
 TR_CFG_RC tr_apply_new_config (TR_INSTANCE *tr);
 TR_CFG_RC tr_cfg_validate (TR_CFG *trc);
 void tr_cfg_free(TR_CFG *cfg);
index d94fff2..07d48e7 100644 (file)
@@ -39,6 +39,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <sys/socket.h>
+#include <sys/wait.h>
 #include <netinet/in.h>
 #include <jansson.h>
 #include <talloc.h>
index 9de6ad0..98aa2bb 100644 (file)
@@ -244,7 +244,6 @@ int main (int argc, const char *argv[])
 {
   TR_INSTANCE *tr = NULL;
   struct dirent **cfg_files = NULL;
-  json_t *jcfg = NULL;
   TR_CFG_RC rc = TR_CFG_SUCCESS;       /* presume success */
   int err = 0, n = 0;;
 
@@ -262,7 +261,7 @@ int main (int argc, const char *argv[])
     exit(1);
   }
 
-  if (TR_CFG_SUCCESS != tr_parse_config(tr, cfg_files)) {
+  if (TR_CFG_SUCCESS != tr_parse_config(tr, n, cfg_files)) {
     fprintf (stderr, "Error decoding configuration information, exiting.\n");
     exit(1);
   }