mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-21 20:30:21 -07:00
postgresql_sequence: add trust_input option (#295)
* Add trust_input option to postgresql_sequence Have added the trust_input option to the postgresql_sequence module. * Add changelog fragment Have added a changelog fragment for these changes.
This commit is contained in:
parent
9ff2c7685f
commit
e4dd15a746
3 changed files with 50 additions and 6 deletions
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
# Copyright: (c) 2019, Tobias Birkefeld (@tcraxs) <t@craxs.de>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
|
@ -686,6 +687,27 @@
|
|||
that:
|
||||
- result.rowcount == 1
|
||||
|
||||
####################
|
||||
# Test: create sequence with trust_input
|
||||
- name: postgresql_sequence - check that trust_input works as expected
|
||||
become_user: "{{ pg_user }}"
|
||||
become: yes
|
||||
postgresql_sequence:
|
||||
db: "{{ db_name }}"
|
||||
login_user: "{{ pg_user }}"
|
||||
name: 'just_a_name"; SELECT * FROM information_schema.tables; --'
|
||||
trust_input: no
|
||||
owner: "{{ db_user2 }}"
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
# Checks
|
||||
- name: postgresql_sequence - check with assert the output
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
- result.msg is search('is potentially dangerous')
|
||||
|
||||
# Cleanup
|
||||
- name: postgresql_sequence - destroy DB
|
||||
become_user: "{{ pg_user }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue