X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Freparse.c;h=133603976f1bfc53d59e6b0e5bc0682f7ca49984;hp=84890c7e7f05b26f12e8bbeee304d7d7cb4167ed;hb=f9695b9f40035f1a20968293255761a8301eaba0;hpb=50ae56edcc3938f5183ddfc8910de2df5774eaf6 diff --git a/src/reparse.c b/src/reparse.c index 84890c7e..13360397 100644 --- a/src/reparse.c +++ b/src/reparse.c @@ -225,7 +225,7 @@ wim_inode_get_reparse_data(const struct wim_inode *inode, u8 *rpbuf) } /* Read the data from the WIM file */ - ret = read_full_resource_into_buf(lte, rpbuf + 8, true); + ret = read_full_resource_into_buf(lte, rpbuf + 8); if (ret) return ret; @@ -432,7 +432,8 @@ unix_get_ino_and_dev(const char *path, u64 *ino_ret, u64 *dev_ret) { struct stat stbuf; if (stat(path, &stbuf)) { - WARNING_WITH_ERRNO("Failed to stat \"%s\"", path); + if (errno != ENOENT) + WARNING_WITH_ERRNO("Failed to stat \"%s\"", path); /* Treat as a link pointing outside the capture root (it * most likely is). */ return WIMLIB_ERR_STAT; @@ -459,10 +460,17 @@ unix_get_ino_and_dev(const char *path, u64 *ino_ret, u64 *dev_ret) /* Fix up absolute symbolic link targets--- mostly shared between UNIX and * Windows */ tchar * -fixup_symlink(tchar *dest, u64 capture_root_ino, u64 capture_root_dev) +capture_fixup_absolute_symlink(tchar *dest, + u64 capture_root_ino, u64 capture_root_dev) { tchar *p = dest; +#ifdef __WIN32__ + /* Skip drive letter */ + if (!is_rp_path_separator(*dest)) + p += 2; +#endif + DEBUG("Fixing symlink or junction \"%"TS"\"", dest); for (;;) { tchar save; @@ -489,6 +497,13 @@ fixup_symlink(tchar *dest, u64 capture_root_ino, u64 capture_root_dev) *(p - 1) = RP_PATH_SEPARATOR; while (p - 1 >= dest && is_rp_path_separator(*(p - 1))) p--; + #ifdef __WIN32__ + if (!is_rp_path_separator(dest[0])) { + *--p = dest[1]; + *--p = dest[0]; + } + #endif + wimlib_assert(p >= dest); return p; }