]> git.sur5r.net Git - bacula/bacula/commitdiff
Make db_get_job_record() return Name so that the ACL
authorKern Sibbald <kern@sibbald.com>
Tue, 25 Oct 2005 17:06:42 +0000 (17:06 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 25 Oct 2005 17:06:42 +0000 (17:06 +0000)
  can be checked.  Fixes bug #446

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

bacula/kernstodo
bacula/kes-1.37
bacula/src/cats/sql_get.c
bacula/src/dird/ua_restore.c
bacula/src/version.h

index 1b77fdc6053f7d391a5f06699d3279ec16f29152..72df835d59e1b57aa2a104aa2d29b699340cc19f 100644 (file)
@@ -9,6 +9,7 @@ Version 1.37                Kern (see below)
 
 Final items for 1.37 before release:
 1. Fix bugs
+- Fix JobACL with restore by JobId.
 - Mount after manually unloading changer causes hang in SD
 - Check if ANSI tape labeling works with drive in
   read-only mode.
index 2e653e80106a0f8ba22d9ec659e7eed6c69cf809..e73bc2284b6a801072b244ba5a6073badd73df45 100644 (file)
@@ -4,6 +4,9 @@
 General:
 
 Changes to 1.37.42:
+25Oct05 
+- Make db_get_job_record() return Name so that the ACL
+  can be checked.  Fixes bug #446
 22Oct05
 - Insure that all the SD tools init the Autochanger
   resources.
index 6d2e1155fa9e3ed370942ffbf4036bef5bc62228..701332e2d56609d1822957571cfee238dcaa1af0 100644 (file)
@@ -269,12 +269,12 @@ int db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
    if (jr->JobId == 0) {
       Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime,"
 "PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus,"
-"Type,Level,ClientId "
+"Type,Level,ClientId,Name "
 "FROM Job WHERE Job='%s'", jr->Job);
     } else {
       Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime,"
 "PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus,"
-"Type,Level,ClientId "
+"Type,Level,ClientId,Name "
 "FROM Job WHERE JobId=%s", 
           edit_int64(jr->JobId, ed1));
     }
@@ -303,6 +303,7 @@ int db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
    jr->JobType = (int)*row[10];
    jr->JobLevel = (int)*row[11];
    jr->ClientId = str_to_uint64(row[12]!=NULL?row[12]:(char *)"");
+   bstrncpy(jr->Name, row[13]!=NULL?row[13]:"", sizeof(jr->Name));
    sql_free_result(mdb);
 
    db_unlock(mdb);
index 37a88125742e2432273b701b0ae67101ae7abcfb..b2cf3b58d135600a5ece0572b3250863ae4fed08 100644 (file)
@@ -589,7 +589,6 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       bsendmsg(ua, _("You have selected the following JobId: %s\n"), rx->JobIds);
    }
 
-   memset(&jr, 0, sizeof(JOB_DBR));
 
    rx->TotalFiles = 0;
    for (p=rx->JobIds; ; ) {
@@ -604,6 +603,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       if (jr.JobId == JobId) {
          continue;                    /* duplicate of last JobId */
       }
+      memset(&jr, 0, sizeof(JOB_DBR));
       jr.JobId = JobId;
       if (!db_get_job_record(ua->jcr, ua->db, &jr)) {
          char ed1[50];
index 083dde788dff027b910b776f1d88187df12724f8..68f97f6c96b5287c5932d04ecd670b699edd3ced 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.37.42"
-#define BDATE   "22 October 2005"
-#define LSMDATE "22Oct05"
+#define BDATE   "25 October 2005"
+#define LSMDATE "25Oct05"
 
 /* Debug flags */
 #undef  DEBUG