An attempt to restrict the search path to avoid injections
An alternative way to fix #168 which is not as invasive as the changes in #171. This currently breaks the current behaviour of the program as the tables specified on command line are not found.
This commit is contained in:
parent
ce8e283f63
commit
914537edc7
@ -99,6 +99,9 @@ setup_workers(int num_workers)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Hardcode a search path to avoid injections into public or pg_temp */
|
||||||
|
pgut_command(conn, "SET search_path TO pg_catalog, pg_temp", 0, NULL);
|
||||||
|
|
||||||
/* Make sure each worker connection can work in non-blocking
|
/* Make sure each worker connection can work in non-blocking
|
||||||
* mode.
|
* mode.
|
||||||
*/
|
*/
|
||||||
|
@ -504,6 +504,9 @@ pgut_connect(const char *info, YesNo prompt, int elevel)
|
|||||||
termStringInfo(&add_pass);
|
termStringInfo(&add_pass);
|
||||||
free(passwd);
|
free(passwd);
|
||||||
|
|
||||||
|
/* Hardcode a search path to avoid injections into public or pg_temp */
|
||||||
|
pgut_command(conn, "SET search_path TO pg_catalog, pg_temp", 0, NULL);
|
||||||
|
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user