IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 43013


Ignore:
Timestamp:
May 11, 2026, 3:07:05 PM (3 months ago)
Author:
eugene
Message:

only allow pxadmin to delete databases named "test" or "simtest"

Location:
branches/eam_branches/ipp-pstamp-20260421/ippTools/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-pstamp-20260421/ippTools/src/difftool.c

    r41681 r43013  
    12501250  PXOPT_COPY_STR(config->args, where, "-data_group", "warpRun.data_group", "==");
    12511251  PXOPT_COPY_STR(config->args, where, "-skycell_id", "warpSkyfile.skycell_id", "==");
    1252   PXOPT_COPY_F32(config->args, where,  "-good_frac", "warpSkyfile.good_frac", ">=");
     1252  PXOPT_COPY_F32(config->args, where, "-good_frac", "warpSkyfile.good_frac", ">=");
    12531253  PXOPT_COPY_STR(config->args, where, "-stack_label", "stackRun.label", "==");
    12541254  PXOPT_COPY_STR(config->args, where, "-stack_data_group", "stackRun.data_group", "==");
     
    13241324
    13251325    // This is just a simple query, so we don't need to do a transaction
    1326     if (!p_psDBRunQueryF(config->dbh, query, whereClauseString, diffWhereClause,joinWhereClause)) {
     1326    if (!p_psDBRunQueryF(config->dbh, query, whereClauseString, diffWhereClause, joinWhereClause)) {
    13271327      psError(PS_ERR_UNKNOWN, false, "database error");
    13281328      psFree(query);
     
    13341334    psFree(joinWhereClause);
    13351335   
    1336   }
    1337   else {
     1336  } else {
    13381337    // Don't queue things that already have diffs.
    13391338    if (! (reRun || newTemplates) ) {
  • branches/eam_branches/ipp-pstamp-20260421/ippTools/src/pxadmin.c

    r42387 r43013  
    185185
    186186        // if name is e.g., gpc1, strcasecmp returns FALSE
    187         bool allowDelete = true;
    188         allowDelete = allowDelete && strcasecmp(dbName, "gpc1"); 
    189         allowDelete = allowDelete && strcasecmp(dbName, "gpc2"); 
    190         allowDelete = allowDelete && strcasecmp(dbName, "nebulous"); 
    191         allowDelete = allowDelete && strcasecmp(dbName, "isp"); 
    192         allowDelete = allowDelete && strcasecmp(dbName, "ssp"); 
    193         allowDelete = allowDelete && strcasecmp(dbName, "uic"); 
    194         allowDelete = allowDelete && strcasecmp(dbName, "hsc_v1"); 
    195         allowDelete = allowDelete && strcasecmp(dbName, "megacam_v1"); 
     187        bool allowDelete = false;
     188
     189        // only allow deletion for the following test databases:
     190        allowDelete = allowDelete || !strcasecmp(dbName, "test"); 
     191        allowDelete = allowDelete || !strcasecmp(dbName, "simtest"); 
     192
     193        // allowDelete = allowDelete && strcasecmp(dbName, "gpc1"); 
     194        // allowDelete = allowDelete && strcasecmp(dbName, "gpc2"); 
     195        // allowDelete = allowDelete && strcasecmp(dbName, "nebulous"); 
     196        // allowDelete = allowDelete && strcasecmp(dbName, "isp"); 
     197        // allowDelete = allowDelete && strcasecmp(dbName, "ssp"); 
     198        // allowDelete = allowDelete && strcasecmp(dbName, "uic"); 
     199        // allowDelete = allowDelete && strcasecmp(dbName, "hsc_v1"); 
     200        // allowDelete = allowDelete && strcasecmp(dbName, "megacam_v1"); 
    196201
    197202        if (!allowDelete) {
  • branches/eam_branches/ipp-pstamp-20260421/ippTools/src/stacktool.c

    r42837 r43013  
    15541554    return false;
    15551555  }
    1556 
    15571556  psFree(where);
    15581557
Note: See TracChangeset for help on using the changeset viewer.