Date: Tue, 11 Sep 2007 23:54:29 GMT From: Christopher Hall <freebsd@generalresources.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/116292: sysutils/cramfs patches for mkcramfs/cramfsck Message-ID: <200709112354.l8BNsTZ0019703@www.freebsd.org> Resent-Message-ID: <200709120000.l8C004nl054866@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 116292 >Category: ports >Synopsis: sysutils/cramfs patches for mkcramfs/cramfsck >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 12 00:00:04 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Christopher Hall >Release: 6.2 stable >Organization: >Environment: FreeBSD 6.2-RELEASE-p7 i386 >Description: 1. mkcramfs always fails with invalid fd on the first mmap call caused by MAP_ANONYMOUS being defined as a number when MAP_ANON should be used 2. cramfsck -x fails when trying to extract an image containing a FIFO caused by mknod being unable to create a FIFO mkfifo should be used >How-To-Repeat: 1. mkcramfs dir image-file 2. cramfsck -x new-dir file.image >Fix: diff -urN cramfs.orig/files/patch-cramfsck.c cramfs/files/patch-cramfsck.c --- cramfs.orig/files/patch-cramfsck.c Thu Dec 7 17:36:45 2006 +++ cramfs/files/patch-cramfsck.c Mon Sep 10 15:41:55 2007 @@ -17,3 +17,23 @@ /* Exit codes used by fsck-type programs */ #define FSCK_OK 0 /* No errors */ +@@ -603,8 +603,17 @@ + } + + if (opt_extract) { +- if (mknod(path, i->mode, devtype) < 0) { +- die(FSCK_ERROR, 1, "mknod failed: %s", path); ++ switch(type) { ++ default: ++ if (mknod(path, i->mode, devtype) < 0) { ++ die(FSCK_ERROR, 1, "mknod failed: %s", path); ++ } ++ break; ++ case 'p': ++ if (mkfifo(path, i->mode) < 0) { ++ die(FSCK_ERROR, 1, "mkfifo failed: %s", path); ++ } ++ break; + } + change_file_status(path, i); + } diff -urN cramfs.orig/files/patch-mkcramfs.c cramfs/files/patch-mkcramfs.c --- cramfs.orig/files/patch-mkcramfs.c Thu Dec 7 17:36:45 2006 +++ cramfs/files/patch-mkcramfs.c Tue Sep 11 08:42:40 2007 @@ -4,7 +4,7 @@ #include <linux/cramfs_fs.h> #include <zlib.h> -+#define MAP_ANONYMOUS 0x20 ++#define MAP_ANONYMOUS MAP_ANON +typedef long long loff_t; + /* Exit codes used by mkfs-type programs */ >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709112354.l8BNsTZ0019703>