Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jan 1998 23:34:25 +0100 (MET)
From:      Guido van Rooij <guido@gvr.org>
To:        guido@gvr.gvr.org (guido)
Cc:        tlambert@primenet.com, FreeBSD-hackers@FreeBSD.ORG
Subject:   Re: socket ops
Message-ID:  <199801182234.XAA24903@gvr.gvr.org>
In-Reply-To: From guido at "Jan 18, 98 11:28:12 pm"

next in thread | raw e-mail | index | archive | help
guido wrote:
> Terry Lambert wrote:
> > > I just found out that I cannot fchmod unix domain sockets.
> > > 
> > > This is because fchmod() calls getvnode() which fails if the vnode
> > > passed is not of type vnode or type fifo. 
> > > Is there a reason for this rationale?
> > 
> > Look for "struct fileops" in /sys/kern/*.c, and all will be revealed.
> > 
> > The mode is referenced via VOP_GETATTR/VOP_SETATTR off of a vnode
> > to get the FS specific method of getting/setting mode bits.  If you
> > do not have a backing object, you do not have mode bits.
> 
> ?? There *is* a backing object. I am talking about UNIX domain
> sockets here.

The problem here is that the struct file underneath the file descriptor
is of type DTYPE_SOCKET. However, there *is* a backing vnode if the
socket happens to be in the unix domain. Indeed there is no simpe
way (I think) to find that out runtime. But that was not the question.

I still think it is a bit strange we cannot use f*() functions on 
files in the unix name space. 

-Guido



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801182234.XAA24903>