exportfs: avoid closing netfd in filter()
netfd is initially zero (stdin), when filter() closes fd0, fd0 is free to be reused. this causes problems with openmount() that assumes sfd being >2. instead, we dup the our pipe end over netfd, and close the pipe.
This commit is contained in:
parent
2c0490a26e
commit
eed4871674
1 changed files with 3 additions and 2 deletions
|
@ -927,10 +927,11 @@ filter(int fd, char *cmd)
|
|||
exec(file, argv);
|
||||
fatal("filter: exec; %r");
|
||||
default:
|
||||
close(fd);
|
||||
dup(p[1], fd);
|
||||
close(p[0]);
|
||||
close(p[1]);
|
||||
}
|
||||
return p[1];
|
||||
return fd;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue