]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Use flag ENABLE_STRICT_STRATEGY to allow strict sync strategy
authorpcarana <pc.moreno2099@gmail.com>
Wed, 12 Jun 2019 23:59:36 +0000 (18:59 -0500)
committerpcarana <pc.moreno2099@gmail.com>
Wed, 12 Jun 2019 23:59:36 +0000 (18:59 -0500)
docs/doc/usage.md
man/fort.8
src/Makefile.am
src/config/sync_strategy.c
src/config/sync_strategy.h

index 02d9164c6870d136698e06df2cfda25ae15b3aa6..ee92acf72181b4e0bf52e8273ffb6e29894db62d 100644 (file)
@@ -185,6 +185,10 @@ Skips all rsyncs. (Validate the existing cache repository pointed by `--local-re
 
 #### `strict`
 
+> In order to enable this strategy, recompile using the flag: **_ENABLE\_STRICT\_STRATEGY_**.
+>
+> e.g. `$ make FORT_FLAGS='-DENABLE_STRICT_STRATEGY'`
+
 rsyncs every repository publication point separately. Only skips publication points that have already been downloaded during the current validation cycle. (Assuming each synchronization is recursive.)
 
 For example, suppose the validator gets certificates whose caRepository access methods (in their Subject Information Access extensions) point to the following publication points:
index 2cd36475377160a50b062b366b4253497a5e7503..41d451799805be674984c40813bff3490d612c75 100644 (file)
@@ -199,6 +199,10 @@ Skip all RSYNCs. (Validate the existing cache repository pointed by
 .P
 .I strict
 .RS 4
+In order to enable this strategy, FORT must be compiled using the flag:
+ENABLE\_STRICT\_STRATEGY. e.g.
+\fB $ make FORT_FLAGS='-DENABLE_STRICT_STRATEGY'\fR
+.P
 RSYNC every repository publication point separately. Only skip publication
 points that have already been downloaded during the current validation cycle.
 (Assuming each synchronization is recursive.)
index 0dd25f35aa4d585af4d812490cc22cf66207607c..8ebb8d83559d34a574e3b67b0558c4ce5c0292d8 100644 (file)
@@ -98,7 +98,7 @@ fort_SOURCES += slurm/slurm_parser.c slurm/slurm_parser.h
 fort_CFLAGS  = -Wall
 # Feel free to temporarily remove this one if you're not using gcc 7.3.0.
 #fort_CFLAGS += $(GCC_WARNS)
-fort_CFLAGS += -std=gnu11 -O0 -g $(CFLAGS_DEBUG)
+fort_CFLAGS += -std=gnu11 -O0 -g $(CFLAGS_DEBUG) $(FORT_FLAGS)
 fort_LDFLAGS = $(LDFLAGS_DEBUG)
 fort_LDADD   = ${JANSSON_LIBS}
 
index e6b13e481878f3af232d7d566376e0e7622e4ffb..697d7fde8e1a7f344f73dea976366c700a99a928 100644 (file)
 
 #define DEREFERENCE(void_value) (*((enum sync_strategy *) void_value))
 
+#ifdef ENABLE_STRICT_STRATEGY
+#define PRINT_STRICT_ARG_DOC "|" SYNC_VALUE_STRICT
+#define HANDLE_SYNC_STRICT DEREFERENCE(result) = SYNC_STRICT;
+#else
+#define PRINT_STRICT_ARG_DOC
+#define HANDLE_SYNC_STRICT                                             \
+       return pr_err("Unknown synchronization strategy: '%s'. In order to use it, recompile using flag ENABLE_STRICT_STRATEGY.",\
+           str);
+#endif
+
 static void
 print_sync_strategy(struct option_field const *field, void *value)
 {
@@ -44,7 +54,7 @@ parse_argv_sync_strategy(struct option_field const *field, char const *str,
        if (strcmp(str, SYNC_VALUE_OFF) == 0)
                DEREFERENCE(result) = SYNC_OFF;
        else if (strcmp(str, SYNC_VALUE_STRICT) == 0)
-               DEREFERENCE(result) = SYNC_STRICT;
+               HANDLE_SYNC_STRICT
        else if (strcmp(str, SYNC_VALUE_ROOT) == 0)
                DEREFERENCE(result) = SYNC_ROOT;
        else if (strcmp(str, SYNC_VALUE_ROOT_EXCEPT_TA) == 0)
@@ -73,7 +83,7 @@ const struct global_type gt_sync_strategy = {
        .parse.argv = parse_argv_sync_strategy,
        .parse.json = parse_json_sync_strategy,
        .arg_doc = SYNC_VALUE_OFF
-           "|" SYNC_VALUE_STRICT
+           PRINT_STRICT_ARG_DOC
            "|" SYNC_VALUE_ROOT
            "|" SYNC_VALUE_ROOT_EXCEPT_TA,
 };
index a41ebc0656d557a8f76f79c77728af1573d3e2cd..2ee8b35f295a3036f9e1090e26342a965d6666f4 100644 (file)
@@ -22,6 +22,9 @@ enum sync_strategy {
         *
         * No risk of downloading unneeded files, but otherwise slow, as every
         * different repository publication point requires a separate sync call.
+        *
+        * In order to enable this strategy, compile using the flag:
+        * ENABLE_STRICT_STRATEGY
         */
        SYNC_STRICT,
        /**