From: Kern Sibbald Date: Tue, 25 Oct 2005 17:06:42 +0000 (+0000) Subject: Make db_get_job_record() return Name so that the ACL X-Git-Tag: Release-1.38.0~38 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c0fdab59381c78ca55d563f5d78b07ddea0fd884;p=bacula%2Fbacula Make db_get_job_record() return Name so that the ACL can be checked. Fixes bug #446 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2479 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 1b77fdc605..72df835d59 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -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. diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index 2e653e8010..e73bc2284b 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -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. diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 6d2e1155fa..701332e2d5 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -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); diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 37a8812574..b2cf3b58d1 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -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]; diff --git a/bacula/src/version.h b/bacula/src/version.h index 083dde788d..68f97f6c96 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -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