From owner-freebsd-ports-bugs@FreeBSD.ORG Mon May 19 18:40:13 2003 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86D8537B401 for ; Mon, 19 May 2003 18:40:13 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 682E843FBD for ; Mon, 19 May 2003 18:40:11 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h4K1eBUp011592 for ; Mon, 19 May 2003 18:40:11 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h4K1eBhb011591; Mon, 19 May 2003 18:40:11 -0700 (PDT) Resent-Date: Mon, 19 May 2003 18:40:11 -0700 (PDT) Resent-Message-Id: <200305200140.h4K1eBhb011591@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Joshua Oreman Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B62D837B401 for ; Mon, 19 May 2003 18:39:44 -0700 (PDT) Received: from adsl-64-161-78-226.dsl.lsan03.pacbell.net (adsl-64-161-78-226.dsl.lsan03.pacbell.net [64.161.78.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 1237B43FCB for ; Mon, 19 May 2003 18:39:44 -0700 (PDT) (envelope-from oremanj@adsl-64-161-78-226.dsl.lsan03.pacbell.net) Received: (qmail 65038 invoked by uid 1001); 20 May 2003 01:40:46 -0000 Message-Id: <20030520014046.65037.qmail@adsl-64-161-78-226.dsl.lsan03.pacbell.net> Date: 20 May 2003 01:40:46 -0000 From: Joshua Oreman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/52452: [PATCH] sysutils/afio mangles FIFOs X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Joshua Oreman List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2003 01:40:14 -0000 >Number: 52452 >Category: ports >Synopsis: [PATCH] sysutils/afio mangles FIFOs >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon May 19 18:40:10 PDT 2003 >Closed-Date: >Last-Modified: >Originator: oremanj >Release: FreeBSD 5.0-CURRENT i386 >Organization: home >Environment: System: FreeBSD webserver.get-linux.org 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed May 7 17:32:53 PDT 2003 root@webserver.get-linux.org:/usr/obj/usr/src/sys/GENERIC i386 >Description: When run under FreeBSD, `afio' will successfully back up FIFOs, but will not correctly restore them. The problem arises from `afio' using mknod(2) to try to create a FIFO - a Linuxism. The correct function for it to use is mkfifo(2). Also, `afio' tries to recreate sockets. This behavior should be disabled under FreeBSD. >How-To-Repeat: $ mkfifo testfifo $ echo testfifo | afio -ov testfifo.afio testfifo -- okay $ rm testfifo $ afio -iv testfifo.afio afio: testfifo: Invalid argument testfifo -- okay $ echo $? 1 $ ls -l testfifo ls: testfifo: No such file or directory >Fix: Put this patch in /usr/ports/sysutils/afio/files/patch-ad: -------[snip]-- --- afio.c.orig Mon May 19 18:11:57 2003 +++ afio.c Mon May 19 18:24:07 2003 @@ -2953,14 +2953,14 @@ if (perm != operm && chmod (name, perm) < 0) return (warn (name, syserr ())); else { ; } - else if (mknod (name, asb->sb_mode, (dev_t) 0) < 0 + else if (mkfifo (name, asb->sb_mode) < 0 && (errno != ENOENT || dirneed (name) < 0 - || mknod (name, asb->sb_mode, (dev_t) 0) < 0)) + || mkfifo (name, asb->sb_mode) < 0)) return (warn (name, syserr ())); break; #endif /* S_IFIFO */ -#ifdef S_IFSOCK +#ifdef S_IFSOCK && !defined (__FreeBSD__) case S_IFSOCK: fd = 0; if (exists) -------[snip]-- Remake the port, and the problem is fixed. $ mkfifo testfifo $ echo testfifo | afio -ov testfifo.afio testfifo -- okay $ rm testfifo $ afio -iv testfifo.afio testfifo -- okay $ echo $? 0 $ ls -l testfifo prw-r--r-- 1 oremanj oremanj 0 May 19 18:35 testfifo| >Release-Note: >Audit-Trail: >Unformatted: