Skip to contentSkip to conversation

fchmod on a socket?

DISCUSSION Dave Wilson 1 participant 1 message Aug 21, 2002

lore
Share & tools
lore
#0 lore raw

Hi there,
I'm unsure as to whether this is a bug or not, but if I try to do an fchmod() on an fd for a UNIX domain socket, it returns success (0), but does not actually change the permission mode.

--- strace
socket(PF_UNIX, SOCK_DGRAM, 0) = 3
bind(3, {sin_family=AF_UNIX, path="/tmp/log.extended"}, 110) = 0 setsockopt(3, SOL_SOCKET, SO_PASSCRED, [1], 4) = 0
fcntl64(3, F_SETFL, O_RDONLY|O_ASYNC) = 0
fchmod(3, 0666) = 0
---

--- socket
File: "/tmp/log.extended"

  Size: 0               Blocks: 0          Socket
Device: 1601h/5633d     Inode: 193160      Links: 1    
Access: (0755/srwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/   wheel)

---

Thanks,
Dave.