]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix compat.cpp times
authorKern Sibbald <kern@sibbald.com>
Sun, 22 Feb 2004 17:41:19 +0000 (17:41 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 22 Feb 2004 17:41:19 +0000 (17:41 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1066 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/findlib/enable_priv.c
bacula/src/findlib/makepath.c
bacula/src/lib/util.c
bacula/src/version.h

index 4095ef2296175537f58e98341bc133c159721cd9..5a35d842eeb165bdcf729398b2490e739e73a275 100755 (executable)
@@ -37,7 +37,7 @@
 /*                                                            */
 /*=============================================================*/
 
-#if !defined(HAVE_CYGWIN) && !defined(WIN32)
+#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
     
 int enable_backup_privileges(JCR *jcr, int ignore_errors)
  { return 0; }
@@ -53,7 +53,7 @@ int enable_backup_privileges(JCR *jcr, int ignore_errors)
 /*                                                            */
 /*=============================================================*/
 
-#if defined(HAVE_CYGWIN) || defined(WIN32)
+#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
 
 void win_error(JCR *jcr, char *prefix, DWORD lerror);
 
index 2932b83e4aaad665b72eb2c26c966fd7901857b2..69ef9c9e97f942989f83567131ebddc606bdadcd 100644 (file)
@@ -135,7 +135,7 @@ make_dir(JCR *jcr, const char *dir, const char *dirpath, mode_t mode, int *creat
 int
 isAbsolute(const char *path)
 {
-#if defined(HAVE_CYGWIN) || defined(WIN32)
+#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
     return path[1] == ':' || *path == '/' || *path == '\\';     /* drivespec:/blah is absolute */
 #else
     return *path == '/';
index 8f30486689ee05d9a7dec58ff1fbf0c15027a3b7..013c9102d3a6ee1e0387b031894c623969459a2b 100644 (file)
@@ -385,12 +385,15 @@ int do_shell_expansion(char *name, int name_len)
       pm_strcat(&cmd, name);
       pm_strcat(&cmd, "\"");
       Dmsg1(400, "Send: %s\n", cmd);
-      bpipe = open_bpipe(cmd, 0, "r");
-      *line = 0;
-      fgets(line, sizeof(line), bpipe->rfd);
-      strip_trailing_junk(line);
-      stat = close_bpipe(bpipe);
-      Dmsg2(400, "stat=%d got: %s\n", stat, line);
+      if ((bpipe = open_bpipe(cmd, 0, "r"))) {
+        *line = 0;
+        fgets(line, sizeof(line), bpipe->rfd);
+        strip_trailing_junk(line);
+        stat = close_bpipe(bpipe);
+         Dmsg2(400, "stat=%d got: %s\n", stat, line);
+      } else {
+        stat = 1;                    /* error */
+      }
       free_pool_memory(cmd);
       if (stat == 0) {
         bstrncpy(name, line, name_len);
@@ -416,7 +419,7 @@ void make_session_key(char *key, char *seed, int mode)
 
      s[0] = 0;
      if (seed != NULL) {
-       strcat(s, seed);
+       bstrncat(s, seed, sizeof(s));
      }
 
      /* The following creates a seed for the session key generator
@@ -426,11 +429,11 @@ void make_session_key(char *key, char *seed, int mode)
        available on your machine, replace it with something
        equivalent or, if you like, just delete it. */
 
-     sprintf(s + strlen(s), "%lu", (unsigned long) getpid());
-     sprintf(s + strlen(s), "%lu", (unsigned long) getppid());
+     sprintf(s + strlen(s), "%lu", (unsigned long)getpid());
+     sprintf(s + strlen(s), "%lu", (unsigned long)getppid());
      getcwd(s + strlen(s), 256);
-     sprintf(s + strlen(s), "%lu", (unsigned long) clock());
-     sprintf(s + strlen(s), "%lu", (unsigned long) time(NULL));
+     sprintf(s + strlen(s), "%lu", (unsigned long)clock());
+     sprintf(s + strlen(s), "%lu", (unsigned long)time(NULL));
 #ifdef Solaris
      sysinfo(SI_HW_SERIAL,s + strlen(s), 12);
 #endif
@@ -446,27 +449,27 @@ void make_session_key(char *key, char *seed, int mode)
      MD5Init(&md5c);
      MD5Update(&md5c, (unsigned char *)s, strlen(s));
      MD5Final(md5key, &md5c);
-     sprintf(s + strlen(s), "%lu", (unsigned long) ((time(NULL) + 65121) ^ 0x375F));
+     sprintf(s + strlen(s), "%lu", (unsigned long)((time(NULL) + 65121) ^ 0x375F));
      MD5Init(&md5c);
      MD5Update(&md5c, (unsigned char *)s, strlen(s));
      MD5Final(md5key1, &md5c);
 #define nextrand    (md5key[j] ^ md5key1[j])
      if (mode) {
        for (j = k = 0; j < 16; j++) {
-           unsigned char rb = nextrand;
+          unsigned char rb = nextrand;
 
 #define Rad16(x) ((x) + 'A')
-           key[k++] = Rad16((rb >> 4) & 0xF);
-           key[k++] = Rad16(rb & 0xF);
+          key[k++] = Rad16((rb >> 4) & 0xF);
+          key[k++] = Rad16(rb & 0xF);
 #undef Rad16
-           if (j & 1) {
-                 key[k++] = '-';
-           }
+          if (j & 1) {
+              key[k++] = '-';
+          }
        }
        key[--k] = 0;
      } else {
        for (j = 0; j < 16; j++) {
-           key[j] = nextrand;
+          key[j] = nextrand;
        }
      }
 }
index d63412bcd551e2e7176a7df3cc6e93ee31bba88d..55693f240227ce3bc34e78f063f12c51320b68ac 100644 (file)
@@ -2,8 +2,8 @@
 #undef  VERSION
 #define VERSION "1.33.4"
 #define VSTRING "1"
-#define BDATE   "18 Feb 2004"
-#define LSMDATE "18Feb04"
+#define BDATE   "22 Feb 2004"
+#define LSMDATE "22Feb04"
 
 /* Debug flags */
 #undef  DEBUG