Run cp -a with --no-preserve=xattr, to avoid problems with copied xattrs

Including them breaking permissions setting on some NFS servers.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2021-08-27 13:09:34 -04:00
parent 7b1709105a
commit e17342b2a0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 62 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{- file copying
-
- Copyright 2010-2019 Joey Hess <id@joeyh.name>
- Copyright 2010-2021 Joey Hess <id@joeyh.name>
-
- License: BSD-2-clause
-}
@ -30,6 +30,12 @@ copyMetaDataParams meta = map snd $ filter fst
, Param "-p")
, (not allmeta && BuildInfo.cp_preserve_timestamps
, Param "--preserve=timestamps")
-- cp -a may preserve xattrs that have special meaning,
-- eg to NFS, and have even been observed to prevent later
-- changing the permissions of the file. So prevent preserving
-- xattrs.
, (allmeta && BuildInfo.cp_a && BuildInfo.cp_no_preserve_xattr_supported
, Param "--no-preserve=xattr")
]
where
allmeta = meta == CopyAllMetaData