Azure/WALinuxAgent

SUSE: sysconfig values may get clobbered

FladoToo opened this issue · 2 comments

if value == '"AUTO"' or value == '"{0}"'.format(hostname):

Looking at wicked's source, this is buggy. Wicked accepts values with single quotes, double quotes, and no quotes at all, so this code should be prepared to react to all those variants ("AUTO", 'AUTO', and AUTO) and not clobber them if the wrong quotes are used.

https://github.com/openSUSE/wicked/blob/a0ba667fd3101bea28c7b0bb3d8692accf6069ae/src/sysconfig.c#L313-L318

Thanks, fixed by #1951

@narrieta, do you mean #2583? Because #1951 is from January 2021...
Anyway, the fix in #2583 is very welcome, but not enough. It only repairs the damage done by the buggy agent and that only while de-provisioning. Meanwhile any hostname change would clobber any value that uses the wrong quotes or no quotes at all. Since AUTO, "AUTO" and 'AUTO' are all valid entries for wicked I don't think any of them should be clobbered by the agent at the first host rename.