1 /*
2   Copyright 2021 Northern.tech AS
3 
4   This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
5 
6   This program is free software; you can redistribute it and/or modify it
7   under the terms of the GNU General Public License as published by the
8   Free Software Foundation; version 3.
9 
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14 
15   You should have received a copy of the GNU General Public License
16   along with this program; if not, write to the Free Software
17   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
18 
19   To the extent this program is licensed as part of the Enterprise
20   versions of CFEngine, the applicable Commercial Open Source License
21   (COSL) may apply to this file if you as a licensee so wish it. See
22   included file COSL.txt.
23 */
24 
25 #ifndef CFENGINE_FILES_COPY_H
26 #define CFENGINE_FILES_COPY_H
27 
28 #include <cf3.defs.h>
29 
30 #ifdef WITH_XATTR_EXTRA_ARGS
31 #define llistxattr(__arg1, __arg2, __arg3) \
32     llistxattr((__arg1), (__arg2), (__arg3), 0)
33 #define lgetxattr(__arg1, __arg2, __arg3, __arg4) \
34     lgetxattr((__arg1), (__arg2), (__arg3), (__arg4), 0, 0)
35 #define lsetxattr(__arg1, __arg2, __arg3, __arg4, __arg5) \
36     lsetxattr((__arg1), (__arg2), (__arg3), (__arg4), 0, (__arg5))
37 #endif
38 
39 bool CopyRegularFileDiskPerms(const char *source, const char *destination,
40                               const int mode);
41 bool CopyRegularFileDisk(const char *source, const char *destination);
42 bool CopyFilePermissionsDisk(const char *source, const char *destination);
43 bool CopyFileExtendedAttributesDisk(const char *source, const char *destination, bool *change);
44 
45 #endif
46