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

Problem with Finder's "Compress"

I'm having a real problem in Leopard with the Compress option in Finder's File menu. After enabling the root user and logging in to it, I create a .zip file of a folder using the Compress option. If I then double-click this .zip file, it indeed uncompresses it, but all of the files and folders are owned by root, not the original owners.

This is decidedly not good, since I have used this mechanism for backup for a long time. Note that taking that same .zip file and unarchiving it (that's what previous operating systems called it) in Tiger, all of the files are owned by their original owners.

Does anyone know why this is so, or any way around the problem?

Power Mac G5, Mac OS X (10.5.4)

Posted on Nov 22, 2008 3:08 PM

Reply
29 replies

Nov 23, 2008 9:23 PM in response to joshz

I realize now that I really didn't emphasize where the problem is. The problem is with the UNcompress function, not the compress function. Compress seems to work just fine.

Why not just use a backup program like Carbon Copy Cloner or SuperDuper?
They'll both back up your whole hard drive very easily.


I want more control of my backups; I want backups on devices that aren't on my hard disk(s); I want backups that can be removed offsite; and I want more copies made at various times.

But even if I took your advice, I still have the problem of restoring the backups I've already created over a number of years.

Nov 24, 2008 5:25 PM in response to frazzlejazz

As far as I know, compressing a folder (also putting it in a disk image) will result in the uncompressed copy taking on the ownership of whoever unzipped it, the same as making a copy of a file takes on the ownership of the one copying it. It works the same way in Tiger, so I'm not sure what options you were using to zip the file (it would make downloading stuff from various websites a crapshoot otherwise). You will probably need to use one of the cloning utilities to make an archive that retains permissions.

Nov 24, 2008 7:56 PM in response to biovizier

Sorry, no.

If I archive in TIger (or compress in Leopard) and then unzip/uncompress from another user, the unzipped files/folders have the ownership of that user, not the original. This makes some sense, in that unzipping the archive makes a copy, and making a copy of a file owned by another user also results in the copy having the ownership of the user making the copy.

I don't know what options the Finder uses for the archive/compress, but I didn't see anything in the man pages about an option that preserves the ownership in the unzipped copy. If there is one, it would most likely not normally be used by the Finder, since I have not come across any .zip file that unzipped to a different owner. I would also suspect that if this were not true, some mayhem would ensue as people shared zip files without fixing the ownership option.

Nov 24, 2008 8:10 PM in response to frazzlejazz

I see your point - it appears that once again, something that worked well and simply in Tiger has been bungmangled in Leopard.

As far as I can tell, "nerowolfe" seems to have been on the right track since running ' unzip', as "root", with the ' -X' flag expands a Leopard Finder ctrl-click archive while preserving ownership. The ' -K' flag (apparently to preserve the sticky bit, etc.) might also be needed depending on what is being zipped.

However, if any of the files had extended attributes or resource forks, these are expanded into a separate folder from the main folder. They can be restored by merging the two folders and running ' FixupResourceForks', but this alters some of the modification dates so isn't ideal.

I suspect there is an easier one-step method that preserves both metadata and ownership buried in the ' man' pages somewhere, but I haven't been able to spot it yet...

If your main goal is to use built-in tools for archiving purposes, note that "/System" > "Library/" > "CoreServices" > "ArchiveUtility.app" creates nice compact ".cpgz" files that can be expanded using the same utility, or using ' ditto', keeping ownership and metadata intact (at least if using 10.5 versions). However, it doesn't seem to wrap up multiple selections into a single archive like the ctrl-click contextual menu does.

Nov 25, 2008 3:58 PM in response to biovizier

Just to follow up on this, I'm beginning to suspect you have uncovered an actual bug.

In the 10.5 "Finder", the creation and expansion of archives is handled by "Archive Utility.app", which in turn appears to act through ' /usr/bin/ditto'. In "Tiger", compressing / expanding using ' ditto' is a fully reversible process (preserving owners, file attributes, resource forks, dates, etc.), whereas in "Leopard", just like the "Finder", ' ditto' fails to preserve ownership on expanded archives. It's possible that something with respect to the syntax for ' ditto' has changed (as has been the case with a few other commands) due to 10.5 having been certified as officially unix compliant, but the problem appears to be at least as deep as the level of the command line tool ' ditto.

Interestingly, 10.4's "BOMArchiveHelper.app" (which seems to work in 10.5 in other respects) and does not seem to act through ' /usr/bin/ditto', also fails to preserve ownership when used in Leopard, so this could mean that the bug is deeper, maybe at the point of some system call common to both ' ditto' and "BOMArchiveHelper.app".

Regardless, it is probably worth submitting a bug report to Apple, which you can do by following this link:
http://developer.apple.com/bugreporter

Nov 25, 2008 9:21 PM in response to biovizier

(This is actually a reply to both of the last two replies from biovizier. Sorry for the late reply, but I've been overly busy.)

_Thank you_. You've provided a great deal of relevant info that I had no idea existed (like FixupResourceForks, ArchiveUtility, and ditto)! Now I need to explore them in more detail.

I'm beginning to suspect you have uncovered an actual bug.


Well, that was my conclusion.

Let me just mention one more interesting (to me) tidbit about this whole mess that I discovered while trying to bypass the problem a while ago, but haven't had time to verify. It looks like simply copying a folder tree with Finder by dragging it, as root, has the same effect; i.e., all of the resulting files and folders are owned by root.

Regardless, it is probably worth submitting a bug report to Apple, which you can do by following this link:
http://developer.apple.com/bugreporter


I can do that even though I'm not a developer? I've searched high and low (and asked people from Apple) how to do that, but I never found an answer.

Nov 26, 2008 10:51 AM in response to frazzlejazz

I think that with a straight "Finder" copy, it is normal for everything to end up being owned by the user making the copy, as alluded to by "red_menace". It might not be ideal, but I think that's way it has always worked.

re: bug reporting, you don't have to be a developer to submit a bug report. Registration is required, but anyone can do so, and it is free.

Originally, I was thinking that the change in terminology from "Archive" to "Compress" indicated an intentional change in the behaviour, in which case filing a bug reported would be met with an unceremonious "intended behaviour" response. However, the fact that a standard tool like ' ditto' is exhibiting the same behaviour is why I now think it is a bug, which might at least have a chance of being fixed.

Nov 26, 2008 4:38 PM in response to biovizier

I'll probably wind up looking like an idiot again (won't be the first/last time, either), but wouldn't the bug be in Tiger for adding that option? If for whatever reason you log in as root, then for whatever reason use the Finder to uncompress something that you wanted to be owned by root, how would you stop this behavior? And if you are going to have to use one of the various utilities to uncompress in the desired way, why use the Finder in the first place? Or log in as root for that matter? It seems like Leopard is the way to do it (minimal options), although it also seems like they are still trying to figure out how to use the Finder in the root account.

Problem with Finder's "Compress"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.