]> git.sur5r.net Git - bacula/bacula/commitdiff
- Fix web page links for new manual.
authorKern Sibbald <kern@sibbald.com>
Sat, 13 Nov 2004 10:34:17 +0000 (10:34 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 13 Nov 2004 10:34:17 +0000 (10:34 +0000)
- Grant postgresql permission to cdimages.
- Correct crash after list nextvol list media bug 160

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

bacula/src/cats/grant_postgresql_privileges.in
bacula/src/dird/ua_output.c
bacula/src/version.h

index 1a3b9dbb04ddbbec43e7bb30ea9b30aba1b3a8c8..02c18fb8e5cf518ca186d89e8c9d1f5226bb987e 100644 (file)
@@ -23,6 +23,7 @@ grant all on path       to ${USER};
 grant all on filename    to ${USER};
 grant all on counters    to ${USER};
 grant all on version     to ${USER};
+grant all on cdimages    to ${USER};
 
 -- for sequences on those tables
 
index 9a1f11d2f2fad2bbaf9f0f68c8a91d0998b52757..69ea42d1fa07234b70d8b270ac0b2e57e2e87121 100644 (file)
@@ -42,11 +42,11 @@ extern int console_msg_pending;
 extern FILE *con_fd;
 extern brwlock_t con_lock;
 
-
 /* Imported functions */
 
 /* Forward referenced functions */
 static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist);
+static bool list_nextvol(UAContext *ua);
 
 /*
  * Turn auto display of console messages on/off
@@ -401,58 +401,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist)
       /* List next volume */
       } else if (strcasecmp(ua->argk[i], _("nextvol")) == 0 || 
                  strcasecmp(ua->argk[i], _("nextvolume")) == 0) {
-        JOB *job;
-        JCR *jcr = ua->jcr;
-        POOL *pool;
-        RUN *run;
-        time_t runtime;
-        bool found = false;
-
-         i = find_arg_with_value(ua, "job");
-        if (i <= 0) {
-           if ((job = select_job_resource(ua)) == NULL) {
-              return 1;
-           }
-        } else {
-           job = (JOB *)GetResWithName(R_JOB, ua->argv[i]);
-           if (!job) {
-               Jmsg(jcr, M_ERROR, 0, _("%s is not a job name.\n"), ua->argv[i]);
-              if ((job = select_job_resource(ua)) == NULL) {
-                 return 1;
-              }
-           }
-        }
-        for (run=NULL; (run = find_next_run(run, job, runtime)); ) {
-           pool = run ? run->pool : NULL;
-           if (!complete_jcr_for_job(jcr, job, pool)) {
-              return 1;
-           }
-          
-           if (!find_next_volume_for_append(jcr, &mr, 0)) {
-               bsendmsg(ua, _("Could not find next Volume.\n"));
-              if (jcr->db) {
-                 db_close_database(jcr, jcr->db);
-                 jcr->db = NULL;
-              }
-              return 1;
-           } else {
-               bsendmsg(ua, _("The next Volume to be used by Job \"%s\" will be %s\n"), 
-                 job->hdr.name, mr.VolumeName);
-              found = true;
-           }
-           if (jcr->db) {
-              db_close_database(jcr, jcr->db);
-              jcr->db = NULL;
-           }
-        }
-        if (jcr->db) {
-           db_close_database(jcr, jcr->db);
-           jcr->db = NULL;
-        }
-        if (!found) {
-            bsendmsg(ua, _("Could not find next Volume.\n"));
-        }
-        return 1;
+        list_nextvol(ua);
       } else {
          bsendmsg(ua, _("Unknown list keyword: %s\n"), NPRT(ua->argk[i]));
       }
@@ -460,6 +409,57 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist)
    return 1;
 }
 
+static bool list_nextvol(UAContext *ua)
+{
+   JOB *job;
+   JCR *jcr = ua->jcr;
+   POOL *pool;
+   RUN *run;
+   time_t runtime;
+   bool found = false;
+   MEDIA_DBR mr;
+
+   memset(&mr, 0, sizeof(mr));
+   int i = find_arg_with_value(ua, "job");
+   if (i <= 0) {
+      if ((job = select_job_resource(ua)) == NULL) {
+        return false;
+      }
+   } else {
+      job = (JOB *)GetResWithName(R_JOB, ua->argv[i]);
+      if (!job) {
+         Jmsg(jcr, M_ERROR, 0, _("%s is not a job name.\n"), ua->argv[i]);
+        if ((job = select_job_resource(ua)) == NULL) {
+           return false;
+        }
+      }
+   }
+   for (run=NULL; (run = find_next_run(run, job, runtime)); ) {
+      pool = run ? run->pool : NULL;
+      if (!complete_jcr_for_job(jcr, job, pool)) {
+        return false;
+      }
+     
+      if (!find_next_volume_for_append(jcr, &mr, 0)) {
+         bsendmsg(ua, _("Could not find next Volume.\n"));
+      } else {
+         bsendmsg(ua, _("The next Volume to be used by Job \"%s\" will be %s\n"), 
+           job->hdr.name, mr.VolumeName);
+        found = true;
+      }
+      if (jcr->db && jcr->db != ua->db) {
+        db_close_database(jcr, jcr->db);
+        jcr->db = NULL;
+      }
+   }
+   if (!found) {
+      bsendmsg(ua, _("Could not find next Volume.\n"));
+      return false;
+   }
+   return true;
+}
+
+
 /* 
  * For a given job, we examine all his run records
  *  to see if it is scheduled today or tomorrow.
index 99c81fd563a8b404bc396f7c5f5f17f8745e2afb..72635fce8217adcb866a9b1a9814b8a134850b99 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #undef  VERSION
 #define VERSION "1.37.1"
-#define BDATE   "10 November 2004"
-#define LSMDATE "10Nov04"
+#define BDATE   "12 November 2004"
+#define LSMDATE "12Nov04"
 
 /* Debug flags */
 #undef  DEBUG