From owner-freebsd-bugs@FreeBSD.ORG Sat Nov 29 19:50:22 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1E3D116A4CF for ; Sat, 29 Nov 2003 19:50:22 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A315F43F3F for ; Sat, 29 Nov 2003 19:50:20 -0800 (PST) (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 hAU3oIFY070999 for ; Sat, 29 Nov 2003 19:50:18 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hAU3oI5J070998; Sat, 29 Nov 2003 19:50:18 -0800 (PST) (envelope-from gnats) Resent-Date: Sat, 29 Nov 2003 19:50:18 -0800 (PST) Resent-Message-Id: <200311300350.hAU3oI5J070998@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Joao Carlos Mendes Luis Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BDCD16A4CE for ; Sat, 29 Nov 2003 19:44:44 -0800 (PST) Received: from mailhost.faperj.br (caronte.faperj.br [200.6.41.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id E3E0643F3F for ; Sat, 29 Nov 2003 19:44:42 -0800 (PST) (envelope-from root@faperj.br) Received: from faperj.br (zeus.faperj.br [10.0.0.2]) by mailhost.faperj.br (Postfix) with ESMTP id B996225570A; Sun, 30 Nov 2003 01:44:38 -0200 (BRST) Received: by faperj.br (Postfix, from userid 0) id B1D8612B58C; Sun, 30 Nov 2003 01:44:38 -0200 (BRST) Message-Id: <20031130034438.B1D8612B58C@faperj.br> Date: Sun, 30 Nov 2003 01:44:38 -0200 (BRST) From: Joao Carlos Mendes Luis To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: rsync@lists.samba.org Subject: kern/59814: FreeBSD mknod refuses to create pipes and fifos X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Joao Carlos Mendes Luis List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2003 03:50:22 -0000 >Number: 59814 >Category: kern >Synopsis: FreeBSD mknod refuses to create pipes and fifos >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Nov 29 19:50:17 PST 2003 >Closed-Date: >Last-Modified: >Originator: Joao Carlos Mendes Luis >Release: FreeBSD 4.9-RC i386 >Organization: >Environment: System: FreeBSD zeus.faperj.br 4.9-RC FreeBSD 4.9-RC #3: Sat Oct 25 17:54:52 BRST 2003 Jonny@zeus.faperj.br:/usr/cvsup/RELENG_4/src/sys/compile/ZEUS i386 >Description: mknod(2) does not create fifos and sockets, as expected from rsync Probably this is supported in some other operating system >How-To-Repeat: Copy a fifo and a socket with rsync Example: mkfifo /tmp/fifo rsync -avP /var/run/log /tmp/fifo /tmp/output/ >Fix: Suggested patches to kernel: --- sys/kern/vfs_syscalls.c.orig Sun Nov 30 00:59:29 2003 +++ sys/kern/vfs_syscalls.c Sun Nov 30 01:25:35 2003 @@ -1189,6 +1189,10 @@ case S_IFBLK: error = suser(p); break; + case S_IFIFO: + case S_IFSOCK: + error = 0; + break; default: error = suser_xxx(0, p, PRISON_ROOT); break; @@ -1217,6 +1221,12 @@ break; case S_IFBLK: vattr.va_type = VBLK; + break; + case S_IFSOCK: + vattr.va_type = VSOCK; + break; + case S_IFIFO: + vattr.va_type = VFIFO; break; case S_IFWHT: whiteout = 1; 1) I'm not sure if FIFO and/or SOCK creation with mknod should be allowed to non-root users. This patch allows non-root to create them, but it's easy to change that. 2) Should we allow IFREG creation with mknod? I did not find a reason to disallow that, but since this does not bother me with rsync, I did not touch that... 3) I did test it with ffs, but did not test with other media, like NFS or EXT2FS. Thanks a lot for your attention... >Release-Note: >Audit-Trail: >Unformatted: