/*
Bacula® - The Network Backup Solution
- Copyright (C) 2001-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2001-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
- modify it under the terms of version two of the GNU General Public
+ modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*
* Kern Sibbald, May MMI
*
- * Version $Id$
- *
*/
#include "bacula.h"
extern bool init_done;
/* Static variables */
-static char derrmsg[] = "3900 Invalid command\n";
+static char derrmsg[] = "3900 Invalid command:";
static char OKsetdebug[] = "3000 OK setdebug=%d\n";
static char invalid_cmd[] = "3997 Invalid command for a Director with Monitor directive enabled.\n";
static char OK_bootstrap[] = "3000 OK bootstrap\n";
Dmsg1(200, "Do command: %s\n", cmds[i].cmd);
if (!cmds[i].func(jcr)) { /* do command */
quit = true; /* error, get out */
- Dmsg1(190, "Command %s reqeusts quit\n", cmds[i].cmd);
+ Dmsg1(190, "Command %s requests quit\n", cmds[i].cmd);
}
found = true; /* indicate command found */
break;
}
}
if (!found) { /* command not found */
- bs->fsend(derrmsg);
+ POOL_MEM err_msg;
+ Mmsg(err_msg, "%s %s\n", derrmsg, bs->msg);
+ bs->fsend(err_msg.c_str());
break;
}
}
} else {
oldStatus = jcr->JobStatus;
set_jcr_job_status(jcr, JS_Canceled);
+ Dmsg2(800, "Cancel JobId=%d %p\n", jcr->JobId, jcr);
if (!jcr->authenticated && oldStatus == JS_WaitFD) {
pthread_cond_signal(&jcr->job_start_wait); /* wake waiting thread */
}
if (jcr->file_bsock) {
- bnet_sig(jcr->file_bsock, BNET_TERMINATE);
+ jcr->file_bsock->signal(BNET_TERMINATE);
+ jcr->file_bsock->set_terminated();
+ Dmsg2(800, "Term bsock jid=%d %p\n", jcr->JobId, jcr);
} else {
/* Still waiting for FD to connect, release it */
pthread_cond_signal(&jcr->job_start_wait); /* wake waiting job */
+ Dmsg2(800, "Signal FD connect jid=%d %p\n", jcr->JobId, jcr);
}
/* If thread waiting on mount, wake him */
if (jcr->dcr && jcr->dcr->dev && jcr->dcr->dev->waiting_for_mount()) {
dev->truncating = true; /* let open() know we will truncate it */
}
/* Set old volume name for open if relabeling */
- bstrncpy(dcr->VolCatInfo.VolCatName, volname, sizeof(dcr->VolCatInfo.VolCatName));
+ dcr->setVolCatName(volname);
if (dev->open(dcr, mode) < 0) {
dir->fsend(_("3910 Unable to open device %s: ERR=%s\n"),
dev->print_name(), dev->bstrerror());
label_status = read_dev_volume_label(dcr);
/* Set new volume name */
- bstrncpy(dcr->VolCatInfo.VolCatName, newname, sizeof(dcr->VolCatInfo.VolCatName));
+ dcr->setVolCatName(newname);
switch(label_status) {
case VOL_NAME_ERROR:
case VOL_VERSION_ERROR: