[Bug 1804] FreeBSD's mknod can't create FIFOs and sockets

samba-bugs at samba.org samba-bugs at samba.org
Wed Sep 22 20:06:27 GMT 2004


------- Additional Comments From rsync-contact at fischglas.de  2004-09-22 13:06 -------
(In reply to comment #1)
> I've separated these common changes for FreeBSD out into a patch named

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

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. 

Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list