Imported Upstream version 2.4.5p1
[debian/amanda] / restore-src / amrestore.c
index dca74ba3c0c043fc753b9372a104b04e5bc0da02..aef9ba429d57cd8e417ffd09855993c1024e6069 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amrestore.c,v 1.28.2.4.4.3.2.8.2.3 2004/11/19 18:12:30 martinea Exp $
+ * $Id: amrestore.c,v 1.28.2.4.4.3.2.8.2.4 2005/09/20 21:31:52 jrjackson Exp $
  *
  * retrieves files from an amanda tape
  */
@@ -477,22 +477,13 @@ char **argv;
     int found_match;
     int arg_state;
     amwait_t compress_status;
-    int fd;
     int r = 0;
     char *e;
     char *err;
     char *label = NULL;
     int count_error;
 
-    for(fd = 3; fd < FD_SETSIZE; fd++) {
-       /*
-        * Make sure nobody spoofs us with a lot of extra open files
-        * that would cause an open we do to get a very high file
-        * descriptor, which in turn might be used as an index into
-        * an array (e.g. an fd_set).
-        */
-       close(fd);
-    }
+    safe_fd(-1, 0);
 
     set_pname("amrestore");