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/dqstatstool.c

    r34081 r41549  
    223223  PXOPT_COPY_S64(config->args, where, "-dqstats_id", "dqstatsRun.dqstats_id", "==");
    224224  PXOPT_COPY_STR(config->args, where, "-label", "dqstatsRun.label", "==");
     225  PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    225226
    226227  psString query = pxDataGet("dqstatstool_get_run.sql");           // query
     
    230231  }
    231232
    232   if (where && psListLength(where->list)) {
     233  if (psListLength(where->list)) {
    233234    psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    234235    psStringAppend(&query, " AND %s", whereClause);
    235236    psFree(whereClause);
     237  } else {
     238    if (!all) {
     239      psError(PXTOOLS_ERR_SYS, false, "unrestricted query not allowed (try -all)");
     240      return false;
     241    }
    236242  }
    237243  psFree(where);
Note: See TracChangeset for help on using the changeset viewer.