]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Change console Job name from *Console* to -Console- to eliminate
authorKern Sibbald <kern@sibbald.com>
Fri, 4 May 2007 15:15:59 +0000 (15:15 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 4 May 2007 15:15:59 +0000 (15:15 +0000)
     Win32 filename problems.  Put Win32 path separator when creating
     Console file.  This fixes bug #846.
kes  Change berrno::strerror() to berrno::bstrerror().  Not yet full
     implemented.
kes  Pass jcr to crypt_sign_decode because it creates a new SIGNATURE
     structure.
kes  Define b_errno_win32 on Linux to be zero so that it can be or'ed in
     to force Win32 error message.

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

15 files changed:
bacula/src/baconfig.h
bacula/src/dird/ua_server.c
bacula/src/filed/restore.c
bacula/src/filed/verify.c
bacula/src/lib/berrno.c
bacula/src/lib/berrno.h
bacula/src/lib/bnet.c
bacula/src/lib/bsys.c
bacula/src/lib/crypto.c
bacula/src/lib/message.c
bacula/src/lib/openssl.c
bacula/src/lib/protos.h
bacula/src/qt-console/run/runcmd.cpp
bacula/src/version.h
bacula/technotes-2.1

index b5d5afb48d305fa3858e451bda72a2c0a3451089..68a3df8663c694af36708ee2d55c54dba644e8ab 100644 (file)
@@ -635,12 +635,14 @@ extern "C" int mknod ( const char *path, int mode, dev_t device );
 
 #if defined(HAVE_WIN32)
 #define DEFAULT_CONFIGDIR "C:\\Documents and Settings\\All Users\\Application Data\\Bacula"
 
 #if defined(HAVE_WIN32)
 #define DEFAULT_CONFIGDIR "C:\\Documents and Settings\\All Users\\Application Data\\Bacula"
+#define PathSeparator '\\'
 
 inline bool IsPathSeparator(int ch) { return ch == '/' || ch == '\\'; }
 inline char *first_path_separator(char *path) { return strpbrk(path, "/\\"); }
 inline const char *first_path_separator(const char *path) { return strpbrk(path, "/\\"); }
 
 #else
 
 inline bool IsPathSeparator(int ch) { return ch == '/' || ch == '\\'; }
 inline char *first_path_separator(char *path) { return strpbrk(path, "/\\"); }
 inline const char *first_path_separator(const char *path) { return strpbrk(path, "/\\"); }
 
 #else
+#define PathSeparator '/'
 /* Define Winsock functions if we aren't on Windows */
 
 #define WSA_Init() 0 /* 0 = success */
 /* Define Winsock functions if we aren't on Windows */
 
 #define WSA_Init() 0 /* 0 = success */
index b29b7e11dbd178bd658589db68ff4e34811c6f92..5d50184b1aceeffa956df709ba2d749bc164a4d7 100644 (file)
@@ -125,7 +125,7 @@ static void *handle_UA_client_request(void *arg)
 
    pthread_detach(pthread_self());
 
 
    pthread_detach(pthread_self());
 
-   jcr = new_control_jcr("*Console*", JT_CONSOLE);
+   jcr = new_control_jcr("-Console-", JT_CONSOLE);
 
    ua = new_ua_context(jcr);
    ua->UA_sock = user;
 
    ua = new_ua_context(jcr);
    ua->UA_sock = user;
index a85cbec6ad3e72cfaa851b9f92ce9dd7dfc31b53..8a81fe6c4d41b0639bb54477f89975316b6700fd 100644 (file)
@@ -604,7 +604,7 @@ void do_restore(JCR *jcr)
          }
 
          /* Save signature. */
          }
 
          /* Save signature. */
-         if (extract && (sig = crypto_sign_decode((uint8_t *)sd->msg, (uint32_t)sd->msglen)) == NULL) {
+         if (extract && (sig = crypto_sign_decode(jcr, (uint8_t *)sd->msg, (uint32_t)sd->msglen)) == NULL) {
             Jmsg1(jcr, M_ERROR, 0, _("Failed to decode message signature for %s\n"), jcr->last_fname);
          }
          break;
             Jmsg1(jcr, M_ERROR, 0, _("Failed to decode message signature for %s\n"), jcr->last_fname);
          }
          break;
