Ticket #2912 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Joins do not accept crypted passwords

Reported by: mko Owned by: aboudreault
Priority: normal Milestone: 6.0 release
Component: MapServer C Library Version: 5.2
Severity: normal Keywords: join crypt
Cc: morissette, mko, sdlime

Description

A JOIN can not have an encryped password in its connection string:

LAYER
   DATA "prov.shp"
   JOIN
      CONNECTION "host=127.0.0.1 port=5432 user=postgres password={XXXXXX} dbname=join" # will not work
   END

Solution: add msDecryptStringTokens() to the *JoinConnect? functions:

//mappostgresql.c, msPOSTGRESQLJoinConnect(), line 119:
    /* Establish database connection */
    char *conn_decrypted;
    conn_decrypted = msDecryptStringTokens(layer->map, join->connection);
    if (conn_decrypted != NULL) {
        joininfo->conn = PQconnectdb(conn_decrypted);
    }

//mapjoin.c, msMySQLJoinConnect(), line 579:
   char *conn_decrypted;
   conn_decrypted = msDecryptStringTokens(layer->map, join->connection);
   if (conn_decrypted == NULL) {
      return(MS_FAILURE);  /* An error should already have been produced */
   }
   delim = strdup(":");
   DB_HOST = strdup(strtok(conn_decrypted, delim));

Change History

Changed 4 years ago by sdlime

  • cc morissette added
  • milestone changed from 5.4 release to 5.4.1 release

Changed 3 years ago by dmorissette

  • cc sdlime added
  • owner changed from sdlime to aboudreault
  • milestone changed from 5.6 release to 6.0 release

Changed 3 years ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

Fixed and committed in r9589.

Note: See TracTickets for help on using tickets.