lintian doesn't like orphan packages with uploaders...
[debian/amanda] / server-src / holding.c
index 0d8cb82dc7d801a7f1a7b1320ff60f24323eca62..82df14c87b38543b661d19baeb50cfb80c5ac5d4 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
  * Copyright (c) 1991-1998 University of Maryland at College Park
+ * Copyright (c) 2007-2012 Zmanda, Inc.  All Rights Reserved.
  * All Rights Reserved.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -32,6 +33,7 @@
 #include "amanda.h"
 #include "util.h"
 #include "holding.h"
+#include "diskfile.h"
 #include "fileheader.h"
 #include "logfile.h"
 
@@ -400,12 +402,9 @@ holding_walk(
     for (il = getconf_identlist(CNF_HOLDINGDISK);
                il != NULL;
                il = il->next) {
-       int is_cruft = 0;
        hdisk_conf = lookup_holdingdisk(il->data);
 
        hdisk = holdingdisk_get_diskdir(hdisk_conf);
-       if (!is_dir(hdisk))
-           is_cruft = 1;
 
        if (per_disk_fn) 
            proceed = per_disk_fn(datap, 
@@ -516,7 +515,6 @@ holding_get_files_for_flush(
     GSList *file_list, *file_elt;
     GSList *date;
     int date_matches;
-    disk_t *dp;
     dumpfile_t file;
     GSList *result_list = NULL;
 
@@ -551,15 +549,6 @@ holding_get_files_for_flush(
             continue;
        }
 
-        /* check that the hostname and disk are in the disklist */
-        dp = lookup_disk(file.name, file.disk);
-        if (dp == NULL) {
-           dbprintf(_("%s: disk %s:%s not in database, skipping it."),
-                        (char *)file_elt->data, file.name, file.disk);
-           dumpfile_free_data(&file);
-            continue;
-        }
-
         /* passed all tests -- we'll flush this file */
         result_list = g_slist_insert_sorted(result_list, 
            stralloc(file_elt->data), 
@@ -567,7 +556,7 @@ holding_get_files_for_flush(
        dumpfile_free_data(&file);
     }
 
-    if (file_list) g_slist_free_full(file_list);
+    if (file_list) slist_free_full(file_list, g_free);
 
     return result_list;
 }
@@ -593,7 +582,7 @@ holding_get_all_datestamps(void)
        dumpfile_free_data(&dfile);
     }
 
-    g_slist_free_full(all_files);
+    slist_free_full(all_files, g_free);
 
     return datestamps;
 }
@@ -790,7 +779,7 @@ holding_cleanup_file(
        return 0;
     }
 
-    if(file.dumplevel < 0 || file.dumplevel > 9) {
+    if(file.dumplevel < 0 || file.dumplevel > 399) {
        if (data->verbose_output)
            g_fprintf(data->verbose_output, 
                _("File '%s' has invalid level %d\n"), element, file.dumplevel);
@@ -952,9 +941,11 @@ rename_tmp_holding(
                dumpfile_free_data(&file);
                amfree(filename);
                amfree(filename_tmp);
+               free(header);
                close(fd);
                return 0;
            }
+           free(header);
            close(fd);
        }
        filename = newstralloc(filename, file.cont_filename);