@@ -786,6 +786,7 @@ static const char *zlib_strerror(int stat)
 static int do_file_digest(FF_PKT *ff_pkt, void *pkt, bool top_level) 
 {
    JCR *jcr = (JCR *)pkt;
 static int do_file_digest(FF_PKT *ff_pkt, void *pkt, bool top_level) 
 {
    JCR *jcr = (JCR *)pkt;
+   Dmsg1(50, "do_file_digest jcr=%p\n", jcr);
    return (digest_file(jcr, ff_pkt, jcr->digest));
 }
 
    return (digest_file(jcr, ff_pkt, jcr->digest));
 }
 
@@ -816,6 +817,7 @@ static bool verify_signature(JCR *jcr, SIGNATURE *sig)
       err = crypto_sign_get_digest(sig, jcr->pki_keypair, &digest);
       switch (err) {
       case CRYPTO_ERROR_NONE:
       err = crypto_sign_get_digest(sig, jcr->pki_keypair, &digest);
       switch (err) {
       case CRYPTO_ERROR_NONE:
+         Dmsg0(50, "== Got digest\n");
          /* Signature found, digest allocated */
          jcr->digest = digest;
 
          /* Signature found, digest allocated */
          jcr->digest = digest;
 
@@ -832,14 +834,14 @@ static bool verify_signature(JCR *jcr, SIGNATURE *sig)
 
          /* Verify the signature */
          if ((err = crypto_sign_verify(sig, keypair, digest)) != CRYPTO_ERROR_NONE) {
 
          /* Verify the signature */
          if ((err = crypto_sign_verify(sig, keypair, digest)) != CRYPTO_ERROR_NONE) {
-            Dmsg1(100, "Bad signature on %s\n", jcr->last_fname);
+            Dmsg1(50, "Bad signature on %s\n", jcr->last_fname);
             Jmsg2(jcr, M_ERROR, 0, _("Signature validation failed for file %s: ERR=%s\n"), 
                   jcr->last_fname, crypto_strerror(err));
             goto bail_out;
          }
 
          /* Valid signature */
             Jmsg2(jcr, M_ERROR, 0, _("Signature validation failed for file %s: ERR=%s\n"), 
                   jcr->last_fname, crypto_strerror(err));
             goto bail_out;
          }
 
          /* Valid signature */
-         Dmsg1(100, "Signature good on %s\n", jcr->last_fname);
+         Dmsg1(50, "Signature good on %s\n", jcr->last_fname);
          crypto_digest_free(digest);
          jcr->digest = NULL;
          return true;
          crypto_digest_free(digest);
          jcr->digest = NULL;
          return true;
@@ -859,7 +861,7 @@ static bool verify_signature(JCR *jcr, SIGNATURE *sig)
    }
 
    /* No signer */
    }
 
    /* No signer */
