IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 9, 2021, 4:44:03 PM (5 years ago)
Author:
eugene
Message:

disallow unrestricted queries and add -all option to definebyquery commands and others which would generate very long results if allowed: camtool, chiptool, difftool, dqstatstool, faketool, pubtool, warptool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/faketool.c

    r34081 r41549  
    367367    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    368368    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     369    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    369370
    370371    psMetadata *where = psMetadataAlloc();
     
    385386        psStringAppend(&query, " AND %s", whereClause);
    386387        psFree(whereClause);
     388    } else {
     389      if (!all) {
     390        psError(PXTOOLS_ERR_SYS, false, "unrestricted query not allowed (try -all)");
     391        return false;
     392      }
    387393    }
    388394    psFree(where);
     
    432438    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    433439    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     440    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    434441
    435442    psMetadata *where = psMetadataAlloc();
     
    451458        psStringAppend(&query, " AND %s", whereClause);
    452459        psFree(whereClause);
     460    } else {
     461      if (!all) {
     462        psError(PXTOOLS_ERR_SYS, false, "unrestricted query not allowed (try -all)");
     463        return false;
     464      }
    453465    }
    454466    psFree(where);
     
    886898    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    887899    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     900    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    888901
    889902    psMetadata *where = psMetadataAlloc();
     
    900913        psStringAppend(&query, " AND %s", whereClause);
    901914        psFree(whereClause);
     915    } else {
     916      if (!all) {
     917        psError(PXTOOLS_ERR_SYS, false, "unrestricted query not allowed (try -all)");
     918        return false;
     919      }
    902920    }
    903921    psFree(where);
     
    948966    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    949967    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     968    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    950969
    951970    psMetadata *where = psMetadataAlloc();
     
    965984        psStringAppend(&query, " AND %s", whereClause);
    966985        psFree(whereClause);
     986    } else {
     987      if (!all) {
     988        psError(PXTOOLS_ERR_SYS, false, "unrestricted query not allowed (try -all)");
     989        return false;
     990      }
    967991    }
    968992    psFree(where);
Note: See TracChangeset for help on using the changeset viewer.