- Implement mount command for autochanger
Fixes for 1.39.20:
-- Writing DVDs should work much better thans to Richard Mortimer.
+- Writing DVDs should work much better thanks to Richard Mortimer.
- Fix bug #462 incorrect error message printed when client script called
from File= was not found.
- Fix bug #558 (waiting for feedback) where Bacula needs too much time to
Priority:
For 1.39:
+- Restricted consoles start in the Default catalog even if it
+ is not permitted.
+- Make sure that the restore options don't permit "seeing" other
+ Client's job data.
- Implement Python event for backing up/restoring a file.
- Fix wx-console scanning problem with commas in names.
- Change dbcheck to tell users to use native tools for fixing
;;
status)
- [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT}
+ [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT}
;;
*)
#include "bacula.h"
#include "cats.h"
-/* For ua_cmds.c */
+/* For ua_update.c */
const char *list_pool = "SELECT * FROM Pool WHERE PoolId=%s";
/* For ua_dotcmds.c */
const char *client_backups =
"SELECT DISTINCT Job.JobId,Client.Name as Client,Level,StartTime,"
- "JobFiles,JobBytes,VolumeName,MediaType,FileSet"
+ "JobFiles,JobBytes,VolumeName,MediaType,FileSet,Media.Enabled as Enabled"
" FROM Client,Job,JobMedia,Media,FileSet"
" WHERE Client.Name='%s'"
" AND FileSet='%s'"
const char *upd_Purged = "UPDATE Job Set PurgedFiles=1 WHERE JobId=%s";
const char *cnt_DelCand = "SELECT count(*) FROM DelCandidates";
const char *del_Job = "DELETE FROM Job WHERE JobId=%s";
-const char *del_MAC = "DELETE FROM MAC WHERE JobId=%s";
const char *del_JobMedia = "DELETE FROM JobMedia WHERE JobId=%s";
const char *cnt_JobMedia = "SELECT count(*) FROM JobMedia WHERE MediaId=%s";
const char *sel_JobMedia = "SELECT JobId FROM JobMedia WHERE MediaId=%s";
"AND Job.StartTime<'%s' "
"AND Level='F' AND JobStatus='T' AND Type='B' "
"AND JobMedia.JobId=Job.JobId "
+ "AND Media.Enabled=1 "
"AND JobMedia.MediaId=Media.MediaId "
"AND Job.FileSetId=FileSet.FileSetId "
"AND FileSet.FileSet='%s' "
"StartTime,VolumeName,JobMedia.StartFile,VolSessionId,VolSessionTime "
"FROM temp1,Job,JobMedia,Media WHERE temp1.JobId=Job.JobId "
"AND Level='F' AND JobStatus='T' AND Type='B' "
+ "AND Media.Enabled=1 "
"AND JobMedia.JobId=Job.JobId "
"AND JobMedia.MediaId=Media.MediaId";
"WHERE Job.JobTDate>%s AND Job.StartTime<'%s' "
"AND Job.ClientId=%s "
"AND JobMedia.JobId=Job.JobId "
+ "AND Media.Enabled=1 "
"AND JobMedia.MediaId=Media.MediaId "
"AND Job.Level='D' AND JobStatus='T' AND Type='B' "
"AND Job.FileSetId=FileSet.FileSetId "
"FROM Job,JobMedia,Media,FileSet "
"WHERE Job.JobTDate>%s AND Job.StartTime<'%s' "
"AND Job.ClientId=%s "
+ "AND Media.Enabled=1 "
"AND JobMedia.JobId=Job.JobId "
"AND JobMedia.MediaId=Media.MediaId "
"AND Job.Level='I' AND JobStatus='T' AND Type='B' "
static int client_backups_handler(void *ctx, int num_field, char **row)
{
UAContext *ua = (UAContext *)ctx;
- bsendmsg(ua, "| %s | %s | %s | %s | %s | %s | %s |\n",
- row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7]);
+ bsendmsg(ua, "| %s | %s | %s | %s | %s | %s | %s | %s |\n",
+ row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8]);
return 0;
}
case -1: /* error or cancel */
return 0;
case 0: /* list last 20 Jobs run */
+ /* ***FIXME*** restrict clients on restricted console */
gui_save = ua->jcr->gui;
ua->jcr->gui = true;
db_list_sql_query(ua->jcr, ua->db, uar_list_jobs, prtit, ua, 1, HORZ_LIST);
pm_strcpy(rx->JobIds, ua->cmd);
break;
case 3: /* Enter an SQL list command */
+ if (!acl_access_ok(ua, Command_ACL, NT_("sqlquery"), 8)) {
+ return 0;
+ }
if (!get_cmd(ua, _("Enter SQL list command: "))) {
return 0;
}
/* Forward referenced functions */
static int update_volume(UAContext *ua);
-static int update_pool(UAContext *ua);
+static bool update_pool(UAContext *ua);
/*
* Update a Pool Record in the database.
/*
* Update pool record -- pull info from current POOL resource
*/
-static int update_pool(UAContext *ua)
+static bool update_pool(UAContext *ua)
{
POOL_DBR pr;
int id;
pool = get_pool_resource(ua);
if (!pool) {
- return 0;
+ return false;
}
memset(&pr, 0, sizeof(pr));
bstrncpy(pr.Name, pool->hdr.name, sizeof(pr.Name));
if (!get_pool_dbr(ua, &pr)) {
- return 0;
+ return false;
}
set_pooldbr_from_poolres(&pr, pool, POOL_OP_UPDATE); /* update */
db_list_sql_query(ua->jcr, ua->db, query, prtit, ua, 1, HORZ_LIST);
free_pool_memory(query);
bsendmsg(ua, _("Pool DB record updated from resource.\n"));
- return 1;
+ return true;
}
*/
jcr->fn_printed = false;
bsnprintf(buf, sizeof(buf),
-"SELECT Path.Path,Filename.Name FROM File,Path,Filename "
-"WHERE File.JobId=%d "
-"AND File.MarkId!=%d AND File.PathId=Path.PathId "
-"AND File.FilenameId=Filename.FilenameId",
- JobId, jcr->JobId);
+ "SELECT Path.Path,Filename.Name FROM File,Path,Filename "
+ "WHERE File.JobId=%d "
+ "AND File.MarkId!=%d AND File.PathId=Path.PathId "
+ "AND File.FilenameId=Filename.FilenameId",
+ JobId, jcr->JobId);
/* missing_handler is called for each file found */
db_sql_query(jcr->db, buf, missing_handler, (void *)jcr);
if (jcr->fn_printed) {
/* We mark Vols as Archive to keep them from being re-written */
bstrncpy(mr->VolStatus, "Archive", sizeof(mr->VolStatus));
mr->VolRetention = 365 * 3600 * 24; /* 1 year */
+ mr->Enabled = 1;
if (vl->VerNum >= 11) {
mr->FirstWritten = btime_to_utime(vl->write_btime);
mr->LabelDate = btime_to_utime(vl->label_btime);
*/
#undef VERSION
-#define VERSION "1.39.20"
-#define BDATE "22 August 2006"
-#define LSMDATE "22Aug06"
+#define VERSION "1.39.21"
+#define BDATE "23 August 2006"
+#define LSMDATE "23Aug06"
#define BYEAR "2006" /* year for copyright messages in progs */
/* Debug flags */
NOTE: The -C means clobber. Any local changes to the source code in
the depkgs-mingw32/src directory will be lost. The source will be
reextracted from the archive and the current patches will be applied.
+
+If you add a new subroutine or global symbol in the CATS library
+=================================================================
+Edit src/win32/cats/bacula_cats.def and update it appropriately.
+The output of a link will tell you the C++ mangled subroutine name
+to add, and for global symbols, it is rather easy. See the file.
+
+
Structure of the new Win32 build environment
============================================
;cnt_File DATA
cnt_DelCand DATA
del_Job DATA
-del_MAC DATA
del_JobMedia DATA
cnt_JobMedia DATA
sel_JobMedia DATA
Technical notes on version 1.39
General:
+24Aug06
+kes Add Media.Enabled flag to client backups for dotcmds.c
+kes Enforce Media.Enabled=1 for a current restore to work.
+kes Require restore case 3 to have sqlquery permission to work.
+kes Remove obsolete del_MAC sql command.
+
+Version 1.39.20 beta released:
22Aug06
kes Correct missing Client table reference in SQL pointed out by
Marc.