The error I when I installed 1.34.2 clients:
The BACULA-FD file is
linked to missing export KERNEL32.DLL:GetFileAttributesExA.
+- Mark a non-removable disk Volume in error rather than asking sys op to
+ mount it.
+- Implement Fixed storage LabelFormat test.
Documentation from Christopher Hull on new client job requests:
===
- Add regression of btape "fill"
==== Done in 1.34.4
- Implement "label slots=1,2... pool=yyy barcodes"
-
#define B_ISUPPER(c) (isascii((int)(c)) && isupper((int)(c)))
#define B_ISDIGIT(c) (isascii((int)(c)) && isdigit((int)(c)))
+/* For multiplying by 10 with shift and addition */
+#define B_TIMES10(d) ((d<<3)+(d<<1))
+
typedef void (HANDLER)();
typedef int (INTHANDLER)();
#undef fgets
#define fgets(x,y,z) bfgets((x), (y), (z))
+/* Use our sscanf, which is safer and works with known sizes */
+// #define sscanf bsscanf
+
#ifdef DEBUG
#define bstrdup(str) strcpy((char *)b_malloc(__FILE__,__LINE__,strlen((str))+1),(str))
#else
nptr = (struct lstr *)((char *)lptr + newlen + PHDRL);
/* Appropriate byte alignment - normally 2 byte, but on
sparc we need 4 byte alignment, so we always do 4 */
- if (((unsigned)nptr & 3) != 0) { /* test four byte alignment */
+ if (((long unsigned)nptr & 3) != 0) { /* test four byte alignment */
p = (char *)nptr;
- nptr = (struct lstr *)((((unsigned) p) & ~3) + 4);
+ nptr = (struct lstr *)((((long unsigned) p) & ~3) + 4);
}
nptr->len = lptr->len - ((char *)nptr - (char *)lptr);
lptr->len -= nptr->len;
static void print_findex(UAContext *ua, RBSR_FINDEX *fi)
{
- bsendmsg(ua, "fi=0x%x\n", (unsigned)fi);
+ bsendmsg(ua, "fi=0x%lx\n", fi);
for ( ; fi; fi=fi->next) {
if (fi->findex == fi->findex2) {
bsendmsg(ua, "FileIndex=%d\n", fi->findex);
job->hdr.name, job_items[i].name, *def_svalue, i, offset);
svalue = (char **)((char *)job + offset);
if (*svalue) {
- Dmsg1(000, "Hey something is wrong. p=0x%u\n", (unsigned)*svalue);
+ Dmsg1(000, "Hey something is wrong. p=0x%lu\n", *svalue);
}
*svalue = bstrdup(*def_svalue);
set_bit(i, job->hdr.item_present);
job->hdr.name, job_items[i].name, i, offset);
svalue = (char **)((char *)job + offset);
if (*svalue) {
- Dmsg1(000, "Hey something is wrong. p=0x%u\n", (unsigned)*svalue);
+ Dmsg1(000, "Hey something is wrong. p=0x%lu\n", *svalue);
}
*svalue = *def_svalue;
set_bit(i, job->hdr.item_present);
{"readfifo", store_opts, NULL, 0, 0, 0},
{"replace", store_opts, NULL, 0, 0, 0},
{"portable", store_opts, NULL, 0, 0, 0},
+ {"mtimeonly", store_opts, NULL, 0, 0, 0},
+ {"keepatime", store_opts, NULL, 0, 0, 0},
{"regex", store_regex, NULL, 0, 0, 0},
{"base", store_base, NULL, 0, 0, 0},
{"wild", store_wild, NULL, 0, 0, 0},
}
+/*
+ * Add fname to include/exclude fileset list. First check for
+ * | and < and if necessary perform command.
+ */
+static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *fileset)
+{
+ char *p;
+ BPIPE *bpipe;
+ POOLMEM *fn;
+ FILE *ffd;
+ char buf[1000];
+ int stat;
+
+ p = (char *)fname;
+ switch (*p) {
+ case '|':
+ p++; /* skip over | */
+ fn = get_pool_memory(PM_FNAME);
+ fn = edit_job_codes(jcr, fn, p, "");
+ bpipe = open_bpipe(fn, 0, "r");
+ free_pool_memory(fn);
+ if (!bpipe) {
+ Jmsg(jcr, M_FATAL, 0, _("Cannot run program: %s. ERR=%s\n"),
+ p, strerror(errno));
+ return;
+ }
+ while (fgets(buf, sizeof(buf), bpipe->rfd)) {
+ strip_trailing_junk(buf);
+ fileset->incexe->name_list.append(bstrdup(buf));
+ }
+ if ((stat=close_bpipe(bpipe)) != 0) {
+ Jmsg(jcr, M_FATAL, 0, _("Error running program: %s. RtnStat=%d ERR=%s\n"),
+ p, stat, strerror(errno));
+ return;
+ }
+ break;
+ case '<':
+ p++; /* skip over < */
+ if ((ffd = fopen(p, "r")) == NULL) {
+ Jmsg(jcr, M_FATAL, 0, _("Cannot open FileSet input file: %s. ERR=%s\n"),
+ p, strerror(errno));
+ return;
+ }
+ while (fgets(buf, sizeof(buf), ffd)) {
+ strip_trailing_junk(buf);
+ fileset->incexe->name_list.append(bstrdup(buf));
+ }
+ fclose(ffd);
+ break;
+ default:
+ fileset->incexe->name_list.append(bstrdup(fname));
+ break;
+ }
+}
+
static void add_fileset(JCR *jcr, const char *item)
{
int state = fileset->state;
findFOPTS *current_opts;
+ Dmsg1(100, "%s\n", item);
int code = item[0];
if (item[1] == ' ') { /* If string follows */
item += 2; /* point to string */
state = state_none;
break;
case 'F':
- /* File item */
+ /* File item to either include/include list */
state = state_include;
- fileset->incexe->name_list.append(bstrdup(item));
+ add_file_to_fileset(jcr, item, fileset);
break;
case 'R':
current_opts = start_options(ff);
if (sd == NULL) {
Jmsg(jcr, M_FATAL, 0, _("Failed to connect to Storage daemon: %s:%d\n"),
jcr->stored_addr, stored_port);
+ Dmsg2(100, "Failed to connect to Storage daemon: %s:%d\n",
+ jcr->stored_addr, stored_port);
return 0;
}
Dmsg1(50, "Create file: %s\n", attr->ofname);
if (is_bopen(bfd)) {
Jmsg1(jcr, M_ERROR, 0, "bpkt already open fid=%d\n", bfd->fid);
+ bclose(bfd);
}
if ((bopen(bfd, attr->ofname, mode, S_IRUSR | S_IWUSR)) < 0) {
Jmsg2(jcr, M_ERROR, 0, _("Could not create %s: ERR=%s\n"),
bstrncpy(host, my_name, sizeof(host));
}
bsnprintf(chal, sizeof(chal), "<%u.%u@%s>", (uint32_t)random(), (uint32_t)time(NULL), host);
+ Dmsg2(100, "send: auth cram-md5 %s ssl=%d\n", chal, ssl_need);
if (!bnet_fsend(bs, "auth cram-md5 %s ssl=%d\n", chal, ssl_need)) {
+ Dmsg0(100, "Send challenge error.\n");
return 0;
}
if (!bnet_ssl_client(bs, password, ssl_need)) {
return 0;
}
-
- Dmsg1(99, "sent challenge: %s", bs->msg);
if (bnet_wait_data(bs, 180) <= 0 || bnet_recv(bs) <= 0) {
bmicrosleep(5, 0);
return 0;
hmac_md5((uint8_t *)chal, strlen(chal), (uint8_t *)password, strlen(password), hmac);
bin_to_base64(host, (char *)hmac, 16);
ok = strcmp(mp_chr(bs->msg), host) == 0;
- Dmsg3(99, "Authenticate %s: wanted %s, got %s\n",
- ok ? "OK" : "NOT OK", host, bs->msg);
+ if (ok) {
+ Dmsg0(99, "Authenticate OK\n");
+ } else {
+ Dmsg2(99, "Authenticate NOT OK: wanted %s, got %s\n", host, bs->msg);
+ }
if (ok) {
bnet_fsend(bs, "1000 OK auth\n");
} else {
bmicrosleep(5, 0);
return 0;
}
- if (sscanf(mp_chr(bs->msg), "auth cram-md5 %s ssl=%d\n", chal, &ssl_has) != 2) {
+ Dmsg1(100, "cram-get: %s", bs->msg);
+ if (sscanf(bs->msg, "auth cram-md5 %s ssl=%d\n", chal, &ssl_has) != 2) {
ssl_has = BNET_SSL_NONE;
- if (sscanf(mp_chr(bs->msg), "auth cram-md5 %s\n", chal) != 1) {
+ if (sscanf(bs->msg, "auth cram-md5 %s\n", chal) != 1) {
+ Dmsg1(100, "Cannot scan challenge: %s", bs->msg);
bnet_fsend(bs, "1999 Authorization failed.\n");
- Dmsg1(100, "Cannot scan challenge: %s\n", bs->msg);
bmicrosleep(5, 0);
return 0;
}
umask(oldmask);
Dmsg0(200, "Exit daemon_start\n");
+
+ /*
+ * Make sure we have fd's 0, 1, 2 open
+ * If we don't do this one of our sockets may open
+ * there and if we then use stdout, it could
+ * send total garbage to our socket.
+ *
+ */
+ int fd;
+ fd = open("/dev/null", O_RDONLY, 0644);
+ if (fd > 2) {
+ close(fd);
+ } else {
+ for(i=1; fd + i <= 2; i++) {
+ dup2(fd, fd+i);
+ }
+ }
+
#endif /* HAVE_CYGWIN */
}
char **argk, char **argv, int max_args);
void split_path_and_filename(const char *fname, POOLMEM **path,
int *pnl, POOLMEM **file, int *fnl);
+int bsscanf(const char *buf, const char *fmt, ...);
+
/* util.c */
int is_buf_zero (char *buf, int len);
Dmsg2(200, "pnl=%d fnl=%d\n", *pnl, *fnl);
Dmsg3(200, "split fname=%s path=%s file=%s\n", fname, *path, *file);
}
+
+/*
+ * Extremely simple sscanf. Handles only %(u,d,ld,lu,lld,llu,c,nns)
+ */
+const int BIG = 1000;
+int bsscanf(const char *buf, const char *fmt, ...)
+{
+ va_list ap;
+ int count = 0;
+ void *vp;
+ char *cp;
+ int l = 0;
+ int max_len = BIG;
+ uint64_t value;
+ bool error = false;
+
+ va_start(ap, fmt);
+ while (*fmt && !error) {
+// Dmsg1(000, "fmt=%c\n", *fmt);
+ if (*fmt == '%') {
+ fmt++;
+// Dmsg1(000, "Got %% nxt=%c\n", *fmt);
+switch_top:
+ switch (*fmt++) {
+ case 'u':
+ case 'd':
+ value = 0;
+ while (B_ISDIGIT(*buf)) {
+ value = B_TIMES10(value) + *buf++ - '0';
+ }
+ vp = (void *)va_arg(ap, void *);
+// Dmsg2(000, "val=%lld at 0x%lx\n", value, (long unsigned)vp);
+ if (l < 2) {
+ *((uint32_t *)vp) = (uint32_t)value;
+// Dmsg0(000, "Store 32 bit int\n");
+ } else {
+ *((uint64_t *)vp) = (uint64_t)value;
+// Dmsg0(000, "Store 64 bit int\n");
+ }
+ count++;
+ l = 0;
+ break;
+ case 'l':
+// Dmsg0(000, "got l\n");
+ l = 1;
+ if (*fmt == 'l') {
+ l++;
+ fmt++;
+ }
+ if (*fmt == 'd' || *fmt == 'u') {
+ goto switch_top;
+ }
+// Dmsg1(000, "fmt=%c !=d,u\n", *fmt);
+ error = true;
+ break;
+ case 'q':
+ l = 2;
+ if (*fmt == 'd' || *fmt == 'u') {
+ goto switch_top;
+ }
+// Dmsg1(000, "fmt=%c !=d,u\n", *fmt);
+ error = true;
+ break;
+ case 's':
+// Dmsg1(000, "Store string max_len=%d\n", max_len);
+ cp = (char *)va_arg(ap, char *);
+ while (*buf && !B_ISSPACE(*buf) && max_len-- > 0) {
+ *cp++ = *buf++;
+ }
+ *cp = 0;
+ count++;
+ max_len = BIG;
+ break;
+ case 'c':
+ cp = (char *)va_arg(ap, char *);
+ *cp = *buf++;
+ count++;
+ break;
+ case '%':
+ if (*buf++ != '%') {
+ error = true;
+ }
+ break;
+ default:
+ fmt--;
+ max_len = 0;
+ while (B_ISDIGIT(*fmt)) {
+ max_len = B_TIMES10(max_len) + *fmt++ - '0';
+ }
+// Dmsg1(000, "Default max_len=%d\n", max_len);
+ if (*fmt == 's') {
+ goto switch_top;
+ }
+// Dmsg1(000, "Default c=%c\n", *fmt);
+ error = true;
+ break; /* error: unknown format */
+ }
+ continue;
+
+ /* White space eats zero or more whitespace */
+ } else if (B_ISSPACE(*fmt)) {
+ fmt++;
+ while (B_ISSPACE(*buf)) {
+ buf++;
+ }
+ /* Plain text must match */
+ } else if (*buf++ != *fmt++) {
+// Dmsg2(000, "Mismatch buf=%c fmt=%c\n", *--buf, *--fmt);
+ error = true;
+ }
+ }
+ va_end(ap);
+// Dmsg2(000, "Error=%d count=%d\n", error, count);
+ if (error) {
+ count = -1;
+ }
+ return count;
+}
+
+#ifdef TEST_PROGRAM
+int main(int argc, char *argv[])
+{
+ char buf[100];
+ uint32_t val32;
+ uint64_t val64;
+ uint32_t FirstIndex, LastIndex, StartFile, EndFile, StartBlock, EndBlock;
+ char Job[200];
+ int cnt;
+ char *helloreq= "Hello *UserAgent* calling\n";
+ char *hello = "Hello %127s calling\n";
+ char *catreq =
+"CatReq Job=NightlySave.2004-06-11_19.11.32 CreateJobMedia FirstIndex=1 LastIndex=114 StartFile=0 EndFile=0 StartBlock=208 EndBlock=2903248";
+static char Create_job_media[] = "CatReq Job=%127s CreateJobMedia "
+ "FirstIndex=%u LastIndex=%u StartFile=%u EndFile=%u "
+ "StartBlock=%u EndBlock=%u\n";
+static char OK_media[] = "1000 OK VolName=%127s VolJobs=%u VolFiles=%u"
+ " VolBlocks=%u VolBytes=%" lld " VolMounts=%u VolErrors=%u VolWrites=%u"
+ " MaxVolBytes=%" lld " VolCapacityBytes=%" lld " VolStatus=%20s"
+ " Slot=%d MaxVolJobs=%u MaxVolFiles=%u InChanger=%d"
+ " VolReadTime=%" lld " VolWriteTime=%" lld;
+ char *media =
+"1000 OK VolName=TestVolume001 VolJobs=0 VolFiles=0 VolBlocks=0 VolBytes=1 VolMounts=0 VolErrors=0 VolWrites=0 MaxVolBytes=0 VolCapacityBytes=0 VolStatus=Append Slot=0 MaxVolJobs=0 MaxVolFiles=0 InChanger=1 VolReadTime=0 VolWriteTime=0";
+struct VOLUME_CAT_INFO {
+ /* Media info for the current Volume */
+ uint32_t VolCatJobs; /* number of jobs on this Volume */
+ uint32_t VolCatFiles; /* Number of files */
+ uint32_t VolCatBlocks; /* Number of blocks */
+ uint64_t VolCatBytes; /* Number of bytes written */
+ uint32_t VolCatMounts; /* Number of mounts this volume */
+ uint32_t VolCatErrors; /* Number of errors this volume */
+ uint32_t VolCatWrites; /* Number of writes this volume */
+ uint32_t VolCatReads; /* Number of reads this volume */
+ uint64_t VolCatRBytes; /* Number of bytes read */
+ uint32_t VolCatRecycles; /* Number of recycles this volume */
+ int32_t Slot; /* Slot in changer */
+ bool InChanger; /* Set if vol in current magazine */
+ uint32_t VolCatMaxJobs; /* Maximum Jobs to write to volume */
+ uint32_t VolCatMaxFiles; /* Maximum files to write to volume */
+ uint64_t VolCatMaxBytes; /* Max bytes to write to volume */
+ uint64_t VolCatCapacityBytes; /* capacity estimate */
+ uint64_t VolReadTime; /* time spent reading */
+ uint64_t VolWriteTime; /* time spent writing this Volume */
+ char VolCatStatus[20]; /* Volume status */
+ char VolCatName[MAX_NAME_LENGTH]; /* Desired volume to mount */
+};
+ struct VOLUME_CAT_INFO vol;
+
+#ifdef xxx
+ bsscanf("Hello_world 123 1234", "%120s %ld %lld", buf, &val32, &val64);
+ printf("%s %d %lld\n", buf, val32, val64);
+
+ *Job=0;
+ cnt = bsscanf(catreq, Create_job_media, &Job,
+ &FirstIndex, &LastIndex, &StartFile, &EndFile,
+ &StartBlock, &EndBlock);
+ printf("cnt=%d Job=%s\n", cnt, Job);
+ cnt = bsscanf(helloreq, hello, &Job);
+ printf("cnt=%d Agent=%s\n", cnt, Job);
+#endif
+ cnt = bsscanf(media, OK_media,
+ vol.VolCatName,
+ &vol.VolCatJobs, &vol.VolCatFiles,
+ &vol.VolCatBlocks, &vol.VolCatBytes,
+ &vol.VolCatMounts, &vol.VolCatErrors,
+ &vol.VolCatWrites, &vol.VolCatMaxBytes,
+ &vol.VolCatCapacityBytes, vol.VolCatStatus,
+ &vol.Slot, &vol.VolCatMaxJobs, &vol.VolCatMaxFiles,
+ &vol.InChanger, &vol.VolReadTime, &vol.VolWriteTime);
+ printf("cnt=%d Vol=%s\n", cnt, vol.VolCatName);
+
+}
+
+#endif
bool tape_previously_mounted;
bool tape_initially_mounted;
VOL_LIST *vol;
- int autochanger = 0;
+ bool try_autochanger = true;
int i;
DCR *dcr = jcr->dcr;
DEVICE *dev;
Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);
}
/* Call autochanger only once unless ask_sysop called */
- if (!autochanger) {
+ if (try_autochanger) {
int stat;
Dmsg2(200, "calling autoload Vol=%s Slot=%d\n",
jcr->VolumeName, jcr->VolCatInfo.Slot);
stat = autoload_device(jcr, dev, 0, NULL);
if (stat > 0) {
- autochanger = 1;
+ try_autochanger = false;
continue;
}
}
if (!dir_ask_sysop_to_mount_volume(jcr, dev)) {
goto get_out; /* error return */
}
- autochanger = 0; /* permit using autochanger again */
+ try_autochanger = true; /* permit using autochanger again */
continue; /* try reading again */
} /* end switch */
break;
DCR *dcr = jcr->dcr;
VOLUME_CAT_INFO vol;
int n;
+ int InChanger;
jcr->VolumeName[0] = 0; /* No volume */
dcr->VolumeName[0] = 0; /* No volume */
&vol.VolCatWrites, &vol.VolCatMaxBytes,
&vol.VolCatCapacityBytes, vol.VolCatStatus,
&vol.Slot, &vol.VolCatMaxJobs, &vol.VolCatMaxFiles,
- &vol.InChanger, &vol.VolReadTime, &vol.VolWriteTime);
+ &InChanger, &vol.VolReadTime, &vol.VolWriteTime);
if (n != 17) {
Dmsg2(100, "Bad response from Dir fields=%d: %s\n", n, dir->msg);
Mmsg(&jcr->errmsg, _("Error getting Volume info: %s\n"), dir->msg);
return 0;
}
+ vol.InChanger = InChanger; /* bool in structure */
unbash_spaces(vol.VolCatName);
pm_strcpy(&jcr->VolumeName, vol.VolCatName); /* set desired VolumeName */
bstrncpy(dcr->VolumeName, vol.VolCatName, sizeof(dcr->VolumeName));
/*
* After writing a Volume, send the updated statistics
- * back to the director.
+ * back to the director. The information comes from the
+ * dev record.
*/
int dir_update_volume_info(JCR *jcr, DEVICE *dev, int label)
{
time_t LastWritten = time(NULL);
char ed1[50], ed2[50], ed3[50], ed4[50];
VOLUME_CAT_INFO *vol = &dev->VolCatInfo;
+ int InChanger;
if (vol->VolCatName[0] == 0) {
Jmsg0(jcr, M_ERROR, 0, _("NULL Volume name. This shouldn't happen!!!\n"));
vol->VolCatBytes = 1; /* indicates tape labeled */
}
bash_spaces(vol->VolCatName);
+ InChanger = vol->InChanger;
bnet_fsend(dir, Update_media, jcr->Job,
vol->VolCatName, vol->VolCatJobs, vol->VolCatFiles,
vol->VolCatBlocks, edit_uint64(vol->VolCatBytes, ed1),
vol->VolCatMounts, vol->VolCatErrors,
vol->VolCatWrites, edit_uint64(vol->VolCatMaxBytes, ed2),
LastWritten, vol->VolCatStatus, vol->Slot, label,
- vol->InChanger,
+ InChanger, /* bool in structure */
edit_uint64(vol->VolReadTime, ed3),
edit_uint64(vol->VolWriteTime, ed4) );
return 0;
}
+#ifdef needed
/*
* If we have a valid volume name and we are not
* removable media, return now, or if we have a
Dmsg0(100, "Return 1 from mount without wait.\n");
return 1;
}
+#endif
if (!dev->poll) {
msg = _("Please mount");
uint32_t StartFile; /* Start write file */
uint32_t StartBlock; /* Start write block */
uint32_t EndBlock; /* Ending block written */
- uint64_t spool_size; /* Current spool size */
- uint64_t max_spool_size; /* Max job spool size */
+ int64_t spool_size; /* Current spool size */
+ int64_t max_spool_size; /* Max job spool size */
char VolumeName[MAX_NAME_LENGTH]; /* Volume name */
VOLUME_CAT_INFO VolCatInfo; /* Catalog info for desired volume */
};
* See if this is a File daemon connection. If so
* call FD handler.
*/
- if (sscanf(bs->msg, "Hello Start Job %127s calling\n", name) == 1) {
+ Dmsg1(110, "Conn: %s", bs->msg);
+ if (sscanf(bs->msg, "Hello Start Job %127s", name) == 1) {
handle_filed_connection(bs, name);
return NULL;
}
+ Dmsg0(110, "Start Dir Job\n");
jcr = new_jcr(sizeof(JCR), stored_free_jcr); /* create Job Control Record */
jcr->dir_bsock = bs; /* save Director bsock */
jcr->dir_bsock->jcr = jcr;
set_jcr_job_status(jcr, JS_ErrorTerminated);
return 0;
}
- jcr->authenticated = FALSE;
+ jcr->authenticated = false;
/*
* Pass back an authorization key for the File daemon
bmicrosleep(0, 50000); /* wait 50 millisecs */
if (!(jcr=get_jcr_by_full_name(job_name))) {
Jmsg1(NULL, M_FATAL, 0, _("Job name not found: %s\n"), job_name);
+ Dmsg1(100, "Job name not found: %s\n", job_name);
return;
}
record = new_record();
Dmsg0(90, "Big if statement in read_volume_label\n");
if (!read_block_from_dev(jcr, dev, block, NO_BLOCK_NUMBER_CHECK)) {
- Mmsg(&jcr->errmsg, _("Volume on %s is not a Bacula labeled Volume, \
-because:\n %s"), dev_name(dev), strerror_dev(dev));
+ Mmsg(&jcr->errmsg, _("Requested Volume \"%s\" on %s is not a Bacula "
+ "labeled Volume, because: ERR=%s"), NPRT(VolName), dev_name(dev),
+ strerror_dev(dev));
} else if (!read_record_from_block(block, record)) {
Mmsg(&jcr->errmsg, _("Could not read Volume label from block.\n"));
} else if (!unser_volume_label(dev, record)) {
- Mmsg(&jcr->errmsg, _("Could not unserialize Volume label: %s\n"),
+ Mmsg(&jcr->errmsg, _("Could not unserialize Volume label: ERR=%s\n"),
strerror_dev(dev));
} else if (strcmp(dev->VolHdr.Id, BaculaId) != 0 &&
strcmp(dev->VolHdr.Id, OldBaculaId) != 0) {
if (!release && dev_is_tape(dev) && dev_cap(dev, CAP_AUTOMOUNT)) {
ask = false; /* don't ask SYSOP this time */
}
+ /* Don't ask if not removable */
+ if (!dev_cap(dev, CAP_REM)) {
+ ask = false;
+ }
Dmsg2(100, "Ask=%d autochanger=%d\n", ask, autochanger);
release = true; /* release next time if we "recurse" */
case VOL_NAME_ERROR:
VOLUME_CAT_INFO VolCatInfo;
+ /* If not removable, Volume is broken */
+ if (!dev_cap(dev, CAP_REM)) {
+ bstrncpy(jcr->VolCatInfo.VolCatStatus, "Error",
+ sizeof(jcr->VolCatInfo.VolCatStatus));
+ memcpy(&dev->VolCatInfo, &jcr->VolCatInfo, sizeof(dev->VolCatInfo));
+ dir_update_volume_info(jcr, dev, 1); /* indicate tape labeled */
+ Jmsg(jcr, M_WARNING, 0, _("Volume \"%s\" not on device %s. Volume marked in error.\n"),
+ jcr->VolumeName, dev_name(dev));
+ goto mount_next_vol;
+ }
+
Dmsg1(100, "Vol NAME Error Name=%s\n", jcr->VolumeName);
/* If polling and got a previous bad name, ignore it */
if (dev->poll && strcmp(dev->BadVolName, dev->VolHdr.VolName) == 0) {
jcr->VolumeName, dev_name(dev));
goto read_volume; /* read label we just wrote */
}
+ /* If not removable, Volume is broken */
+ if (!dev_cap(dev, CAP_REM)) {
+ bstrncpy(jcr->VolCatInfo.VolCatStatus, "Error",
+ sizeof(jcr->VolCatInfo.VolCatStatus));
+ memcpy(&dev->VolCatInfo, &jcr->VolCatInfo, sizeof(dev->VolCatInfo));
+ dir_update_volume_info(jcr, dev, 1); /* indicate tape labeled */
+ Jmsg(jcr, M_WARNING, 0, _("Volume \"%s\" not on device %s. Volume marked in error.\n"),
+ jcr->VolumeName, dev_name(dev));
+ goto mount_next_vol;
+ }
/* NOTE! Fall-through wanted. */
case VOL_NO_MEDIA:
default:
uint32_t attr_jobs;
uint32_t total_data_jobs; /* total jobs to have spooled data */
uint32_t total_attr_jobs;
- uint64_t max_data_size; /* max data size */
- uint64_t max_attr_size;
- uint64_t data_size; /* current data size (all jobs running) */
+ int64_t max_data_size; /* max data size */
+ int64_t max_attr_size;
+ int64_t data_size; /* current data size (all jobs running) */
int64_t attr_size;
};
#undef VERSION
#define VERSION "1.34.4"
#define VSTRING "1"
-#define BDATE "09 June 2004"
-#define LSMDATE "09Jun04"
+#define BDATE "12 June 2004"
+#define LSMDATE "12Jun04"
/* Debug flags */
#undef DEBUG