Bug #21773
closedSnap 6.3.0 25 virt-who doesn't validate file contents and file name leading to duplicate config
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1517123
Description of problem:
Using Virt-who Configurations plugin to create new configuration leads to duplicate config if created config same as old one on satellite 6.3 server.
Version-Release number of selected component (if applicable):
satellite 6.3.0 25.0
virt-who-0.19-6.el7_4.noarch
foreman-1.15.6.9-1.el7sat.noarch
How reproducible:
Always
Steps to Reproduce:
1. Infrastructure --> Virt-who Configurations --> Create Config
2. Fill all the details and submit
3. Again follow steps 1 and 2
Actual results:
Creates two configuration files with same name
Expected results:
Should give error while creating new config file which has same contents as old one.
Additional info:
- ll
total 16rw-r--r-. 1 root root 1213 Jul 22 02:16 template.confrw-r--r-. 1 root root 485 Nov 24 12:16 virt-who-config-1.confrw-r--r-. 1 root root 602 Nov 24 12:26 virt-who-config-2.confrw-r--r-. 1 root root 485 Nov 24 14:18 virt-who-config-3.conf - pwd
/etc/virt-who.d
- diff virt-who-config-1.conf virt-who-config-3.conf
3c3
< [virt-who-config-1]
---
[virt-who-config-3]
12,13c12,13
< rhsm_username=virt_who_reporter_1
< rhsm_encrypted_password=8aa98b69ebfddac99e9239d3f93604d8b1e502cb24b051c89a141e29e31f0582
---
rhsm_username=virt_who_reporter_3
rhsm_encrypted_password=a7713acc7262a086c9fa57ba5b914189ebe1ff712c611f3fa83a29ba3d2a5c85
- cat virt-who-config-1.conf
- This configuration file is managed via the virt-who configure plugin
- manual edits will be deleted.
[virt-who-config-1]
type=esx
hypervisor_id=hostname
owner=RedHat
env=Library
server=vmware-1.xxx.redhat.com
username=satadmin
encrypted_password=ea5c98bfec1784e4860a102026eb71ac
rhsm_hostname=vm250-75.xxx.com
rhsm_username=virt_who_reporter_1
rhsm_encrypted_password=8aa98b69ebfddac99e9239d3f93604d8b1e502cb24b051c89a141e29e31f0582
rhsm_prefix=/rhsm