[Reproducible-commits] [dpkg] 14/37: dpkg: Detect non-regular file archive arguments earlier
Jérémy Bobbio
lunar at moszumanska.debian.org
Sun Jan 31 16:28:39 UTC 2016
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch pu/buildinfo
in repository dpkg.
commit 3456a88215ad7cd124f84da865a0a86b71ac96db
Author: Guillem Jover <guillem at debian.org>
Date: Tue Jan 26 12:25:55 2016 +0100
dpkg: Detect non-regular file archive arguments earlier
We cannot handle anything else that is not a regular file (excluding
symlinks to them), so detect this earlier and error out in such case.
---
debian/changelog | 1 +
src/archives.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 520e9ee..ccf285f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,7 @@ dpkg (1.18.5) UNRELEASED; urgency=medium
Closes: #809963
* Use ohshit() instead of internerr() for unhandled dpkg-split exit codes.
(i.e. do not abort). Closes: #812679
+ * Detect non-regular file archive arguments earlier in dpkg.
* Perl modules:
- Add new CTRL_REPO_RELEASE control block type to Dpkg::Control.
- Add new CTRL_COPYRIGHT_HEADER, CTRL_COPYRIGHT_FILES and
diff --git a/src/archives.c b/src/archives.c
index 391b101..03f828d 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -1512,6 +1512,10 @@ archivefiles(const char *const *argv)
/* We need the filename to exist. */
if (stat(argp[i], &st) < 0)
ohshite(_("cannot access archive '%s'"), argp[i]);
+
+ /* We cannot work with anything that is not a regular file. */
+ if (!S_ISREG(st.st_mode))
+ ohshit(_("archive '%s' is not a regular file"), argp[i]);
}
currenttime = time(NULL);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list