diff options
Diffstat (limited to 'src/test/examples/testlo.c')
-rw-r--r-- | src/test/examples/testlo.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/examples/testlo.c b/src/test/examples/testlo.c index 7afe24714a2..be5c72b9a67 100644 --- a/src/test/examples/testlo.c +++ b/src/test/examples/testlo.c @@ -232,6 +232,17 @@ main(int argc, char **argv) exit_nicely(conn); } + /* Set always-secure search path, so malicous users can't take control. */ + res = PQexec(conn, + "SELECT pg_catalog.set_config('search_path', '', false)"); + if (PQresultStatus(res) != PGRES_COMMAND_OK) + { + fprintf(stderr, "SET failed: %s", PQerrorMessage(conn)); + PQclear(res); + exit_nicely(conn); + } + PQclear(res); + res = PQexec(conn, "begin"); PQclear(res); printf("importing file \"%s\" ...\n", in_filename); |