MCPcopy Create free account
hub / github.com/coreutils/coreutils / chown_failure_ok

Function chown_failure_ok

src/copy.c:2853–2868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2851 option set. */
2852
2853extern bool
2854chown_failure_ok (struct cp_options const *x)
2855{
2856 /* If non-root uses -p, it's ok if we can't preserve ownership.
2857 But root probably wants to know, e.g. if NFS disallows it,
2858 or if the target system doesn't support file ownership.
2859
2860 Treat EACCES like EPERM and EINVAL to work around a bug in Linux
2861 CIFS <https://bugs.gnu.org/65599>. Although this means coreutils
2862 will ignore EACCES errors that it should report, problems should
2863 occur only when some other process is racing with coreutils and
2864 coreutils is not immune to races anyway. */
2865
2866 return ((errno == EPERM || errno == EINVAL || errno == EACCES)
2867 && !x->chown_privileges);
2868}
2869
2870/* Similarly, return true if it's OK for chmod and similar operations
2871 to fail, where errno is the error number that chmod failed with and

Callers 3

set_ownerFunction · 0.85
copy_internalFunction · 0.85
re_protectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected