]> git.sur5r.net Git - bacula/bacula/commitdiff
- Correct compiler complaints in wx-console and tray-monitor.
authorKern Sibbald <kern@sibbald.com>
Fri, 22 Jul 2005 20:30:00 +0000 (20:30 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 22 Jul 2005 20:30:00 +0000 (20:30 +0000)
- Correct VSS problems recognizing c:
- Add VSS before job status
- Fix output of status from being one big line.
- Change cd xx; make to cd xx && make as suggested by Phil.
- Cleanup projects file
- Remove unnecessary casting of FF_PKT in filed.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2236 91ce42f0-d328-0410-95d8-f526ca767f89

14 files changed:
bacula/Makefile.in
bacula/kes-1.37
bacula/projects
bacula/src/Makefile.in
bacula/src/filed/job.c
bacula/src/filed/status.c
bacula/src/findlib/find.c
bacula/src/lib/winapi.c
bacula/src/tray-monitor/tray-monitor.c
bacula/src/win32/compat/compat.cpp
bacula/src/win32/compat/vss.cpp
bacula/src/win32/compat/vss.h
bacula/src/win32/compat/vss_generic.cpp
bacula/src/wx-console/console_thread.cpp

index abc9c6f4b7338c8d032b68203aaf2e2b1d9950b1..59442a576ff2260f1df5160a687f009b1396a52e 100755 (executable)
@@ -113,34 +113,34 @@ install-menu-consolehelper: gnomedirs
        ln -s $(DESTDIR)/usr/bin/consolehelper $(DESTDIR)/usr/bin/gnome-console
 
 install: installdirs
-       @for I in $(all_subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
+       @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
 
 uninstall:
-       @for I in $(all_subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
+       @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
 
 install-autostart:
-       (cd platforms; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
+       (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
 
 install-autostart-dir:
-       (cd platforms; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
+       (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
 
 install-autostart-fd:
-       (cd platforms; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
+       (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
 
 install-autostart-sd:
-       (cd platforms; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
+       (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
 
 uninstall-autostart:
-       (cd platforms; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
+       (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
 
 uninstall-autostart-dir:
-       (cd platforms; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
+       (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
 
 uninstall-autostart-fd:
-       (cd platforms; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
+       (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
 
 uninstall-autostart-sd:
-       (cd platforms; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
+       (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
 
 uninstall-menu:
        rm -f $(DESTDIR)/usr/share/pixmaps/bacula.png
@@ -188,10 +188,10 @@ clean:
 
 # clean for distribution
 distclean:
-       @for I in $(all_subdirs); do (cd $$I; $(MAKE) $@ || exit 1); done
-       @for I in $(all_subdirs); do (cd $$I; $(RMF) startit stopit btraceback); done
-       @(cd $(srcdir); $(RMF) *~ config.cache config.h config.log config.status config.out)
-       @(cd $(srcdir); $(RMF) Makefile autoconf/Make.common)
+       @for I in $(all_subdirs); do (cd $$I && $(MAKE) $@ || exit 1); done
+       @for I in $(all_subdirs); do (cd $$I && $(RMF) startit stopit btraceback); done
+       @(cd $(srcdir) && $(RMF) *~ config.cache config.h config.log config.status config.out)
+       @(cd $(srcdir) && $(RMF) Makefile autoconf/Make.common)
        @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
        @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
        @$(RMF) bconsole gconsole
@@ -200,10 +200,10 @@ distclean:
        @$(RMF) -rf txt diff src/python src/testprogs
 
 devclean:
-       @for I in $(all_subdirs); do (cd $$I; $(MAKE) $@ || exit 1); done
-       @for I in $(all_subdirs); do (cd $$I; $(RMF) startit stopit btraceback); done
-       @(cd $(srcdir); $(RMF) *~ config.cache config.h config.log config.status config.out)
-       @(cd $(srcdir); $(RMF) Makefile autoconf/Make.common)
+       @for I in $(all_subdirs); do (cd $$I && $(MAKE) $@ || exit 1); done
+       @for I in $(all_subdirs); do (cd $$I && $(RMF) startit stopit btraceback); done
+       @(cd $(srcdir) && $(RMF) *~ config.cache config.h config.log config.status config.out)
+       @(cd $(srcdir) && $(RMF) Makefile autoconf/Make.common)
        @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
        @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
        @$(RMF) bconsole gconsole
@@ -213,12 +213,12 @@ devclean:
 distdirs:
        mkdir ../$(VERNAME);
        mkdir ../$(VERNAME)/autoconf;
-       @for I in $(all_subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || (echo "Failed to make distclean in $$I"; exit 0) ); done
+       @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || (echo "Failed to make distclean in $$I"; exit 0) ); done
 
 distcopy:
        $(CP) -p $(DIST) ../$(VERNAME);
        $(CP) -p $(DIST_CFG) ../$(VERNAME)/autoconf;
-       @for I in $(all_subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
+       @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
 
 distrib: configure autoconf/config.h.in distdirs distcopy
 
index bff462c366865a31d0e942291d088ca7a571a691..4835db30b17930661cfdc0bc9d8fdee09314eadf 100644 (file)
@@ -5,6 +5,13 @@ General:
 
 Changes to 1.37.31:
 22Jul05
+- Correct compiler complaints in wx-console and tray-monitor.
+- Correct VSS problems recognizing c:
+- Add VSS before job status
+- Fix output of status from being one big line.
+- Change cd xx; make to cd xx && make as suggested by Phil.
+- Cleanup projects file
+- Remove unnecessary casting of FF_PKT in filed.
 - Apply Thorsten's bugfix for vss_generic.cpp
 - Add check for df path for dvd_freespace
 - Use df to get space used on DVD.
index d1e71862a2429fa1b066a851a5e4cde2c61f85bd..956569fd64e74b7ee2e05fffdae0df98cca4d5b3 100644 (file)
@@ -1,22 +1,9 @@
                 
 Projects:
                      Bacula Projects Roadmap 
-                       23 April 2005
+                       22 July 2005
 
 The following major projects are scheduled for 1.37:
-#3   Migration (Move, Copy, Archive Jobs)
-#4   Embedded Python Scripting (implemented in all Daemons)
-#5   Events that call a Python program (Implemented in all
-       daemons, but more cleanup work to be done).
-#6   Select one from among Multiple Storage Devices for Job.
-       This is already implemented in 1.37.
-#7   Single Job Writing to Multiple Storage Devices. This is
-       currently implemented with a Clone feature.
-#-   Full multiple drive Autochanger support (mostly implemented).
-#-   We will have built in support for communications 
-       encryption (TLS) done by Landon Fuller.
-#    We will most likely have support for Unicode characters
-       (via UTF-8) on Win32 machines thanks to Thorsten Engle.
 
 
 Below, you will find more information on those projects as
@@ -91,95 +78,34 @@ Item 3:   Implement a Migration job type that will move the job
            Highwater size (keep total size)
            Lowwater mark
 
-
-Item 4:   Embedded Python Scripting (precursor to 5).
-  Status: Implemented in 1.37 in all 3 daemons.
-
-  What:   On a configuration parameter, embed the Python language in
-          Bacula.
-
-  Why:    The embedded Python scripting can be called to implement
-          Events such as "Volume Name needed", "End of Tape",
-          "Tape at x% of rated capacity", "Job started", 
-          "Job Ended", "Job error", ...
-
-  Notes:  This needs Events.
-
-
-Item 5:   Implement Events that call the scripting language.
-  Status: Implemented in 1.37, but more events to complete and
-          more work to be done to cleanup the implementation.
-
-  What:   When a particular user defined Event occurs, call the
-          embedded Python interpreter.
-
-  Why:    This will provide the ultimate in user customization for
-          Bacula. Almost anything imaginable can be done if Events
-          are called at the appropriate place.
-
-  Notes:  There is a certain amount of work to be done on how
-          the user defines or "registers" events.
-
-
-Item 6:   Multiple Storage Devices for a Single Job
-  Status: This is already implemented in 1.37 (at least the
-            initial selection of one from a number of storage
-                       devices.
-
-  What:   Allow any Job to specify a number of storage devices,
-          from which one will be used.
-
-  Why:    With two devices, for example, the second device could
-          have the next backup tape pre-mounted reducing operator
-          intervention in the middle of the night.
-
-
-Item 7:   Backup a Single Job Simultaneously to Multiple Storage Devices
-  Status: This will probably not be done in 1.37. However, version
-          1.37 has a job Cloning feature, which permits essentially
-                 the same thing.
-
-  What:   Make two copies of the backup data at the same time.
-
-  Why:    Large shops typically do this and then take one set of
-          backups off-site.  Some design work it needed in how to
-          specify the type of backup (backup, archive, ...) for
-          each Device.
-
-
-
-Item  8:  Break the one-to-one Relationship between a Job and a
-          Specific Storage Device (or Devices if #10 is implemented).
-  Status: Mostly done in 1.37.
-
-  What:   Allow a Job to simply specify one or more MediaType, and
-          the Storage daemon will select a device for it.  In
-          fact, the user should be able to specify one or more
-          MediaType, Storage daemon, and/or device to be used.
-
-  Why:    To allow more flexibility in large shops that have multiple 
-          drives and/or multiple drives of different types.
-
-
 Item  9:  Implement data encryption (as opposed to communications
           encryption)
-  Status: Abel Menos expressed interest in this, but he is busy
-          at work.
-                 
+  Status: Landon Fuller has agreed to work on this.
+                  
   What:   Currently the data that is stored on the Volume is not
           encrypted. For confidentiality, encryption of data at
-          the File daemon level is essential. Note, communications
-          encryption encrypts the data when leaving the File daemon,
-          then decrypts the data on entry to the Storage daemon.
+          the File daemon level is essential. 
           Data encryption encrypts the data in the File daemon and
           decrypts the data in the File daemon during a restore.
 
   Why:    Large sites require this.
 
-  Notes:  The only algorithm that is needed is AES.
-          http://csrc.nist.gov/CryptoToolkit/aes/
-
 
+Items completed for release 1.38.0:
+#4   Embedded Python Scripting (implemented in all Daemons)
+#5   Events that call a Python program (Implemented in all
+       daemons, but more cleanup work to be done).
+#6   Select one from among Multiple Storage Devices for Job.
+       This is already implemented in 1.37.
+#7   Single Job Writing to Multiple Storage Devices. This is
+       currently implemented with a Clone feature.
+#-   Full multiple drive Autochanger support (mostly implemented).
+#-   We will have built in support for communications 
+       encryption (TLS) done by Landon Fuller.
+#    We will most likely have support for Unicode characters
+       (via UTF-8) on Win32 machines thanks to Thorsten Engle.
+Item  8:  Break the one-to-one Relationship between a Job and a
+          Specific Storage Device (or Devices if #10 is implemented).
 
 Completed items from last year's list:
 Item 1:   Multiple simultaneous Jobs. (done)
index c2c128a975fcaeb7ac23337728613e7c8cbae1f5..cee9c1fce1b51b9c62244bf622b7654ff16ccf08 100644 (file)
@@ -43,20 +43,20 @@ clean:
        @$(RMF) AUTHORS ChangeLog Makefile.am NEWS README acconfig.h autogen.sh 
        @$(RMF) configure.in stamp.h stamp-h.in
        @$(RMF) -r po
-       (cd gnome2-console; $(MAKE) clean)
+       (cd gnome2-console && $(MAKE) clean)
 
 realclean: clean
        @$(RMF) tags
 
 distclean: realclean
        if test $(srcdir) = .; then $(MAKE) realclean; fi
-       @(cd $(srcdir); $(RMF) Makefile)
+       @(cd $(srcdir) && $(RMF) Makefile)
        @$(RMF) config.h host.h
        @$(RMF) -r CVS
 
 devclean: realclean
        if test $(srcdir) = .; then $(MAKE) realclean; fi
-       @(cd $(srcdir); $(RMF) Makefile)
+       @(cd $(srcdir) && $(RMF) Makefile)
        @$(RMF) config.h host.h
 
 install:
index dc3db1a422f7e77e96c405597fb0b245d181d28f..c7683b10202f369f8038a6e981c818be3f8161f5 100644 (file)
@@ -233,7 +233,7 @@ void *handle_client_request(void *dirp)
    bnet_sig(dir, BNET_TERMINATE);
 
    /* Clean up fileset */
-   FF_PKT *ff = (FF_PKT *)jcr->ff;
+   FF_PKT *ff = jcr->ff;
    findFILESET *fileset = ff->fileset;
    if (fileset) {
       int i, j, k;
@@ -287,7 +287,7 @@ void *handle_client_request(void *dirp)
    }
    ff->fileset = NULL;
    Dmsg0(100, "Calling term_find_files\n");
-   term_find_files((FF_PKT *)jcr->ff);
+   term_find_files(jcr->ff);
    jcr->ff = NULL;
    Dmsg0(100, "Done with term_find_files\n");
    free_jcr(jcr);                     /* destroy JCR record */
@@ -502,7 +502,7 @@ static bool init_fileset(JCR *jcr)
    if (!jcr->ff) {
       return false;
    }
-   ff = (FF_PKT *)jcr->ff;
+   ff = jcr->ff;
    if (ff->fileset) {
       return false;
    }
@@ -602,7 +602,7 @@ static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *filese
 
 static void add_fileset(JCR *jcr, const char *item)
 {
-   FF_PKT *ff = (FF_PKT *)jcr->ff;
+   FF_PKT *ff = jcr->ff;
    findFILESET *fileset = ff->fileset;
    int state = fileset->state;
    findFOPTS *current_opts;
@@ -739,7 +739,7 @@ static void add_fileset(JCR *jcr, const char *item)
 
 static bool term_fileset(JCR *jcr)
 {
-   FF_PKT *ff = (FF_PKT *)jcr->ff;
+   FF_PKT *ff = jcr->ff;
    findFILESET *fileset = ff->fileset;
    int i, j, k;
 
@@ -1164,7 +1164,7 @@ static int backup_cmd(JCR *jcr)
 
    set_jcr_job_status(jcr, JS_Blocked);
    jcr->JobType = JT_BACKUP;
-   Dmsg1(100, "begin backup ff=%p\n", (FF_PKT *)jcr->ff);
+   Dmsg1(100, "begin backup ff=%p\n", jcr->ff);
 
    if (sd == NULL) {
       Jmsg(jcr, M_FATAL, 0, _("Cannot contact Storage daemon\n"));
@@ -1212,17 +1212,15 @@ static int backup_cmd(JCR *jcr)
 
 #ifdef WIN32_VSS
    /* START VSS ON WIN 32 */
-   if (g_pVSSClient && enable_vss == 1) {
+   if (g_pVSSClient && enable_vss) {
       if (g_pVSSClient->InitializeForBackup()) {
          /* tell vss which drives to snapshot */   
          char szWinDriveLetters[27];   
-         if (get_win32_driveletters((FF_PKT *)jcr->ff, szWinDriveLetters)) {
+         if (get_win32_driveletters(jcr->ff, szWinDriveLetters)) {
             Jmsg(jcr, M_INFO, 0, _("Generate VSS snapshots. Driver=\"%s\", Drive(s)=\"%s\"\n"), g_pVSSClient->GetDriverName(), szWinDriveLetters);
-
             if (!g_pVSSClient->CreateSnapshots(szWinDriveLetters)) {
                   Jmsg(jcr, M_WARNING, 0, _("Generate VSS snapshots failed\n"));
-            }
-            else {
+            } else {
                /* tell user if snapshot creation of a specific drive failed */
                size_t i;
                for (i=0; i<strlen (szWinDriveLetters); i++) {
@@ -1234,10 +1232,11 @@ static int backup_cmd(JCR *jcr)
                   int msg_type = M_INFO;
                   if (g_pVSSClient->GetWriterState(i) < 0)
                      msg_type = M_WARNING;
-
                   Jmsg(jcr, msg_type, 0, _("VSS Writer: %s\n"), g_pVSSClient->GetWriterInfo(i));
                }
             }
+         } else {
+            Jmsg(jcr, M_INFO, 0, _("No drive letters found for generating VSS snapshots.\n"));
          }
       } else {
          Jmsg(jcr, M_WARNING, 0, _("VSS was not initialized properly. VSS support is disabled.\n"));
index 275399949d1ee80dd7838530fd4b30b788ad5dc5..3e86e6e0c5cecdedbc50d8797c46bebc98c55e2c 100755 (executable)
@@ -44,7 +44,9 @@ static char DotStatusJob[] = "JobId=%d JobStatus=%c JobErrors=%d\n";
 static int privs = 0;
 #endif
 #ifdef WIN32_VSS
+#include "vss.h"
 #define VSS " VSS"
+extern VSSClient *g_pVSSClient;
 #else
 #define VSS ""
 #endif
@@ -74,50 +76,43 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
       if (!privs) {
          privs = enable_backup_privileges(NULL, 1);
       }
-      len = Mmsg(msg,
-     _(" Priv 0x%x\n APIs=%sOPT,%sATP,%sLPV,%sCFA,%sCFW,\n"
-     " %sWUL,%sWMKD,%sWOP,%sGFAA,%sGFAW,%sGFAEA,%sGFAEW,%sSFAA,%sSFAW,%sBR,%sBW,%sSPSP,\n" 
-     " %sWC2MB,%sMB2WC,%sFFFA,%sFFFW,%sFNFA,%sFNFW,%sSCDA,%sSCDW,\n"
-     " %sGCDA,%sGCDW\n"), 
-     privs,
-         p_OpenProcessToken?"":"!",
-         p_AdjustTokenPrivileges?"":"!",
-         p_LookupPrivilegeValue?"":"!",
-
-    p_CreateFileA?"":"!",
-         p_CreateFileW?"":"!",
-
-    p_wunlink?"":"!",
-    p_wmkdir?"":"!",
-    p_wopen?"":"!",
-
-    p_GetFileAttributesA?"":"!",
-    p_GetFileAttributesW?"":"!",
-
-    p_GetFileAttributesExA?"":"!",
-         p_GetFileAttributesExW?"":"!",
-
-    p_SetFileAttributesA?"":"!",
-         p_SetFileAttributesW?"":"!",
-         p_BackupRead?"":"!",
-         p_BackupWrite?"":"!",
-         p_SetProcessShutdownParameters?"":"!",
-
-    p_WideCharToMultiByte?"":"!",
-    p_MultiByteToWideChar?"":"!",
-
-    p_FindFirstFileA?"":"!",
-    p_FindFirstFileW?"":"!",
-
-    p_FindNextFileA?"":"!",
-    p_FindNextFileW?"":"!",
-
-    p_SetCurrentDirectoryA?"":"!",
-    p_SetCurrentDirectoryW?"":"!",
-
-    p_GetCurrentDirectoryA?"":"!",
-    p_GetCurrentDirectoryW?"":"!");
+      len = Mmsg(msg, "Priv 0x%x\n", privs);
+      sendit(msg, len, arg);
+      len = Mmsg(msg, "APIs=%sOPT,%sATP,%sLPV,%sCFA,%sCFW,\n",
+                 p_OpenProcessToken?"":"!",
+                 p_AdjustTokenPrivileges?"":"!",
+                 p_LookupPrivilegeValue?"":"!",
+                 p_CreateFileA?"":"!",
+                 p_CreateFileW?"":"!");
+      sendit(msg, len, arg);
+      len = Mmsg(msg, " %sWUL,%sWMKD,%sWOP,%sGFAA,%sGFAW,%sGFAEA,%sGFAEW,%sSFAA,%sSFAW,%sBR,%sBW,%sSPSP,\n",
+                 p_wunlink?"":"!",
+                 p_wmkdir?"":"!",
+                 p_wopen?"":"!",
+                 p_GetFileAttributesA?"":"!",
+                 p_GetFileAttributesW?"":"!",
+                 p_GetFileAttributesExA?"":"!",
+                 p_GetFileAttributesExW?"":"!",
+                 p_SetFileAttributesA?"":"!",
+                 p_SetFileAttributesW?"":"!",
+                 p_BackupRead?"":"!",
+                 p_BackupWrite?"":"!",
+                 p_SetProcessShutdownParameters?"":"!");
       sendit(msg, len, arg);
+      len = Mmsg(msg, " %sWC2MB,%sMB2WC,%sFFFA,%sFFFW,%sFNFA,%sFNFW,%sSCDA,%sSCDW,\n",
+                 p_WideCharToMultiByte?"":"!",
+                 p_MultiByteToWideChar?"":"!",
+                 p_FindFirstFileA?"":"!",
+                 p_FindFirstFileW?"":"!",
+                 p_FindNextFileA?"":"!",
+                 p_FindNextFileW?"":"!",
+                 p_SetCurrentDirectoryA?"":"!",
+                 p_SetCurrentDirectoryW?"":"!");
+      sendit(msg, len, arg);
+      len = Mmsg(msg, " %sGCDA,%sGCDW\n",  
+                 p_GetCurrentDirectoryA?"":"!",
+                 p_GetCurrentDirectoryW?"":"!");
+     sendit(msg, len, arg);
    }
 #endif
    if (debug_level > 0) {
@@ -140,6 +135,12 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
    Dmsg0(1000, "Begin status jcr loop.\n");
    len = Mmsg(msg, _("Running Jobs:\n"));
    sendit(msg, len, arg);
+   char *vss = "";
+#ifdef WIN32_VSS
+   if (g_pVSSClient && g_pVSSClient->IsInitialized()) {
+      vss = "VSS ";
+   }
+#endif
    foreach_jcr(njcr) {
       bstrftime_nc(dt, sizeof(dt), njcr->start_time);
       if (njcr->JobId == 0) {
@@ -148,8 +149,8 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
          len = Mmsg(msg, _("JobId %d Job %s is running.\n"),
                     njcr->JobId, njcr->Job);
          sendit(msg, len, arg);
-         len = Mmsg(msg, _("    %s Job started: %s\n"),
-                    job_type_to_str(njcr->JobType), dt);
+         len = Mmsg(msg, _("    %s%s Job started: %s\n"),
+                    vss, job_type_to_str(njcr->JobType), dt);
       }
       sendit(msg, len, arg);
       if (njcr->JobId == 0) {
index 46530a62bfd79ca65fb81677ad3f4c3e3232eb34..5d1fda292552d79194f97b56bf3ddf1ed9adc5d1 100644 (file)
@@ -121,8 +121,8 @@ get_win32_driveletters(FF_PKT *ff, char* szDrives)
          for (j=0; j<incexe->name_list.size(); j++) {
             char *fname = (char *)incexe->name_list.get(j);
             /* fname should match x:/ */
-            if (strlen (fname) > 3 && B_ISALPHA(fname[0]) 
-               && fname[1] == ':' && fname[2] == '/') {
+            if (strlen(fname) >= 2 && B_ISALPHA(fname[0]) 
+               && fname[1] == ':') {
                
                /* always add in uppercase */
                char ch = toupper(fname[0]);
index 976a33a24c2d7bffce1329ab8f89930155313348..45d382ad9e83dfba696dae3db78ee47f910d46f8 100644 (file)
@@ -6,22 +6,17 @@
  *     Kern Sibbald MMIII
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2003-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
 DWORD  g_platform_id = VER_PLATFORM_WIN32_WINDOWS;
 #ifdef WIN32_VSS
 /* preset VSSClient to NULL */
-VSSClientg_pVSSClient = NULL;
+VSSClient *g_pVSSClient = NULL;
 #endif
 
 
 /* API Pointers */
 
-t_OpenProcessToken     p_OpenProcessToken = NULL;
+t_OpenProcessToken      p_OpenProcessToken = NULL;
 t_AdjustTokenPrivileges p_AdjustTokenPrivileges = NULL;
-t_LookupPrivilegeValue p_LookupPrivilegeValue = NULL;
+t_LookupPrivilegeValue  p_LookupPrivilegeValue = NULL;
 
 t_SetProcessShutdownParameters p_SetProcessShutdownParameters = NULL;
 
-t_CreateFileA  p_CreateFileA = NULL;
-t_CreateFileW  p_CreateFileW = NULL;
+t_CreateFileA   p_CreateFileA = NULL;
+t_CreateFileW   p_CreateFileW = NULL;
 
 t_wunlink p_wunlink = NULL;
 t_wmkdir p_wmkdir = NULL;
 t_wopen p_wopen = NULL;
 
-t_GetFileAttributesA   p_GetFileAttributesA = NULL;
-t_GetFileAttributesW   p_GetFileAttributesW = NULL;
+t_GetFileAttributesA    p_GetFileAttributesA = NULL;
+t_GetFileAttributesW    p_GetFileAttributesW = NULL;
 
-t_GetFileAttributesExA p_GetFileAttributesExA = NULL;
-t_GetFileAttributesExW p_GetFileAttributesExW = NULL;
+t_GetFileAttributesExA  p_GetFileAttributesExA = NULL;
+t_GetFileAttributesExW  p_GetFileAttributesExW = NULL;
 
-t_SetFileAttributesA   p_SetFileAttributesA = NULL;
-t_SetFileAttributesW   p_SetFileAttributesW = NULL;
-t_BackupRead           p_BackupRead = NULL;
-t_BackupWrite          p_BackupWrite = NULL;
+t_SetFileAttributesA    p_SetFileAttributesA = NULL;
+t_SetFileAttributesW    p_SetFileAttributesW = NULL;
+t_BackupRead            p_BackupRead = NULL;
+t_BackupWrite           p_BackupWrite = NULL;
 t_WideCharToMultiByte p_WideCharToMultiByte = NULL;
 t_MultiByteToWideChar p_MultiByteToWideChar = NULL;
 
@@ -162,7 +157,7 @@ InitWinAPIWrapper()
       /* wopen */
       p_wopen = (t_wopen)
       GetProcAddress(hLib, "_wopen");
-       
+        
       FreeLibrary(hLib);
    }
    
@@ -197,12 +192,12 @@ InitWinAPIWrapper()
       p_BackupRead = NULL;
       p_BackupWrite = NULL;
 
-      p_CreateFileW = NULL;         
-      p_GetFileAttributesW = NULL;         
+      p_CreateFileW = NULL;          
+      p_GetFileAttributesW = NULL;          
       p_GetFileAttributesExW = NULL;
-         
+          
       p_SetFileAttributesW = NULL;
-               
+                
       p_FindFirstFileW = NULL;
       p_FindNextFileW = NULL;
       p_SetCurrentDirectoryW = NULL;
@@ -217,15 +212,15 @@ InitWinAPIWrapper()
 #ifdef WIN32_VSS
    switch (dwMinorVersion) {
       case 1: 
-        g_pVSSClient = new VSSClientXP();
-        atexit(VSSCleanup);
-        break;
+         g_pVSSClient = new VSSClientXP();
+         atexit(VSSCleanup);
+         break;
       case 2: 
-        g_pVSSClient = new VSSClient2003();
-        atexit(VSSCleanup);
-        break;
+         g_pVSSClient = new VSSClient2003();
+         atexit(VSSCleanup);
+         break;
    }
-#endif
+#endif /* WIN32_VSS */
 }
 
 #endif
index 9abc40098fc65bd9ac08a566361b28874f87e1b0..3917beaea12192197fb4989234947d0bc95400a3 100644 (file)
@@ -566,18 +566,16 @@ static int authenticate_daemon(monitoritem* item, JCR *jcr) {
    switch (item->type) {
    case R_DIRECTOR:
       return authenticate_director(jcr, monitor, (DIRRES*)item->resource);
-      break;
    case R_CLIENT:
       return authenticate_file_daemon(jcr, monitor, (CLIENT*)item->resource);
-      break;
    case R_STORAGE:
       return authenticate_storage_daemon(jcr, monitor, (STORE*)item->resource);
-      break;
    default:
       printf("Error, currentitem is not a Client or a Storage..\n");
       gtk_main_quit();
       return FALSE;
    }
+   return false;
 }
 
 static gboolean blink(gpointer data) {
index 8bb55bb3dfd3c290274be232665e2d34a96ed8c9..285786826a5c1a9a05cc4e2da8d99b476e7d98dd 100644 (file)
@@ -85,11 +85,11 @@ cygwin_conv_to_win32_path(const char *name, char *win32_name, DWORD dwSize)
        from c:\bacula\uninstall.exe
     */ 
     if (g_pVSSClient && enable_vss == 1) {
-      POOLMEM* pszBuf = get_pool_memory (PM_FNAME);
-      pszBuf = check_pool_memory_size(pszBuf, dwSize);
-      bstrncpy (pszBuf, tname, strlen(tname)+1);
-      g_pVSSClient->GetShadowPath(pszBuf,tname,dwSize);
-      free_pool_memory(pszBuf);
+       POOLMEM *pszBuf = get_pool_memory (PM_FNAME);
+       pszBuf = check_pool_memory_size(pszBuf, dwSize);
+       bstrncpy(pszBuf, tname, strlen(tname)+1);
+       g_pVSSClient->GetShadowPath(pszBuf, tname, dwSize);
+       free_pool_memory(pszBuf);
     }
 #endif
 }
index cd62b8864d1e685a9f67852e942e5a944e26d48a..e59e5e5ea273d0def2285b4a62d5e316480678fc 100644 (file)
@@ -113,7 +113,7 @@ BOOL VSSClient::InitializeForBackup()
 
 
 
-BOOL VSSClient::GetShadowPath (const char* szFilePath, char* szShadowPath, int nBuflen)
+BOOL VSSClient::GetShadowPath (const char *szFilePath, char *szShadowPath, int nBuflen)
 {
    if (!m_bBackupIsInitialized)
       return FALSE;
@@ -129,15 +129,14 @@ BOOL VSSClient::GetShadowPath (const char* szFilePath, char* szShadowPath, int n
    if (bIsValidName) {
       int nDriveIndex = toupper(szFilePath[0])-'A';
       if (m_szShadowCopyName[nDriveIndex][0] != 0) {
-         strncpy (szShadowPath, m_szShadowCopyName[nDriveIndex], nBuflen);
-         nBuflen -= (int) strlen (m_szShadowCopyName[nDriveIndex]);
-         strncat (szShadowPath, szFilePath+2,nBuflen);
-
+         strncpy(szShadowPath, m_szShadowCopyName[nDriveIndex], nBuflen);
+         nBuflen -= (int)strlen(m_szShadowCopyName[nDriveIndex]);
+         strncat(szShadowPath, szFilePath+2, nBuflen);
          return TRUE;
       }
    }
    
-   strncpy (szShadowPath,  szFilePath, nBuflen);
+   strncpy(szShadowPath,  szFilePath, nBuflen);
    return FALSE;   
 }
 
index 42916e8e10e0f74e4d915dc490c5c7251dec1fd2..9f8a4c0ebf2c6b3ac396e1459a91661e9726617d 100644 (file)
@@ -46,6 +46,7 @@ public:
     const size_t GetWriterCount();
     const char* GetWriterInfo(size_t nIndex);
     const int   GetWriterState(size_t nIndex);
+    const BOOL  IsInitialized() { return m_bBackupIsInitialized; };
          
 private:
     virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore = FALSE) = 0;
index bbefe7c43f00eda708ba4cbf183e8d664f193edf..f412f1c7adef6160e0b93c63c0d9c9236961b63d 100644 (file)
@@ -272,8 +272,7 @@ void VSSClientGeneric::WaitAndCheckForAsyncOperation(IVssAsync* pAsync)
     hr = pAsync->QueryStatus(&hrReturned, NULL);
 
     // Check if the async operation succeeded...
-    if(FAILED(hrReturned))
-    {
+    if(FAILED(hrReturned)) {
       PWCHAR pwszBuffer = NULL;
       DWORD dwRet = ::FormatMessageW(
          FORMAT_MESSAGE_ALLOCATE_BUFFER 
@@ -284,10 +283,7 @@ void VSSClientGeneric::WaitAndCheckForAsyncOperation(IVssAsync* pAsync)
          (LPWSTR)&pwszBuffer, 0, NULL);
 
       // No message found for this error. Just return <Unknown>
-      if (dwRet != 0)
-      {
-         // Convert the message into wstring         
-    
+      if (dwRet != 0) {
          LocalFree(pwszBuffer);         
       }
     }
@@ -304,7 +300,7 @@ BOOL VSSClientGeneric::CreateSnapshots(char* szDriveLetters)
 
    m_uidCurrentSnapshotSet = GUID_NULL;
 
-   IVssBackupComponents* pVss = (IVssBackupComponents*) m_pVssObject;
+   IVssBackupComponents *pVss = (IVssBackupComponents*)m_pVssObject;
 
    // 1. InitializeForBackup
    HRESULT hr = pVss->InitializeForBackup();
index 1d1fc76f08f6b1d0253382acba225fb5e7e67e22..2d317626793022ea388c5d09714e9190bf90fa69 100644 (file)
@@ -474,23 +474,22 @@ void* console_thread::Entry() {
    return NULL;
 }
 
-void console_thread::Write(const char* str) {
+void console_thread::Write(const char* str) 
+{
    if (UA_sock) {
        UA_sock->msglen = strlen(str);
        pm_strcpy(&UA_sock->msg, str);
        bnet_send(UA_sock);
-   }
-   else if (choosingdirector) {
-
+   } else if (choosingdirector) {
 //      wxString number = str;
 //      number.RemoveLast(); /* Removes \n */
       long val;
       
 //      if (number.ToLong(&val)) {
-      if (val = atol(str)) {
+      val = atol(str);
+      if (val) {
          directorchoosen = (int)val;
-      }
-      else {
+      } else {
          directorchoosen = 0;
       }
    }