From 8c2fbf8ae771c66c20e664155f0a34fb44cbe6ee Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 28 Apr 2013 17:11:00 -0500 Subject: [PATCH] wimlib_print_wim_information(): Print RPFIX status --- src/win32.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/win32.c b/src/win32.c index b6e28e75..0fd7508a 100644 --- a/src/win32.c +++ b/src/win32.c @@ -700,7 +700,8 @@ win32_capture_maybe_rpfix_target(wchar_t *target, u16 *target_nbytes_p, * failure. */ static int win32_capture_try_rpfix(u8 *rpbuf, u16 *rpbuflen_p, - u64 capture_root_ino, u64 capture_root_dev) + u64 capture_root_ino, u64 capture_root_dev, + const wchar_t *path) { struct reparse_data rpdata; DWORD rpbuflen; @@ -738,6 +739,19 @@ win32_capture_try_rpfix(u8 *rpbuf, u16 *rpbuflen_p, else ret = -ret; } else { + if (ret == RP_EXCLUDED) { + 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); + } ret = rp_status; } return ret; @@ -805,7 +819,8 @@ win32_get_reparse_data(HANDLE hFile, const wchar_t *path, ret = win32_capture_try_rpfix(rpbuf, &rpbuflen, params->capture_root_ino, - params->capture_root_dev); + params->capture_root_dev, + path); } else { ret = RP_NOT_FIXED; } -- 2.43.0