Opened 15 years ago

Closed 15 years ago

#2912 closed defect (fixed)

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 (3)

comment:1 by sdlime, 15 years ago

Cc: morissette added
Milestone: 5.4 release5.4.1 release

comment:2 by dmorissette, 15 years ago

Cc: sdlime added
Milestone: 5.6 release6.0 release
Owner: changed from sdlime to aboudreault

comment:3 by aboudreault, 15 years ago

Resolution: fixed
Status: newclosed

Fixed and committed in r9589.

Note: See TracTickets for help on using tickets.