mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 09:21:53 -05:00
Check for errors on descfile extraction
If /tmp was full during the early stages of package extraction, we were unable to extract the package description file with the call to archive_read_data_into_fd(archive, fd) becuase we never checked the return code. Add a check to ensure the extraction was successful and print and return an error if it was not instead of falling through to a possibly untrue error message. This should fix FS #8885. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
20bad3b839
commit
ce424a356f
@ -1032,7 +1032,11 @@ pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full)
|
||||
/* extract this file into /tmp. it has info for us */
|
||||
descfile = strdup("/tmp/alpm_XXXXXX");
|
||||
fd = mkstemp(descfile);
|
||||
archive_read_data_into_fd(archive, fd);
|
||||
if(archive_read_data_into_fd(archive, fd) != ARCHIVE_OK) {
|
||||
_alpm_log(PM_LOG_ERROR, _("error extracting package description file to %s\n"),
|
||||
descfile);
|
||||
goto pkg_invalid;
|
||||
}
|
||||
/* parse the info file */
|
||||
if(parse_descfile(descfile, info) == -1) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not parse package description file in %s\n"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user