Imported Upstream version 2.4.5p1
[debian/amanda] / server-src / amflush.c
index f6a5df5d79315905ccc0d9fa73aec2481e9df0ea..c8d5a4a428221e588ab6958be46e5e77d88abe4a 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amflush.c,v 1.41.2.13.4.6.2.9.2.2 2004/10/20 21:49:26 martinea Exp $
+ * $Id: amflush.c,v 1.41.2.13.4.6.2.9.2.3 2005/09/20 21:31:52 jrjackson Exp $
  *
  * write files from work directory onto tape
  */
@@ -68,7 +68,6 @@ char **main_argv;
     char *dumpuser;
     char **datearg = NULL;
     int nb_datearg = 0;
-    int fd;
     char *conffile;
     char *conf_diskfile;
     char *conf_tapelist;
@@ -85,16 +84,7 @@ char **main_argv;
     char date_string[100];
     time_t today;
 
-    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);
     safe_cd();
 
     set_pname("amflush");