-
- if (file_is_included(ff, fname) && !file_is_excluded(ff, fname)) {
- uint32_t LinkFI;
-
- decode_stat(ap, &statp, &LinkFI);
- /*
- * Prepend the where directory so that the
- * files are put where the user wants.
- *
- * We do a little jig here to handle Win32 files with
- * a drive letter -- we simply strip the drive: from
- * every filename if a prefix is supplied.
- */
- if (where[0] == 0) {
- strcpy(ofile, fname);
- strcpy(lname, lp);
- } else {
- char *fn;
- strcpy(ofile, where);
- if (win32_client && fname[1] == ':') {
- fn = fname+2; /* skip over drive: */
- } else {
- fn = fname; /* take whole name */
- }
- /* Ensure where is terminated with a slash */
- if (where[wherelen-1] != '/' && fn[0] != '/') {
- strcat(ofile, "/");
- }
- strcat(ofile, fn); /* copy rest of name */
- /* Fixup link name for hard links, but not for
- * soft links
- */
- if (type == FT_LNKSAVED) {
- if (lp[0] == '/') { /* if absolute path */
- strcpy(lname, where);
- }
- if (win32_client && lp[1] == ':') {
- strcat(lname, lp+2); /* copy rest of name */
- } else {
- strcat(lname, lp); /* On Unix systems we take everything */
- }
- }
- }
-
- /* Pmsg1(000, "Restoring: %s\n", ofile); */
-
- extract = FALSE;
- stat = create_file(jcr, fname, ofile, lname, type, stream,
- &statp, attribsEx, &bfd, REPLACE_ALWAYS, 0);
- switch (stat) {
- case CF_ERROR:
- case CF_SKIP:
- break;
- case CF_EXTRACT:
- extract = TRUE;
- print_ls_output(ofile, lname, type, &statp);
- num_files++;
- fileAddr = 0;
- break;
- case CF_CREATED:
- set_attributes(jcr, fname, ofile, lname, type, stream, &statp,
- attribsEx, &bfd);
- print_ls_output(ofile, lname, type, &statp);
- num_files++;
- fileAddr = 0;
- break;
- }
+ if (file_is_included(ff, attr->fname) && !file_is_excluded(ff, attr->fname)) {
+
+ attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
+ if (!is_restore_stream_supported(attr->data_stream)) {
+ if (!non_support_data++) {
+ Jmsg(jcr, M_ERROR, 0, _("%s stream not supported on this Client.\n"),
+ stream_to_ascii(attr->data_stream));
+ }
+ extract = false;
+ return true;
+ }
+
+ build_attr_output_fnames(jcr, attr);
+
+ if (attr->type == FT_DELETED) { /* TODO: choose the right fname/ofname */
+ Jmsg(jcr, M_INFO, 0, _("%s was deleted.\n"), attr->fname);
+ extract = false;
+ return true;
+ }
+
+ extract = false;
+ stat = create_file(jcr, attr, &bfd, REPLACE_ALWAYS);
+ switch (stat) {
+ case CF_ERROR:
+ case CF_SKIP:
+ break;
+ case CF_EXTRACT:
+ extract = true;
+ print_ls_output(jcr, attr);
+ num_files++;
+ fileAddr = 0;
+ break;
+ case CF_CREATED:
+ set_attributes(jcr, attr, &bfd);
+ print_ls_output(jcr, attr);
+ num_files++;
+ fileAddr = 0;
+ break;
+ }