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

    r40534 r41549  
    489489    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    490490    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     491    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    491492
    492493    psMetadata *where = psMetadataAlloc();
     
    502503    }
    503504
    504     if (where && psListLength(where->list)) {
     505    if (psListLength(where->list)) {
    505506        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    506507        psStringAppend(&query, " AND %s", whereClause);
    507508        psFree(whereClause);
     509    } else {
     510      if (!all) {
     511        psError(PXTOOLS_ERR_SYS, false, "unrestricted query not allowed (try -all)");
     512        return false;
     513      }
    508514    }
    509515    psFree(where);
     
    12691275    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    12701276    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     1277    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    12711278
    12721279    psMetadata *where = psMetadataAlloc();
     
    12831290        psStringAppend(&query, " AND %s", whereClause);
    12841291        psFree(whereClause);
     1292    } else {
     1293      if (!all) {
     1294        psError(PXTOOLS_ERR_SYS, false, "unrestricted query not allowed (try -all");
     1295        return false;
     1296      }
    12851297    }
    12861298    psFree(where);
     
    13511363        psStringAppend(&query, " AND %s", whereClause);
    13521364        psFree(whereClause);
     1365    } else {
     1366      if (!all) {
     1367        psError(PXTOOLS_ERR_SYS, false, "unrestricted query not allowed (try -all)");
     1368        return false;
     1369      }
    13531370    }
    13541371    psFree(where);
Note: See TracChangeset for help on using the changeset viewer.