X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=amandad-src%2Famandad.c;h=25a51830134b5f380446937606e27af0a1ffa6c5;hb=4fd9649694a4fcb4d4f364fe66e568a889feee20;hp=772cd39df3bc5d66d69e15a35441165a0cebe217;hpb=cdbbeef9cde260e429854dd313bc0bf7560e1e24;p=debian%2Famanda diff --git a/amandad-src/amandad.c b/amandad-src/amandad.c index 772cd39..25a5183 100644 --- a/amandad-src/amandad.c +++ b/amandad-src/amandad.c @@ -25,7 +25,7 @@ */ /* - * $Id: amandad.c,v 1.18 2006/08/21 20:17:09 martinea Exp $ + * $Id: amandad.c,v 1.18.2.1 2006/09/15 17:18:06 martinea Exp $ * * handle client-host side of Amanda network communications, including * security checks, execution of the proper service, and acking the @@ -1424,6 +1424,11 @@ service_new( aclose(data_write[0][0]); aclose(data_write[0][1]); + for (i = 0; i < DATA_FD_COUNT; i++) { + aclose(data_read[i + 1][0]); + aclose(data_write[i + 1][1]); + } + /* * Make sure they are not open in the range DATA_FD_OFFSET to * DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1 @@ -1444,7 +1449,7 @@ service_new( data_write[i + 1][0] = newfd; } } - for (i = 0; i < DATA_FD_COUNT; i++) + for (i = 0; i < DATA_FD_COUNT*2; i++) close(DATA_FD_OFFSET + i); /* @@ -1456,7 +1461,6 @@ service_new( error("dup %d to %d failed: %s\n", data_read[i + 1][1], i + DATA_FD_OFFSET, strerror(errno)); } - aclose(data_read[i + 1][0]); aclose(data_read[i + 1][1]); if (dup2(data_write[i + 1][0], i*2 + 1 + DATA_FD_OFFSET) < 0) { @@ -1464,7 +1468,6 @@ service_new( i + DATA_FD_OFFSET, strerror(errno)); } aclose(data_write[i + 1][0]); - aclose(data_write[i + 1][1]); } /* close all unneeded fd */