]> wimlib.net Git - wimlib/blobdiff - src/win32_capture.c
Expose symlink exclusions through WIMLIB_PROGRESS_MSG_SCAN_DENTRY messages
[wimlib] / src / win32_capture.c
index 20a86b5d3e9cd84ab877e2a9d7fc7dfe4e53e97c..6f29828c842a95d70e7aea9a0df66cd7a06a3375 100644 (file)
@@ -621,7 +621,7 @@ win32_capture_maybe_rpfix_target(wchar_t *target, u16 *target_nbytes_p,
 static int
 win32_capture_try_rpfix(u8 *rpbuf, u16 *rpbuflen_p,
                        u64 capture_root_ino, u64 capture_root_dev,
-                       const wchar_t *path)
+                       const wchar_t *path, struct add_image_params *params)
 {
        struct reparse_data rpdata;
        int ret;
@@ -658,17 +658,18 @@ win32_capture_try_rpfix(u8 *rpbuf, u16 *rpbuflen_p,
                        ret = -ret;
        } else {
                if (rp_status == RP_EXCLUDED) {
+                       /* Ignoring absolute symbolic link or junction point
+                        * that points out of the tree to be captured.  */
                        size_t print_name_nchars = rpdata.print_name_nbytes / 2;
                        wchar_t print_name0[print_name_nchars + 1];
                        print_name0[print_name_nchars] = L'\0';
                        wmemcpy(print_name0, rpdata.print_name, print_name_nchars);
-                       WARNING("Ignoring %ls pointing out of capture directory:\n"
-                               "          \"%ls\" -> \"%ls\"\n"
-                               "          (Use --norpfix to capture all symbolic links "
-                               "and junction points as-is)",
-                               (rpdata.rptag == WIM_IO_REPARSE_TAG_SYMLINK) ?
-                                       L"absolute symbolic link" : L"junction point",
-                               path, print_name0);
+
+                       params->progress.scan.cur_path = path;
+                       params->progress.scan.symlink_target = print_name0;
+                       do_capture_progress(params,
+                                           WIMLIB_SCAN_DENTRY_EXCLUDED_SYMLINK,
+                                           NULL);
                }
                ret = rp_status;
        }
@@ -737,7 +738,8 @@ win32_get_reparse_data(HANDLE hFile, const wchar_t *path,
                                              &rpbuflen,
                                              params->capture_root_ino,
                                              params->capture_root_dev,
-                                             path);
+                                             path,
+                                             params);
        } else {
                ret = RP_NOT_FIXED;
        }
@@ -1202,7 +1204,7 @@ again:
                        not_rpfixed = 0;
                } else if (ret == RP_EXCLUDED) {
                        ret = 0;
-                       goto out_progress;
+                       goto out;
                } else {
                        not_rpfixed = 1;
                }