From 7453f4a4245219a9c01a70902283f6ebb2a65123 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 24 Jun 2016 19:41:24 -0500 Subject: [PATCH] unix_capture.c: add error messages for invalid UTF-8 --- src/unix_capture.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/unix_capture.c b/src/unix_capture.c index a909f45b..eed38f62 100644 --- a/src/unix_capture.c +++ b/src/unix_capture.c @@ -320,8 +320,13 @@ unix_scan_symlink(const char *full_path, int dirfd, const char *relpath, /* Translate the UNIX symlink target into a Windows reparse point. */ ret = wim_inode_set_symlink(inode, target, params->blob_table); - if (ret) + if (unlikely(ret)) { + if (ret == WIMLIB_ERR_INVALID_UTF8_STRING) { + ERROR("\"%s\": target of symbolic link is not valid " + "UTF-8. This is not supported.", full_path); + } return ret; + } /* On Windows, a reparse point can be set on both directory and * non-directory files. Usually, a link that is intended to point to a @@ -389,8 +394,13 @@ unix_build_dentry_tree_recursive(struct wim_dentry **tree_ret, ret = inode_table_new_dentry(params->inode_table, relpath, stbuf.st_ino, stbuf.st_dev, false, &tree); - if (ret) + if (unlikely(ret)) { + if (ret == WIMLIB_ERR_INVALID_UTF8_STRING) { + ERROR("\"%s\": filename is not valid UTF-8. " + "This is not supported.", full_path); + } goto out; + } inode = tree->d_inode; -- 2.43.0