Re: Problem with streamed ZIP file and Windows XP



Robbie wrote:

> After a bit of investigating, I think this problem might be due to the
> fact that there are spaces in the path name for files contained in the
> ZIP file.

Spaces in filenames /shouldn't/ cause problems. They don't on my system
(XP-pro but without SP2).


> We don't actually need the path to be in the ZIP file so this begs the
> question: how does one put ZipEntries into a ZipFile *without* the path
> information being retained from the original Files' path on the file
> system?

Hmm, how are you creating the zip file ? With the Java ZIP implementation
(java.util.zip.ZipOutputStream and friends) ? If so then it should be pretty
obvious -- just set the name to whatever you want (but ensure that it's unique)
when you add the data.

If not then you are using some other tool or library, and I don't know what its
capabilities might be. I wouldn't be surprised to find that you are using a
utility that can only create ZIP files by adding actual files from the
filesystem, rather than a library that creates ZIP format data in memory out of
other data that is also held in memory. The first approach seems to be the
most common even for code libraries (and is the only one possible for external
utilities, of course).

What do you mean by the 'path information' ? If you are building ZIP files
with embedded filenames like
"C:\this is a test\something.pdf"
then that won't work -- ':' is one of the special characters, and '/' is the
correct separator, not '\' (though Windows does seem to interpret '\' as a
separator in ZIP files). Anyway you don't want even to /think/ about embedding
/absolute/ paths in a ZIP file. The filename should be something like:
"top level/sub dir/something.pdf"
or, merely:
"something.pdf"
Whatever tool you are using should certainly have some way to control this
aspect of how it works -- if not then ditch it.

Another thing that occurs to me is that if you are building your ZIP data from
real files, then the tool you are using to do it may be adding data that
Windows interprets as file-system permissions (probably copied from the source
PDF files). The basic permissions are essentially those of DOS/FAT, and one of
the permission flags says that the file is 'hidden', another marks it as being
a 'system' file. It may be that the entries in the ZIP file have one or other
of these flags set, and that Windows is attempting to honour them (it doesn't
on my system, but then I don't have SP2, and I don't let Windows hide 'hidden'
and 'system' files anyway). There is also a more elaborate extended (and
optional) set of file permissions that can be set, and which may have a similar
effect, but I don't know anything much about that aspect of the system.

-- chris



.



Relevant Pages

  • RE: What server hardening are you doing these days?
    ... permissions on their data, and Microsoft encourages ISVs to minimize ... I've been able to discuss ACLs and other security issues in Windows with ... Control or DAC (which is what you're referring to by the "stupid ...
    (Focus-Microsoft)
  • Re: Unnown process... 5eplorer.exe
    ... do not remove the cause (a "super"-hidden .dll program) but only remove ... symptom files and registry settings. ... It has all permissions but 'copy' denied to everyone, ... then by using the Windows XP Recovery Console. ...
    (microsoft.public.win2000.general)
  • Re: compile+link Fujitsu Linux
    ... My security is better because it does not depend on file system permissions. ... Reliability is worse because a 'missing file' stops the whole ... completely independent of whether it uses libraries or individual ... take longer because you also load the library. ...
    (comp.lang.cobol)
  • RE: dcom permissions and vista?
    ... user BLAH with Local Activation and Local Launch permissions. ... Windows Vista indeed do some changes in handling DCOM and you may need to ... Windows Vista introduces the notion of Mandatory Access Labels in security ... Microsoft Online Community Support ...
    (microsoft.public.vc.atl)
  • Re: Passwords on Folders
    ... domain computer [there is also a recovery agent for a domain]. ... > Windows under which those permissions were defined. ... use NTFS on your hard drives so you can then EFS ...
    (microsoft.public.win2000.security)