]> git.sur5r.net Git - bacula/bacula/commitdiff
- Start implementing Christopher's St.Bernard code.
authorKern Sibbald <kern@sibbald.com>
Fri, 28 Apr 2006 13:19:34 +0000 (13:19 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 28 Apr 2006 13:19:34 +0000 (13:19 +0000)
- Add Christopher's mods for opening files.
- Strip \r \n from Win32 error messages (Christopher)
- Add more info about Win32 system if unknown (Christopher)
- Use bstrn(cpy, cat) routines to avoid overrun in compat.cpp
- Fix a number of incorrect strings marked for translation, when
  they should not be (e.g. commands).
- Fix StartTime bug reported for ClientRunBeforeJob and RunBeforeJob
  Patches supplied by user in bugs #608 and #599.
- Use most recent of st_ctime and st_mtime in restore tree DIR
  listing. This fixes some problems with Win32 printing incorrect
  values.
- Correct the clock shift comm time calculation between the DIR
  and the FD. It was added rather than subtracted.
- Strip all backslashes in filenames to be restored on Win32
  machines -- the names should all be in Unix format, and if
  there are any backslashes it is most likely due to an improper
  FileSet definition, and the files will not otherwise be
  restorable.
- Remove lib/regex.c (replaced by bregex.c).
- Delete src/win32/License.txt
- Modify installer to install LICENSE

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

17 files changed:
bacula/LICENSE
bacula/kernstodo
bacula/kes-1.38
bacula/kes-1.39
bacula/src/dird/backup.c
bacula/src/dird/fd_cmds.c
bacula/src/dird/job.c
bacula/src/filed/job.c
bacula/src/filed/restore.c
bacula/src/filed/status.c
bacula/src/findlib/bfile.c
bacula/src/version.h
bacula/src/win32/License.txt [deleted file]
bacula/src/win32/compat/compat.cpp
bacula/src/win32/lib/attr.cpp
bacula/src/win32/pebuilder/Makefile.in
bacula/src/win32/winbacula.nsi.in

index 56a74ef734afe7c39d188660b36b9a67c62dfa0d..d0b2ced278f1c04d42711addeb58a7efc3188e2b 100644 (file)
@@ -85,8 +85,8 @@ respect for proprietary and copyrighted code.
 =====================================
 
 The entire GPL is reproduced in the manuals distributed with the
-Bacula documentation and can also be found online on the GNU web site as well
-as at www.bacula.org.
+Bacula documentation and can also be found online on the GNU web site
+as well as at www.bacula.org.
 
 Certain parts of the Bacula software are licensed by their
 copyright holder(s) undert the GPL with no modifications.  These
index cfa76f1b9acf9ef38a113cc09c7ea50ab11b214e..45ebb2f1a1f03f78d1784d9a18b231b74eb852c9 100644 (file)
@@ -88,6 +88,7 @@ minutes).
 
 [ possibly a Python event -- kes ]
 ===
+- Integrate Christopher's St. Bernard code.
 - run_cmd() returns int should return JobId_t
 - get_next_jobid_from_list() returns int should return JobId_t
 - Document export LDFLAGS=-L/usr/lib64
@@ -98,7 +99,6 @@ minutes).
   then be migrated.
 - Detect resource deadlock in Migrate when same job wants to read
   and write the same device.
-- Make hardlink code at line 240 of find_one.c use binary search.
 - Queue warning/error messages during restore so that they
   are reported at the end of the report rather than being
   hidden in the file listing ...
@@ -107,6 +107,8 @@ minutes).
 - Look at fixing restore status stats in SD.
 - Make selection of Database used in restore correspond to
   client.
+- Look at using ioctl(FIMAP) and FIGETBSZ for sparse files.
+  http://www.informatik.uni-frankfurt.de/~loizides/reiserfs/fibmap.html
 - Implement a mode that says when a hard read error is
   encountered, read many times (as it currently does), and if the
   block cannot be read, skip to the next block, and try again.  If
@@ -118,6 +120,7 @@ minutes).
   ("D","Diff"),
   ("I","Inc");
 - Add ACL to restore only to original location.
+- Show files/second in client status output.
 - Add a recursive mark command (rmark) to restore.
 - "Minimum Job Interval = nnn" sets minimum interval between Jobs
   of the same level and does not permit multiple simultaneous
@@ -1404,3 +1407,4 @@ Block Position: 0
 - Fix Maximum Changer Wait, Maximum Open Wait, Maximum Rewind Wait to 
   accept time qualifiers.
 - Does ClientRunAfterJob fail the job on a bad return code?
+- Make hardlink code at line 240 of find_one.c use binary search.
index 054d6de3b39ef4598bf60be7cc660dac0a42339c..4ce01f51926853901aca541c71cf7310b9dc10ad 100644 (file)
@@ -2,6 +2,59 @@
                         Kern Sibbald
 
 General:
+26Apr06
+- Implement an NT_() macro to indicate that text should NOT
+  be translated.
+- Fix a number of incorrect strings marked for translation, when
+  they should not be (e.g. commands).
+- Fix StartTime bug reported for ClientRunBeforeJob and RunBeforeJob
+  Patches supplied by user in bugs #608 and #599.
+- Use most recent of st_ctime and st_mtime in restore tree DIR
+  listing. This fixes some problems with Win32 printing incorrect
+  values.
+- Correct the clock shift comm time calculation between the DIR
+  and the FD. It was added rather than subtracted.
+- Strip all backslashes in filenames to be restored on Win32
+  machines -- the names should all be in Unix format, and if
+  there are any backslashes it is most likely due to an improper
+  FileSet definition, and the files will not otherwise be 
+  restorable.
+- Remove lib/regex.c (replaced by bregex.c).
+- Delete src/win32/License.txt
+- Modify installer to install LICENSE
+25Apr06
+- Add back ua_label barcode fix from Rufolf Cejka.
+23Apr06
+- Add 'Dir Status' button to the gnome console.
+- Display heap stats in Storage daemon without debug level.
+22Apr06
+- Integrate most of the MinGW changes -- more to do.
+21Apr06
+- Implement using pg_config for finding PostgreSQL files.
+  Fixes bug #600. Patch supplied by user.
+- Remove -t option from mktemp in mtx_changer.in and use
+  working directory. Fixes bug #578.
+- Update job start time after the any run before job so that
+  files created by the script are only backed up once. Fixes
+  bug #599.
+- Strip trailing newline only from filenames entered in
+  the restore command when reading a file. This permits
+  the user to enter filenames with trailing spaces. Fixes
+  bug #549. The user supplied a patch that I modified slightly.
+- Use the most recent time (st_mtime, st_ctime) in the dir
+  command in restore. This gives the user a better idea of what
+  the newest file really is. This fixes bug #574. The fix
+  was suggested by the user.
+18Apr06
+- Remove the -f option from the chown in Makefile.in for more
+  portability.
+- Change setting the group in Makefile.in to use chgrp for
+  more portability.
+- Implement a Bacula read/write lock for Python rather
+  than using the Python lock to avoid recursive problems.
+- Correct the uninstall directory names in filed/Makefile.in
+  as reported by a user.
+
 Release 1.38.8 (14Apr06) released 14Apr06
 15Apr06
 - Correct Makefile bug found by Dan Langille.
index e214dad2be25566c8fbe71565d1062d64303de1b..0e391218c1a36bf8afb0ca667d5c2eab2841d87e 100644 (file)
@@ -2,6 +2,29 @@
                         Kern Sibbald
 
 General:
+28Apr06
+- Start implementing Christopher's St.Bernard code.
+- Add Christopher's mods for opening files.
+- Strip \r \n from Win32 error messages (Christopher)
+- Add more info about Win32 system if unknown (Christopher)
+- Use bstrn(cpy, cat) routines to avoid overrun in compat.cpp
+- Fix a number of incorrect strings marked for translation, when
+  they should not be (e.g. commands).
+- Fix StartTime bug reported for ClientRunBeforeJob and RunBeforeJob
+  Patches supplied by user in bugs #608 and #599.
+- Use most recent of st_ctime and st_mtime in restore tree DIR
+  listing. This fixes some problems with Win32 printing incorrect
+  values.
+- Correct the clock shift comm time calculation between the DIR
+  and the FD. It was added rather than subtracted.
+- Strip all backslashes in filenames to be restored on Win32
+  machines -- the names should all be in Unix format, and if
+  there are any backslashes it is most likely due to an improper
+  FileSet definition, and the files will not otherwise be 
+  restorable.
+- Remove lib/regex.c (replaced by bregex.c).
+- Delete src/win32/License.txt
+- Modify installer to install LICENSE
 26Apr06
 - Fix bug in build-win32-cross-tools script reported by Howard
 - Implement cross compiled bconsole
index 292857a20732ed5488875015b1984f393f36071f..9ba0ee4bdde69b71fb01b55d0ee7dc7d4efff501 100644 (file)
@@ -220,6 +220,22 @@ bool do_backup(JCR *jcr)
       goto bail_out;
    }
 
+   /*    
+    * We re-update the job start record so that the start
+    *  time is set after the run before job.  This avoids 
+    *  that any files created by the run before job will
+    *  be saved twice.  They will be backed up in the current
+    *  job, but not in the next one unless they are changed.
+    *  Without this, they will be backed up in this job and
+    *  in the next job run because in that case, their date 
+    *   is after the start of this run.
+    */
+   jcr->start_time = time(NULL);
+   jcr->jr.StartTime = jcr->start_time;
+   if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
+      Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
+   }
+
    /* Send backup command */
    bnet_fsend(fd, backupcmd);
    if (!response(jcr, fd, OKbackup, "backup", DISPLAY_ERROR)) {
index 51ad085b079cb62b2366a34e2a348438a62884ee..6c262a73416d6d751db8fd7ebceb7a4aac556e98 100644 (file)
@@ -194,7 +194,7 @@ static void send_since_time(JCR *jcr)
    char ed1[50];
 
    stime = str_to_utime(jcr->stime);
-   bnet_fsend(fd, levelcmd, _("since_utime "), edit_uint64(stime, ed1), 0);
+   bnet_fsend(fd, levelcmd, NT_("since_utime "), edit_uint64(stime, ed1), 0);
    while (bget_dirmsg(fd) >= 0) {  /* allow him to poll us to sync clocks */
       Jmsg(jcr, M_INFO, 0, "%s\n", fd->msg);
    }
index 339fb408440e625d7e7a5707915fecbdcad288a7..511581d3874f20f2053922bac8305da6bf5edd07 100644 (file)
@@ -275,6 +275,8 @@ static void *job_thread(void *arg)
        *  in the next job run because in that case, their date
        *   is after the start of this run.
        */
+      jcr->start_time = time(NULL);
+      jcr->jr.StartTime = jcr->start_time;
       if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
          Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
       }
index b6dba3c223fca3483b4b53d2ba9b46b926e16947..91235844f2593e4f14a45aefca1358145f02ae8d 100644 (file)
@@ -1058,6 +1058,7 @@ static int level_cmd(JCR *jcr)
          goto bail_out;
       }
       since_time = str_to_uint64(buf);  /* this is the since time */
+      Dmsg1(100, "since_time=%d\n", (int)since_time);
       char ed1[50], ed2[50];
       /*
        * Sync clocks by polling him for the time. We take
@@ -1077,8 +1078,10 @@ static int level_cmd(JCR *jcr)
          }
          his_time = str_to_uint64(buf);
          rt = get_current_btime() - bt_start; /* compute round trip time */
-         bt_adj -= his_time - bt_start - rt/2;
-         Dmsg2(200, "rt=%s adj=%s\n", edit_uint64(rt, ed1), edit_uint64(bt_adj, ed2));
+         Dmsg2(100, "Dirtime=%s FDtime=%s\n", edit_uint64(his_time, ed1),
+               edit_uint64(bt_start, ed2));
+         bt_adj +=  bt_start - his_time - rt/2;
+         Dmsg2(100, "rt=%s adj=%s\n", edit_uint64(rt, ed1), edit_uint64(bt_adj, ed2));
       }
 
       bt_adj = bt_adj / 8;            /* compute average time */
index 274b07148f3588ffeae38aa2b7998b52766f5025..fc4f3df977e854682fb54bada5e66c411fe91919 100644 (file)
@@ -127,6 +127,30 @@ void do_restore(JCR *jcr)
    }
    jcr->buf_size = sd->msglen;
 
