From: Geert U. <ge...@li...> - 2000-08-06 12:25:54
|
On Fri, 4 Aug 2000, Roman Zippel wrote: > I'm proud to present the very first version of affstools. :-) > Anyway, enjoy and tell me what you think about it. Some of the definitions for AFFS_*MAY*() in amigaffs.h are not correct. Protection bits for other and group (which were added later in AmigaOS 3.0 for Envoy) use inverse logic w.r.t. user. I don't have the AmigaOS includes at hand, so I don't dare to supply a patch for this. The same bug is present in the kernel, even in 2.0.38 (the oldest version I have here). I'm wondering how it got there, since it once was OK (IIRC, I added support for muFS and other/group protection in 1994). Or am I missing something? I also compiled with -Wall and created the patch below. Personally I would use __u32 to store 32-bit values (i.e. `LONG' under AmigaOS), and __u16 for 16-bit values, to avoid portability problems. I ran affsck on all the ADF images I have here, and it found some invalid checksums. I'll mail you the offending images in a separate mail. --- affstools-0.1/bitmap.c.orig Fri Aug 4 17:06:31 2000 +++ affstools-0.1/bitmap.c Sat Aug 5 15:50:28 2000 @@ -23,6 +23,7 @@ #include <stdlib.h> #include <stdio.h> +#include <string.h> #include "amigaffs.h" @@ -120,7 +121,7 @@ { struct affs_root_tail *tail = AFFS_ROOT_TAIL(affs_rootbuf); u_int bitmap_blocks, blocks, bits; - u_long extmap[AFFS_BLOCKSIZE_MAX/4]; + u_int extmap[AFFS_BLOCKSIZE_MAX/4]; u_int ext, i, size; u_char *ptr; @@ -214,7 +215,7 @@ { struct affs_root_tail *tail = AFFS_ROOT_TAIL(affs_rootbuf); u_int bitmap_blocks, blocks, bits; - u_long extmap[AFFS_BLOCKSIZE_MAX/4]; + u_int extmap[AFFS_BLOCKSIZE_MAX/4]; u_int ext, i; u_char *ptr; @@ -305,7 +306,7 @@ { struct affs_root_tail *tail = AFFS_ROOT_TAIL(affs_rootbuf); u_int bitmap_blocks, blocks, bits; - u_long extmap[AFFS_BLOCKSIZE_MAX/4]; + u_int extmap[AFFS_BLOCKSIZE_MAX/4]; u_int ext, i, new, size; /* bit number in bitmap block */ Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |