0

I've got permissions problems with files on my MacOS 10.13.4 desktop.

When I try to correct the problems by hand, I see a curious issue:

Matt$ sudo chown Matt:Engineers TestFile
chown: TestFile: Operation not permitted

Matt$ ls -l
-rwx------ 1 _unknown  _unknown     24281 Jul 19 2016 TestFile

This file was copied as part of a large data transfer from another system with different users. However, chmod should still honor root authority, and even with an unknown user ID, should still allow root or a sudoer to change it.

Any ideas on this situation?

How can assert authority over this file, and correct its ownership and permissions?

2
  • 1
    Please add the results of this command to your question- ls -ledO@ TestFile
    – fd0
    Sep 13, 2018 at 14:10
  • I suspect that there is some ACL (access control list allow for fancier permissions than plain User:Group:Other standard Unix permissions) problems with the file or folder in question. ls -ledO@ TestFile (as alluded to by @fd0 ) will show info about the ACLs and chmod -N TestFile will clear all ACLs.
    – j-beda
    Oct 12, 2022 at 12:27

1 Answer 1

0

I have found that 'chmod' is broken on 10.13.4, but 'cp', 'rm' and 'mv' are not.

That is, as a sudoer I can:

  1. use 'cp' to copy the file (I now own the copy)
  2. use 'rm' to remove the file with corrupted permissions
  3. use 'mv' to rename my copy as the original
  4. use 'chmod' and 'chown' to adjust ownership and permissions on the file.

It's a bit clumsy, but I can use a simple BASH script to fix one of these files, when I find it.

1
  • I suspect that there is some ACL (access control list allow for fancier permissions than plain User:Group:Other standard Unix permissions) problems with the file or folder in question. ls -ledO@ TestFile will show info about the ACLs and chmod -N TestFile will clear all ACLs.
    – j-beda
    Oct 12, 2022 at 12:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .