This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH,Hurd] bind() fails when umask is 0777
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Samuel Thibault <samuel dot thibault at gnu dot org>
- Cc: libc-alpha at sourceware dot org, bug-hurd at gnu dot org
- Date: Wed, 27 Aug 2014 15:01:48 -0700 (PDT)
- Subject: Re: [PATCH,Hurd] bind() fails when umask is 0777
- Authentication-results: sourceware.org; auth=none
- References: <53B83BBB dot 7060303 at googlemail dot com> <20140824192957 dot GY3053 at type dot youpi dot perso dot aquilenet dot fr> <20140824200642 dot GD3053 at type dot youpi dot perso dot aquilenet dot fr> <20140824211149 dot GG3053 at type dot youpi dot perso dot aquilenet dot fr> <20140825120934 dot GB3213 at type dot bordeaux dot inria dot fr> <20140825122157 dot GC3213 at type dot bordeaux dot inria dot fr> <20140826212615 dot 6E7F62C39C1 at topped-with-meat dot com> <20140827212220 dot GM3343 at type dot youpi dot perso dot aquilenet dot fr>
> + if (! err)
> + if (doretry != FS_RETRY_NORMAL || retryname[0] != '\0')
> + err = EADDRINUSE;
Please use a simple && expression rather than a nested if here.
> + /* Get the address port. */
> + err = __ifsock_getsockaddr (ifsock, &aport);
> + if (err == MIG_BAD_ID || err == EOPNOTSUPP)
> + /* We are not talking to /hurd/ifsock. Probably
> + someone came in after we linked our node, unlinked
> + it, and replaced it with a different node, before we
> + did our lookup. Treat it as if our link had failed
> + with EEXIST. */
> + err = EADDRINUSE;
This failure scenario should now be impossible, so I don't think it makes
sense to preserve a comment describing it. We could remove this check
entirely and just let the underlying error percolate. But I'd be more
inclined to change it to return EGRATUITOUS because that's exactly the case
here--a system translator with a clear mandate to support a protocol is
failing to support that protocol correctly.
> + /* Link the node, now a socket with proper mode, into the
> + * target directory. */
Fix comment formatting (no *).
Thanks,
Roland