summaryrefslogtreecommitdiff
path: root/rpm2cpio.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix Header leak when running rpm2cpioxujing2022-12-081-1/+1
| | | | | | Header "h" is alloced in rpmReadPackageFile but not freed when running rpm2cpio. Fix it. Remove redundant whitespace between the Fclose()'s too while at it for logical cleanup grouping.
* Include rpmpgp.h only where it is actually neededJustus Winter2021-11-171-1/+1
| | | | | Include necessary headers that were previously transitively included by including rpmpgp.h.
* rpm2cpio cannot handle files over 4GB, error out cleanly (RhBug:1662481)Panu Matilainen2019-01-021-0/+5
|
* Use new RPMVSF_MASK_* constantsFlorian Festi2018-06-051-2/+2
|
* rpm2cpio and rpm2archive: don't write archive data to a terminal.Peter Jones2017-01-261-0/+5
| | | | | | | | | | | | rpm2cpio and rpm2archive happily write binary data to the output terminal. This happens, for example, when I'm typing a command such as "rpm2cpio foo.rpm | less" and I make a typo, hitting <Return> instead of the pipe key. This often results in hilarious (if bewildering) font and character encoding changes. On some systems, this can even result in installation of relatively arbitrary rpms! Nobody has ever meant to do this, and it's easy to prevent, so that's what this patch does.
* Reimplement setprogname() and getprogname() to be generic and portableKamil Rytarowski2016-02-111-2/+2
| | | | | | | | | | | | | | | | | The RPM code contains setprogname()/getprogname() support implemented through compatiblity layer with very old GLIBC (internals supported back to '95 and earlier), before stabilization of the GNU C library. This compatiblity layer (__progname, __assert_progname, setprogname()) is supposed to support well archaic GLIBC, but on the other hand it pollutes the library namespace and introduces unpredicable compillation errors on BSD systems. The functions setprogname() and getprogname() are natively supported in NetBSD and work the same way as __progname from the GNU C library (they are even implemented in the same way - but with a slightly changed logic). The support for very old (20 years and older) GNU C Library is obfuscating the code, because it uses defines over defines without a word of explaination why to do so. It's important to note that the setprogname()/getprogname() was inconstiently implemented in the codebase, duplicating the code and/or functionality. Add new generic functions getprogname() and setprogname() and bind it to: - the current and for two decades stable GNU LIB C implementation, - the current NetBSD implementation (introduces to NetBSD in 2002), - fallback reimplementation functions of the setprogname() and getprogname() functionality for other systems. Don't support anymore old GNU Lib C internals and don't support older NetBSD systems, as they aren't supported for many years. Add to the codebase comments explaining the relevant codeparts.
* Make rpm2cpio exit code accurate for large packages and partial copyPanu Matilainen2012-03-141-3/+5
| | | | | | | - Grab the uncompressed payload size from header and compare number of bytes copied to that for exit code. Previously, truncated payloads could have returned with success. This also fixes the exit code for large payloads (RhBug:790396)
* Fix up bunch of silly int vs rpmRC return code mismatchesPanu Matilainen2010-09-211-1/+1
|
* Initialize rpm earlier in rpm2cpio (RhBug:523260)Panu Matilainen2009-09-151-1/+1
| | | | - url retrieval requires macros to be loaded
* Take advantage of new header string gettersPanu Matilainen2009-09-021-6/+1
|
* Replace equal/not equal uses of str[n]cmp() with rstreq[n] in binariesPanu Matilainen2009-08-311-1/+1
|
* Eliminate now unnecessary compressor -> ioflags conversionsPanu Matilainen2009-08-311-14/+6
|
* Kill off lclint remnants everywherePanu Matilainen2009-07-231-1/+0
| | | | - remove ancient and likely irrelevant LCL comments and bogus NULL checks
* Add -h/--help to rpm2cpio (ticket #63)Panu Matilainen2009-06-181-1/+6
| | | | - patch originally from Debian, with slight adjustments to indentation
* Add support for "lzma alone" compression format (lzdio)Panu Matilainen2009-03-181-0/+2
| | | | | | | | | | | | - "lzma alone" is superseeded by XZ but it's used by Suse and Mandriva distros so it's nice to have as it doesn't need much, only open differs from XZ - rpmlib() dependency versions are an uuuuuuuugly mess here: Suse used "PayloadIsLzma = 4.4.2-1" so that's what we provide to be most compatible (hopefully). Built packages require "PayloadIsLzma <= 4.4.6-1" however to be compatible with Mandriva 2008.0. Did I already say it's ugly? - Based on similar patch in Mandriva by Per Øyvind Karlsen, but avoiding unnecessary renames in rpmio
* LZMA -> XZ renamingPanu Matilainen2009-03-181-2/+2
| | | | | | | | | | - what we support now in payloads is XZ, not the former LZMA format, rename user- and header-visible parts to match this - rpmlib(PayloadIsXz) dependency versioned 5.2-1 to avoid unnecessary incompatibility with what rpm5 has and what Mandriva is already using - only provide the rpmlib dependency if actually built with xz support - rpmFileIsCompressed() attempts to guess the magicless old lzma format by file suffix, so it can handle both right now
* Convert rpm2cpio to new headerGet()Panu Matilainen2008-05-261-2/+6
|
* Handle lzma payloadJindrich Novy2008-04-221-0/+2
|
* Call rpmReadConfigFiles() in rpm2cpio so that rpm2cpio won't complain like:Jindrich Novy2008-04-101-0/+1
| | | | | warning: Unknown system: (null) warning: Please contact rpm-maint@lists.rpm.org
* Don't use stack allocations in rpm2cpio when not neededJindrich Novy2008-04-091-5/+2
|
* rpmlib.h mass evictionPanu Matilainen2008-01-301-1/+3
| | | | | - explicitly include what's really needed instead - document remaining uses
* Add rpm_data_t (and _constdata_t) for header data, use everywherePanu Matilainen2007-12-191-1/+1
| | | | | - consistent, easy to grep for and change... - bogus consts removed where spotted
* Switch to <rpm/foo.h> style for public headersPanu Matilainen2007-12-081-3/+3
| | | | - adjust include paths accordingly
* Use #include <x.h> syntax to include public headers.Ralf Corsépius2007-11-231-3/+3
|
* Include "rpmts.h" instead of <rpmts.h>.Ralf Corsépius2007-10-281-1/+1
|
* Include "rpmlib.h" instead of <rpmlib.h>.Ralf Corsépius2007-10-281-1/+1
|
* Include "rpmpgp.h" instead of <rpmpgp.h>.Ralf Corsépius2007-10-281-1/+1
|
* Include rpmts.h instead of depends.c.Ralf Corsépius2007-10-041-1/+1
|
* Change main() to using char *argv[].Ralf Corsépius2007-09-181-1/+1
|
* Remove splint tags.Ralf Corsépius2007-09-111-2/+1
|
* Build on macosx.jbj2005-01-171-0/+1
| | | | | | CVS patchset: 7701 CVS date: 2005/01/17 23:58:09
* - merge signature returns into rpmRC.jbj2002-08-231-2/+2
| | | | | | | | - python: exceptions on NOKEY/NOTTRUSTED. CVS patchset: 5667 CVS date: 2002/08/23 21:01:59
* - add bitmask for precise control of signature/digest verification.jbj2002-08-061-5/+5
| | | | | | CVS patchset: 5604 CVS date: 2002/08/06 01:41:44
* - fix: --repackage repaired (#67217).jbj2002-07-251-0/+7
| | | | | | | | - fix: rpm2cpio disables signature checks (i.e. same behavior). CVS patchset: 5574 CVS date: 2002/07/25 23:36:32
* - Grand Renaming of rpm data types.jbj2002-05-191-1/+1
| | | | | | CVS patchset: 5439 CVS date: 2002/05/19 18:42:25
* - opaque (well mostly) rpmTransactionSet using methods.jbj2002-05-161-2/+2
| | | | | | CVS patchset: 5437 CVS date: 2002/05/16 16:55:21
* Add toy db->associate, db->join, dbcursor->c_pget wrappers.jbj2002-05-041-1/+1
| | | | | | CVS patchset: 5421 CVS date: 2002/05/04 20:13:14
* - legacy signatures always checked where possible on package read.jbj2001-10-271-10/+2
| | | | | | | | | | | - wire transactions through rpmcli build modes. - lazy rpmdb open/close through transaction methods (mostly anyways). - no-brainer refcounts for rpmdb object. - check added header against transaction set, replace if newer. CVS patchset: 5135 CVS date: 2001/10/27 20:09:20
* - wire transactions through rpmcli install/erase modes.jbj2001-10-261-5/+28
| | | | | | | | - legacy signatures always checked on package read. CVS patchset: 5134 CVS date: 2001/10/26 04:16:19
* Sync with rpm-4_0 branch.jbj2001-06-171-21/+5
| | | | | | CVS patchset: 4876 CVS date: 2001/06/17 22:18:03
* Sync with rpm-4_0 branch.jbj2000-12-121-0/+1
| | | | | | CVS patchset: 4338 CVS date: 2000/12/12 20:03:45
* Bring header reggions mods back to top of stack.jbj2000-12-021-1/+1
| | | | | | CVS patchset: 4305 CVS date: 2000/12/02 21:53:44
* - support for separate source/binary compression policy.jbj2000-06-231-1/+17
| | | | | | | | - support for bzip payloads. CVS patchset: 3908 CVS date: 2000/06/23 01:19:45
* lib/rpmio.c: Implement per-fd layers as a stack, add fdPush/fdPop.jbj1999-11-141-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | lib/rpmio.c: Add fd{Get,Set}{Io,Fp,Fdno} abstraction wrappers. lib/rpmio.c: Start rationalizing debug output by using fdbg to display the fd layer stack. rpm.c: Add --nolibio to disable libio if desired. rpm2cpio.c: Use Fdopen(..., gzdio) and ufdCopy(). build/build.c: Use Fdopen(..., fpio) rather than fdio. build/files.c: Use Fdopen(..., fpio) rather than ufdio. build/parseSpec.c: ditto. lib/macro.c: ditto. lib/rpmrc.c: ditto lib/macro.c: Use Fopen(..., ufdio) in isCompressed() rather that fdOpen(). lib/misc.c: ditto. lib/misc.c: Avoid fstat by using Stat. build/pack.c: Add persist fdLink() and use fdFree() in package{Sources,Binaries} build/pack.c: Try to remove the fdDup before cpioBuildArchive() call. build/pack.c: Use rpmGenPath with %{_builddir}. build/parsePreamble.c: Use fdSize rather than Stat to get icon file size. lib/rpmrc.c: ditto lib/ftp.c: start capturing ufdio layer syserrno/errcookie. CVS patchset: 3424 CVS date: 1999/11/14 19:15:18
* Swap 2nd and 3rd arg to Fread/Fwrite to preserve read/write type return.jbj1999-11-101-3/+3
| | | | | | | | | | | Use Fstrerror to retrieve fd->syserrno. Make ftpFileDoneNeeded per-fd rather than per-url. Make data fd unique rather than per-url. Use appropriate protocol commands for ufdio writing. CVS patchset: 3421 CVS date: 1999/11/10 22:09:49
* Use Fopen almost everywhere.jbj1999-11-041-1/+1
| | | | | | | | | | | | | | | Rip out --enable-bzip2-payload, we'll use Fopen w macros instead. Work out ref counting for ftpControl so that control channel is persistent. build/build.c: Use fpio to write build stage script. parseSpec.c: Rework include stack to use FD_t, not FILE *. tread.c: Delete, use ufdio->read instead. rpmio.c: Filter out fdio fd == NULL assertion failures. rpmrc.c: Don't fail if HOME is not environment. rpmrc.c: Rework ufdio FTP rcfile I/O to be more similar to stdio. CVS patchset: 3417 CVS date: 1999/11/04 21:26:08
* First use of libio.jbj1999-11-031-0/+4
| | | | | | CVS patchset: 3416 CVS date: 1999/11/03 20:33:53
* Add ref/deref/new/fileno/open vectors to FDIO_t.jbj1999-11-021-1/+1
| | | | | | | | | | | | | Hide fdOpen/ufdOpen, use {fdio,ufdio}->open throughout. url.c: Create ref counted abstract urlinfo type with debugging. url.c: Rename functions to urlNew/urlFree/urlFreeCache for consistency. rpmio.c: Create ref counted abstract FD_t type with debugging. rpmio.c: Create private struct _FD_s type. cpio.c: Create fd[GS]etCpioPos to preserve FD_t abstraction. CVS patchset: 3414 CVS date: 1999/11/02 14:33:14
* Make fdFileno() static, use Fileno()/Ferror() analogues throughout.jbj1999-10-301-1/+1
| | | | | | | | | | | | | Make ufdClose() static, use Fclose() with ufdio cookie throughout. rpm.c: Clean urlinfoCache and rpmBuildArgs leaks. url.c: urlIsURL() should be here, not in rpmio.c. url.c: Preserve FD_t abstraction by creating ufdGetUrlinfo(). url.c: Create freeUrlinfoCache(). rpmio.c: Create ufdio cookie. CVS patchset: 3407 CVS date: 1999/10/30 16:43:29
* fix: resurrect multiple target platform builds.jbj1999-10-291-1/+1
| | | | | | CVS patchset: 3404 CVS date: 1999/10/29 23:03:12