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:
Thomas O'Donnell 2020-05-07 08:07:49 +02:00 committed by GitHub
commit e4dd15a746
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 6 deletions

View file

@ -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 }}"