Browse code

Replace CL_CLEAN with CL_SUCCESS in clamav.h, and scanners.c

Both enum variants are 0, so it's a no-op.

`cl_error_t` should be used to determine if we keep going or stop, whether
that's because there was a detection and we're not in allmatch mode, or if
because of an error.

`cl_verdict_t` should be used to determine or say the verdict (clean is a
verdict, though I feel 'nothing found' is more accurate).

Valerie Snyder authored on 2025/07/29 23:44:13
Showing 2 changed files
... ...
@@ -958,7 +958,7 @@ typedef enum scan_callback {
958 958
  *         Scan aborted by callback (the rest of the scan is skipped).
959 959
  *         This does not mark the file as clean or infected, it just skips the rest of the scan.
960 960
  *
961
- * @return CL_SUCCESS / CL_CLEAN
961
+ * @return CL_SUCCESS
962 962
  *
963 963
  *         File scan will continue.
964 964
  *
... ...
@@ -1008,7 +1008,7 @@ extern void cl_engine_set_scan_callback(struct cl_engine *engine, clcb_scan call
1008 1008
  * @param fd        File descriptor which is about to be scanned.
1009 1009
  * @param type      File type detected via magic - i.e. NOT on the fly - (e.g. "CL_TYPE_MSEXE").
1010 1010
  * @param context   Opaque application provided data.
1011
- * @return          CL_CLEAN = File is scanned.
1011
+ * @return          CL_SUCCESS = File is scanned.
1012 1012
  * @return          CL_BREAK = Allowed by callback - file is skipped and marked as clean.
1013 1013
  * @return          CL_VIRUS = Blocked by callback - file is skipped and marked as infected.
1014 1014
  */
... ...
@@ -1048,7 +1048,7 @@ extern void cl_engine_set_clcb_pre_cache(struct cl_engine *engine, clcb_pre_cach
1048 1048
  * @param recursion_level     Recursion level / depth of the current file.
1049 1049
  * @param layer_attributes    See LAYER_ATTRIBUTES_* flags.
1050 1050
  * @param context             Opaque application provided data.
1051
- * @return                    CL_CLEAN = File is scanned.
1051
+ * @return                    CL_SUCCESS = File is scanned.
1052 1052
  * @return                    CL_BREAK = Whitelisted by callback - file is skipped and marked as clean.
1053 1053
  * @return                    CL_VIRUS = Blacklisted by callback - file is skipped and marked as infected.
1054 1054
  */
... ...
@@ -1092,7 +1092,7 @@ extern void cl_engine_set_clcb_file_inspection(struct cl_engine *engine, clcb_fi
1092 1092
  * @param fd        File descriptor which is about to be scanned.
1093 1093
  * @param type      File type detected via magic - i.e. NOT on the fly - (e.g. "CL_TYPE_MSEXE").
1094 1094
  * @param context   Opaque application provided data.
1095
- * @return          CL_CLEAN = File is scanned.
1095
+ * @return          CL_SUCCESS = File is scanned.
1096 1096
  * @return          CL_BREAK = Allowed by callback - file is skipped and marked as clean.
1097 1097
  * @return          CL_VIRUS = Blocked by callback - file is skipped and marked as infected.
1098 1098
  */
... ...
@@ -1123,7 +1123,7 @@ extern void cl_engine_set_clcb_pre_scan(struct cl_engine *engine, clcb_pre_scan
1123 1123
  * @param result    The scan result for the file.
1124 1124
  * @param virname   A signature name if there was one or more matches.
1125 1125
  * @param context   Opaque application provided data.
1126
- * @return          CL_CLEAN = File is scanned.
1126
+ * @return          CL_SUCCESS = File is scanned.
1127 1127
  * @return          CL_BREAK = Allowed by callback - file is skipped and marked as clean.
1128 1128
  * @return          CL_VIRUS = Blocked by callback - file is skipped and marked as infected.
1129 1129
  */
... ...
@@ -1341,7 +1341,7 @@ extern void cl_engine_set_clcb_hash(struct cl_engine *engine, clcb_hash callback
1341 1341
  * @param filepos_container File index in container.
1342 1342
  * @param context           Opaque application provided data.
1343 1343
  * @return                  CL_VIRUS to block (alert on)
1344
- * @return                  CL_CLEAN to continue scanning
1344
+ * @return                  CL_SUCCESS to continue scanning
1345 1345
  */
1346 1346
 typedef cl_error_t (*clcb_meta)(
1347 1347
     const char *container_type,
... ...
@@ -1593,7 +1593,7 @@ extern void cl_engine_stats_enable(struct cl_engine *engine);
1593 1593
  * @param[out] scanned    The number of bytes scanned / CL_COUNT_PRECISION.
1594 1594
  * @param engine          The scanning engine.
1595 1595
  * @param scanoptions     Scanning options.
1596
- * @return cl_error_t     CL_CLEAN, CL_VIRUS, or an error code if an error occurred during the scan.
1596
+ * @return cl_error_t     CL_SUCCESS, CL_VIRUS, or an error code if an error occurred during the scan.
1597 1597
  */
1598 1598
 extern cl_error_t cl_scandesc(
1599 1599
     int desc,
... ...
@@ -1619,7 +1619,7 @@ extern cl_error_t cl_scandesc(
1619 1619
  * @param scanoptions     Scanning options.
1620 1620
  * @param[in,out] context (Optional) An application-defined context struct, opaque to libclamav.
1621 1621
  *                        May be used within your callback functions.
1622
- * @return cl_error_t     CL_CLEAN, CL_VIRUS, or an error code if an error occurred during the scan.
1622
+ * @return cl_error_t     CL_SUCCESS, CL_VIRUS, or an error code if an error occurred during the scan.
1623 1623
  */
1624 1624
 extern cl_error_t cl_scandesc_callback(
1625 1625
     int desc,
... ...
@@ -1697,7 +1697,7 @@ extern cl_error_t cl_scandesc_ex(
1697 1697
  * @param[out] scanned    The number of bytes scanned / CL_COUNT_PRECISION.
1698 1698
  * @param engine          The scanning engine.
1699 1699
  * @param scanoptions     Scanning options.
1700
- * @return cl_error_t     CL_CLEAN, CL_VIRUS, or an error code if an error occurred during the scan.
1700
+ * @return cl_error_t     CL_SUCCESS, CL_VIRUS, or an error code if an error occurred during the scan.
1701 1701
  */
1702 1702
 extern cl_error_t cl_scanfile(
1703 1703
     const char *filename,
... ...
@@ -1721,7 +1721,7 @@ extern cl_error_t cl_scanfile(
1721 1721
  * @param scanoptions     Scanning options.
1722 1722
  * @param[in,out] context (Optional) An application-defined context struct, opaque to libclamav.
1723 1723
  *                        May be used within your callback functions.
1724
- * @return cl_error_t     CL_CLEAN, CL_VIRUS, or an error code if an error occurred during the scan.
1724
+ * @return cl_error_t     CL_SUCCESS, CL_VIRUS, or an error code if an error occurred during the scan.
1725 1725
  */
1726 1726
 extern cl_error_t cl_scanfile_callback(
1727 1727
     const char *filename,
... ...
@@ -1809,7 +1809,7 @@ extern cl_error_t cl_scanfile_ex(
1809 1809
  * @param scanoptions   The scanning options struct.
1810 1810
  * @param context       An application-defined context struct, opaque to
1811 1811
  *                      libclamav. May be used within your callback functions.
1812
- * @return cl_error_t   CL_CLEAN if no signature matched. CL_VIRUS if a
1812
+ * @return cl_error_t   CL_SUCCESS if no signature matched. CL_VIRUS if a
1813 1813
  *                      signature matched. Another CL_E* error code if an
1814 1814
  *                      error occurred.
1815 1815
  */
... ...
@@ -128,7 +128,7 @@
128 128
 
129 129
 cl_error_t cli_magic_scan_dir(const char *dir, cli_ctx *ctx, uint32_t attributes)
130 130
 {
131
-    cl_error_t status = CL_CLEAN;
131
+    cl_error_t status = CL_SUCCESS;
132 132
     DIR *dd           = NULL;
133 133
     struct dirent *dent;
134 134
     STATBUF statbuf;
... ...
@@ -192,11 +192,11 @@ done:
192 192
  * @param metadata  unrar metadata structure
193 193
  * @param ctx       scanning context structure
194 194
  * @param files
195
- * @return cl_error_t  Returns CL_CLEAN if nothing found, CL_VIRUS if something found, CL_EUNPACK if encrypted.
195
+ * @return cl_error_t  Returns CL_SUCCESS if nothing found, CL_VIRUS if something found, CL_EUNPACK if encrypted.
196 196
  */
197 197
 static cl_error_t cli_unrar_scanmetadata(unrar_metadata_t *metadata, cli_ctx *ctx, unsigned int files)
198 198
 {
199
-    cl_error_t status = CL_CLEAN;
199
+    cl_error_t status = CL_SUCCESS;
200 200
 
201 201
     cli_dbgmsg("RAR: %s, crc32: 0x%x, encrypted: %u, compressed: %u, normal: %u, method: %u, ratio: %u\n",
202 202
                metadata->filename, metadata->crc, metadata->encrypted, (unsigned int)metadata->pack_size,
... ...
@@ -307,7 +307,7 @@ static cl_error_t cli_scanrar_file(const char *filepath, int desc, cli_ctx *ctx)
307 307
      *      and if we have not detected a signature match.
308 308
      */
309 309
     do {
310
-        status = CL_CLEAN;
310
+        status = CL_SUCCESS;
311 311
 
312 312
         /* Zero out the metadata struct before we read the header */
313 313
         memset(&metadata, 0, sizeof(unrar_metadata_t));
... ...
@@ -597,11 +597,11 @@ done:
597 597
  * @param metadata  egg metadata structure
598 598
  * @param ctx       scanning context structure
599 599
  * @param files     number of files
600
- * @return cl_error_t  Returns CL_CLEAN if nothing found, CL_VIRUS if something found, CL_EUNPACK if encrypted.
600
+ * @return cl_error_t  Returns CL_SUCCESS if nothing found, CL_VIRUS if something found, CL_EUNPACK if encrypted.
601 601
  */
602 602
 static cl_error_t cli_egg_scanmetadata(cl_egg_metadata *metadata, cli_ctx *ctx, unsigned int files)
603 603
 {
604
-    cl_error_t status = CL_CLEAN;
604
+    cl_error_t status = CL_SUCCESS;
605 605
 
606 606
     cli_dbgmsg("EGG: %s, encrypted: %u, compressed: %u, normal: %u, ratio: %u\n",
607 607
                metadata->filename, metadata->encrypted, (unsigned int)metadata->pack_size,
... ...
@@ -728,7 +728,7 @@ static cl_error_t cli_scanegg(cli_ctx *ctx)
728 728
      *      and if we have not detected a signature match.
729 729
      */
730 730
     do {
731
-        status = CL_CLEAN;
731
+        status = CL_SUCCESS;
732 732
 
733 733
         /* Zero out the metadata struct before we read the header */
734 734
         memset(&metadata, 0, sizeof(cl_egg_metadata));
... ...
@@ -899,7 +899,7 @@ static cl_error_t cli_scanegg(cli_ctx *ctx)
899 899
         }
900 900
 
901 901
         if (ctx->engine->maxscansize && ctx->scansize >= ctx->engine->maxscansize) {
902
-            status = CL_CLEAN;
902
+            status = CL_SUCCESS;
903 903
             break;
904 904
         }
905 905
 
... ...
@@ -911,10 +911,10 @@ static cl_error_t cli_scanegg(cli_ctx *ctx)
911 911
             metadata.filename = NULL;
912 912
         }
913 913
 
914
-    } while (status == CL_CLEAN);
914
+    } while (status == CL_SUCCESS);
915 915
 
916 916
     if (status == CL_BREAK) {
917
-        status = CL_CLEAN;
917
+        status = CL_SUCCESS;
918 918
     }
919 919
 
920 920
 done:
... ...
@@ -970,7 +970,7 @@ done:
970 970
 
971 971
 static cl_error_t cli_scanarj(cli_ctx *ctx)
972 972
 {
973
-    cl_error_t ret = CL_CLEAN;
973
+    cl_error_t ret = CL_SUCCESS;
974 974
     int file       = 0;
975 975
     arj_metadata_t metadata;
976 976
     char *dir = NULL;
... ...
@@ -1015,7 +1015,7 @@ static cl_error_t cli_scanarj(cli_ctx *ctx)
1015 1015
             return CL_VIRUS;
1016 1016
         }
1017 1017
 
1018
-        if ((ret = cli_checklimits("ARJ", ctx, metadata.orig_size, metadata.comp_size, 0)) != CL_CLEAN) {
1018
+        if ((ret = cli_checklimits("ARJ", ctx, metadata.orig_size, metadata.comp_size, 0)) != CL_SUCCESS) {
1019 1019
             ret = CL_SUCCESS;
1020 1020
             if (metadata.filename)
1021 1021
                 free(metadata.filename);
... ...
@@ -1098,7 +1098,7 @@ static cl_error_t cli_scangzip_with_zib_from_the_80s(cli_ctx *ctx, unsigned char
1098 1098
 
1099 1099
     while ((bytes = gzread(gz, buff, FILEBUFF)) > 0) {
1100 1100
         outsize += bytes;
1101
-        if (cli_checklimits("GZip", ctx, outsize, 0, 0) != CL_CLEAN)
1101
+        if (cli_checklimits("GZip", ctx, outsize, 0, 0) != CL_SUCCESS)
1102 1102
             break;
1103 1103
         if (cli_writen(fd, buff, (size_t)bytes) != (size_t)bytes) {
1104 1104
             close(fd);
... ...
@@ -1135,7 +1135,7 @@ static cl_error_t cli_scangzip_with_zib_from_the_80s(cli_ctx *ctx, unsigned char
1135 1135
 static cl_error_t cli_scangzip(cli_ctx *ctx)
1136 1136
 {
1137 1137
     int fd;
1138
-    cl_error_t ret = CL_CLEAN;
1138
+    cl_error_t ret = CL_SUCCESS;
1139 1139
     unsigned char buff[FILEBUFF];
1140 1140
     char *tmpname;
1141 1141
     z_stream z;
... ...
@@ -1197,7 +1197,7 @@ static cl_error_t cli_scangzip(cli_ctx *ctx)
1197 1197
                 return CL_EWRITE;
1198 1198
             }
1199 1199
             outsize += sizeof(buff) - z.avail_out;
1200
-            if (cli_checklimits("GZip", ctx, outsize, 0, 0) != CL_CLEAN) {
1200
+            if (cli_checklimits("GZip", ctx, outsize, 0, 0) != CL_SUCCESS) {
1201 1201
                 at = map->len;
1202 1202
                 break;
1203 1203
             }
... ...
@@ -1242,7 +1242,7 @@ static cl_error_t cli_scangzip(cli_ctx *ctx)
1242 1242
 
1243 1243
 static cl_error_t cli_scanbzip(cli_ctx *ctx)
1244 1244
 {
1245
-    cl_error_t ret = CL_CLEAN;
1245
+    cl_error_t ret = CL_SUCCESS;
1246 1246
     int fd, rc;
1247 1247
     uint64_t size = 0;
1248 1248
     char *tmpname;
... ...
@@ -1301,7 +1301,7 @@ static cl_error_t cli_scanbzip(cli_ctx *ctx)
1301 1301
                 return CL_EWRITE;
1302 1302
             }
1303 1303
 
1304
-            if (cli_checklimits("Bzip", ctx, size, 0, 0) != CL_CLEAN)
1304
+            if (cli_checklimits("Bzip", ctx, size, 0, 0) != CL_SUCCESS)
1305 1305
                 break;
1306 1306
 
1307 1307
             strm.next_out  = buf;
... ...
@@ -1333,7 +1333,7 @@ static cl_error_t cli_scanbzip(cli_ctx *ctx)
1333 1333
 
1334 1334
 static cl_error_t cli_scanxz(cli_ctx *ctx)
1335 1335
 {
1336
-    cl_error_t ret = CL_CLEAN;
1336
+    cl_error_t ret = CL_SUCCESS;
1337 1337
     int fd, rc;
1338 1338
     unsigned long int size = 0;
1339 1339
     char *tmpname;
... ...
@@ -1405,7 +1405,7 @@ static cl_error_t cli_scanxz(cli_ctx *ctx)
1405 1405
                 ret = CL_EWRITE;
1406 1406
                 goto xz_exit;
1407 1407
             }
1408
-            if (cli_checklimits("cli_scanxz", ctx, size, 0, 0) != CL_CLEAN) {
1408
+            if (cli_checklimits("cli_scanxz", ctx, size, 0, 0) != CL_SUCCESS) {
1409 1409
                 cli_warnmsg("cli_scanxz: decompress file size exceeds limits - "
1410 1410
                             "only scanning %li bytes\n",
1411 1411
                             size);
... ...
@@ -1423,7 +1423,7 @@ xz_exit:
1423 1423
     cli_XzShutdown(&strm);
1424 1424
     close(fd);
1425 1425
     if (!ctx->engine->keeptmp) {
1426
-        if (cli_unlink(tmpname) && ret == CL_CLEAN) {
1426
+        if (cli_unlink(tmpname) && ret == CL_SUCCESS) {
1427 1427
             ret = CL_EUNLINK;
1428 1428
         }
1429 1429
     }
... ...
@@ -1720,7 +1720,7 @@ done:
1720 1720
  */
1721 1721
 static cl_error_t cli_ole2_tempdir_scan_summary(const char *dir, cli_ctx *ctx, struct uniq *U)
1722 1722
 {
1723
-    cl_error_t status = CL_CLEAN;
1723
+    cl_error_t status = CL_SUCCESS;
1724 1724
     cl_error_t ret;
1725 1725
     char summary_filename[1024];
1726 1726
     char *hash;
... ...
@@ -1783,7 +1783,7 @@ done:
1783 1783
  */
1784 1784
 static cl_error_t cli_ole2_tempdir_scan_embedded_ole10(const char *dir, cli_ctx *ctx, struct uniq *U)
1785 1785
 {
1786
-    cl_error_t status = CL_CLEAN;
1786
+    cl_error_t status = CL_SUCCESS;
1787 1787
     cl_error_t ret;
1788 1788
     char ole10_filename[1024];
1789 1789
     char *hash;
... ...
@@ -2053,7 +2053,7 @@ done:
2053 2053
 
2054 2054
 static cl_error_t cli_ole2_tempdir_scan_for_xlm_and_images(const char *dir, cli_ctx *ctx, struct uniq *U)
2055 2055
 {
2056
-    cl_error_t ret      = CL_CLEAN;
2056
+    cl_error_t ret      = CL_SUCCESS;
2057 2057
     char *hash          = NULL;
2058 2058
     uint32_t hashcnt    = 0;
2059 2059
     char STR_WORKBOOK[] = "workbook";
... ...
@@ -2686,7 +2686,7 @@ static cl_error_t cli_scanscript(cli_ctx *ctx)
2686 2686
     /* CL_ENGINE_MAX_SCRIPTNORMALIZE */
2687 2687
     if (curr_len > ctx->engine->maxscriptnormalize) {
2688 2688
         cli_dbgmsg("cli_scanscript: exiting (file larger than MaxScriptSize)\n");
2689
-        ret = CL_CLEAN;
2689
+        ret = CL_SUCCESS;
2690 2690
         goto done;
2691 2691
     }
2692 2692
 
... ...
@@ -2952,7 +2952,7 @@ static cl_error_t cli_ole2_scan_tempdir(
2952 2952
     int has_xlm,
2953 2953
     int has_image)
2954 2954
 {
2955
-    cl_error_t status = CL_CLEAN;
2955
+    cl_error_t status = CL_SUCCESS;
2956 2956
     DIR *dd           = NULL;
2957 2957
     int has_macros    = 0;
2958 2958
 
... ...
@@ -3069,7 +3069,7 @@ done:
3069 3069
 static cl_error_t cli_scanole2(cli_ctx *ctx)
3070 3070
 {
3071 3071
     char *dir          = NULL;
3072
-    cl_error_t ret     = CL_CLEAN;
3072
+    cl_error_t ret     = CL_SUCCESS;
3073 3073
     struct uniq *files = NULL;
3074 3074
     int has_vba        = 0;
3075 3075
     int has_xlm        = 0;
... ...
@@ -3134,7 +3134,7 @@ done:
3134 3134
 static cl_error_t cli_scantar(cli_ctx *ctx, unsigned int posix)
3135 3135
 {
3136 3136
     char *dir;
3137
-    cl_error_t ret = CL_CLEAN;
3137
+    cl_error_t ret = CL_SUCCESS;
3138 3138
 
3139 3139
     cli_dbgmsg("in cli_scantar()\n");
3140 3140
 
... ...
@@ -3160,7 +3160,7 @@ static cl_error_t cli_scantar(cli_ctx *ctx, unsigned int posix)
3160 3160
 static cl_error_t cli_scanscrenc(cli_ctx *ctx)
3161 3161
 {
3162 3162
     char *tempname;
3163
-    cl_error_t ret = CL_CLEAN;
3163
+    cl_error_t ret = CL_SUCCESS;
3164 3164
 
3165 3165
     cli_dbgmsg("in cli_scanscrenc()\n");
3166 3166
 
... ...
@@ -3185,7 +3185,7 @@ static cl_error_t cli_scanscrenc(cli_ctx *ctx)
3185 3185
 
3186 3186
 static cl_error_t cli_scanriff(cli_ctx *ctx)
3187 3187
 {
3188
-    cl_error_t ret = CL_CLEAN;
3188
+    cl_error_t ret = CL_SUCCESS;
3189 3189
 
3190 3190
     if (cli_check_riff_exploit(ctx) == 2)
3191 3191
         ret = cli_append_potentially_unwanted(ctx, "Heuristics.Exploit.W32.MS05-002");
... ...
@@ -3195,7 +3195,7 @@ static cl_error_t cli_scanriff(cli_ctx *ctx)
3195 3195
 
3196 3196
 static cl_error_t cli_scancryptff(cli_ctx *ctx)
3197 3197
 {
3198
-    cl_error_t ret = CL_CLEAN, ndesc;
3198
+    cl_error_t ret = CL_SUCCESS, ndesc;
3199 3199
     unsigned int i;
3200 3200
     const unsigned char *src;
3201 3201
     unsigned char *dest = NULL;
... ...
@@ -3294,7 +3294,7 @@ static cl_error_t cli_scantnef(cli_ctx *ctx)
3294 3294
 
3295 3295
     ret = cli_tnef(dir, ctx);
3296 3296
 
3297
-    if (ret == CL_CLEAN)
3297
+    if (ret == CL_SUCCESS)
3298 3298
         ret = cli_magic_scan_dir(dir, ctx, LAYER_ATTRIBUTES_NONE);
3299 3299
 
3300 3300
     if (!ctx->engine->keeptmp)
... ...
@@ -3320,7 +3320,7 @@ static cl_error_t cli_scanuuencoded(cli_ctx *ctx)
3320 3320
 
3321 3321
     ret = cli_uuencode(dir, ctx->fmap);
3322 3322
 
3323
-    if (ret == CL_CLEAN)
3323
+    if (ret == CL_SUCCESS)
3324 3324
         ret = cli_magic_scan_dir(dir, ctx, LAYER_ATTRIBUTES_NONE);
3325 3325
 
3326 3326
     if (!ctx->engine->keeptmp)
... ...
@@ -3448,12 +3448,12 @@ static cl_error_t cli_scan_structured(cli_ctx *ctx)
3448 3448
         }
3449 3449
     }
3450 3450
 
3451
-    return CL_CLEAN;
3451
+    return CL_SUCCESS;
3452 3452
 }
3453 3453
 
3454 3454
 static cl_error_t cli_scanembpe(cli_ctx *ctx, off_t offset)
3455 3455
 {
3456
-    cl_error_t ret = CL_CLEAN;
3456
+    cl_error_t ret = CL_SUCCESS;
3457 3457
     int fd;
3458 3458
     size_t bytes;
3459 3459
     size_t size = 0;
... ...
@@ -3493,7 +3493,7 @@ static cl_error_t cli_scanembpe(cli_ctx *ctx, off_t offset)
3493 3493
         size += bytes;
3494 3494
         todo -= bytes;
3495 3495
 
3496
-        if (cli_checklimits("cli_scanembpe", ctx, size, 0, 0) != CL_CLEAN)
3496
+        if (cli_checklimits("cli_scanembpe", ctx, size, 0, 0) != CL_SUCCESS)
3497 3497
             break;
3498 3498
 
3499 3499
         if (cli_writen(fd, buff, bytes) != bytes) {
... ...
@@ -3536,7 +3536,7 @@ static cl_error_t cli_scanembpe(cli_ctx *ctx, off_t offset)
3536 3536
     }
3537 3537
     free(tmpname);
3538 3538
 
3539
-    return CL_CLEAN;
3539
+    return CL_SUCCESS;
3540 3540
 }
3541 3541
 
3542 3542
 #if defined(_WIN32) || defined(C_LINUX) || defined(C_DARWIN)
... ...
@@ -3717,7 +3717,7 @@ static inline void perf_done(cli_ctx *ctx)
3717 3717
  */
3718 3718
 static cl_error_t scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_t *dettype)
3719 3719
 {
3720
-    cl_error_t ret = CL_CLEAN, nret = CL_CLEAN;
3720
+    cl_error_t ret = CL_SUCCESS, nret = CL_SUCCESS;
3721 3721
     struct cli_matched_type *ftoffset = NULL, *fpt;
3722 3722
     unsigned int acmode               = AC_SCAN_VIR;
3723 3723
 
... ...
@@ -3934,7 +3934,7 @@ static cl_error_t scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_fi
3934 3934
                                         cli_dbgmsg("GPT signature found at %u\n", (unsigned int)fpt->offset);
3935 3935
                                         nret = cli_scangpt(ctx, 0);
3936 3936
                                     }
3937
-                                } else if ((iret == CL_CLEAN) && (DCONF_ARCH & ARCH_CONF_MBR)) {
3937
+                                } else if ((iret == CL_SUCCESS) && (DCONF_ARCH & ARCH_CONF_MBR)) {
3938 3938
                                     // Reassign type of current layer based on what we discovered
3939 3939
                                     if (CL_SUCCESS != (ret = cli_recursion_stack_change_type(ctx, CL_TYPE_MBR, true))) {
3940 3940
                                         cli_dbgmsg("Call to cli_recursion_stack_change_type() returned %s \n", cl_strerror(ret));
... ...
@@ -4301,7 +4301,7 @@ void emax_reached(cli_ctx *ctx)
4301 4301
  */
4302 4302
 static cl_error_t dispatch_file_inspection_callback(clcb_file_inspection cb, cli_ctx *ctx, const char *filetype)
4303 4303
 {
4304
-    cl_error_t status = CL_CLEAN;
4304
+    cl_error_t status = CL_SUCCESS;
4305 4305
     cl_error_t append_ret;
4306 4306
 
4307 4307
     int fd              = -1;
... ...
@@ -4377,7 +4377,7 @@ done:
4377 4377
 
4378 4378
 static cl_error_t dispatch_prescan_callback(clcb_pre_scan cb, cli_ctx *ctx, const char *filetype)
4379 4379
 {
4380
-    cl_error_t status = CL_CLEAN;
4380
+    cl_error_t status = CL_SUCCESS;
4381 4381
     cl_error_t append_ret;
4382 4382
 
4383 4383
     if (cb) {
... ...
@@ -4656,11 +4656,11 @@ cl_error_t cli_magic_scan(cli_ctx *ctx, cli_file_t type)
4656 4656
      * Run the deprecated file_inspection callback.
4657 4657
      */
4658 4658
     ret = dispatch_file_inspection_callback(ctx->engine->cb_file_inspection, ctx, filetype);
4659
-    if (CL_CLEAN != ret) {
4659
+    if (CL_SUCCESS != ret) {
4660 4660
         if (ret == CL_VIRUS) {
4661 4661
             ret = cli_check_fp(ctx, NULL);
4662 4662
         } else {
4663
-            ret = CL_CLEAN;
4663
+            ret = CL_SUCCESS;
4664 4664
         }
4665 4665
         status = ret;
4666 4666
         goto done;
... ...
@@ -5487,7 +5487,7 @@ cl_error_t cli_magic_scan_desc_type(int desc, const char *filepath, cli_ctx *ctx
5487 5487
                                     const char *name, uint32_t attributes)
5488 5488
 {
5489 5489
     STATBUF sb;
5490
-    cl_error_t status = CL_CLEAN;
5490
+    cl_error_t status = CL_SUCCESS;
5491 5491
     fmap_t *new_map   = NULL;
5492 5492
 
5493 5493
     if (!ctx) {
... ...
@@ -5503,7 +5503,7 @@ cl_error_t cli_magic_scan_desc_type(int desc, const char *filepath, cli_ctx *ctx
5503 5503
     }
5504 5504
     if (sb.st_size <= 5) {
5505 5505
         cli_dbgmsg("cli_magic_scan_desc_type: Small data (%u bytes)\n", (unsigned int)sb.st_size);
5506
-        status = CL_CLEAN;
5506
+        status = CL_SUCCESS;
5507 5507
         goto done;
5508 5508
     }
5509 5509
 
... ...
@@ -5555,7 +5555,7 @@ cl_error_t cli_magic_scan_desc(int desc, const char *filepath, cli_ctx *ctx, con
5555 5555
 static cl_error_t magic_scan_nested_fmap_type(cl_fmap_t *map, size_t offset, size_t length, cli_ctx *ctx,
5556 5556
                                               cli_file_t type, const char *name, uint32_t attributes)
5557 5557
 {
5558
-    cl_error_t status = CL_CLEAN;
5558
+    cl_error_t status = CL_SUCCESS;
5559 5559
     fmap_t *new_map   = NULL;
5560 5560
 
5561 5561
     cli_dbgmsg("magic_scan_nested_fmap_type: [0, +%zu), [%zu, +%zu)\n",
... ...
@@ -5608,12 +5608,12 @@ done:
5608 5608
 cl_error_t cli_magic_scan_nested_fmap_type(cl_fmap_t *map, size_t offset, size_t length, cli_ctx *ctx,
5609 5609
                                            cli_file_t type, const char *name, uint32_t attributes)
5610 5610
 {
5611
-    cl_error_t ret = CL_CLEAN;
5611
+    cl_error_t ret = CL_SUCCESS;
5612 5612
 
5613 5613
     cli_dbgmsg("cli_magic_scan_nested_fmap_type: [%zu, +%zu)\n", offset, length);
5614 5614
     if (offset >= map->len) {
5615 5615
         cli_dbgmsg("Invalid offset: %zu\n", offset);
5616
-        return CL_CLEAN;
5616
+        return CL_SUCCESS;
5617 5617
     }
5618 5618
 
5619 5619
     if (ctx->engine->engine_options & ENGINE_OPTIONS_FORCE_TO_DISK) {
... ...
@@ -5638,11 +5638,11 @@ cl_error_t cli_magic_scan_nested_fmap_type(cl_fmap_t *map, size_t offset, size_t
5638 5638
         }
5639 5639
         if (length <= 5) {
5640 5640
             cli_dbgmsg("cli_magic_scan_nested_fmap_type: Small data (%u bytes)\n", (unsigned int)length);
5641
-            return CL_CLEAN;
5641
+            return CL_SUCCESS;
5642 5642
         }
5643 5643
         if (!CLI_ISCONTAINED_0_TO(map->len, offset, length)) {
5644 5644
             cli_dbgmsg("cli_magic_scan_nested_fmap_type: map error occurred [%zu, %zu] not within [0, %zu]\n", offset, length, map->len);
5645
-            return CL_CLEAN;
5645
+            return CL_SUCCESS;
5646 5646
         }
5647 5647
 
5648 5648
         /* Length checked, now get map */
... ...
@@ -6156,15 +6156,15 @@ static cl_error_t scan_common(
6156 6156
             if (0 == evidence_num_indicators_type(ctx.this_layer_evidence, IndicatorType_Strong)) {
6157 6157
                 // And it looks like we haven't reported anything else, so report the last "potentially unwanted" one.
6158 6158
                 // cli_get_last_virus() will do that, grabbing the last alerting indicator of any type.
6159
-                cl_error_t callback_ret = CL_CLEAN;
6159
+                cl_error_t callback_ret = CL_SUCCESS;
6160 6160
 
6161
-                while ((CL_CLEAN == callback_ret) &&
6161
+                while ((CL_SUCCESS == callback_ret) &&
6162 6162
                        (0 < evidence_num_indicators_type(ctx.this_layer_evidence, IndicatorType_PotentiallyUnwanted))) {
6163 6163
                     callback_ret = cli_virus_found_cb(
6164 6164
                         &ctx,
6165 6165
                         cli_get_last_virus(&ctx),
6166 6166
                         IndicatorType_PotentiallyUnwanted);
6167
-                    // If the callback returned CL_CLEAN then it will have also removed the indicator from evidence
6167
+                    // If the callback returned CL_SUCCESS then it will have also removed the indicator from evidence
6168 6168
                     // And we must loop around and report the next one.
6169 6169
                 }
6170 6170
             }
... ...
@@ -6391,7 +6391,7 @@ cl_error_t cl_scandesc_ex(
6391 6391
     }
6392 6392
     if (sb.st_size <= 5) {
6393 6393
         cli_dbgmsg("cl_scandesc_callback: File too small (" STDu64 " bytes), ignoring\n", (uint64_t)sb.st_size);
6394
-        status = CL_CLEAN;
6394
+        status = CL_SUCCESS;
6395 6395
         goto done;
6396 6396
     }
6397 6397
     if ((engine->maxfilesize > 0) && ((uint64_t)sb.st_size > engine->maxfilesize)) {
... ...
@@ -6405,7 +6405,7 @@ cl_error_t cl_scandesc_ex(
6405 6405
             }
6406 6406
             status = CL_VIRUS;
6407 6407
         } else {
6408
-            status = CL_CLEAN;
6408
+            status = CL_SUCCESS;
6409 6409
         }
6410 6410
         goto done;
6411 6411
     }
... ...
@@ -6519,7 +6519,7 @@ cl_error_t cl_scanmap_ex(
6519 6519
             }
6520 6520
             return CL_VIRUS;
6521 6521
         }
6522
-        return CL_CLEAN;
6522
+        return CL_SUCCESS;
6523 6523
     }
6524 6524
 
6525 6525
     if (NULL != filename && map->name == NULL) {