From nobody Sun May 5 15:40:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486979598320670.9952545129239; Mon, 13 Feb 2017 01:53:18 -0800 (PST) Received: from localhost ([::1]:55406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdDJs-00028y-7t for importer@patchew.org; Mon, 13 Feb 2017 04:53:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdDIw-0001js-3f for qemu-devel@nongnu.org; Mon, 13 Feb 2017 04:52:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdDIs-0002ZJ-Qz for qemu-devel@nongnu.org; Mon, 13 Feb 2017 04:52:18 -0500 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:33259) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cdDIs-0002XV-Ho for qemu-devel@nongnu.org; Mon, 13 Feb 2017 04:52:14 -0500 Received: from linux-xpcv.apac.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Mon, 13 Feb 2017 02:51:57 -0700 From: Lin Ma To: qemu-devel@nongnu.org Date: Mon, 13 Feb 2017 17:51:48 +0800 Message-Id: <20170213095148.25500-1-lma@suse.com> X-Mailer: git-send-email 2.9.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 137.65.250.26 Subject: [Qemu-devel] [PATCH v2 RESEND] Makefile: Fix owner and group for qemu-version.h.tmp X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: famz@redhat.com, stefanha@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" By commit 67a1de0d, When we perform 'git pull && make && sudo make install', In 'make' stage a qemu-version.h.tmp will be generated. If the content of qemu-version.h.tmp and qemu-version.h aren't consistent, The qemu-version.h= .tmp will be renamed to qemu-version.h. Because of the target FORCE, The same ac= tion will be do again in 'make install' stage. In 'make install' stage, If there is no qemu-version.h.tmp exists and we run 'make install' with sudo, The owner and group of new qemu-version.h.tmp wil= l be privileged user/group. When we run 'make' next time, qemu-version.h.tmp can= 't be overwritten because of permission issue. This patch uses 'cp' instead of 'mv' to keep the qemu-version.h.tmp file, So during the 'sudo make install' stage, new qemu-version.h.tmp's owner and gr= oup wont be set to privileged user/group. Signed-off-by: Lin Ma Reviewed-by: Fam Zheng --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1a8bfb2..1ca45b2 100644 --- a/Makefile +++ b/Makefile @@ -184,7 +184,7 @@ qemu-version.h: FORCE printf '""\n'; \ fi; \ fi) > $@.tmp) - $(call quiet-command, cmp -s $@ $@.tmp || mv $@.tmp $@) + $(call quiet-command, cmp -s $@ $@.tmp || cp $@.tmp $@) =20 config-host.h: config-host.h-timestamp config-host.h-timestamp: config-host.mak --=20 2.9.2