Uploaded image for project: 'GeoServer'
  1. GEOS-8796

GeorectifyCoverage fails to handle paths with spaces

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.12.4, 2.13.1, 2.14-RC
    • Fix Version/s: 2.12.5, 2.13.2
    • Component/s: WPS
    • Labels:
      None

      Description

      GeorectifyCoverage constructs gdal_translate command lines as strings without any consideration of arguments such as filenames containing spaces that might require quoting.

      For example, building with -Djava.io.tmpdir=target in a path with spaces fails:

      Tests in error: 
        testGeorectify(org.geoserver.wps.gs.GeorectifyCoverageTest): Error launching OS command: 'gdal_translate' with arguments '-of VRT  -gcp 183 33 -74.01183158 40.70852996 -gcp 103 114 -74.01083751 40.70754684 -gcp 459 298 -74.00857344 40.71194565 -gcp 252 139 -74.01053024 40.70938712  /home/ben/geoserver/src with spaces/geoserver/src/extension/wps/wps-core/target/readCoverage6331435335797481973.tif /home/ben/geoserver/src with spaces/geoserver/src/extension/wps/wps-core/target/vrt_4681318640566863810.vrt' and env vars 'null': (..)
      

      Rather than trying to add argument quoting and then preserve it through String split and join operations, a better approach is pass arguments lists as List<String> and let ProcessBuilder do all the argument quoting. This is a more idiomatic use of ProcessBuilder.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                bencaradocdavies Ben Caradoc-Davies
                Reporter:
                bencaradocdavies Ben Caradoc-Davies
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: