Imported Upstream version 2.4.5p1
[debian/amanda] / server-src / amcheck.c
index b7c2c172dafc000fc3386e3482c21070e09613cb..79f2d308447bde3dc1fe9a2323668376159ce693 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amcheck.c,v 1.50.2.19.2.7.2.20.2.10 2005/04/06 12:32:31 martinea Exp $
+ * $Id: amcheck.c,v 1.50.2.19.2.7.2.20.2.12 2005/10/11 14:50:00 martinea Exp $
  *
  * checks for common problems in server and clients
  */
@@ -109,7 +109,6 @@ char **argv;
     pid_t pid;
     extern int optind;
     int l, n, s;
-    int fd;
     char *mailto = NULL;
     extern char *optarg;
     int mailout;
@@ -121,16 +120,7 @@ char **argv;
     struct passwd *pw;
     uid_t uid_me;
 
-    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("amcheck");
@@ -660,6 +650,7 @@ uid_t dumpuid;
 
 int start_server_check(fd, do_localchk, do_tapechk)
     int fd;
+    int do_localchk, do_tapechk;
 {
     char *errstr, *tapename;
     generic_fs_stats_t fs;