Skip to content

Commit

Permalink
OpenFileGDB: remove obsole #ifdef FOR_FUSIL code paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 13, 2025
1 parent a498111 commit 2c17139
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 54 deletions.
27 changes: 0 additions & 27 deletions ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
26 changes: 0 additions & 26 deletions ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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") ||
Expand Down Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion port/cpl_known_config_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c17139

Please sign in to comment.