btrfs-progs: build: Do not use cp -a to install files
Subsystems (2)
PATCH 1/1 btrfs-progs: build: Do not use cp -a to install files
Using cp -a to install files will preserve the ownership of the original files (if possible), which is typically not wanted. E.g., if the files were built by a normal user, but are being installed by root, then the installed files would maintain the UIDs/GIDs of the user that built the files rather than be owned by root.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -578,7 +578,7 @@ install: $(libs) $(progs_install) $(INSTALLDIRS) $(LN_S) -f btrfs $(DESTDIR)$(bindir)/btrfsck $(INSTALL) -m755 -d $(DESTDIR)$(libdir) $(INSTALL) $(libs) $(DESTDIR)$(libdir) - cp -a $(lib_links) $(DESTDIR)$(libdir) + cp -d $(lib_links) $(DESTDIR)$(libdir) $(INSTALL) -m755 -d $(DESTDIR)$(incdir) $(INSTALL) -m644 $(headers) $(DESTDIR)$(incdir) ifneq ($(udevdir),)
Signature · 1 line
2.12.0
Quoted 5 lines · Peter Kjellerstedt
Using cp -a to install files will preserve the ownership of the original files (if possible), which is typically not wanted. E.g., if the files were built by a normal user, but are being installed by root, then the installed files would maintain the UIDs/GIDs of the user that built the files rather than be owned by root.
Thanks, Anand
Quoted 7 lines · Peter Kjellerstedt
Using cp -a to install files will preserve the ownership of the original files (if possible), which is typically not wanted. E.g., if the files were built by a normal user, but are being installed by root, then the installed files would maintain the UIDs/GIDs of the user that built the files rather than be owned by root.
Signed-off-by Peter Kjellerstedt <[email protected]>
Applied and added to 4.16, thanks.