FreeBSD's mknod(2) is not specified to create other than character and block device entries. For FIFO there exists mkfifo(2), for unix domain sockets socket(2) / bind(2). Thomas Quinot issued the mentioned postingincluding a patch which has been adopted by the FreeBSD ports maintainer.
Created attachment 674 [details] Adapted the referenced diff for the modern codebase There has been a diff in the patches directory named tru64.diff that added this mkfifo() and socket-making code among some other tru64 changes. I've separated these common changes for FreeBSD out into a patch named mkfifo.diff (which is in the CVS patches dir, as well as attached here). This should make it easier for maintainers to customize their version of rsync with this functionality. The reason that these changes aren't in the main codebase is that it affects too many systems (as the patch is currently written). For instance, Linux has both mkfifo() and the sys/un.h header file, but it needs neither kluge added by this patch because mknod() works for FIFOs and sockets. Furthermore, the socket-making code in this patch looks to be inferior to mknod() (on a system where mknod() works for sockets) because it has to delay the chmod() call until after the bind() call.
I believe that FreeBSD may enhance their mknod() so that it can handle FIFOs and sockets. In the meantime, I suggest that the FreeBSD build package simply apply the mkfifo.diff that will come with the final 2.6.3 release: patch -d rsync-2.6.3 -p0 <patches/mkfifo.diff
(In reply to comment #1) > I've separated these common changes for FreeBSD out into a patch named mkfifo.diff Ok, so one can find it more easy. > The reason that these changes aren't in the main codebase is that it affects > too many systems. What can be done about that? A program testing for mknod(2) functionality could be look like that: #include <stdio.h> #include <sys/stat.h> #include <errno.h> int main () { int rc; rc = mknod("p", S_IFIFO,0600); if ( rc ) { printf("%d %d\n",rc,errno); } return errno; } > Furthermore, the socket-making code in this patch looks to be inferior to > mknod() (on a system where mknod() works for sockets) > because it has to delay the chmod() call until after the bind() call. It looks superior to not working code. To keep permissions tight one could set umask to 0 before creating the socket and chmod() it afterwards. > I believe that FreeBSD may enhance their mknod() ... As I know them, they will not. They distribute a verision of cpio which does not handle socket files. They say socket files are created by the process using them instantly so copying would be pointless. I'm convinced concerning the fifo problem the argumentation would be: creating block and charakter devices is a privileged operation, creating a pipe (or a socket) are not. So there are different system calls. (On FreeBSD mkfifo is a system call, on Linux it's a library call using mknod(2)) So they will - also for reasons of orthogonality - not modify mknod(2). As this is neither the first or the last system dependency let's get around it.
OK, I've reconsidered the "WONTFIX". However, a full fix will have to wait until after 2.6.3 is released.
Created attachment 677 [details] Enhanced patch with configure support This patch modifies configure to (1) check if mknod() can create a FIFO, (2) check if mknod() can create a socket, and (3) check if struct sockaddr_un has a sun_len member element or not. This information is used in the do_mknod() routine (in syscall.c) to fill in any missing mknod() functionality on a system where it doesn't handle a FIFO and/or a socket (and the sun_len change makes the socket-creating compatibility-code even more portable than it was).
fyi: the bug also shows up on openbsd (3.5) (see http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=3926 ) and IMHO also posibil present present on mac OSX (see http://sourceforge.net/mailarchive/forum.php?thread_id=5351434&forum_id=41320 )
I've checked this patch into CVS for the next version. Those needing something for 2.6.3 should simply apply the patches/mkfifo.diff file to the source before building (that diff is a simpler verson of this bug's patch that does not do any of the configure-tweaking, so only apply that diff if you need it).