On Mon, Oct 31, 2022 at 12:20:56PM +0100, Stefano Brivio wrote: > On ramfs, connecting to a non-existent UNIX domain socket yields > EACCESS, instead of ENOENT. This is visible if we use passt directly > on rootfs (a ramfs instance) from an initramfs image. > > It's probably wrong for ramfs to return EACCES, but given the > simplicity of the filesystem, I doubt we should try to fix it there > at the possible cost of added complexity. Yeah, that's deeply weird. I'm not even sure how you'd get such a bug involving the intersection of filesystem and unix socket. > Also, this whole beauty should go away once qrap-less usage is > established, so just accept EACCES as indication that a conflicting > socket does not, in fact, exist. That's reasonable, in addition, another case that would give EACCES is if some other user has a passt instance running there, in which case this is still probably the right thing to do. > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tap.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tap.c b/tap.c > index 4dcff4f..0a3ccce 100644 > --- a/tap.c > +++ b/tap.c > @@ -912,7 +912,8 @@ static void tap_sock_unix_init(struct ctx *c) > } > > ret = connect(ex, (const struct sockaddr *)&addr, sizeof(addr)); > - if (!ret || (errno != ENOENT && errno != ECONNREFUSED)) { > + if (!ret || (errno != ENOENT && errno != ECONNREFUSED && > + errno != EACCES)) { > if (*c->sock_path) { > err("Socket path %s already in use", path); > exit(EXIT_FAILURE); -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson