Samuel Thibault, le Sun 24 Aug 2014 22:06:42 +0200, a écrit : > Samuel Thibault, le Sun 24 Aug 2014 21:29:57 +0200, a écrit : > > On the technical side, what fails is the __ifsock_getsockaddr call. > > Indeed, since the node is created as 0000, the ifsock translators > > tells glibc that it doesn't have any right. The port to the translator > > was gotten through a __file_name_lookup_under. Isn't there a way to > > get a port to the translator directly from the node port on which the > > translator is running, instead of looking up the name? > > dir_lookup(node, "", ...) seems to be doing it indeed. The it's a matter > of ifsock accepting __ifsock_getsockaddr when it's opened with O_READ > too.
Mmm, no, that doesn't work. My idea was to do this from glibc: bind() { ... dir_mkfile(dir, O_CREAT, 0666, &node); file_set_translator(node, ...) dir_lookup(node, "", O_RDWR, 0, ..., &ifsock); file_chmod(node, 0666 & ~_hurd_umask); dir_link(dir, node, name, 1); ifsock_getsockaddr(ifsock, &aport); ... } The idea being to let perm 0666 while calling dir_lookup, and clearing those permissions before making the node show up in the FS. But libdiskfs/dir-lookup.c has a clear: if (((type == S_IFSOCK || ...) && (flags & (O_READ|O_WRITE|O_EXEC))) || ...) error = EACCES; i.e. we're not allowed to have openstat != 0 for the ifsock node, basically. Roland, any idea of another way to create local sockets with umask 777? Samuel