static char *cwdbuf;
static size_t cwdbufsize;
static char *ovbuf;
-static int ovused, systemerror;
+static int ovused, systemerror, socketfd;
static void blocksignals(int how) {
sigset_t set;
reading= fdsetup[fd].mods & fdm_read;
catdup(catnamebuf, fdsetup[fd].copyfd, reading ? 0 : 1);
catdup(catnamebuf, fdsetup[fd].pipefd, reading ? 1 : 0);
+ if (close(socketfd))
+ fsyscallerror("%s: close client socket for for cat",catnamebuf);
close_unwanted_pipes();
execl("/bin/cat",catnamebuf,(char*)0);
fprintf(stderr,"userv: %s: cannot exec `cat': %s\n",catnamebuf,strerror(errno));
}
int main(int argc, char *const *argv) {
- int status, socketfd;
+ int status;
#ifdef NDEBUG
# error Do not disable assertions in this security-critical code !
userv (1.0.3.99-0.0.1) unstable; urgency=low
+ Bugfixes:
+ * Close client socket fd in spawned cats (avoids some service-side hangs
+ when client terminates). Thanks to report from Simon Tatham.
+
Minor portability fixes:
* Missing #include <string.h> and <stdlib.h> } Thanks to report
* getgroups returns int, not gid_t (!). } from Peter Benie.