+#ifdef stbernard_implemented
+/  #if defined(HAVE_WIN32)
+   bool        bResumeOfmOnExit = FALSE;
+   if (isOpenFileManagerRunning()) {
+       if ( pauseOpenFileManager() ) {
+          Jmsg(jcr, M_INFO, 0, _("Open File Manager paused\n") );
+          bResumeOfmOnExit = TRUE;
+       }
+       else {
+          Jmsg(jcr, M_ERROR, 0, _("FAILED to pause Open File Manager\n") );
+       }
+   }
+   {
+       char username[UNLEN+1];
+       DWORD usize = sizeof(username);
+       int privs = enable_backup_privileges(NULL, 1);
+       if (GetUserName(username, &usize)) {
+          Jmsg2(jcr, M_INFO, 0, _("Running as '%s'. Privmask=%#08x\n"), username,
+       } else {
+          Jmsg(jcr, M_WARNING, 0, _("Failed to retrieve current UserName\n"));
+       }
+   }
+#endif
+
 #ifdef HAVE_LIBZ
    uint32_t compress_buf_size = jcr->buf_size + 12 + ((jcr->buf_size+999) / 1000) + 100;
    jcr->compress_buf = (char *)bmalloc(compress_buf_size);
index 4c342c8a4148ed365e3c3e2fdb1923d5e23596db..e96060aead2221e86c8fd980e5ddb566c815811b 100755 (executable)
@@ -127,8 +127,6 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
          sizeof(off_t), sizeof(size_t), debug_level, get_trace());
    sendit(msg, len, arg);
 
-   list_terminated_jobs(sendit, arg);
-
    /*
     * List running jobs
     */
@@ -188,13 +186,15 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
    }
    endeach_jcr(njcr);
 
-   Dmsg0(1000, "Begin status jcr loop.\n");
    if (!found) {
       len = Mmsg(msg, _("No Jobs running.\n"));
       sendit(msg, len, arg);
    }
    len = Mmsg(msg, _("====\n"));
    sendit(msg, len, arg);
+
+   list_terminated_jobs(sendit, arg);
+
    free_pool_memory(msg);
 }
 
index ec0f3beeb6f466031d71cb352fbc22c2de088813..cab8c54c025b2685a38f5da90d4202552d81c16f 100644 (file)
@@ -397,26 +397,24 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode)
          dwflags = 0;
       }
 
-   // unicode or ansii open for create write
-   if (p_CreateFileW && p_MultiByteToWideChar) {   
-      bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar,
-             dwaccess,                /* Requested access */
-             0,                       /* Shared mode */
-             NULL,                    /* SecurityAttributes */
-             CREATE_ALWAYS,           /* CreationDisposition */
-             dwflags,                 /* Flags and attributes */
-             NULL);                   /* TemplateFile */
-   }
-   else {
-      bfd->fh = p_CreateFileA(win32_fname,
-             dwaccess,                /* Requested access */
-             0,                       /* Shared mode */
-             NULL,                    /* SecurityAttributes */
-             CREATE_ALWAYS,           /* CreationDisposition */
-             dwflags,                 /* Flags and attributes */
-             NULL);                   /* TemplateFile */
-   }
-
+      // unicode or ansii open for create write
+      if (p_CreateFileW && p_MultiByteToWideChar) {   
+         bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar,
+                dwaccess,                /* Requested access */
+                0,                       /* Shared mode */
+                NULL,                    /* SecurityAttributes */
+                CREATE_ALWAYS,           /* CreationDisposition */
+                dwflags,                 /* Flags and attributes */
+                NULL);                   /* TemplateFile */
+      } else {
+         bfd->fh = p_CreateFileA(win32_fname,
+                dwaccess,                /* Requested access */
+                0,                       /* Shared mode */
+                NULL,                    /* SecurityAttributes */
+                CREATE_ALWAYS,           /* CreationDisposition */
+                dwflags,                 /* Flags and attributes */
+                NULL);                   /* TemplateFile */
+      }
 
       bfd->mode = BF_WRITE;
 
@@ -429,26 +427,25 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode)
          dwflags = 0;
       }
 
-   // unicode or ansii open for open existing write
-   if (p_CreateFileW && p_MultiByteToWideChar) {   
-      bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar,
-             dwaccess,                /* Requested access */
-             0,                       /* Shared mode */
-             NULL,                    /* SecurityAttributes */
-             OPEN_EXISTING,           /* CreationDisposition */
-             dwflags,                 /* Flags and attributes */
-             NULL);                   /* TemplateFile */
-   }
-   else {
-      bfd->fh = p_CreateFileA(win32_fname,
-             dwaccess,                /* Requested access */
-             0,                       /* Shared mode */
-             NULL,                    /* SecurityAttributes */
-             OPEN_EXISTING,           /* CreationDisposition */
-             dwflags,                 /* Flags and attributes */
-             NULL);                   /* TemplateFile */
+      // unicode or ansii open for open existing write
+      if (p_CreateFileW && p_MultiByteToWideChar) {   
+         bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar,
+                dwaccess,                /* Requested access */
+                0,                       /* Shared mode */
+                NULL,                    /* SecurityAttributes */
+                OPEN_EXISTING,           /* CreationDisposition */
+                dwflags,                 /* Flags and attributes */
+                NULL);                   /* TemplateFile */
+      } else {
+         bfd->fh = p_CreateFileA(win32_fname,
+                dwaccess,                /* Requested access */
+                0,                       /* Shared mode */
+                NULL,                    /* SecurityAttributes */
+                OPEN_EXISTING,           /* CreationDisposition */
+                dwflags,                 /* Flags and attributes */
+                NULL);                   /* TemplateFile */
 
-   }
+      }
 
       bfd->mode = BF_WRITE;
 
@@ -464,24 +461,23 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode)
       }
 
       // unicode or ansii open for open existing read
-   if (p_CreateFileW && p_MultiByteToWideChar) {   
-      bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar,
-             dwaccess,                /* Requested access */
-             dwshare,                 /* Share modes */
-             NULL,                    /* SecurityAttributes */
-             OPEN_EXISTING,           /* CreationDisposition */
-             dwflags,                 /* Flags and attributes */
-             NULL);                   /* TemplateFile */
-   }
-   else {
-      bfd->fh = p_CreateFileA(win32_fname,
-             dwaccess,                /* Requested access */
-             dwshare,                 /* Share modes */
-             NULL,                    /* SecurityAttributes */
-             OPEN_EXISTING,           /* CreationDisposition */
-             dwflags,                 /* Flags and attributes */
-             NULL);                   /* TemplateFile */
-   }
+      if (p_CreateFileW && p_MultiByteToWideChar) {   
+         bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar,
+                dwaccess,                /* Requested access */
+                dwshare,                 /* Share modes */
+                NULL,                    /* SecurityAttributes */
+                OPEN_EXISTING,           /* CreationDisposition */
+                dwflags,                 /* Flags and attributes */
+                NULL);                   /* TemplateFile */
+      } else {
+         bfd->fh = p_CreateFileA(win32_fname,
+                dwaccess,                /* Requested access */
+                dwshare,                 /* Share modes */
+                NULL,                    /* SecurityAttributes */
+                OPEN_EXISTING,           /* CreationDisposition */
+                dwflags,                 /* Flags and attributes */
+                NULL);                   /* TemplateFile */
+      }
 
       bfd->mode = BF_READ;
    }
index e0810e5c875fb3a58cf27cc380a5fe37de759c67..ba951eb5c9fe762036fb5ed5dfe2cfc5698cf184 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.10"
-#define BDATE   "26 April 2006"
-#define LSMDATE "26Apr06"
+#define BDATE   "28 April 2006"
+#define LSMDATE "28Apr06"
 
 /* Debug flags */
 #undef  DEBUG
diff --git a/bacula/src/win32/License.txt b/bacula/src/win32/License.txt
deleted file mode 100644 (file)
index 3a9e9b2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright ©2002-2004, Kern Sibbald
-
-This software is provided 'as-is', without any express or implied
-warranty.  In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
-   claim that you wrote the original software.  If you use this software
-   in a product, an acknowledgment in the product documentation would be
-   appreciated but is not required.
-
-2.  Altered versions must be plainly marked as such, and must not be
-    misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any distribution.
index 2f5b6d7048ffacf1078dba20605ba598c3b82523..e44e57c9459da751f007909ce69871835494eb80 100644 (file)
@@ -439,7 +439,17 @@ errorString(void)
                  0,
                  NULL);
 
-   return (const char *) lpMsgBuf;
+   /* Strip any \r or \n */
+   char *rval = (char *) lpMsgBuf;
+   char *cp = strchr(rval, '\r');
+   if (cp != NULL) {
+      *cp = 0;
+   } else {
+      cp = strchr(rval, '\n');
+      if (cp != NULL)
+         *cp = 0;
+   }
+   return rval;
 }
 
 #ifndef HAVE_MINGW
@@ -1315,6 +1325,7 @@ win32_unlink(const char *filename)
 
 char WIN_VERSION_LONG[64];
 char WIN_VERSION[32];
+char WIN_RAWVERSION[32];
 
 class winver {
 public:
@@ -1338,8 +1349,11 @@ winver::winver(void)
         version = "Unknown";
         platform = "Unknown";
     }
-    else
-        switch (_mkversion(osvinfo.dwPlatformId, osvinfo.dwMajorVersion, osvinfo.dwMinorVersion))
+        const int ver = _mkversion(osvinfo.dwPlatformId,
+                                   osvinfo.dwMajorVersion,
+                                   osvinfo.dwMinorVersion);
+        snprintf(WIN_RAWVERSION, sizeof(WIN_RAWVERSION), "Windows %#08x", ver);
+         switch (ver)
         {
         case MS_WINDOWS_95: (version =  "Windows 95"); break;
         case MS_WINDOWS_98: (version =  "Windows 98"); break;
@@ -1348,7 +1362,7 @@ winver::winver(void)
         case MS_WINDOWS_2K: (version =  "Windows 2000");platform = "NT"; break;
         case MS_WINDOWS_XP: (version =  "Windows XP");platform = "NT"; break;
         case MS_WINDOWS_S2003: (version =  "Windows Server 2003");platform = "NT"; break;
-        default: version = "Windows ??"; break;
+        default: version = WIN_RAWVERSION; break;
         }
 
     bstrncpy(WIN_VERSION_LONG, version, sizeof(WIN_VERSION_LONG));
@@ -1420,12 +1434,18 @@ getArgv0(const char *cmdline)
 HANDLE
 CreateChildProcess(const char *cmdline, HANDLE in, HANDLE out, HANDLE err)
 {
+    static const char *comspec = NULL;
     PROCESS_INFORMATION piProcInfo;
     STARTUPINFOA siStartInfo;
     BOOL bFuncRetn = FALSE;
 
-    // Set up members of the PROCESS_INFORMATION structure.
+    if (comspec == NULL) {
+       comspec = getenv("COMSPEC");
+    }
+    if (comspec == NULL) // should never happen
+        return INVALID_HANDLE_VALUE;
 
+    // Set up members of the PROCESS_INFORMATION structure.
     ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) );
 
     // Set up members of the STARTUPINFO structure.
@@ -1453,18 +1473,14 @@ CreateChildProcess(const char *cmdline, HANDLE in, HANDLE out, HANDLE err)
     // Create the child process.
 
     char exeFile[256];
+    int cmdLen = strlen(cmdline) + strlen(comspec) + 16;
 
-    const char *comspec = getenv("COMSPEC");
-
-    if (comspec == NULL) // should never happen
-        return INVALID_HANDLE_VALUE;
+    char *cmdLine = (char *)alloca(cmdLen);
 
