Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Question:

Question: How to remove com.apple.quarantine from the files in a tar archive

How can I remove com.apple.quarantine from the files inside a tar archive?


I am developing Wordpress websites using MAMP on my Mac running 10.6.8. I use a utility called Bloggzapper to build a tar.gz archive of my site and then upload it and use the same Bloggzapper to automatically install it on a remote server. Now I am suddenly getting corrupted displays from the server after the files have been extracted and the corruption is displaying lots of instances of com.apple.quarantine meta data at the top of my web pages. Somehow extended attribute meta data is being added to my various Wordpress php files as they are compressed. How can I stop this? How can I remove such data from inside the tar archive without opening it? Any suggestions?

Posted on

Reply

Jun 27, 2011 5:13 PM in response to Tony from London In response to Tony from London

Apple stores metadata in resource forks of the files. Many file systems don't understand them, so the metadata gets stripped out into ._ files. They are just text descriptions of the metadata, so I would imagine they'd show up as such.


I found this as a solution: http://sites.google.com/site/michaelsafyan/software-engineering/a-better-tar-on- macosx-excluding-save-backup-files-svn-metadata-and-resource-forks

Jun 27, 2011 5:13 PM

Reply Helpful

Jun 28, 2011 4:22 AM in response to Barney-15E In response to Barney-15E

I undertsand what this metadata problem is but I don't think your advice helps me. The problem is this: I use the utility Bloggzaaper to clone Wordpress sites developed in a MAMP setup on my Mac. Bloggzapper builds a tar archive of my local site and then I upload it to the remote server where it is decompressed and installed by Blogzapper at the other end. It is central to my work flow. Blogzapper builds a very specific tar archive and if you mess with it then Bloggzapper cannot work its magic on the remote server and install my wordpress site, it cannot deal with a tar archive that has been tampered with.


Suddenly after I installed 10.6.8 on my Mac I started to get corrupt installed caused by the com.apple.quarantine attribute being added to all my files inside the tar archive created by Bloggzapper - I assume it is caused by some aspect of a security upgrade in the 10.6.8 update.


So cannot open the archive on my mac as it breaks the bloggzapper work flow. What I need is either:


a) a way to stop this date being writen during the process of Bloggzapper creating the tar archive on my mac


or


b) a way to strip the extended attributes metadata from the files inside the tar archive (without decompressing it.


As it is this problem completely breaks my work flow

Jun 28, 2011 4:22 AM

Reply Helpful

Jun 28, 2011 4:59 AM in response to Tony from London In response to Tony from London

The link I posted shows how to create an alias to "tar -c --exclude" but you could do the same for whatever Bloggzapper uses as its call to build the tarball. If it calls tar directly, using the full path, this likely won't work.


Unless you are extracting on a Mac OS X system, I would imagine the extended attributes are on the source files already.

Perhaps the php files have the quarantine attribute set before you are uploading. You can view the extended attributes in Terminal with:

xattr filename


You can delete the attributes with:

xattr -d com.apple.quarantine filename


Or from a whole directory with:

xattr -dr com.apple.quarantine diretoryName


Note that the version of tar on OS X does not suppor the --delete option, so I don't see a way to delete anything from the archive.

You'll either have to remove the attributes before compressing or after uncompressing.

Jun 28, 2011 4:59 AM

Reply Helpful (3)

Jun 28, 2011 5:34 AM in response to Barney-15E In response to Barney-15E

Thanks for the info


A couple of questions about the xattr command. I have no experience of using the Terminal.


Do I need to put in a path to the file, I have multiple files with the same name (in different Wordpress install). I tried the first of the commands you suggested with just a file name and it didn't work.


Is there any sort of xattr utility with a GUI for seeing and deleting the attributes?

Jun 28, 2011 5:34 AM

Reply Helpful

Jun 28, 2011 5:58 AM in response to Tony from London In response to Tony from London

For the xattr command, to simply print/list the extended attributes, just enter the command then, important, leave a space. Then drag the file whose extended attributes you want to see into the Terminal window and hit Return.


To use the delete command, you must use the file name as it was printed/listed above. Again, leave a space after the command. Copy/paste the file name after the space.

Jun 28, 2011 5:58 AM

Reply Helpful

Jun 28, 2011 7:10 AM in response to WZZZ In response to WZZZ

Thanks - I will try this.


I found another solution (I think - still testing) which is based on using a USB drive formatted to MS-DOS FAT (which is actually FAT32) which does not support extended attributes metadata. I created a symbolic link to a folder on this drive (using a utility called SymbolicLinker) and placed the symbolic link in my htdocs folder in my MAMP folder (which is where MAMP expects site folders to be). Then I put the Wordpress install files in the folder on the usb drive and then ran an install using MAMP via a url that pointed at the symbolic link. This all worked perfectly and Wordpress installed into the folder on the USB drive. My Bloggzapper php utility also works in this folder via the symbolic link. So all the wordpress files and the tar archive are all created and live on the FAT32 USB drive so none can contain the metadata. I uploaded them to the remote server and the site seems to work with no metadata corruption. This seems a good method because all it means is one extra step (create the symbolic link) at the start of the wordpress web site development process and from then on I can forget that the files are actually on the USB stick.

Jun 28, 2011 7:10 AM

Reply Helpful

Jun 28, 2011 3:30 PM in response to Tony from London In response to Tony from London

Tony from London wrote:


Thanks - I will try this.


I found another solution (I think - still testing) which is based on using a USB drive formatted to MS-DOS FAT (which is actually FAT32) which does not support extended attributes metadata.

Therein lies your problem. tar doesn't support metadata, either. When the OS tries to copy files to a file system that does not support resource forks, it splits the metadata off into ._ files.


What you have done in the process seems to have stripped off the metadata from the source files.

Jun 28, 2011 3:30 PM

Reply Helpful
User profile for user: Tony from London

Question: How to remove com.apple.quarantine from the files in a tar archive