mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 18:50:21 -07:00
postgresql_copy: add trust_input parameter (#313)
* postgresql_copy: add trust_input parameter * add changelog fragment
This commit is contained in:
parent
51b8e79203
commit
fce150fcf7
3 changed files with 51 additions and 2 deletions
|
@ -52,6 +52,7 @@
|
|||
<<: *pg_parameters
|
||||
copy_to: '{{ data_file_txt }}'
|
||||
src: '{{ test_table }}'
|
||||
trust_input: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
|
@ -76,6 +77,7 @@
|
|||
<<: *pg_parameters
|
||||
copy_from: '{{ data_file_txt }}'
|
||||
dst: '{{ test_table }}'
|
||||
trust_input: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
|
@ -101,18 +103,35 @@
|
|||
<<: *pg_parameters
|
||||
copy_to: '{{ data_file_txt }}'
|
||||
src: non_existent_table
|
||||
trust_input: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.failed == true
|
||||
- result.queries is not defined
|
||||
|
||||
- name: postgresql_copy - check trust_input
|
||||
<<: *task_parameters
|
||||
postgresql_copy:
|
||||
<<: *pg_parameters
|
||||
copy_to: '{{ data_file_txt }}'
|
||||
src: '{{ test_table }}'
|
||||
session_role: 'curious.anonymous"; SELECT * FROM information_schema.tables; --'
|
||||
trust_input: no
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is failed
|
||||
- result.msg is search('is potentially dangerous')
|
||||
|
||||
- name: postgresql_copy - copy test table data to data_file_txt
|
||||
<<: *task_parameters
|
||||
postgresql_copy:
|
||||
<<: *pg_parameters
|
||||
copy_to: '{{ data_file_txt }}'
|
||||
src: '{{ test_table }}'
|
||||
trust_input: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
|
@ -142,6 +161,7 @@
|
|||
- name
|
||||
options:
|
||||
format: csv
|
||||
trust_input: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
|
@ -170,6 +190,7 @@
|
|||
- name
|
||||
options:
|
||||
format: csv
|
||||
trust_input: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
|
@ -198,6 +219,7 @@
|
|||
columns: id, name
|
||||
options:
|
||||
delimiter: '|'
|
||||
trust_input: no
|
||||
when: ansible_distribution != 'FreeBSD'
|
||||
|
||||
- assert:
|
||||
|
@ -218,6 +240,7 @@
|
|||
columns: id, name
|
||||
options:
|
||||
delimiter: ','
|
||||
trust_input: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue