]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Fix FD->SD authorization failure, which was due to spurious
authorKern Sibbald <kern@sibbald.com>
Thu, 27 Sep 2007 15:10:51 +0000 (15:10 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 27 Sep 2007 15:10:51 +0000 (15:10 +0000)
     wakeups from a pthread_cond_timedwait().  Simply check the
     predicate before continuing.

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

19 files changed:
bacula/src/cats/cats.h
bacula/src/cats/mysql.c
bacula/src/cats/postgresql.c
bacula/src/cats/sql_create.c
bacula/src/cats/sqlite.c
bacula/src/filed/status.c
bacula/src/lib/breg.c
bacula/src/lib/breg.h
bacula/src/lib/bsnprintf.c
bacula/src/lib/edit.c
bacula/src/lib/jcr.c
bacula/src/lib/message.c
bacula/src/lib/parse_conf.h
bacula/src/lib/res.c
bacula/src/stored/dev.c
bacula/src/stored/job.c
bacula/src/tools/testfind.c
bacula/src/version.h
bacula/technotes-2.3

index 1971b8681a30e7b3e46c849f27a0c5af264c4c4e..03e7f6adf10b6e927d595ff7fd96cef168ab03be 100644 (file)
@@ -187,10 +187,10 @@ SQL_ROW    my_sqlite_fetch_row(B_DB *mdb);
 int        my_sqlite_query(B_DB *mdb, const char *cmd);
 void       my_sqlite_field_seek(B_DB *mdb, int field);
 SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb);
-extern char* my_sqlite_batch_lock_query;
-extern char* my_sqlite_batch_unlock_query;
-extern char* my_sqlite_batch_fill_filename_query;
-extern char* my_sqlite_batch_fill_path_query;
+extern const char* my_sqlite_batch_lock_query;
+extern const char* my_sqlite_batch_unlock_query;
+extern const char* my_sqlite_batch_fill_filename_query;
+extern const char* my_sqlite_batch_fill_path_query;
 
 
 #else
@@ -317,10 +317,10 @@ SQL_ROW    my_sqlite_fetch_row(B_DB *mdb);
 int        my_sqlite_query(B_DB *mdb, const char *cmd);
 void       my_sqlite_field_seek(B_DB *mdb, int field);
 SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb);
-extern char* my_sqlite_batch_lock_query;
-extern char* my_sqlite_batch_unlock_query;
-extern char* my_sqlite_batch_fill_filename_query;
-extern char* my_sqlite_batch_fill_path_query;
+extern const char* my_sqlite_batch_lock_query;
+extern const char* my_sqlite_batch_unlock_query;
+extern const char* my_sqlite_batch_fill_filename_query;
+extern const char* my_sqlite_batch_fill_path_query;
 
 
 #else
@@ -398,11 +398,11 @@ struct B_DB {
 #define sql_batch_fill_path_query       my_mysql_batch_fill_path_query
 
 
-extern char* my_mysql_batch_lock_path_query;
-extern char* my_mysql_batch_lock_filename_query;
-extern char* my_mysql_batch_unlock_tables_query;
-extern char* my_mysql_batch_fill_filename_query;
-extern char* my_mysql_batch_fill_path_query;
+extern const char* my_mysql_batch_lock_path_query;
+extern const char* my_mysql_batch_lock_filename_query;
+extern const char* my_mysql_batch_unlock_tables_query;
+extern const char* my_mysql_batch_fill_filename_query;
+extern constchar* my_mysql_batch_fill_path_query;
 extern void  my_mysql_free_result(B_DB *mdb);
 
 #else
@@ -486,11 +486,11 @@ typedef struct ATTR_DBR ATTR_DBR;
 int my_postgresql_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar);
 char *my_postgresql_copy_escape(char *dest, char *src, size_t len);
 
-extern char* my_pg_batch_lock_path_query;
-extern char* my_pg_batch_lock_filename_query;
-extern char* my_pg_batch_unlock_tables_query;
-extern char* my_pg_batch_fill_filename_query;
-extern char* my_pg_batch_fill_path_query;
+extern const char* my_pg_batch_lock_path_query;
+extern const char* my_pg_batch_lock_filename_query;
+extern const char* my_pg_batch_unlock_tables_query;
+extern const char* my_pg_batch_fill_filename_query;
+extern const char* my_pg_batch_fill_path_query;
 
 /* "Generic" names for easier conversion */
 #define sql_store_result(x)   ((x)->result)
index cc5aee701b8f431967b7003ca31d0ca1abed7793..e54db4cebc36445898da7acb4a0f65cfea81da51 100644 (file)
@@ -351,34 +351,26 @@ void my_mysql_free_result(B_DB *mdb)
 }
 
 #ifdef HAVE_BATCH_FILE_INSERT
-char *my_mysql_batch_lock_path_query = "LOCK TABLES Path write," 
-                                                   "batch write," 
-                                                   "Path as p write";
-
-
-char *my_mysql_batch_lock_filename_query = "LOCK TABLES Filename write,"
-                                                       "batch write,"
-                                                       "Filename as f write";
-
-char *my_mysql_batch_unlock_tables_query = "UNLOCK TABLES";
-
-char *my_mysql_batch_fill_path_query = "INSERT INTO Path (Path) "
-                                         "SELECT a.Path FROM " 
-                                          "(SELECT DISTINCT Path "
-                                             "FROM batch) AS a " 
-                                            "WHERE NOT EXISTS "
-                                               "(SELECT Path "
-                                                  "FROM Path AS p "
-                                                 "WHERE p.Path = a.Path)";     
-
-char *my_mysql_batch_fill_filename_query = "INSERT INTO Filename (Name) "
-                                              "SELECT a.Name FROM " 
-                                                "(SELECT DISTINCT Name "
-                                                   "FROM batch) AS a " 
-                                                  "WHERE NOT EXISTS "
-                                                     "(SELECT Name "
-                                                        "FROM Filename AS f "
-                                                        "WHERE f.Name = a.Name)";
+const char *my_mysql_batch_lock_path_query = 
+   "LOCK TABLES Path write, batch write, Path as p write";
+
+
+const char *my_mysql_batch_lock_filename_query = 
+   "LOCK TABLES Filename write, batch write, Filename as f write";
+
+const char *my_mysql_batch_unlock_tables_query = "UNLOCK TABLES";
+
+const char *my_mysql_batch_fill_path_query = 
+   "INSERT INTO Path (Path) "
+    "SELECT a.Path FROM " 
+     "(SELECT DISTINCT Path FROM batch) AS a WHERE NOT EXISTS "
+     "(SELECT Path FROM Path AS p WHERE p.Path = a.Path)";     
+
+const char *my_mysql_batch_fill_filename_query = 
+   "INSERT INTO Filename (Name) "
+    "SELECT a.Name FROM " 
+     "(SELECT DISTINCT Name FROM batch) AS a WHERE NOT EXISTS "
+     "(SELECT Name FROM Filename AS f WHERE f.Name = a.Name)";
 #endif /* HAVE_BATCH_FILE_INSERT */
 
 #endif /* HAVE_MYSQL */
index dc0467041dfa2d322c885278901557597d284e5e..5f3d5bcb882869a2b392673cab803fb82b61b55b 100644 (file)
@@ -800,24 +800,28 @@ char *my_postgresql_copy_escape(char *dest, char *src, size_t len)
 }
 
 #ifdef HAVE_BATCH_FILE_INSERT
-char *my_pg_batch_lock_path_query = "BEGIN; LOCK TABLE Path IN SHARE ROW EXCLUSIVE MODE";
+const char *my_pg_batch_lock_path_query = 
+   "BEGIN; LOCK TABLE Path IN SHARE ROW EXCLUSIVE MODE";
 
 
-char *my_pg_batch_lock_filename_query = "BEGIN; LOCK TABLE Filename IN SHARE ROW EXCLUSIVE MODE";
+const char *my_pg_batch_lock_filename_query = 
+   "BEGIN; LOCK TABLE Filename IN SHARE ROW EXCLUSIVE MODE";
 
-char *my_pg_batch_unlock_tables_query = "COMMIT";
+const char *my_pg_batch_unlock_tables_query = "COMMIT";
 
-char *my_pg_batch_fill_path_query = "INSERT INTO Path (Path) "
-                                      "SELECT a.Path FROM "
-                                         "(SELECT DISTINCT Path FROM batch) AS a "
-                                           "WHERE NOT EXISTS (SELECT Path FROM Path WHERE Path = a.Path) ";
+const char *my_pg_batch_fill_path_query = 
+   "INSERT INTO Path (Path) "
+    "SELECT a.Path FROM "
+     "(SELECT DISTINCT Path FROM batch) AS a "
+      "WHERE NOT EXISTS (SELECT Path FROM Path WHERE Path = a.Path) ";
 
 
-char *my_pg_batch_fill_filename_query = "INSERT INTO Filename (Name) "
-                                          "SELECT a.Name FROM "
-                                             "(SELECT DISTINCT Name FROM batch) as a "
-                                               "WHERE NOT EXISTS "
-                                                 "(SELECT Name FROM Filename WHERE Name = a.Name)";
+const char *my_pg_batch_fill_filename_query = 
+   "INSERT INTO Filename (Name) "
+    "SELECT a.Name FROM "
+     "(SELECT DISTINCT Name FROM batch) as a "
+      "WHERE NOT EXISTS "
+       "(SELECT Name FROM Filename WHERE Name = a.Name)";
 #endif /* HAVE_BATCH_FILE_INSERT */
 
 #endif /* HAVE_POSTGRESQL */
index 5c9c11fa5a3c6e57499c97452635aa1ead3ae337..8ea820b36afa4689ebc743893099f6159cb0aa26 100644 (file)
@@ -710,7 +710,7 @@ bool my_batch_start(JCR *jcr, B_DB *mdb)
 bool my_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar)
 {
    size_t len;
-   char *digest;
+   const char *digest;
    char ed1[50];
 
    mdb->esc_name = check_pool_memory_size(mdb->esc_name, mdb->fnl*2+1);
@@ -833,7 +833,6 @@ bool db_write_batch_file_records(JCR *jcr)
  */
 bool db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar)
 {
-   int retry = 0;
    Dmsg1(dbglevel, "Fname=%s\n", ar->fname);
    Dmsg0(dbglevel, "put_file_into_catalog\n");
 
index 9459f3b8b5aa33d210a351ac05058cefa1cf83bd..964c30d9c1b3b8a8c34ffc45dd07dac13128bf9b 100644 (file)
@@ -456,15 +456,18 @@ SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb)
 }
 
 #ifdef HAVE_BATCH_FILE_INSERT
-char *my_sqlite_batch_lock_query = "BEGIN";
-char *my_sqlite_batch_unlock_query = "COMMIT";
-char *my_sqlite_batch_fill_path_query = "INSERT INTO Path (Path)          " 
-                                        " SELECT DISTINCT Path FROM batch "
-                                        " EXCEPT SELECT Path FROM Path    ";
-
-char *my_sqlite_batch_fill_filename_query = "INSERT INTO Filename (Name)       " 
-                                            " SELECT DISTINCT Name FROM batch  "
-                                            " EXCEPT SELECT Name FROM Filename ";
+const char *my_sqlite_batch_lock_query = "BEGIN";
+const char *my_sqlite_batch_unlock_query = "COMMIT";
+
+const char *my_sqlite_batch_fill_path_query = 
+   "INSERT INTO Path (Path)" 
+   " SELECT DISTINCT Path FROM batch"
+   " EXCEPT SELECT Path FROM Path";
+
+const char *my_sqlite_batch_fill_filename_query = 
+   "INSERT INTO Filename (Name)"
+   " SELECT DISTINCT Name FROM batch "
+   " EXCEPT SELECT Name FROM Filename";
 #endif /* HAVE_BATCH_FILE_INSERT */
 
 
index c3c2da632d4e2c3854f06c67b55a17871f1c89ed..afff50db84270404c433a4da9843b33b87c149db 100644 (file)
@@ -143,7 +143,7 @@ void output_status(void sendit(const char *msg, int len, void *sarg), void *arg)
    Dmsg0(1000, "Begin status jcr loop.\n");
    len = Mmsg(msg, _("\nRunning Jobs:\n"));
    sendit(msg.c_str(), len, arg);
-   char *vss = "";
+   const char *vss = "";
 #ifdef WIN32_VSS
    if (g_pVSSClient && g_pVSSClient->IsInitialized()) {
       vss = "VSS ";
index 0f742d66650743e5d477fad9027dee64b2c1f1d4..6a3d33c7ae83160488197455e084652a2fe6596a 100644 (file)
@@ -340,7 +340,7 @@ char *BREGEXP::edit_subst(const char *fname, regmatch_t regs[])
 /* escape sep char and \
  * dest must be long enough (src*2+1)
  * return end of the string */
-char *bregexp_escape_string(char *dest, char *src, char sep)
+char *bregexp_escape_string(char *dest, const char *src, const char sep)
 {
    char *ret = dest;
    while (*src)
@@ -357,10 +357,10 @@ char *bregexp_escape_string(char *dest, char *src, char sep)
    return ret; 
 }
 
-static char regexp_sep = '!';
-static char *str_strip_prefix = "!%s!!i";
-static char *str_add_prefix   = "!^!%s!";
-static char *str_add_suffix   = "!([^/])$!$1%s!";
+static const char regexp_sep = '!';
+static const char *str_strip_prefix = "!%s!!i";
+static const char *str_add_prefix   = "!^!%s!";
+static const char *str_add_suffix   = "!([^/])$!$1%s!";
 
 int bregexp_get_build_where_size(char *strip_prefix, 
                                  char *add_prefix, 
index 33be5397d1a730fed4c5db2df4c978d424a35cb9..27ddfbbd1fe1dc59fdcdccd86a8d9ab544d4cec1 100644 (file)
  */
 class BREGEXP {
 public:
-   POOLMEM *result;            /* match result */
-   bool success;               /* match is ok */
+   POOLMEM *result;             /* match result */
+   bool success;                /* match is ok */
 
    char *replace(const char *fname); /* return this.result */
    void debug();
 
    /* private */
-   POOLMEM *expr;              /* search epression */
-   POOLMEM *subst;             /* substitution */
-   regex_t preg;               /* regex_t result of regcomp() */
+   POOLMEM *expr;               /* search epression */
+   POOLMEM *subst;              /* substitution */
+   regex_t preg;                /* regex_t result of regcomp() */
    regmatch_t regs[BREG_NREGS]; /* contains match */
-   char *eor;                  /* end of regexp in expr */
+   char *eor;                   /* end of regexp in expr */
 
    char *return_fname(const char *fname, int len); /* return fname as result */
    char *edit_subst(const char *fname, regmatch_t regs[]);
@@ -100,20 +100,20 @@ void free_bregexps(alist *bregexps); /* you have to free alist */
 
 /* get regexp size */
 int bregexp_get_build_where_size(char *strip_prefix, 
-                                char *add_prefix, 
-                                char *add_suffix);
+                                 char *add_prefix, 
+                                 char *add_suffix);
 
 /* get a bregexp string from user arguments 
  * you must allocate it with bregexp_get_build_where_size();
  */
 char *bregexp_build_where(char *dest, int str_size,
-                         char *strip_prefix, 
+                          char *strip_prefix, 
                           char *add_prefix, 
                           char *add_suffix);
 
 /* escape a string to regexp format (sep and \) 
  * dest must be long enough (dest = 2*src + 1)
  */
-char *bregexp_escape_string(char *dest, char *src, char sep);
+char *bregexp_escape_string(char *dest, const char *src, const char sep);
 
 #endif /* __BREG_H_ */
index f8f88aea6b78cea65bb43154d16281e93ff0f3b3..920fdb1b240c9204cf9720bdca5698a963426b55 100644 (file)
@@ -63,7 +63,7 @@
 
 int bvsnprintf(char *buffer, int32_t maxlen, const char *format, va_list args);
 static int32_t fmtstr(char *buffer, int32_t currlen, int32_t maxlen,
-                   char *value, int flags, int min, int max);
+                   const char *value, int flags, int min, int max);
 static int32_t fmtint(char *buffer, int32_t currlen, int32_t maxlen,
                    int64_t value, int base, int min, int max, int flags);
 
@@ -396,7 +396,7 @@ int bvsnprintf(char *buffer, int32_t maxlen, const char *format, va_list args)
 }
 
 static int32_t fmtstr(char *buffer, int32_t currlen, int32_t maxlen,
-                   char *value, int flags, int min, int max)
+                   const char *value, int flags, int min, int max)
 {
    int padlen, strln;              /* amount to pad */
    int cnt = 0;
index 5c3bfdbb006c11378489d9db038987feeb617fb8..89768f5d941d6d0f38d8dec7d197734b6e7140dd 100644 (file)
@@ -120,7 +120,7 @@ char *edit_uint64_with_suffix(uint64_t val, char *buf)
 {
   int commas = 0;
   char *c, mbuf[50];
-  char *suffix[] =
+  const char *suffix[] =
     { "", "K", "M", "G", "T", "P", "E", "Z", "Y", "FIX ME" };
   int suffixes = sizeof(suffix) / sizeof(*suffix);
 
index 69a431d699e3ce3cdc68774d22be3687ba538bbb..58921659da7b12021ab56848e124f197d5398d98 100644 (file)
@@ -416,14 +416,15 @@ static void free_common_jcr(JCR *jcr)
 #ifdef DEBUG
 void b_free_jcr(const char *file, int line, JCR *jcr)
 {
-   Dmsg3(dbglvl, "Enter free_jcr 0x%x from %s:%d\n", jcr, file, line);
+   Dmsg3(dbglvl, "Enter free_jcr jid=%u from %s:%d\n", jcr->JobId, file, line);
 
 #else
 
 void free_jcr(JCR *jcr)
 {
 
-   Dmsg2(dbglvl, "Enter free_jcr 0x%x job=%d\n", jcr, jcr->JobId);
+   Dmsg3(dbglvl, "Enter free_jcr jid=%u use_count=%d Job=%s\n", 
+         jcr->JobId, jcr->use_count(), jcr->Job);
 
 #endif
 
@@ -434,13 +435,18 @@ void free_jcr(JCR *jcr)
       Emsg2(M_ERROR, 0, _("JCR use_count=%d JobId=%d\n"),
          jcr->use_count(), jcr->JobId);
    }
-   Dmsg3(dbglvl, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count(), jcr->JobId);
+   if (jcr->JobId > 0) {
+      Dmsg3(dbglvl, "Dec free_jcr jid=%u use_count=%d Job=%s\n", 
+         jcr->JobId, jcr->use_count(), jcr->Job);
+   }
    if (jcr->use_count() > 0) {          /* if in use */
       unlock_jcr_chain();
-      Dmsg3(dbglvl, "free_jcr 0x%x job=%d use_count=%d\n", jcr, jcr->JobId, jcr->use_count());
       return;
    }
-
+   if (jcr->JobId > 0) {
+      Dmsg3(dbglvl, "remove jcr jid=%u use_count=%d Job=%s\n", 
+            jcr->JobId, jcr->use_count(), jcr->Job);
+   }
    remove_jcr(jcr);                   /* remove Jcr from chain */
    unlock_jcr_chain();
 
@@ -515,7 +521,8 @@ JCR *get_jcr_by_id(uint32_t JobId)
    foreach_jcr(jcr) {
       if (jcr->JobId == JobId) {
          jcr->inc_use_count();
-         Dmsg2(dbglvl, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count());
+         Dmsg3(dbglvl, "Inc get_jcr jid=%u use_count=%d Job=%s\n", 
+            jcr->JobId, jcr->use_count(), jcr->Job);
          break;
       }
    }
@@ -536,7 +543,8 @@ JCR *get_jcr_by_session(uint32_t SessionId, uint32_t SessionTime)
       if (jcr->VolSessionId == SessionId &&
           jcr->VolSessionTime == SessionTime) {
          jcr->inc_use_count();
-         Dmsg2(dbglvl, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count());
+         Dmsg3(dbglvl, "Inc get_jcr jid=%u use_count=%d Job=%s\n", 
+            jcr->JobId, jcr->use_count(), jcr->Job);
          break;
       }
    }
@@ -564,7 +572,8 @@ JCR *get_jcr_by_partial_name(char *Job)
    foreach_jcr(jcr) {
       if (strncmp(Job, jcr->Job, len) == 0) {
          jcr->inc_use_count();
-         Dmsg2(dbglvl, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count());
+         Dmsg3(dbglvl, "Inc get_jcr jid=%u use_count=%d Job=%s\n", 
+            jcr->JobId, jcr->use_count(), jcr->Job);
          break;
       }
    }
@@ -589,7 +598,8 @@ JCR *get_jcr_by_full_name(char *Job)
    foreach_jcr(jcr) {
       if (strcmp(jcr->Job, Job) == 0) {
          jcr->inc_use_count();
-         Dmsg2(dbglvl, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count());
+         Dmsg3(dbglvl, "Inc get_jcr jid=%u use_count=%d Job=%s\n", 
+            jcr->JobId, jcr->use_count(), jcr->Job);
          break;
       }
    }
@@ -686,7 +696,10 @@ JCR *jcr_walk_start()
    jcr = (JCR *)jcrs->first();
    if (jcr) {
       jcr->inc_use_count();
-      Dmsg3(dbglvl, "Inc jcr_walk_start 0x%x job=%d use_count=%d\n", jcr, jcr->JobId, jcr->use_count());
+      if (jcr->JobId > 0) {
+         Dmsg3(dbglvl, "Inc walk_start jid=%u use_count=%d Job=%s\n", 
+            jcr->JobId, jcr->use_count(), jcr->Job);
+      }
    }
    unlock_jcr_chain();
    return jcr;
@@ -703,7 +716,10 @@ JCR *jcr_walk_next(JCR *prev_jcr)
    jcr = (JCR *)jcrs->next(prev_jcr);
    if (jcr) {
       jcr->inc_use_count();
-      Dmsg3(dbglvl, "Inc jcr_walk_next 0x%x job=%d use_count=%d\n", jcr, jcr->JobId, jcr->use_count());
+      if (jcr->JobId > 0) {
+         Dmsg3(dbglvl, "Inc walk_next jid=%u use_count=%d Job=%s\n", 
+            jcr->JobId, jcr->use_count(), jcr->Job);
+      }
    }
    unlock_jcr_chain();
    if (prev_jcr) {
@@ -718,6 +734,10 @@ JCR *jcr_walk_next(JCR *prev_jcr)
 void jcr_walk_end(JCR *jcr)
 {
    if (jcr) {
+      if (jcr->JobId > 0) {
+         Dmsg3(dbglvl, "Free walk_end jid=%u use_count=%d Job=%s\n", 
+            jcr->JobId, jcr->use_count(), jcr->Job);
+      }
       free_jcr(jcr);
    }
 }
index 8cccb87339104c318b753925a384e72b5e7ab5e6..1ce1f85fc6545e82bc4b1f4aa64b0256be9905e5 100644 (file)
@@ -600,7 +600,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
     int len, dtlen;
     MSGS *msgs;
     BPIPE *bpipe;
-    char *mode;
+    const char *mode;
 
     Dmsg2(850, "Enter dispatch_msg type=%d msg=%s", type, msg);
 
index a7a5d59e105fb947e896e7faeba40ce73cb1fab6..470ac528184c3120a2eae3a30fbaa0b231eb165c 100644 (file)
@@ -134,7 +134,7 @@ RES   **new_res_head();
 
 
 /* Resource routines */
-RES *GetResWithName(int rcode, char *name);
+RES *GetResWithName(int rcode, const char *name);
 RES *GetNextRes(int rcode, RES *res);
 void b_LockRes(const char *file, int line);
 void b_UnlockRes(const char *file, int line);
index 59a41e8d8c96a4c736d74c8b123556d84c0f7f05..886f1a220b79119eafe5a63391fa26a20581b105 100644 (file)
@@ -87,7 +87,7 @@ void b_UnlockRes(const char *file, int line)
  * Return resource of type rcode that matches name
  */
 RES *
-GetResWithName(int rcode, char *name)
+GetResWithName(int rcode, const char *name)
 {
    RES *res;
    int rindex = rcode - r_first;
index 3b2ff0400695ef6d58c3131b28f80d1bc700d246..f0e1684ce7ef0eef65a14a4fcc2927f39698b955 100644 (file)
@@ -89,7 +89,7 @@
 /* Forward referenced functions */
 void set_os_device_parameters(DCR *dcr);   
 static bool dev_get_os_pos(DEVICE *dev, struct mtget *mt_stat);
-static char *mode_to_str(int mode);
+static const char *mode_to_str(int mode);
 
 /*
  * Allocate and initialize the DEVICE structure
@@ -2476,7 +2476,7 @@ static const char *modes[] = {
 };
 
 
-static char *mode_to_str(int mode)  
+static const char *mode_to_str(int mode)  
 {
    static char buf[100];
    if (mode < 1 || mode > 4) {
index a95b072a75c70c08956042c906019216f2a7258e..75cf2f2d5e20ba928f97664e79ec865ea85ba80e 100644 (file)
@@ -185,9 +185,9 @@ bool run_cmd(JCR *jcr)
     *  expires.
     */
    P(mutex);
-   for ( ; !job_canceled(jcr); ) {
+   while ( !jcr->authenticated && !job_canceled(jcr) ) {
       errstat = pthread_cond_timedwait(&jcr->job_start_wait, &mutex, &timeout);
-      if (errstat == 0 || errstat == ETIMEDOUT) {
+      if (errstat == ETIMEDOUT || errstat == EINVAL || errstat == EPERM) {
          break;
       }
    }
index a14799a9a6c026fc2c6c29dcb1d618403a35c2a9..184580604b70fc6c7bbc1c825d629e23ed0bedb8 100644 (file)
@@ -87,8 +87,8 @@ int
 main (int argc, char *const *argv)
 {
    FF_PKT *ff;
-   char *configfile = "bacula-dir.conf";
-   char *fileset_name = "Windows-Full-Set";
+   const char *configfile = "bacula-dir.conf";
+   const char *fileset_name = "Windows-Full-Set";
    int ch, hard_links;
 
    OSDependentInit();
index 6d5be57357e0ec3adbfd98af394038865eeb06e4..04823a8c98bdf9937b8bce8115e3c5c668fa4800 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 #undef  VERSION
-#define VERSION "2.3.5"
-#define BDATE   "26 September 2007"
-#define LSMDATE "26Sep07"
+#define VERSION "2.3.6"
+#define BDATE   "27 September 2007"
+#define LSMDATE "27Sep07"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2007"       /* year for copyright messages in progs */
index c82b284a76323c19c351624e091289f0b835ef72..e0a53e37120948a2d5cd9c4a40da733643f93de8 100644 (file)
@@ -2,6 +2,9 @@
 
 General:
 27Sep07 
+kes  Fix FD->SD authorization failure, which was due to spurious
+     wakeups from a pthread_cond_timedwait().  Simply check the
+     predicate before continuing.
 kes  Add const char where needed (more to do). Remove temp debug code.
 26Sep07
 kes  Setup SQLite busy handler before doing queries.