6

I downloaded and extracted an archive from GitHub (Homebrew/brew) into a temporary directory under /root (with help from sudo). If I do ls -l I see an extended attribute:

total 0
drwxr-xr-x@ 16 root  wheel  512 Jul  2 09:30 brew-master

If I do ls -l@ (thanks to this answer to this question) I get the following output:

total 0
drwxr-xr-x@ 16 root  wheel  512 Jul  2 09:30 brew-master
    com.apple.quarantine     59 

If I do ls -l@ brew-master I get the following output:

total 48
-rw-r--r--@  1 root  wheel    98 Jul  2 09:30 CHANGELOG.md
    com.apple.quarantine      59 
-rw-r--r--@  1 root  wheel  3161 Jul  2 09:30 CODE_OF_CONDUCT.md
    com.apple.quarantine      59 
-rw-r--r--@  1 root  wheel   720 Jul  2 09:30 CONTRIBUTING.md
    com.apple.quarantine      59 
-rw-r--r--@  1 root  wheel  1334 Jul  2 09:30 LICENSE.txt
    com.apple.quarantine      59 
drwxr-xr-x@  7 root  wheel   224 Jul  2 09:30 Library
    com.apple.quarantine      59 
-rw-r--r--@  1 root  wheel  7374 Jul  2 09:30 README.md
    com.apple.quarantine      59 
drwxr-xr-x@  3 root  wheel    96 Jul  2 09:30 bin
    com.apple.quarantine      59 
drwxr-xr-x@  5 root  wheel   160 Jul  2 09:30 completions
    com.apple.quarantine      59 
drwxr-xr-x@ 48 root  wheel  1536 Jul  2 09:30 docs
    com.apple.quarantine      59 
drwxr-xr-x@  5 root  wheel   160 Jul  2 09:30 manpages
    com.apple.quarantine      59 

This answer to this question tells me to do xattr -d to clear the attribute but it would only work on a single file or directory entry.

How can I clear this attribute recursively?

P.S. If I would unzip the download into a non-root subdirectory I seem to get a similar quarantine attribute.

2 Answers 2

8

Quick and easy solution (combination of this answer to this question and this blog post):

xattr -cr brew-master

(using sudo if and only if this is within root directory)

Slightly more refined solution from the same blog post:

xattr -r -d com.apple.quarantine brew-master

An even better solution would be to use command-line tools to fetch and extract such an archive in order to avoid this kind of issue in the first place. This kind of solution is part of my answer on how to install Homebrew manually.

0

This can be done without brew, this way:

xattr -r -d  com.apple.metadata:kMDItemWhereFroms /Users/MyUserName/Downloads/FolderContainingFilesAndOtherFolders

To remove those datas from anything in a particular folder.

You must log in to answer this question.

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