Ticket #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
Note: See
TracTickets for help on using
tickets.
