Merge branch '3064_crash_rpm_with_tar'

* 3064_crash_rpm_with_tar:
  Support tar payload of rpm.
  Ticket #3064: crash in case of incorrect cpio content within rpm.
This commit is contained in:
Andrew Borodin 2013-09-14 10:25:02 +04:00
commit d6cd226c44
2 changed files with 7 additions and 2 deletions

View File

@ -737,6 +737,8 @@ cpio_open_archive (struct vfs_s_super *super, const vfs_path_t * vpath,
ssize_t status;
status = cpio_read_head (vpath_element->class, super);
if (status < 0)
return (-1);
switch (status)
{

View File

@ -23,6 +23,8 @@
# 2009: Totally rewritten.
# Alexander Chumachenko <ledest@gmail.com>
# 2013: add dependency version output
# Denis Silakov <denis.silakov@rosalab.ru>
# 2013: tar payload support.
#
# This file is part of the Midnight Commander.
#
@ -197,6 +199,7 @@ mcrpmfs_list ()
exit 1
}
DATE=`mcrpmfs_getRawOneTag "%{BUILDTIME:date}\n" | cut -c 5-11,21-24`
PAYLOAD=`mcrpmfs_getRawOneTag "%{PAYLOADFORMAT}\n" | sed s/ustar/tar/`
HEADERSIZE=`echo "$DESC" | wc -c`
printf '%s %s %s HEADER\n' "${FILEPREF}" "${HEADERSIZE}" "${DATE}"
@ -226,7 +229,7 @@ mcrpmfs_list ()
mcrpmfs_list_fastRPM
fi
echo "$FILEPREF 0 $DATE CONTENTS.cpio"
echo "$FILEPREF 0 $DATE CONTENTS.$PAYLOAD"
}
mcrpmfs_copyout ()
@ -280,7 +283,7 @@ mcrpmfs_copyout ()
INFO/SIZE) mcrpmfs_getRawOneTag "%{SIZE} bytes\n" > "$2"; exit 0;;
INFO/OBSOLETES) mcrpmfs_getRawOneTag "[%{OBSOLETENAME} %|OBSOLETEFLAGS?{%{OBSOLETEFLAGS:depflags} %{OBSOLETEVERSION}}:{}|\n]" > "$2"; exit 0;;
INFO/CONFLICTS) mcrpmfs_getRawOneTag "[%{CONFLICTNAME} %{CONFLICTFLAGS:depflags} %{CONFLICTVERSION}\n]" >"$2"; exit 0;;
CONTENTS.cpio) $RPM2CPIO "${rpm_filename}" > "$2"; exit 0;;
CONTENTS.*) $RPM2CPIO "${rpm_filename}" > "$2"; exit 0;;
*)
;;
esac