From 2c17139bb8a634148e869e0bb47359bee26c8634 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 13 Jan 2025 20:28:38 +0100 Subject: [PATCH] OpenFileGDB: remove obsole #ifdef FOR_FUSIL code paths --- .../openfilegdb/ogropenfilegdbdriver.cpp | 27 ------------------- .../openfilegdb/ogropenfilegdbdrivercore.cpp | 26 ------------------ port/cpl_known_config_options.h | 1 - 3 files changed, 54 deletions(-) diff --git a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp index 8874dc5813bd..a3d9ee87e6a1 100644 --- a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp @@ -37,37 +37,10 @@ static GDALDataset *OGROpenFileGDBDriverOpen(GDALOpenInfo *poOpenInfo) { const char *pszFilename = poOpenInfo->pszFilename; -#ifdef FOR_FUSIL - CPLString osOrigFilename(pszFilename); -#endif if (OGROpenFileGDBDriverIdentify(poOpenInfo, pszFilename) == GDAL_IDENTIFY_FALSE) return nullptr; -#ifdef FOR_FUSIL - const char *pszSrcDir = CPLGetConfigOption("FUSIL_SRC_DIR", NULL); - if (pszSrcDir != NULL && VSIStatL(osOrigFilename, &stat) == 0 && - VSI_ISREG(stat.st_mode)) - { - /* Copy all files from FUSIL_SRC_DIR to directory of pszFilename */ - /* except pszFilename itself */ - CPLString osSave(pszFilename); - char **papszFiles = VSIReadDir(pszSrcDir); - for (int i = 0; papszFiles[i] != NULL; i++) - { - if (strcmp(papszFiles[i], CPLGetFilename(osOrigFilename)) != 0) - { - CPLCopyFile( - CPLFormFilename(CPLGetPathSafe(osOrigFilename).c_str(), - papszFiles[i], NULL), - CPLFormFilename(pszSrcDir, papszFiles[i], NULL)); - } - } - CSLDestroy(papszFiles); - pszFilename = CPLFormFilename("", osSave.c_str(), NULL); - } -#endif - #ifdef DEBUG /* For AFL, so that .cur_input is detected as the archive filename */ if (poOpenInfo->fpL != nullptr && diff --git a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdrivercore.cpp b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdrivercore.cpp index b7dcc71b18cd..3dbbd49c36f5 100644 --- a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdrivercore.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdrivercore.cpp @@ -27,11 +27,6 @@ GDALIdentifyEnum OGROpenFileGDBDriverIdentify(GDALOpenInfo *poOpenInfo, if (STARTS_WITH(pszFilename, "OpenFileGDB:")) return GDAL_IDENTIFY_TRUE; - // FUSIL is a fuzzer -#ifdef FOR_FUSIL - CPLString osOrigFilename(pszFilename); -#endif - // First check if we have to do any work. size_t nLen = strlen(pszFilename); if (ENDS_WITH(pszFilename, nLen, ".gdb") || @@ -104,27 +99,6 @@ GDALIdentifyEnum OGROpenFileGDBDriverIdentify(GDALOpenInfo *poOpenInfo, { return GDAL_IDENTIFY_TRUE; } -#ifdef FOR_FUSIL - /* To be able to test fuzzer on any auxiliary files used (indexes, etc.) */ - else if (CPLGetBasenameSafe(pszFilename).size() == 9 && - CPLGetBasenameSafe(pszFilename)[0] == 'a') - { - pszFilename = CPLFormFilename(CPLGetPathSafe(pszFilename).c_str(), - CPLGetBasenameSafe(pszFilename).c_str(), - "gdbtable"); - return GDAL_IDENTIFY_TRUE; - } - else if (strlen(CPLGetBasenameSafe(CPLGetBasename(pszFilename)).c_str()) == - 9 && - CPLGetBasename(CPLGetBasenameSafe(pszFilename).c_str())[0] == 'a') - { - pszFilename = CPLFormFilename( - CPLGetPathSafe(pszFilename).c_str(), - CPLGetBasename(CPLGetBasenameSafe(pszFilename).c_str()), - "gdbtable"); - return GDAL_IDENTIFY_TRUE; - } -#endif #ifdef DEBUG /* For AFL, so that .cur_input is detected as the archive filename */ diff --git a/port/cpl_known_config_options.h b/port/cpl_known_config_options.h index c866bad5b3b5..336110c05885 100644 --- a/port/cpl_known_config_options.h +++ b/port/cpl_known_config_options.h @@ -224,7 +224,6 @@ constexpr static const char* const apszKnownConfigOptions[] = "FGDB_STRING_WIDTH", // from FGdbUtils.cpp "FILEGDB_DISABLE_SPARSE_PAGES", // from FGdbLayer.cpp "FORCE_BLOCKSIZE", // from hfaopen.cpp - "FUSIL_SRC_DIR", // from ogropenfilegdbdriver.cpp "GDAL_ALLOW_LARGE_LIBJPEG_MEM_ALLOC", // from JPEG_band.cpp, jpgdataset.cpp "GDAL_BAG_BLOCK_SIZE", // from bagdataset.cpp "GDAL_BAG_MAX_SIZE_VARRES_MAP", // from bagdataset.cpp