tools/hotplug: Fix dhcpd symlink removal in vif-nat
authorDiego Sueiro <diego.sueiro@arm.com>
Wed, 9 Sep 2020 12:35:56 +0000 (13:35 +0100)
committerWei Liu <wl@xen.org>
Wed, 9 Sep 2020 12:41:59 +0000 (12:41 +0000)
commit6d2f1ebccdef655d64fbc3abc83db76c3de08cb1
tree48aaa5737be17fe03cfefac0bc46e42dd1e29880
parent17f80e7fc1e3bb49fc91794ef1b6e5a2f1b540cb
tools/hotplug: Fix dhcpd symlink removal in vif-nat

Copy temp files used to add/remove dhcpd configurations to avoid
replacing potential symlinks.

If dhcp.conf is a symlink pointing to dhcp.conf.real, using 'mv'
creates a new file dhcp.conf where cp will actually modify
dhcp.conf.real instead of replacing the symlink with a real
file.

Using 'cp' prevents some mistakes where the user will actually
continue to modify dhcp.conf.real where it would not be the one
used anymore.

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Wei Liu <wl@xen.org>
tools/hotplug/Linux/vif-nat