Bug 717251

Summary: [yast2-core] IniAgent with SysConfigFile would corrupt "'foo\nbar'" entries
Product: [openSUSE] openSUSE 12.1 Reporter: Lukas Ocilka <locilka>
Component: YaST2Assignee: Martin Vidner <mvidner>
Status: RESOLVED WONTFIX QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P3 - Medium    
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://trello.com/c/agc53K37
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Full diff of my config file
The whole SuSEfirewall2 config file

Description Lukas Ocilka 2011-09-12 13:13:32 UTC
/etc/sysconfig/SuSEfirewall2
--- cut ---
FW_SERVICES_ACCEPT_RELATED_INT='0/0,udp,427
0/0,udp,11
0/0,udp,22
0/0,udp,33
0/0,udp,44'
--- cut ---

/usr/share/YaST2/scrconf/sysconfig_SuSEfirewall2.scr
--- cut ---
.sysconfig.SuSEfirewall2

`ag_ini(
    `SysConfigFile("/etc/sysconfig/SuSEfirewall2")
)
--- cut ---

echo '\`Read(.sysconfig.SuSEfirewall2.FW_SERVICES_ACCEPT_RELATED_INT)' |  /usr/lib/YaST2/bin/y2base stdio scr
--- cut ---
([])
((nil))
("'0/0,udp,427")
((nil))
--- cut ---
Comment 1 Martin Vidner 2011-09-12 13:47:42 UTC
OK, IIUC currently this will not be triggered, because yast2-firewall uses a modified sysconfig_SuSEfirewall2.scr, which has another bug (misparsing FW_FOO='', right? after fixing bnc#712670 ?).

http://svn.opensuse.org/viewvc/yast/trunk/yast2/library/network/agents/sysconfig_SuSEfirewall2.scr?view=log

The severity will be much higher if they result in yast corrupting the config file (writing back the truncated value). Is that the case?
Comment 2 Lukas Ocilka 2011-09-12 14:15:03 UTC
(In reply to comment #1)
> OK, IIUC currently this will not be triggered, because yast2-firewall uses a
> modified sysconfig_SuSEfirewall2.scr, which has another bug (misparsing
> FW_FOO='', right? after fixing bnc#712670 ?).

It's bug #716013

> The severity will be much higher if they result in yast corrupting the config
> file (writing back the truncated value). Is that the case?

Er, yes, values are truncated. Full diff will be attached.
Comment 3 Lukas Ocilka 2011-09-12 14:16:33 UTC
Created attachment 450245 [details]
Full diff of my config file

diff -u /etc/sysconfig/SuSEfirewall2.backup /etc/sysconfig/SuSEfirewall2 > /SuSEfirewall2.diff

BTW, only this change was wanted (to trigger writing new config file):
-FW_CONFIGURATIONS_EXT="apache2 apache2-ssl bind postgresql sshd vnc-server"
+FW_CONFIGURATIONS_EXT="apache2 apache2-ssl bind mysql postgresql sshd vnc-server"
Comment 4 Lukas Ocilka 2011-09-13 09:34:48 UTC
Created attachment 450407 [details]
The whole SuSEfirewall2 config file

... in the initial state ...
... just for the record ...
Comment 5 Martin Vidner 2011-10-11 09:20:27 UTC
It is a long standing bug. It is rare, dependent on manual editing of the config with unusual syntax, but it is data corruption, so it will need to be fixed in SLE too.
Comment 6 Tomáš Chvátal 2017-08-12 16:24:22 UTC
12.1 release is out of support. As it is hard to reproduce the problem on the current releases please retry on the current distribution and open a new issue if it is still present.