-   Dmsg1(100, "Could not find a valid public key for signature on %s\n", jcr->last_fname);
+   Dmsg1(50, "Could not find a valid public key for signature on %s\n", jcr->last_fname);
 
 bail_out:
    if (digest) {
 
 bail_out:
    if (digest) {
index 4456e426753393a419b08355da118f96e87d4985..126ef80fed59c07e4d57bc18e424c2d534987bcb 100644 (file)
@@ -285,6 +285,7 @@ int digest_file(JCR *jcr, FF_PKT *ff_pkt, DIGEST *digest)
 {
    BFILE bfd;
 
 {
    BFILE bfd;
 
+   Dmsg0(50, "=== digest_file\n");
    binit(&bfd);
 
    if (ff_pkt->statp.st_size > 0 || ff_pkt->type == FT_RAW
    binit(&bfd);
 
    if (ff_pkt->statp.st_size > 0 || ff_pkt->type == FT_RAW
@@ -294,6 +295,7 @@ int digest_file(JCR *jcr, FF_PKT *ff_pkt, DIGEST *digest)
          ff_pkt->ff_errno = errno;
          berrno be;
          be.set_errno(bfd.berrno);
          ff_pkt->ff_errno = errno;
          berrno be;
          be.set_errno(bfd.berrno);
+         Dmsg2(100, "Cannot open %s: ERR=%s\n", ff_pkt->fname, be.strerror());
          Jmsg(jcr, M_ERROR, 1, _("     Cannot open %s: ERR=%s.\n"),
                ff_pkt->fname, be.strerror());
          return 1;
          Jmsg(jcr, M_ERROR, 1, _("     Cannot open %s: ERR=%s.\n"),
                ff_pkt->fname, be.strerror());
          return 1;
@@ -336,6 +338,7 @@ int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr)
    char buf[DEFAULT_NETWORK_BUFFER_SIZE];
    int64_t n;
 
    char buf[DEFAULT_NETWORK_BUFFER_SIZE];
    int64_t n;
 
+   Dmsg0(50, "=== read_digest\n");
    while ((n=bread(bfd, buf, sizeof(buf))) > 0) {
       crypto_digest_update(digest, (uint8_t *)buf, n);
       jcr->JobBytes += n;
    while ((n=bread(bfd, buf, sizeof(buf))) > 0) {
       crypto_digest_update(digest, (uint8_t *)buf, n);
       jcr->JobBytes += n;
@@ -344,6 +347,7 @@ int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr)
    if (n < 0) {
       berrno be;
       be.set_errno(bfd->berrno);
    if (n < 0) {
       berrno be;
       be.set_errno(bfd->berrno);
+      Dmsg2(100, "Error reading file %s: ERR=%s\n", jcr->last_fname, be.strerror());
       Jmsg(jcr, M_ERROR, 1, _("Error reading file %s: ERR=%s\n"),
             jcr->last_fname, be.strerror());
       jcr->Errors++;
       Jmsg(jcr, M_ERROR, 1, _("Error reading file %s: ERR=%s\n"),
             jcr->last_fname, be.strerror());
       jcr->Errors++;
index 4f673635bf5aef120bb7a0ac4e227315385b04f6..47c1ad82d443e1cb02ca31651cfd2af874699e26 100644 (file)
@@ -1,20 +1,7 @@
-/*
- *  Bacula errno handler
- *
- *    berrno is a simplistic errno handler that works for
- *      Unix, Win32, and Bacula bpipes.
- *
- *    See berrno.h for how to use berrno.
- *
- *   Kern Sibbald, July MMIV
- *
- *   Version $Id$
- *
- */
 /*
    Bacula® - The Network Backup Solution
 
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *  Bacula errno handler
+ *
+ *    berrno is a simplistic errno handler that works for
+ *      Unix, Win32, and Bacula bpipes.
+ *
+ *    See berrno.h for how to use berrno.
+ *
+ *   Kern Sibbald, July MMIV
+ *
+ *   Version $Id$
+ *
+ */
 
 #include "bacula.h"
 
 
 #include "bacula.h"
 
@@ -47,7 +47,7 @@ extern int num_execvp_errors;
 extern int execvp_errors[];
 #endif
 
 extern int execvp_errors[];
 #endif
 
-const char *berrno::strerror()
+const char *berrno::bstrerror()
 {
 #ifdef HAVE_WIN32
    if (berrno_ & b_errno_win32) {
 {
 #ifdef HAVE_WIN32
    if (berrno_ & b_errno_win32) {
@@ -82,7 +82,7 @@ const char *berrno::strerror()
    }
 #endif
    /* Normal errno */
    }
 #endif
    /* Normal errno */
-   if (bstrerror(berrno_, buf_, 1024) < 0) {
+   if (b_strerror(berrno_, buf_, 1024) < 0) {
       return _("Invalid errno. No error message possible.");
    }
    return buf_;
       return _("Invalid errno. No error message possible.");
    }
    return buf_;
index 28408a8089aa96d5042e2e51dff44531af868651..13750cdd3563060ccb4511c7bd288ad3c45f1282 100644 (file)
@@ -1,13 +1,7 @@
-/*
- *   Version $Id$
- *
- * Kern Sibbald, July MMIV
- *
- */
 /*
    Bacula® - The Network Backup Solution
 
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *   Version $Id$
+ *
+ * Kern Sibbald, July MMIV
+ *
+ */
 
 /*
  * Extra bits set to interpret errno value differently from errno
  */
 #ifdef HAVE_WIN32
 #define b_errno_win32  (1<<29)        /* user reserved bit */
 
 /*
  * Extra bits set to interpret errno value differently from errno
  */
 #ifdef HAVE_WIN32
 #define b_errno_win32  (1<<29)        /* user reserved bit */
+#else
+#define b_errno_win32  0              /* On Unix/Linix system */
 #endif
 #define b_errno_exit   (1<<28)        /* child exited, exit code returned */
 #define b_errno_signal (1<<27)        /* child died, signal code returned */
 #endif
 #define b_errno_exit   (1<<28)        /* child exited, exit code returned */
 #define b_errno_signal (1<<27)        /* child died, signal code returned */
@@ -61,8 +63,10 @@ class berrno : public SMARTALLOC {
 public:
    berrno(int pool=PM_EMSG);
    ~berrno();
 public:
    berrno(int pool=PM_EMSG);
    ~berrno();
-   const char *strerror();
-   const char *strerror(int errnum);
+   const char *strerror() { return bstrerror(); };
+   const char *bstrerror();
+   const char *strerror(int errnum) { return bstrerror(errnum); };
+   const char *bstrerror(int errnum);
    void set_errno(int errnum);
    int code() { return berrno_ & ~(b_errno_exit|b_errno_signal); }
    int code(int stat) { return stat & ~(b_errno_exit|b_errno_signal); }
    void set_errno(int errnum);
    int code() { return berrno_ & ~(b_errno_exit|b_errno_signal); }
    int code(int stat) { return stat & ~(b_errno_exit|b_errno_signal); }
@@ -83,10 +87,10 @@ inline berrno::~berrno()
    free_pool_memory(buf_);
 }
 
    free_pool_memory(buf_);
 }
 
-inline const char *berrno::strerror(int errnum)
+inline const char *berrno::bstrerror(int errnum)
 {
    berrno_ = errnum;
 {
    berrno_ = errnum;
-   return berrno::strerror();
+   return berrno::bstrerror();
 }
 
 
 }
 
 
index 6c2c6a00d5e266e2815f0c7518ad1177bea083ac..43b71c8136b0c2f837761aa387e96d81bead914a 100644 (file)
@@ -628,7 +628,7 @@ static BSOCK *bnet_open(JCR *jcr, const char *name, char *host, char *service,
 
    if (!connected) {
       free_addresses(addr_list);
 
    if (!connected) {
       free_addresses(addr_list);
-      errno = save_errno;
+      errno = save_errno | b_errno_win32;
       return NULL;
    }
    /*
       return NULL;
    }
    /*
index b869d51d1c2ebd8acaf63d67c72d37f8d77bff31..3a7899d581090ab66586bb0ce7bc97ceb48263e1 100644 (file)
@@ -348,7 +348,7 @@ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
 #endif /* HAVE_READDIR_R */
 
 
 #endif /* HAVE_READDIR_R */
 
 
-int bstrerror(int errnum, char *buf, size_t bufsiz)
+int b_strerror(int errnum, char *buf, size_t bufsiz)
 {
     static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
     int stat = 0;
 {
     static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
     int stat = 0;
index b5cd07c12a7ba9b05184b8537ef7d56c41f38e34..77aa7bcff57e9ba5948534260dec3b32b5c98290 100644 (file)
@@ -597,6 +597,7 @@ DIGEST *crypto_digest_new(JCR *jcr, crypto_digest_t type)
    digest = (DIGEST *)malloc(sizeof(DIGEST));
    digest->type = type;
    digest->jcr = jcr;
    digest = (DIGEST *)malloc(sizeof(DIGEST));
    digest->type = type;
    digest->jcr = jcr;
+   Dmsg1(50, "crypto_digest_new jcr=%p\n", jcr);
 
    /* Initialize the OpenSSL message digest context */
    EVP_MD_CTX_init(&digest->ctx);
 
    /* Initialize the OpenSSL message digest context */
    EVP_MD_CTX_init(&digest->ctx);
@@ -631,6 +632,7 @@ DIGEST *crypto_digest_new(JCR *jcr, crypto_digest_t type)
 
 err:
    /* This should not happen, but never say never ... */
 
 err:
    /* This should not happen, but never say never ... */
+   Dmsg0(50, "Digest init failed.\n");
    openssl_post_errors(jcr, M_ERROR, _("OpenSSL digest initialization failed"));
    crypto_digest_free(digest);
    return NULL;
    openssl_post_errors(jcr, M_ERROR, _("OpenSSL digest initialization failed"));
    crypto_digest_free(digest);
    return NULL;
@@ -644,6 +646,7 @@ err:
 bool crypto_digest_update(DIGEST *digest, const uint8_t *data, uint32_t length)
 {
    if (EVP_DigestUpdate(&digest->ctx, data, length) == 0) {
 bool crypto_digest_update(DIGEST *digest, const uint8_t *data, uint32_t length)
 {
    if (EVP_DigestUpdate(&digest->ctx, data, length) == 0) {
+      Dmsg0(50, "digest update failed\n");
       openssl_post_errors(digest->jcr, M_ERROR, _("OpenSSL digest update failed"));
       return false;
    } else { 
       openssl_post_errors(digest->jcr, M_ERROR, _("OpenSSL digest update failed"));
       return false;
    } else { 
@@ -661,6 +664,7 @@ bool crypto_digest_update(DIGEST *digest, const uint8_t *data, uint32_t length)
 bool crypto_digest_finalize(DIGEST *digest, uint8_t *dest, uint32_t *length)
 {
    if (!EVP_DigestFinal(&digest->ctx, dest, (unsigned int *)length)) {
 bool crypto_digest_finalize(DIGEST *digest, uint8_t *dest, uint32_t *length)
 {
    if (!EVP_DigestFinal(&digest->ctx, dest, (unsigned int *)length)) {
+      Dmsg0(50, "digest finalize failed\n");
       openssl_post_errors(digest->jcr, M_ERROR, _("OpenSSL digest finalize failed"));
       return false;
    } else {
       openssl_post_errors(digest->jcr, M_ERROR, _("OpenSSL digest finalize failed"));
       return false;
    } else {
@@ -693,6 +697,7 @@ SIGNATURE *crypto_sign_new(JCR *jcr)
 
    sig->sigData = SignatureData_new();
    sig->jcr = jcr;
 
    sig->sigData = SignatureData_new();
    sig->jcr = jcr;
+   Dmsg1(50, "crypto_sign_new jcr=%p\n", jcr);
 
    if (!sig->sigData) {
       /* Allocation failed in OpenSSL */
 
    if (!sig->sigData) {
       /* Allocation failed in OpenSSL */
@@ -724,6 +729,7 @@ crypto_error_t crypto_sign_get_digest(SIGNATURE *sig, X509_KEYPAIR *keypair, DIG
       si = sk_SignerInfo_value(signers, i);
       if (M_ASN1_OCTET_STRING_cmp(keypair->keyid, si->subjectKeyIdentifier) == 0) {
          /* Get the digest algorithm and allocate a digest context */
       si = sk_SignerInfo_value(signers, i);
       if (M_ASN1_OCTET_STRING_cmp(keypair->keyid, si->subjectKeyIdentifier) == 0) {
          /* Get the digest algorithm and allocate a digest context */
+         Dmsg1(50, "crypto_sign_get_digest jcr=%p\n", sig->jcr);
          switch (OBJ_obj2nid(si->digestAlgorithm)) {
          case NID_md5:
             *digest = crypto_digest_new(sig->jcr, CRYPTO_DIGEST_MD5);
          switch (OBJ_obj2nid(si->digestAlgorithm)) {
          case NID_md5:
             *digest = crypto_digest_new(sig->jcr, CRYPTO_DIGEST_MD5);
@@ -919,7 +925,7 @@ int crypto_sign_encode(SIGNATURE *sig, uint8_t *dest, uint32_t *length)
 
  */
 
 
  */
 
-SIGNATURE *crypto_sign_decode(const uint8_t *sigData, uint32_t length)
+SIGNATURE *crypto_sign_decode(JCR *jcr, const uint8_t *sigData, uint32_t length)
 {
    SIGNATURE *sig;
 #if (OPENSSL_VERSION_NUMBER >= 0x0090800FL)
 {
    SIGNATURE *sig;
 #if (OPENSSL_VERSION_NUMBER >= 0x0090800FL)
@@ -932,13 +938,14 @@ SIGNATURE *crypto_sign_decode(const uint8_t *sigData, uint32_t length)
    if (!sig) {
       return NULL;
    }
    if (!sig) {
       return NULL;
    }
+   sig->jcr = jcr;
 
    /* d2i_SignatureData modifies the supplied pointer */
    sig->sigData  = d2i_SignatureData(NULL, &p, length);
 
    if (!sig->sigData) {
       /* Allocation / Decoding failed in OpenSSL */
 
    /* d2i_SignatureData modifies the supplied pointer */
    sig->sigData  = d2i_SignatureData(NULL, &p, length);
 
    if (!sig->sigData) {
       /* Allocation / Decoding failed in OpenSSL */
-      openssl_post_errors(M_ERROR, _("Signature decoding failed"));
+      openssl_post_errors(jcr, M_ERROR, _("Signature decoding failed"));
       free(sig);
       return NULL;
    }
       free(sig);
       return NULL;
    }
index 9b161a798eac1c2a07ca24a10aa5dc1a6de5f749..da28cee39f789abb50d4509f241d70015103508b 100644 (file)
@@ -55,7 +55,7 @@ const char *version = VERSION " (" BDATE ")";
 char my_name[30];                     /* daemon name is stored here */
 char *exepath = (char *)NULL;
 char *exename = (char *)NULL;
 char my_name[30];                     /* daemon name is stored here */
 char *exepath = (char *)NULL;
 char *exename = (char *)NULL;
-int console_msg_pending = 0;
+int console_msg_pending = false;
 char con_fname[500];                  /* Console filename */
 FILE *con_fd = NULL;                  /* Console file descriptor */
 brwlock_t con_lock;                   /* Console lock structure */
 char con_fname[500];                  /* Console filename */
 FILE *con_fd = NULL;                  /* Console file descriptor */
 brwlock_t con_lock;                   /* Console lock structure */
@@ -256,7 +256,7 @@ void init_console_msg(const char *wd)
 {
    int fd;
 
 {
    int fd;
 
-   bsnprintf(con_fname, sizeof(con_fname), "%s/%s.conmsg", wd, my_name);
+   bsnprintf(con_fname, sizeof(con_fname), "%s%c%s.conmsg", wd, PathSeparator, my_name);
    fd = open(con_fname, O_CREAT|O_RDWR|O_BINARY, 0600);
    if (fd == -1) {
       berrno be;
    fd = open(con_fname, O_CREAT|O_RDWR|O_BINARY, 0600);
    if (fd == -1) {
       berrno be;
@@ -679,7 +679,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
                       (void)fwrite("\n", 2, 1, con_fd);
                    }
                    fflush(con_fd);
                       (void)fwrite("\n", 2, 1, con_fd);
                    }
                    fflush(con_fd);
-                   console_msg_pending = TRUE;
+                   console_msg_pending = true;
                    Vw(con_lock);
                 }
                 break;
                    Vw(con_lock);
                 }
                 break;
index 8650ca8956d56bcad73df7f288c95b7d3b491eab..3626d6bc1f13119d46a7ac213de7b9c3ebb3861d 100644 (file)
@@ -76,6 +76,7 @@ void openssl_post_errors(JCR *jcr, int code, const char *errstring)
    while((sslerr = ERR_get_error()) != 0) {
       /* Acquire the human readable string */
       ERR_error_string_n(sslerr, (char *) &buf, sizeof(buf));
    while((sslerr = ERR_get_error()) != 0) {
       /* Acquire the human readable string */
       ERR_error_string_n(sslerr, (char *) &buf, sizeof(buf));
+      Dmsg3(100, "jcr=%p %s: ERR=%s\n", jcr, errstring, buf);
       Jmsg2(jcr, M_ERROR, 0, "%s: ERR=%s\n", errstring, buf);
    }
 }
       Jmsg2(jcr, M_ERROR, 0, "%s: ERR=%s\n", errstring, buf);
    }
 }
index 14d202f225446ae9fbead506f63c9ec9c2999bfe..da3aa4d35074a187b7fc7ceba8c9bf088e48f3a1 100644 (file)
@@ -74,7 +74,7 @@ void      make_unique_filename   (POOLMEM **name, int Id, char *what);
 long long int strtoll            (const char *ptr, char **endptr, int base);
 #endif
 void      read_state_file(char *dir, const char *progname, int port);
 long long int strtoll            (const char *ptr, char **endptr, int base);
 #endif
 void      read_state_file(char *dir, const char *progname, int port);
-int       bstrerror(int errnum, char *buf, size_t bufsiz);
+int       b_strerror(int errnum, char *buf, size_t bufsiz);
 char     *escape_filename(const char *file_path);
 
 /* bnet.c */
 char     *escape_filename(const char *file_path);
 
 /* bnet.c */
@@ -143,7 +143,7 @@ crypto_error_t     crypto_sign_get_digest      (SIGNATURE *sig, X509_KEYPAIR *ke
 crypto_error_t     crypto_sign_verify          (SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST *digest);
 int                crypto_sign_add_signer      (SIGNATURE *sig, DIGEST *digest, X509_KEYPAIR *keypair);
 int                crypto_sign_encode          (SIGNATURE *sig, uint8_t *dest, uint32_t *length);
 crypto_error_t     crypto_sign_verify          (SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST *digest);
 int                crypto_sign_add_signer      (SIGNATURE *sig, DIGEST *digest, X509_KEYPAIR *keypair);
 int                crypto_sign_encode          (SIGNATURE *sig, uint8_t *dest, uint32_t *length);
-SIGNATURE *        crypto_sign_decode          (const uint8_t *sigData, uint32_t length);
+SIGNATURE *        crypto_sign_decode          (JCR *jcr, const uint8_t *sigData, uint32_t length);
 void               crypto_sign_free            (SIGNATURE *sig);
 CRYPTO_SESSION *   crypto_session_new          (crypto_cipher_t cipher, alist *pubkeys);
 void               crypto_session_free         (CRYPTO_SESSION *cs);
 void               crypto_sign_free            (SIGNATURE *sig);
 CRYPTO_SESSION *   crypto_session_new          (crypto_cipher_t cipher, alist *pubkeys);
 void               crypto_session_free         (CRYPTO_SESSION *cs);
index 4eb8680b1c7f06d1c630eaaa1b6630a0216c76f5..b86769539027570dd94ccc391b0860defdb83519 100644 (file)
@@ -64,13 +64,13 @@ void runCmdDialog::fillRunDialog()
    item = m_console->msg();
    items = item.split("\n");
    label->setText(items[0]);
    item = m_console->msg();
    items = item.split("\n");
    label->setText(items[0]);
-   Dmsg1(000, "Title=%s\n", items[0].toUtf8().data());
+   Dmsg1(200, "Title=%s\n", items[0].toUtf8().data());
    items.removeFirst();               /* remove title */
    foreach(item, items) {
       rx.indexIn(item);
       val = rx.cap(1);
    items.removeFirst();               /* remove title */
    foreach(item, items) {
       rx.indexIn(item);
       val = rx.cap(1);
-      Dmsg1(000, "Item=%s\n", item.toUtf8().data());
-      Dmsg1(000, "Value=%s\n", val.toUtf8().data());
+      Dmsg1(200, "Item=%s\n", item.toUtf8().data());
+      Dmsg1(200, "Value=%s\n", val.toUtf8().data());
 
       if (item.startsWith("JobName:")) {
          jobCombo->addItem(val);
 
       if (item.startsWith("JobName:")) {
          jobCombo->addItem(val);
index 3a891316bf60c94dfff4d5ee7f8d07a09ff8d8e4..67a2ebe9e6e73895b7352f3077e608cb79d52cbc 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "2.1.8"
 
 #undef  VERSION
 #define VERSION "2.1.8"
-#define BDATE   "03 May 2007"
-#define LSMDATE "03May07"
+#define BDATE   "04 May 2007"
+#define LSMDATE "04May07"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2007"       /* year for copyright messages in progs */
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2007"       /* year for copyright messages in progs */
index 696d548a041f43b57ac326fefb4cc0fd1a35a46b..715e62e3040f8d7b276cd34037e55ea634312b3b 100644 (file)
@@ -1,6 +1,16 @@
               Technical notes on version 2.1
 
 General:
               Technical notes on version 2.1
 
 General:
+04May07
+kes  Change console Job name from *Console* to -Console- to eliminate
+     Win32 filename problems.  Put Win32 path separator when creating
+     Console file.  This fixes bug #846.
+kes  Change berrno::strerror() to berrno::bstrerror().  Not yet full
+     implemented.
+kes  Pass jcr to crypt_sign_decode because it creates a new SIGNATURE
+     structure.
+kes  Define b_errno_win32 on Linux to be zero so that it can be or'ed in
+     to force Win32 error message.
 03May07
 kes  First cut strip path. The data should be passed to the FD,
      but nothing is done with it yet.
 03May07
 kes  First cut strip path. The data should be passed to the FD,
      but nothing is done with it yet.