diff options
author | Guillem Jover <guillem@debian.org> | 2013-08-09 03:23:20 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-08-10 20:08:57 +0200 |
commit | cb8ed03bbffe892165620ed1ddf753a6b0c1ee62 (patch) | |
tree | ee986d1c7143fce2de20ff09d844bdfdb5427e91 /dpkg-deb | |
parent | 66cc4f78373a472471f09392feaee948ff3a7346 (diff) | |
download | dpkg-cb8ed03bbffe892165620ed1ddf753a6b0c1ee62.tar.gz |
dpkg-deb: Be more precise on deb member errors
Print a message when we've found the data member but do not know the
compression, and another one when there's an unknown member before the
data member.
This also stops resetting adminmember to -1 as a temporary sentinel,
so that we don't lose previous state.
Diffstat (limited to 'dpkg-deb')
-rw-r--r-- | dpkg-deb/extract.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c index c90863a3c..60fff76b9 100644 --- a/dpkg-deb/extract.c +++ b/dpkg-deb/extract.c @@ -181,18 +181,20 @@ extracthalf(const char *debar, const char *dir, if (strncmp(arh.ar_name, ADMINMEMBER, sizeof(arh.ar_name)) == 0) adminmember = 1; else { - adminmember = -1; - if (strncmp(arh.ar_name, DATAMEMBER, strlen(DATAMEMBER)) == 0) { const char *extension = arh.ar_name + strlen(DATAMEMBER); adminmember= 0; decompressor = compressor_find_by_extension(extension); - } - - if (adminmember == -1 || decompressor == compressor_type_unknown) - ohshit(_("archive '%.250s' contains not understood data member %.*s, giving up"), - debar, (int)sizeof(arh.ar_name), arh.ar_name); + if (decompressor == compressor_type_unknown) + ohshit(_("archive '%s' uses unknown compression for member '%.*s', " + "giving up"), + debar, (int)sizeof(arh.ar_name), arh.ar_name); + } else { + ohshit(_("archive '%s' has premature member '%.*s' before '%s', " + "giving up"), + debar, (int)sizeof(arh.ar_name), arh.ar_name, DATAMEMBER); + } } if (adminmember == 1) { if (ctrllennum != 0) |