[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH 2/3] tools/hotplug: Fix dhcpd symlink removal in vif-nat


  • To: Wei Liu <wl@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Diego Sueiro <Diego.Sueiro@xxxxxxx>
  • Date: Wed, 9 Sep 2020 12:38:03 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0rCnPxAf56q4NDSxG80F9hQB69WZxrgA6V8E/jsIqwU=; b=bbF4nrMrmrMeP0B1sE58YfkeJw9o2XHbOr8sNKSFulvcKIGD08+htKjiP+GBBJQCzOP4GScP5bxAYvyVbrspKWaMLwDTExMf7y04Zz18wfkJ2x4qNp+Jlf7yEX44gQyxFMX6YU68Fy5A6fUAxuUdOE/8U8tsLMDqVWRHj3zQfmlmbjZLEQ5y1eVaNLIW4oWb7mMNNnEGtxXPnoHQ7AjYH9ucjs7IQB/9kDvoIcSIQMRb0xGHUpcDdJkV0nozbxlcnDsckWlkWkF/mpJiOc/V8byYAhxFggFs5aSVXHPRpKiRoXjKewOnz0JrRkNmJRuQILBFU1QFtft4ZYNynxMDVg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RsX0WCg+quo1jFpMr1pnPZGfu1sggFYDuXHwWFu5oET9DvnPOKjZ3m4ZSMQ+rR5EP9FzfhBUp41Q92qqki5A8HNcmua/V0j10NcBabYqnXGtALFHhAEZxv9Kmd2OiX/crdKZA+nuIVzgwM69uDqKUXlhelVQJgKlJBOaFWLBQSmCT3MBrUX3qW1qqdoMMJfgROoibZ1GXTWQidCGnnmo9nTusuA0GsNRaSI39PBa3KrbEdzqZw0pohb9/3TMFNCGaBHJIAT34gN0BXGqZeaJ7uFTm6GFUg2EvBiMYoMnX2j9wDZz1wD59tyNznIdpX0zqWpoE3GSElEcA/+6qPw/Yg==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, nd <nd@xxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Wed, 09 Sep 2020 12:38:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWduEcCYgO9CTqnUq3GyJB7RikoaldWqeAgAAHKICAAAI2AIAC+exA
  • Thread-topic: [PATCH 2/3] tools/hotplug: Fix dhcpd symlink removal in vif-nat

>-----Original Message-----
>From: Wei Liu <wl@xxxxxxx>
>Sent: 07 September 2020 16:10
>To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
>Cc: Wei Liu <wl@xxxxxxx>; Diego Sueiro <Diego.Sueiro@xxxxxxx>; xen-
>devel@xxxxxxxxxxxxxxxxxxxx; nd <nd@xxxxxxx>; Ian Jackson
><ian.jackson@xxxxxxxxxxxxx>
>Subject: Re: [PATCH 2/3] tools/hotplug: Fix dhcpd symlink removal in vif-nat
>
>On Mon, Sep 07, 2020 at 03:01:37PM +0000, Bertrand Marquis wrote:
>> Hi Wei,
>>
>> > On 7 Sep 2020, at 15:36, Wei Liu <wl@xxxxxxx> wrote:
>> >
>> > On Thu, Aug 20, 2020 at 12:00:23PM +0100, Diego Sueiro wrote:
>> >> Copy temp files used to add/remove dhcpd configurations to avoid
>> >> replacing potential symlinks.
>> >>
>> >
>> > Can you clarify the issue you saw a bit?
>> >
>> > Which one of the parameter is a symlink (I assume the latter) and
>> > what problem you see with replacing the symlinks?
>>
>> Maybe i can explain here.
>>
>> If you have this:
>> /etc/dhcp.conf -> dhcp.conf.real
>>
>> mv will create a new file dhcp.conf where cp will actually modify
>> dhcp.conf.real instead of replacing the symlink with a real file.
>>
>> This prevents some mistakes where the user will actually continue to
>> modify dhcp.conf.real where it would not be the one used anymore.
>
>OK. Now I understand the use case. Thanks.
>
>I think you explanation should be part of the commit message.
>
>Diego, can you please incorporate Bertrand's explanation and deal with my
>comment below?
>

Done and v2 sent to the mailing list. Thanks for your review.

--
Diego Sueiro

>> >> ---
>> >> tools/hotplug/Linux/vif-nat | 12 +++++++-----
>> >> 1 file changed, 7 insertions(+), 5 deletions(-)
>> >>
>> >> diff --git a/tools/hotplug/Linux/vif-nat
>> >> b/tools/hotplug/Linux/vif-nat index 2614435..1ab80ed 100644
>> >> --- a/tools/hotplug/Linux/vif-nat
>> >> +++ b/tools/hotplug/Linux/vif-nat
>> >> @@ -99,7 +99,8 @@ dhcparg_remove_entry()
>> >>   then
>> >>     rm "$tmpfile"
>> >>   else
>> >> -    mv "$tmpfile" "$dhcpd_arg_file"
>> >> +    cp "$tmpfile" "$dhcpd_arg_file"
>> >> +    rm "$tmpfile"
>> >>   fi
>> >
>> > You could've simplified the code a bit here and below now that both
>> > branches issue the same rm command.
>
>Wei.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.