This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=2504bba21563f396d8c86d61899ceed080bd0a86 commit 2504bba21563f396d8c86d61899ceed080bd0a86 Author: Guillem Jover <[email protected]> AuthorDate: Tue Feb 14 23:43:57 2023 +0100 dpkg: Remove path_quote_filename() usage The original problem for which this function was introduced in commit 520ad3054094d91201089bf97cf3e73266b6e879, is no longer relevant since commit 1a8d12285d650fa4bb13406a515228030d4d9ca1 where the varbuf function doing vprintf was fixed to not loop infinitely. Changes in commit 520ad3054094d91201089bf97cf3e73266b6e879, further changed the code to not even pass the filenames to fd_fd_copy() anymore, and instead call the ohshit() functions from the call sites. We leave the function around for now, if this ends up not being useful for anything it will be eventually removed. Warned-by: cppcheck Changelog: internal --- src/main/archives.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/archives.c b/src/main/archives.c index 5618c1a12..02a088fd1 100644 --- a/src/main/archives.c +++ b/src/main/archives.c @@ -297,11 +297,10 @@ tarobject_skip_entry(struct tarcontext *tc, struct tar_entry *ti) * file data and set it to oblivion. */ if (ti->type == TAR_FILETYPE_FILE) { struct dpkg_error err; - char fnamebuf[256]; if (fd_skip(tc->backendpipe, ti->size, &err) < 0) ohshit(_("cannot skip file '%.255s' (replaced or excluded?) from pipe: %s"), - path_quote_filename(fnamebuf, ti->name, 256), err.str); + ti->name, err.str); tarobject_skip_padding(tc, ti); } } @@ -354,8 +353,6 @@ tarobject_extract(struct tarcontext *tc, struct tar_entry *te, struct dpkg_error err; struct fsys_namenode *linknode; - char fnamebuf[256]; - char fnamenewbuf[256]; char *newhash; int rc; @@ -379,8 +376,7 @@ tarobject_extract(struct tarcontext *tc, struct tar_entry *te, newhash = nfmalloc(MD5HASHLEN + 1); if (fd_fd_copy_and_md5(tc->backendpipe, fd, newhash, te->size, &err) < 0) ohshit(_("cannot copy extracted data for '%.255s' to '%.255s': %s"), - path_quote_filename(fnamebuf, te->name, 256), - path_quote_filename(fnamenewbuf, fnamenewvb.buf, 256), err.str); + te->name, fnamenewvb.buf, err.str); namenode->newhash = newhash; debug(dbg_eachfiledetail, "tarobject file digest=%s", namenode->newhash); @@ -460,13 +456,12 @@ tarobject_hash(struct tarcontext *tc, struct tar_entry *te, { if (te->type == TAR_FILETYPE_FILE) { struct dpkg_error err; - char fnamebuf[256]; char *newhash; newhash = nfmalloc(MD5HASHLEN + 1); if (fd_md5(tc->backendpipe, newhash, te->size, &err) < 0) ohshit(_("cannot compute MD5 digest for file '%.255s' in tar archive: %s"), - path_quote_filename(fnamebuf, te->name, 256), err.str); + te->name, err.str); tarobject_skip_padding(tc, te); namenode->newhash = newhash; -- Dpkg.Org's dpkg

