MCPcopy Index your code
hub / github.com/MapServer/MapServer / msSplitLogin

Function msSplitLogin

maporaclespatial.c:301–343  ·  view source on GitHub ↗

break layer->connection (username/password@dblink) into username, password and dblink */

Source from the content-addressed store, hash-verified

299
300/* break layer->connection (username/password@dblink) into username, password and dblink */
301static void msSplitLogin( char *connection, mapObj *map, char **username, char **password, char **dblink )
302{
303 char *src, *tgt, *conn_decrypted;
304 size_t buffer_size = 0;
305
306 /* bad 'connection' */
307 if (connection == NULL) return;
308
309 buffer_size = strlen(connection)+1;
310 *username = (char*)malloc(buffer_size);
311 *password = (char*)malloc(buffer_size);
312 *dblink = (char*)malloc(buffer_size);
313
314 /* clearup */
315 **username = **password = **dblink = 0;
316
317 /* Decrypt any encrypted token */
318 conn_decrypted = msDecryptStringTokens(map, connection);
319 if (conn_decrypted == NULL) return;
320
321 /* ok, split connection */
322 for( tgt=*username, src=conn_decrypted; *src; src++, tgt++ )
323 if (*src=='/' || *src=='@')
324 break;
325 else
326 *tgt = *src;
327 *tgt = 0;
328 if (*src == '/')
329 {
330 for( tgt=*password, ++src; *src; src++, tgt++ )
331 if (*src == '@')
332 break;
333 else
334 *tgt = *src;
335 *tgt = 0;
336 }
337 if (*src == '@')
338 {
339 strlcpy( *dblink, ++src, buffer_size);
340 }
341
342 msFree(conn_decrypted);
343}
344
345/* break layer->data into geometry_column_name, table_name and srid */
346static int msSplitData( char *data, char **geometry_column_name, char **table_name, char **unique, char **srid, int *function, int *version )

Callers 1

msOracleSpatialLayerOpenFunction · 0.85

Calls 3

msDecryptStringTokensFunction · 0.85
strlcpyFunction · 0.85
msFreeFunction · 0.85

Tested by

no test coverage detected