-    char *cmdLine = (char *)alloca(strlen(cmdline) + strlen(comspec) + 16);
-
-    strcpy(exeFile, comspec);
-    strcpy(cmdLine, comspec);
-    strcat(cmdLine, " /c ");
-    strcat(cmdLine, cmdline);
+    bstrncpy(exeFile, comspec, sizeof(exeFile));
+    bstrncpy(cmdLine, comspec, cmdLen);
+    bstrncat(cmdLine, " /c ", cmdLen);
+    bstrncat(cmdLine, cmdline, cmdLen);
 
     // try to execute program
     bFuncRetn = CreateProcessA(exeFile,
@@ -1726,9 +1742,9 @@ int
 utime(const char *fname, struct utimbuf *times)
 {
     FILETIME acc, mod;
-    char tmpbuf[1024];
+    char tmpbuf[5000];
 
-    conv_unix_to_win32_path(fname, tmpbuf, 1024);
+    conv_unix_to_win32_path(fname, tmpbuf, 5000);
 
     cvt_utime_to_ftime(times->actime, acc);
     cvt_utime_to_ftime(times->modtime, mod);
@@ -1739,22 +1755,22 @@ utime(const char *fname, struct utimbuf *times)
       POOLMEM* pwszBuf = get_pool_memory(PM_FNAME);
       make_win32_path_UTF8_2_wchar(&pwszBuf, tmpbuf);
 
-      h = p_CreateFileW((LPCWSTR) pwszBuf,
+      h = p_CreateFileW((LPCWSTR)pwszBuf,
                         FILE_WRITE_ATTRIBUTES,
-                        FILE_SHARE_WRITE,
+                        FILE_SHARE_WRITE|FILE_SHARE_READ|FILE_SHARE_DELETE,
                         NULL,
                         OPEN_EXISTING,
-                        0,
+                        FILE_FLAG_BACKUP_SEMANTICS, // required for directories
                         NULL);
 
       free_pool_memory(pwszBuf);
     } else if (p_CreateFileA) {
       h = p_CreateFileA(tmpbuf,
                         FILE_WRITE_ATTRIBUTES,
-                        FILE_SHARE_WRITE,
+                        FILE_SHARE_WRITE|FILE_SHARE_READ|FILE_SHARE_DELETE,
                         NULL,
                         OPEN_EXISTING,
-                        0,
+                        FILE_FLAG_BACKUP_SEMANTICS, // required for directories
                         NULL);
     }
 
@@ -1867,8 +1883,7 @@ open(const char *file, int flags, int mode)
 
        foo = p_CreateFileW((LPCWSTR) pwszBuf, access, shareMode, NULL, create, msflags, NULL);
        free_pool_memory(pwszBuf);
-    }
-    else if (p_CreateFileA)
+    } else if (p_CreateFileA)
        foo = CreateFile(file, access, shareMode, NULL, create, msflags, NULL);
 
     if (INVALID_HANDLE_VALUE == foo) {
index d0e5c0737da38c0441b740b2b0c8928a5eaedd26..46b9e429547bee8e1cf25fa15303ff15904dd400 100644 (file)
@@ -1,4 +1 @@
-#ifdef HAVE_WXCONSOLE
-int const win32_client = 1;
-#endif
-#include "../../lib/attr.c"
\ No newline at end of file
+#include "../../lib/attr.c"
index fa0cca5b99a1fcb16468c1593a019c89307e0f25..075b4215d5cc88853e7990bd74bbcb8309300dee 100644 (file)
@@ -32,7 +32,7 @@ pebuilder:
        cp -f ../wx-console/Release/wx-console.exe bacula/files/
        cp -f ../../../../depkgs-win32/pthreads/pthreadVCE.dll bacula/files/
        cp -f c:/windows/system32/msvcr71.dll bacula/files
-       cp -f ../License.txt bacula/files/
+       cp -f ../../../LICENSE bacula/files/
 
 zip: pebuilder
        zip -r ../winbacula-bartpe-@VERSION@.zip bacula README
index 617e5b3e7520e4d961dfb1a00a2427eca23c27b0..af9ba879073eba6aac3247f12a08af2bbaa89085 100755 (executable)
@@ -49,7 +49,7 @@
 ; Pull in pages
 ;
  !insertmacro MUI_PAGE_WELCOME
-;  !insertmacro MUI_PAGE_LICENSE "License.txt"
+;  !insertmacro MUI_PAGE_LICENSE "..\..\LICENSE"
  !insertmacro MUI_PAGE_COMPONENTS
  !insertmacro MUI_PAGE_DIRECTORY
  !insertmacro MUI_PAGE_INSTFILES
@@ -106,7 +106,8 @@ Section "Bacula File Service" SecService
   File baculafd\Release\bacula-fd.exe
   File c:\windows\system32\msvcr71.dll
   File ..\..\..\depkgs-win32\pthreads\pthreadVCE.dll
-  File License.txt
+  File ..\..\LICENSE
+  Delete /REBOOTOK "$INSTDIR\bin\License.txt"
   IfFileExists "$INSTDIR\bin\bacula-fd.conf" newconf 
   File baculafd\bacula-fd.conf
   goto do_service