]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/bextract.c
Update the Microsoft Visual Studio build to match the MinGW32 build.
[bacula/bacula] / bacula / src / stored / bextract.c
index 92fcbd761857fb362f1bfd10e9a39de87215a712..8251f90e61f73f32f48a79a3374abbda7d4a0aac 100644 (file)
@@ -8,7 +8,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
 #include "stored.h"
 #include "findlib/find.h"
 
-#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
-int win32_client = 1;
-#else
-int win32_client = 0;
-#endif
-
 static void do_extract(char *fname);
 static bool record_cb(DCR *dcr, DEV_RECORD *rec);
 
@@ -67,7 +61,7 @@ pthread_cond_t wait_device_release = PTHREAD_COND_INITIALIZER;
 static void usage()
 {
    fprintf(stderr, _(
-"Copyright (C) 2000-2005 Kern Sibbald.\n"
+"Copyright (C) 2000-%s Kern Sibbald.\n"
 "\nVersion: %s (%s)\n\n"
 "Usage: bextract <options> <bacula-archive-device-name> <directory-to-store-files>\n"
 "       -b <file>       specify a bootstrap file\n"
@@ -78,7 +72,7 @@ static void usage()
 "       -p              proceed inspite of I/O errors\n"
 "       -v              verbose\n"
 "       -V <volumes>    specify Volume names (separated by |)\n"
-"       -?              print this message\n\n"), VERSION, BDATE);
+"       -?              print this message\n\n"), BYEAR, VERSION, BDATE);
    exit(1);
 }
 
@@ -98,6 +92,8 @@ int main (int argc, char *argv[])
    my_name_is(argc, argv, "bextract");
    init_msg(NULL, NULL);              /* setup message handler */
 
+   OSDependentInit();
+
    ff = init_find_files();
    binit(&bfd);
 
@@ -122,7 +118,7 @@ int main (int argc, char *argv[])
          break;
 
       case 'e':                    /* exclude list */
-         if ((fd = fopen(optarg, "r")) == NULL) {
+         if ((fd = fopen(optarg, "rb")) == NULL) {
             berrno be;
             Pmsg2(0, _("Could not open exclude file: %s, ERR=%s\n"),
                optarg, be.strerror());
@@ -137,7 +133,7 @@ int main (int argc, char *argv[])
          break;
 
       case 'i':                    /* include list */
-         if ((fd = fopen(optarg, "r")) == NULL) {
+         if ((fd = fopen(optarg, "rb")) == NULL) {
             berrno be;
             Pmsg2(0, _("Could not open include file: %s, ERR=%s\n"),
                optarg, be.strerror());
@@ -214,11 +210,11 @@ static void do_extract(char *devname)
    if (!jcr) {
       exit(1);
    }
-   dev = jcr->dcr->dev;
+   dev = jcr->read_dcr->dev;
    if (!dev) {
       exit(1);
    }
-   dcr = jcr->dcr;
+   dcr = jcr->read_dcr;
 
    /* Make sure where directory exists and that it is a directory */
    if (stat(where, &statp) < 0) {
@@ -246,7 +242,7 @@ static void do_extract(char *devname)
    release_device(dcr);
    free_attr(attr);
    free_jcr(jcr);
-   term_dev(dev);
+   dev->term();
 
    printf(_("%u files restored.\n"), num_files);
    return;
@@ -425,8 +421,15 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
 #endif
       break;
 
-   case STREAM_MD5_SIGNATURE:
-   case STREAM_SHA1_SIGNATURE:
+   case STREAM_MD5_DIGEST:
+   case STREAM_SHA1_DIGEST:
+   case STREAM_SHA256_DIGEST:
+   case STREAM_SHA512_DIGEST:
+      break;
+
+   case STREAM_SIGNED_DIGEST:
+   case STREAM_ENCRYPTED_SESSION_DATA:
+      // TODO landonf: Investigate crypto support in the storage daemon
       break;
 
    case STREAM_PROGRAM_NAMES:
@@ -462,9 +465,6 @@ bool    dir_create_jobmedia_record(DCR *dcr) { return 1; }
 bool    dir_ask_sysop_to_create_appendable_volume(DCR *dcr) { return 1; }
 bool    dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
 bool    dir_send_job_status(JCR *jcr) {return 1;}
-VOLRES *new_volume(DCR *dcr, const char *VolumeName) { return NULL; }
-bool    free_volume(DEVICE *dev) { return true; }
-void    free_unused_volume(DCR *dcr) { }
 
 
 bool dir_ask_sysop_to_mount_volume(DCR *dcr)