Last Updated: February 25, 2016
·
2.8K
· dyba

Removing Apple Quarantined Metadata on Downloaded Files

TL;DR

xattr -c filename removes Apple Metadata

The Problem

I recently had trouble logging on to IRC. The symptom was a failed TLS handshake because the certificates my IRC client uses to check against the server I log on to were not matching the ones the server was providing.

Short History Leading Up

A little history might help to shed light on my setup. I use weechat for an IRC client. The computer on which I was experiencing trouble now runs Apple's Mountain Lion OS. I had not logged on to IRC using this computer for a long time. A few days ago, I decided to upgrade weechat and download the correct certificates to log on to Freenode.

My Findings

I noticed something strange on the certificates I downloaded. When I ran the ls -l command, they all had @ symbols suffixed to them. I did a Google search and found out that any file on a Mac OS X system that has an @ symbol appended to the permissions list has Apple metadata attached to it. Here's an example of what you would see if you run the ls -l command on a file that has Apple metadata:

-rw-r--r--@ 1 Paintdexter  admin  163557414 Dec  1 16:55 das-0079-primitive-obsession.mov

You can see what that metadata is by running the xattr command [1].

>_ xattr das-0079-primitive-obsession.mov
com.apple.metadata:kMDItemWhereFroms
com.apple.quarantine

In order to remove it, you need to run the command xattr -c yourfile:

>_ xattr -c das-0079-primitive-obsession.mov

That should remove the metadata from your file. Running the ls -l command, you'll see the @ symbol has been removed:

-rw-r--r--  1 Paintdexter  admin  163557414 Dec  1 16:55 das-0079-primitive-obsession.mov

After removing the Apple metadata from the certificates I downloaded, I had no trouble connecting to Freenode on IRC.

Sources:

[1] http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/xattr.1.html