Strange unzip problems
I'm using dosemu under Linux with FreeDOS beta 8. I'm also using a Linux directory as my C drive. Everything seemed to be working great until I tried to install DJGPP. When I use unzip from within dosemu on a recursive zip archive, there are several errors. When unzip is extracting files from an archive and creating directories (from within DOSEMU), the directories are created without execute permission (in the linux file system). The unzip program then can't extract files to these directories.
I asked for help on the DJGPP list, but people there seemed to think that I might have a DOSEMU configuration setting messed up. Do I? Does anyone have any suggestions? Unfortunately, I can't just unzip on the Linux side because long file names are handled differently by Linux and DOS.
Thanks,
Tony Richardson
Quoted 7 lines · Anthony M. Richardson
I'm using dosemu under Linux with FreeDOS beta 8. I'm also using a Linux directory as my C drive. Everything seemed to be working great until I tried to install DJGPP. When I use unzip from within dosemu on a recursive zip archive, there are several errors. When unzip is extracting files from an archive and creating directories (from within DOSEMU), the directories are created without execute permission (in the linux file system). The unzip program then can't extract files to these directories.
Ah, that narrows it down from your post on comp.os.msdos.djgpp :)
I suspect that unzip does something like this:
mkdir dir
attrib +a dir -- this removes the (user) x bit from dir
You'll need to either hack unzip or hack DOSEMU src/dosext/mfs/mfs.c to avoid this. I'm away and cannot make a patch easily, but anyway, it is impossible to avoid it using dosemu.conf adjustments.
Bart
Quoted 14 lines · Bart Oldeman
Quoted 8 lines · Anthony M. Richardson
I'm using dosemu under Linux with FreeDOS beta 8. I'm also using a Linux directory as my C drive. Everything seemed to be working great until I tried to install DJGPP. When I use unzip from within dosemu on a recursive zip archive, there are several errors. When unzip is extracting files from an archive and creating directories (from within DOSEMU), the directories are created without execute permission (in the linux file system). The unzip program then can't extract files to these directories.
Ah, that narrows it down from your post on comp.os.msdos.djgpp :)
I suspect that unzip does something like this:
Quoted 8 lines
mkdir dir
attrib +a dir -- this removes the (user) x bit from dirYou'll need to either hack unzip or hack DOSEMU
src/dosext/mfs/mfs.cto avoid this. I'm away and cannot make a patch easily, but anyway, it is impossible to avoid it using dosemu.conf adjustments.Bart
Thanks for the information. I think you are right about what is happening. Shouldn't DOSEMU handle directories differently than regular files in this case?
For what its worth, I have to use "attrib +s +a dir" and not just "attrib +a dir" (from the command line) to remove the x bit from the directory.
Tony
Quoted 8 lines · Anthony M. Richardson
I'm using dosemu under Linux with FreeDOS beta 8. I'm also using a Linux directory as my C drive. Everything seemed to be working great until I tried to install DJGPP. When I use unzip from within dosemu on a recursive zip archive, there are several errors. When unzip is extracting files from an archive and creating directories (from within DOSEMU), the directories are created without execute permission (in the linux file system). The unzip program then can't extract files to these directories.
Quoted 7 lines
I asked for help on the DJGPP list, but people there seemed to think that I might have a DOSEMU configuration setting messed up. Do I? Does anyone have any suggestions? Unfortunately, I can't just unzip on the Linux side because long file names are handled differently by Linux and DOS.
Thanks,
Tony Richardson
What umask says?
On my machine:
# umask 022
and
C:\> zip -r freedos.zip freedos
C:\> unzip -d temp freedos.zip
works
dosemu started from root account,
Freedos Beta 7 Ripcord
dosemu-1.0.2.1
Signature · 1 line
Witold Filipczyk <[email protected]>
Quoted 7 lines · Witold Filipczyk
C:\> zip -r freedos.zip freedos
C:\> unzip -d temp freedos.zip
worksdosemu started from root account,
Freedos Beta 7 Ripcord
dosemu-1.0.2.1
on a FAT partition? That makes a difference because you cannot turn off directory x bits on (Linux mounted and lredir'ed) FAT partitions.
If C:\ corresponds to an ext2 instead of a FAT partition then things are different of course.
Bart
Quoted 10 lines · Bart Oldeman
Quoted 7 lines · Witold Filipczyk
C:\> zip -r freedos.zip freedos
C:\> unzip -d temp freedos.zip
worksdosemu started from root account,
Freedos Beta 7 Ripcord
dosemu-1.0.2.1
Quoted 5 lines
on a FAT partition? That makes a difference because you cannot turn off directory x bits on (Linux mounted and lredir'ed) FAT partitions.
If C:\ corresponds to an ext2 instead of a FAT partition then things are different of course.
On ext2.
Signature · 1 line
Witold Filipczyk <[email protected]>
Quoted 9 lines · Bart Oldeman
Quoted 7 lines · Witold Filipczyk
C:\> zip -r freedos.zip freedos
C:\> unzip -d temp freedos.zip
worksdosemu started from root account,
Freedos Beta 7 Ripcord
dosemu-1.0.2.1
Quoted 5 lines
on a FAT partition? That makes a difference because you cannot turn off directory x bits on (Linux mounted and lredir'ed) FAT partitions.
If C:\ corresponds to an ext2 instead of a FAT partition then things are different of course.
The example above will not work for me on ext2. (Actually I'm using ext3, would that make a difference?) In the example above the temp directory would be created (with execute permission). The freedos directory would be created also, but without execute permission so no files could be extracted to it.
I've found that I can extract some zip archives (that have subdirectories), but not others. I played around with zip a bit and found that I can unzip files that are created with -R, but not with -r. Unfortunately the archives I'm trying to extract were apparently created with -r. I'm using the info-zip unzip that comes with freedos. (djgpp provides one too, but I think it is the info-zip one - it doesn't work either.)
I've found that I can get around the problem by creating an MSDOS partition image and using the loopback device to mount the image under my linux filesystem and using the mount point as my cdrive. Not nearly as nice as just keeping everything under my ext3 filesystem but workable.
I think there is a problem with mapping of dos attribs to ext3 perms in dosemu. Why should "attrib +s +h dir" make a directroy inaccessible? It doesn't make it inaccessible under MSDOS on real hardware does it?
Thanks,
Tony