--- cauldron/rpm/current/SOURCES/rpm-4.9.x-kill-libio.patch 2012/02/29 21:36:50 216258 +++ updates/1/rpm/current/SOURCES/rpm-4.8.1-kill-libio.patch 2012/02/29 21:55:50 216262 @@ -7,11 +7,10 @@ The attached patch makes my previous code snippet to read headers directly from compressed stream work on rpm-4.9.x too. It's essentially commit 3ab3a931b4dd84eedcb35229187e5be8d14f9418 from master + unconditionally disable libio usage. Rpm itself should be ok with this change as is (at least the test-suite still passes) but I can't guarantee it wont break anything else in your setup. Eg if you have code that's tuned to the exact semantics it had before... but then again it might just as well fix some "mysteriously broken things" for you. -diff --git a/lib/header.c b/lib/header.c -index 8bea91a..06eb59e 100644 ---- a/lib/header.c -+++ b/lib/header.c -@@ -983,8 +983,7 @@ Header headerRead(FD_t fd, int magicp) +diff -up rpm-4.8.1/lib/header.c.0160 rpm-4.8.1/lib/header.c +--- rpm-4.8.1/lib/header.c.0160 2012-02-29 22:46:17.717223536 +0100 ++++ rpm-4.8.1/lib/header.c 2012-02-29 22:46:17.727223566 +0100 +@@ -962,8 +962,7 @@ Header headerRead(FD_t fd, enum hMagic m if (magicp == HEADER_MAGIC_YES) i += 2; @@ -21,7 +20,7 @@ goto exit; i = 0; -@@ -1010,8 +1009,7 @@ Header headerRead(FD_t fd, int magicp) +@@ -989,8 +988,7 @@ Header headerRead(FD_t fd, enum hMagic m ei[1] = htonl(dl); len -= sizeof(il) + sizeof(dl); @@ -31,11 +30,10 @@ goto exit; h = headerLoad(ei); -diff --git a/lib/package.c b/lib/package.c -index e1795dd..51fd20b 100644 ---- a/lib/package.c -+++ b/lib/package.c -@@ -468,7 +468,7 @@ static rpmRC rpmpkgReadHeader(rpmKeyring keyring, rpmVSFlags vsflags, +diff -up rpm-4.8.1/lib/package.c.0160 rpm-4.8.1/lib/package.c +--- rpm-4.8.1/lib/package.c.0160 2010-06-11 10:45:34.000000000 +0200 ++++ rpm-4.8.1/lib/package.c 2012-02-29 22:46:17.727223566 +0100 +@@ -468,7 +468,7 @@ static rpmRC rpmpkgReadHeader(rpmKeyring *msg = NULL; memset(block, 0, sizeof(block)); @@ -44,7 +42,7 @@ rasprintf(&buf, _("hdr size(%d): BAD, read returned %d\n"), (int)sizeof(block), xx); goto exit; -@@ -494,7 +494,7 @@ static rpmRC rpmpkgReadHeader(rpmKeyring keyring, rpmVSFlags vsflags, +@@ -494,7 +494,7 @@ static rpmRC rpmpkgReadHeader(rpmKeyring ei = xmalloc(uc); ei[0] = block[2]; ei[1] = block[3]; @@ -53,11 +51,10 @@ rasprintf(&buf, _("hdr blob(%zd): BAD, read returned %d\n"), nb, xx); goto exit; } -diff --git a/lib/rpmlead.c b/lib/rpmlead.c -index d41a413..101d3ff 100644 ---- a/lib/rpmlead.c -+++ b/lib/rpmlead.c -@@ -116,8 +116,7 @@ rpmRC rpmLeadRead(FD_t fd, rpmlead lead) +diff -up rpm-4.8.1/lib/rpmlead.c.0160 rpm-4.8.1/lib/rpmlead.c +--- rpm-4.8.1/lib/rpmlead.c.0160 2010-06-11 10:45:34.000000000 +0200 ++++ rpm-4.8.1/lib/rpmlead.c 2012-02-29 22:46:17.727223566 +0100 +@@ -117,8 +117,7 @@ rpmRC rpmLeadRead(FD_t fd, rpmlead lead) { assert(lead != NULL); memset(lead, 0, sizeof(*lead)); @@ -67,11 +64,10 @@ if (Ferror(fd)) { rpmlog(RPMLOG_ERR, _("read failed: %s (%d)\n"), Fstrerror(fd), errno); -diff --git a/lib/signature.c b/lib/signature.c -index 74d74a4..5fb4493 100644 ---- a/lib/signature.c -+++ b/lib/signature.c -@@ -86,7 +86,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * sighp, sigType sig_type, char ** msg) +diff -up rpm-4.8.1/lib/signature.c.0160 rpm-4.8.1/lib/signature.c +--- rpm-4.8.1/lib/signature.c.0160 2009-12-07 15:36:49.000000000 +0100 ++++ rpm-4.8.1/lib/signature.c 2012-02-29 22:46:17.727223566 +0100 +@@ -124,7 +124,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * goto exit; memset(block, 0, sizeof(block)); @@ -80,7 +76,7 @@ rasprintf(&buf, _("sigh size(%d): BAD, read returned %d\n"), (int)sizeof(block), xx); goto exit; -@@ -117,7 +117,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * sighp, sigType sig_type, char ** msg) +@@ -155,7 +155,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * ei[1] = block[3]; pe = (entryInfo) &ei[2]; dataStart = (unsigned char *) (pe + il); @@ -89,7 +85,7 @@ rasprintf(&buf, _("sigh blob(%d): BAD, read returned %d\n"), (int)nb, xx); goto exit; -@@ -206,7 +206,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * sighp, sigType sig_type, char ** msg) +@@ -244,7 +244,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * rpm_loff_t archSize = 0; /* Position at beginning of header. */ @@ -98,22 +94,21 @@ rasprintf(&buf, _("sigh pad(%zd): BAD, read %zd bytes\n"), pad, trc); goto exit; -diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c -index 2fbbf91..9614c55 100644 ---- a/rpmio/rpmio.c -+++ b/rpmio/rpmio.c -@@ -16,9 +16,7 @@ - - #include "debug.h" +diff -up rpm-4.8.1/rpmio/rpmio.c.0160 rpm-4.8.1/rpmio/rpmio.c +--- rpm-4.8.1/rpmio/rpmio.c.0160 2009-12-07 15:36:49.000000000 +0100 ++++ rpm-4.8.1/rpmio/rpmio.c 2012-02-29 22:46:38.537284284 +0100 +@@ -5,9 +5,7 @@ + #include "system.h" + #include -#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION) -#define _USE_LIBIO 1 -#endif +#define _USE_LIBIO 0 - typedef struct _FDSTACK_s { - FDIO_t io; -@@ -653,7 +651,7 @@ static const FDIO_t ufdio = &ufdio_s ; + #include + #include +@@ -765,7 +763,7 @@ static const FDIO_t ufdio = &ufdio_s ; ssize_t timedRead(FD_t fd, void * bufptr, size_t length) {