diff options
author | Rob Landley <rob@landley.net> | 2016-05-31 17:33:23 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-05-31 17:33:23 -0500 |
commit | 4cf8a72f550e6299138e336ab9f0d37c6b197dd4 (patch) | |
tree | f65e02bcda0c952c4e44b75ac7b376e67e10f245 | |
parent | 6ba719100115ec788bcbc4276a1b4c31e937e855 (diff) | |
download | toybox-4cf8a72f550e6299138e336ab9f0d37c6b197dd4.tar.gz |
In cp -a, don't complain if non-root user can't chown, failure is expected.0.7.1
-rw-r--r-- | toys/posix/cp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c index d21af2ff..06c537eb 100644 --- a/toys/posix/cp.c +++ b/toys/posix/cp.c @@ -318,7 +318,7 @@ int cp_node(struct dirtree *try) rc = fchownat(cfd, catch, try->st.st_uid, try->st.st_gid, AT_SYMLINK_NOFOLLOW); else rc = fchown(fdout, try->st.st_uid, try->st.st_gid); - if (rc) { + if (rc && !geteuid()) { char *pp; perror_msg("chown '%s'", pp = dirtree_path(try, 0)); |