Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp771807lqt; Fri, 19 Apr 2024 09:54:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqJGk7DAB9d5scYPqaa9FcVGR22j+69H1tnNZPmJYQbKcVvdvgzNOd1OaPOW6/qjGLx7iXlks4RZqaXjlcVmp8g0aUf80vgt/9ua58iA== X-Google-Smtp-Source: AGHT+IGs9qRI4CnBStMZI0WwrooydG3nypjWQ3V0J+EC6j35SzHzaW5BHZMS41gW5CqNLdY/gp3U X-Received: by 2002:a05:622a:1206:b0:436:f26e:465 with SMTP id y6-20020a05622a120600b00436f26e0465mr2804960qtx.25.1713545689001; Fri, 19 Apr 2024 09:54:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713545688; cv=pass; d=google.com; s=arc-20160816; b=vJl02uJ0Hujh3yP+CoFC9Ie0+OKzF2zRlJQUnXO5lMF9qLJOLuDmEV5zlgC05xw1OU qiAA+Wyp4eBrAMdMrL+ovlf+IpBLjLfSZCerR2JnUcHfW9Yk/mGXnv7a6S4tfM4ev7bp YhD1TtgfE3LhOiv62GGqztywNQLJDCjtuLvAcFvdtboJ9kBhlBhF5EAW5QHY4JARYI0y rOzT4C+6iQlMMz/+i971vHbqRBiWbipqGGz1bzI1LJbrxw89kB3GxkD64pE4ZGkeFZRe FvEPwlD5eq1UoSXfUsrTt92lv6QUXqoGdj2b28s7ayV7Ec6kywRacrN47fM/hbEHuvse k1gA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=s8RrX6fyZ456/LIZpdM4fzLm/GVjoSvdhiXZUDPzgVk=; fh=Oo/YKc3ZXqJbr8wkUptwfLZOg8zwO3plMNT1d1bLUFo=; b=tPRQopQdhvVZGO8iJ2o5rM5g5zOiBIJj2sscLhp601S6JjtvVN3vZwWS8lYNKfOGYJ WNcxNFNr9N0VrgYRDKHoleGaD9uS//MxYGl3TQ9g8KPAVS+KaO6heBTX3u4x+Da/oE4S ZKab9tq+wgxDm9326G/63wBGhHi/QHwxa+KzFum4hOdo5P5/Py8nyLbqsI5PsSdAM3uU yZ609lW2joC5EUPMq6X+E+kjr+Tvp9eMRivJJMB+a7OkKKlbevg18u9rtE1GPsD1FJHy fmJailtEtSOOSQM4fRK5Botp6FZyQpp7N7X4qBHe3pA2hGjSBU7pG+lRZUrJvUoXJ1GE sPRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=nlQyy1jL; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-151783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 18-20020ac85952000000b00434996df207si4010055qtz.402.2024.04.19.09.54.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 09:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=nlQyy1jL; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-151783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A71F61C220DE for ; Fri, 19 Apr 2024 16:54:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CD40136E20; Fri, 19 Apr 2024 16:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="nlQyy1jL" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D1FA13848D; Fri, 19 Apr 2024 16:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713545675; cv=none; b=AjZlOJJoTLCgdxIhQaWBJCafIusrVxnzA7gPHtvr9qnSOmOQonDkTXB1ZZO+9FT0A6Kd80JP+Rz0dAG6tK5teTGl5/Jl93uHZpiMGdCe4q6lXWwbG6fEJh8WiBaPj90ZNI5MQ8O7bXhW2ZW1QjDImJzVCGXwAMZq1CTFRnsbPiQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713545675; c=relaxed/simple; bh=p+AhksF9UH47nFYw6ev3EzJCJllx/nP7dwMICYgHVhk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VJMx33vh6tjR5L3lvLcpOOg8FU5NIzCeIUOyiW4jS/gysNciDq3Rlu6OYyab5WcHEqBz2wNDiyVNnCDP7tXXmwIPQ0obyJ8X/F26ySjgiobD9IgTjVnzYxg+v2iIXEP79seb3GRXDP09nu0Gn1y0sn281UzSwFepjEp/Oi7n+4A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=nlQyy1jL; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: by linux.microsoft.com (Postfix, from userid 1134) id C187420FDC2A; Fri, 19 Apr 2024 09:54:33 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C187420FDC2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713545673; bh=s8RrX6fyZ456/LIZpdM4fzLm/GVjoSvdhiXZUDPzgVk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nlQyy1jLlnLNQEOEIA6b4Dplj9u0w+B4PIHV3L2viFaJ2aZ5OSTWUzTSqqj+4qpry IDYXooy6rJ8rlXqB/QHWJGq5JjXyxShX7iionnfftDz/7k25mfjwABak38PwiJYIlw NBHoSvS17ygympnMnxLbeJdB+tO/bNtlQhB+4PTM= Date: Fri, 19 Apr 2024 09:54:33 -0700 From: Shradha Gupta To: Ani Sinha Cc: "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , eahariha@linux.microsoft.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Add a header in ifcfg and nm keyfiles describing the owner of the files Message-ID: <20240419165433.GB506@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20240418120549.59018-1-anisinha@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240418120549.59018-1-anisinha@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) On Thu, Apr 18, 2024 at 05:35:49PM +0530, Ani Sinha wrote: > A comment describing the source of writing the contents of the ifcfg and > network manager keyfiles (hyperv kvp daemon) is useful. It is valuable both > for debugging as well as for preventing users from modifying them. > > CC: shradhagupta@linux.microsoft.com > CC: eahariha@linux.microsoft.com > CC: wei.liu@kernel.org > Signed-off-by: Ani Sinha > --- > tools/hv/hv_kvp_daemon.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > changelog: > v2: simplify and fix issues with error handling. > > diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c > index ae57bf69ad4a..014e45be6981 100644 > --- a/tools/hv/hv_kvp_daemon.c > +++ b/tools/hv/hv_kvp_daemon.c > @@ -94,6 +94,8 @@ static char *lic_version = "Unknown version"; > static char full_domain_name[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; > static struct utsname uts_buf; > > +#define CFG_HEADER "# Generated by hyperv key-value pair daemon. Please do not modify.\n" > + > /* > * The location of the interface configuration file. > */ > @@ -1435,6 +1437,18 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val) > return HV_E_FAIL; > } > > + /* Write the config file headers */ > + error = fprintf(ifcfg_file, CFG_HEADER); > + if (error < 0) { > + error = HV_E_FAIL; > + goto setval_error; > + } > + error = fprintf(nmfile, CFG_HEADER); > + if (error < 0) { > + error = HV_E_FAIL; > + goto setval_error; > + } > + > /* > * First write out the MAC address. > */ > -- > 2.42.0 Reviewed-by: Shradha Gupta