case FT_NOFSCHG:
/* Suppress message for /dev filesystems */
if (!is_in_fileset(ff_pkt)) {
-#ifdef HAVE_WIN32
- Jmsg(jcr, M_INFO, 1, _(" %s is a junction point or a different filesystem. Will not descend from %s into it.\n"),
- ff_pkt->fname, ff_pkt->top_fname);
-#else
Jmsg(jcr, M_INFO, 1, _(" %s is a different filesystem. Will not descend from %s into it.\n"),
ff_pkt->fname, ff_pkt->top_fname);
-#endif
}
ff_pkt->type = FT_DIREND; /* Backup only the directory entry */
break;
ff_pkt->fname);
break;
case FT_REPARSE:
+ case FT_JUNCTION:
case FT_DIREND:
Dmsg1(130, "FT_DIREND: %s\n", ff_pkt->link);
break;
do_read = ff_pkt->statp.st_size > 0;
#endif
} else if (ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO ||
- ff_pkt->type == FT_REPARSE ||
+ ff_pkt->type == FT_REPARSE || ff_pkt->type == FT_JUNCTION ||
(!is_portable_backup(&ff_pkt->bfd) && ff_pkt->type == FT_DIREND)) {
do_read = true;
}
tid = NULL;
}
int noatime = ff_pkt->flags & FO_NOATIME ? O_NOATIME : 0;
- ff_pkt->bfd.reparse_point = ff_pkt->type == FT_REPARSE;
+ ff_pkt->bfd.reparse_point = (ff_pkt->type == FT_REPARSE ||
+ ff_pkt->type == FT_JUNCTION);
if (bopen(&ff_pkt->bfd, ff_pkt->fname, O_RDONLY | O_BINARY | noatime, 0) < 0) {
ff_pkt->ff_errno = errno;
berrno be;
break;
case FT_DIREND:
case FT_REPARSE:
+ case FT_JUNCTION:
/* Here link is the canonical filename (i.e. with trailing slash) */
stat = sd->fsend("%ld %d %s%c%s%c%c%s%c%u%c", jcr->JobFiles,
ff_pkt->type, ff_pkt->link, 0, attribs, 0, 0,
ff_pkt->object_name = (char *)"job_metadata.xml";
ff_pkt->object = (char *)metadata;
ff_pkt->object_len = (wcslen(metadata) + 1) * sizeof(WCHAR);
+ ff_pkt->object_index = (int)time(NULL);
save_file(jcr, ff_pkt, true);
}
}
case FT_INVALIDFS:
case FT_INVALIDDT:
case FT_REPARSE:
+ case FT_JUNCTION:
case FT_DIREND:
case FT_SPEC:
case FT_RAW:
jcr->num_files_examined--; /* correct file count */
return 1; /* ignored */
case FT_REPARSE:
+ case FT_JUNCTION:
case FT_DIREND:
Dmsg1(30, "FT_DIR saving: %s\n", ff_pkt->fname);
break;
stat = dir->fsend("%d %d %s %s%c%s%c%s%c", jcr->JobFiles,
STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->fname,
0, attribs, 0, ff_pkt->link, 0);
- } else if (ff_pkt->type == FT_DIREND || ff_pkt->type == FT_REPARSE) {
+ } else if (ff_pkt->type == FT_DIREND || ff_pkt->type == FT_REPARSE ||
+ ff_pkt->type == FT_JUNCTION) {
/* Here link is the canonical filename (i.e. with trailing slash) */
stat = dir->fsend("%d %d %s %s%c%s%c%c", jcr->JobFiles,
STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->link,
} /* End inner switch */
case FT_REPARSE:
+ case FT_JUNCTION:
bfd->reparse_point = true;
/* Fall through wanted */
case FT_DIRBEGIN:
case FT_INVALIDFS:
case FT_INVALIDDT:
case FT_NOOPEN:
- case FT_REPARSE:
// return ff->file_save(jcr, ff, top_level);
/* These items can be filtered */
case FT_FIFO:
case FT_SPEC:
case FT_DIRNOCHG:
+ case FT_REPARSE:
+ case FT_JUNCTION:
if (accept_file(ff)) {
return ff->file_save(jcr, ff, top_level);
} else {
* if st_rdev is 2, it is a mount point
*/
#if defined(HAVE_WIN32)
+ /*
+ * A reparse point (WIN32_REPARSE_POINT)
+ * is something special like one of the following:
+ * IO_REPARSE_TAG_DFS 0x8000000A
+ * IO_REPARSE_TAG_DFSR 0x80000012
+ * IO_REPARSE_TAG_HSM 0xC0000004
+ * IO_REPARSE_TAG_HSM2 0x80000006
+ * IO_REPARSE_TAG_SIS 0x80000007
+ * IO_REPARSE_TAG_SYMLINK 0xA000000C
+ *
+ * A junction point is a:
+ * IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
+ * which can be either a link to a Volume (WIN32_MOUNT_POINT)
+ * or a link to a directory (WIN32_JUNCTION_POINT)
+ *
+ * Ignore WIN32_REPARSE_POINT and WIN32_JUNCTION_POINT
+ */
if (ff_pkt->statp.st_rdev == WIN32_REPARSE_POINT) {
ff_pkt->type = FT_REPARSE;
+ } else if (ff_pkt->statp.st_rdev == WIN32_JUNCTION_POINT) {
+ ff_pkt->type = FT_JUNCTION;
}
#endif
/*
* in the directory is seen (i.e. the FT_DIREND).
*/
rtn_stat = handle_file(jcr, ff_pkt, top_level);
- if (rtn_stat < 1 || ff_pkt->type == FT_REPARSE) { /* ignore or error status */
+ if (rtn_stat < 1 || ff_pkt->type == FT_REPARSE ||
+ ff_pkt->type == FT_JUNCTION) { /* ignore or error status */
free(link);
return rtn_stat;
}