char ed1[30];
Mmsg1(&mdb->errmsg, _("Got %s FileSets expected only one!\n"),
edit_uint64(mdb->num_rows, ed1));
- sql_data_seek(mdb, mdb->num_rows-1);
Jmsg(mdb->jcr, M_ERROR, 0, "%s", mdb->errmsg);
+ sql_data_seek(mdb, mdb->num_rows-1);
}
if ((row = sql_fetch_row(mdb)) == NULL) {
Mmsg1(&mdb->errmsg, _("Error fetching row get_fileset: %s\n"), sql_strerror(mdb));
switch (ff_pkt->type) {
case FT_LNKSAVED: /* Hard linked, file already saved */
+ Dmsg2(130, "FT_LNKSAVED hard link: %s => %s\n", ff_pkt->fname, ff_pkt->link);
break;
case FT_REGE:
Dmsg1(130, "FT_REGE saving: %s\n", ff_pkt->fname);
* For a directory, link is the same as fname, but with trailing
* slash. For a linked file, link is the link.
*/
- if (ff_pkt->type == FT_LNK) {
+ if (ff_pkt->type == FT_LNK || ff_pkt->type == FT_LNKSAVED) {
+ Dmsg2(100, "Link %s to %s\n", ff_pkt->fname, ff_pkt->link);
stat = bnet_fsend(sd, "%ld %d %s%c%s%c%s%c", jcr->JobFiles,
ff_pkt->type, ff_pkt->fname, 0, attribs, 0, ff_pkt->link, 0);
} else if (ff_pkt->type == FT_DIR) {
BSOCK *sd;
POOLMEM *fname; /* original file name */
POOLMEM *ofile; /* output name with possible prefix */
- POOLMEM *lname; /* link name */
+ POOLMEM *lname; /* link name with possible prefix */
int32_t stream;
uint32_t size;
uint32_t VolSessionId, VolSessionTime, file_index;
if ((int)sizeof_pool_memory(fname) < sd->msglen) {
fname = realloc_pool_memory(fname, sd->msglen + 1);
}
- if (sizeof_pool_memory(ofile) < sizeof_pool_memory(fname) + wherelen + 1) {
- ofile = realloc_pool_memory(ofile, sizeof_pool_memory(fname) + wherelen + 1);
+ if ((int)sizeof_pool_memory(ofile) < sd->msglen + wherelen + 1) {
+ ofile = realloc_pool_memory(ofile, sd->msglen + wherelen + 1);
}
- if ((int)sizeof_pool_memory(lname) < sd->msglen) {
- lname = realloc_pool_memory(lname, sd->msglen + 1);
+ if ((int)sizeof_pool_memory(lname) < sd->msglen + wherelen + 1) {
+ lname = realloc_pool_memory(lname, sd->msglen + wherelen + 1);
}
*fname = 0;
*lname = 0;
*fp = *ap++; /* terminate filename & point to attribs */
/* Skip to Link name */
- if (type == FT_LNK) {
+ if (type == FT_LNK || type == FT_LNKSAVED) {
lp = ap;
while (*lp++ != 0) {
;
}
- strcat(lname, lp); /* "save" link name */
} else {
- *lname = 0;
+ lp = "";
}
decode_stat(ap, &statp);
*/
if (jcr->where[0] == 0 && win32_client) {
strcpy(ofile, fname);
+ strcpy(lname, lp);
} else {
strcpy(ofile, jcr->where);
if (fname[1] == ':') {
} else {
strcat(ofile, fname);
}
+ /* Fixup link name */
+ if (type == FT_LNK || type == FT_LNKSAVED) {
+ if (lp[0] == '/') { /* if absolute path */
+ strcpy(lname, jcr->where);
+ }
+ /* ***FIXME**** we shouldn't have links on Windoz */
+ if (lp[1] == ':') {
+ lp[1] = '/';
+ strcat(lname, lp);
+ lp[1] = ':';
+ } else {
+ strcat(lname, lp);
+ }
+ }
}
Dmsg1(30, "Outfile=%s\n", ofile);
* Handle hard linked files
*
* Maintain a list of hard linked files already backed up. This
- * allows us to ensure that the data ofeach file gets backed
+ * allows us to ensure that the data of each file gets backed
* up only once.
*/
if (ff_pkt->statp.st_nlink > 1
/* */
#define VERSION "1.25"
#define VSTRING "1"
-#define DATE "28 August 2002"
-#define LSMDATE "29Aug02"
+#define DATE "30 August 2002"
+#define LSMDATE "30Aug02"
/* Debug flags */
#define DEBUG 1