btrfs-progs: build: Do not use cp -a to install library links
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Wed, 4 Apr 2018 14:04:59 +0000 (16:04 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 6 Apr 2018 13:06:50 +0000 (15:06 +0200)
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 <peter.kjellerstedt@axis.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Makefile

index fbd6677..5ba76d2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -642,7 +642,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)/btrfs
        $(INSTALL) -m644 $(libbtrfs_headers) $(DESTDIR)$(incdir)/btrfs
        $(INSTALL) -m644 libbtrfsutil/btrfsutil.h $(DESTDIR)$(incdir)