* [Qemu-devel] [PATCH] Makefile: Fix owner and group for qemu-version.h.tmp
@ 2017-01-15 10:03 Lin Ma
2017-01-16 5:32 ` Fam Zheng
0 siblings, 1 reply; 3+ messages in thread
From: Lin Ma @ 2017-01-15 10:03 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini
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 action
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 will be
privileged user/group. When we run 'make' next time, qemu-version.h.tmp can't
be overwrited 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 group
wont be set to privileged user/group.
Signed-off-by: Lin Ma <lma@suse.com>
---
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 $@)
config-host.h: config-host.h-timestamp
config-host.h-timestamp: config-host.mak
--
2.9.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Makefile: Fix owner and group for qemu-version.h.tmp
2017-01-15 10:03 [Qemu-devel] [PATCH] Makefile: Fix owner and group for qemu-version.h.tmp Lin Ma
@ 2017-01-16 5:32 ` Fam Zheng
0 siblings, 0 replies; 3+ messages in thread
From: Fam Zheng @ 2017-01-16 5:32 UTC (permalink / raw)
To: Lin Ma; +Cc: qemu-devel, pbonzini
On Sun, 01/15 18:03, Lin Ma wrote:
> 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 action
> 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 will be
> privileged user/group. When we run 'make' next time, qemu-version.h.tmp can't
> be overwrited because of permission issue.
s/overwrited/overwritten/
Otherwise, the change looks fine to me.
Reviewed-by: Fam Zheng <famz@redhat.com>
>
> 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 group
> wont be set to privileged user/group.
>
> Signed-off-by: Lin Ma <lma@suse.com>
> ---
> 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 $@)
>
> config-host.h: config-host.h-timestamp
> config-host.h-timestamp: config-host.mak
> --
> 2.9.2
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH] Makefile: Fix owner and group for qemu-version.h.tmp
@ 2017-01-17 4:33 Lin Ma
0 siblings, 0 replies; 3+ messages in thread
From: Lin Ma @ 2017-01-17 4:33 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, famz
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 action
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 will 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 group
wont be set to privileged user/group.
Signed-off-by: Lin Ma <lma@suse.com>
---
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 $@)
config-host.h: config-host.h-timestamp
config-host.h-timestamp: config-host.mak
--
2.9.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-17 4:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-15 10:03 [Qemu-devel] [PATCH] Makefile: Fix owner and group for qemu-version.h.tmp Lin Ma
2017-01-16 5:32 ` Fam Zheng
-- strict thread matches above, loose matches on Subject: below --
2017-01-17 4:33 Lin Ma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).