/[packages]/updates/1/rpm/current/SOURCES/rpm-4.8.1-kill-libio.patch
ViewVC logotype

Diff of /updates/1/rpm/current/SOURCES/rpm-4.8.1-kill-libio.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

cauldron/rpm/current/SOURCES/rpm-4.9.x-kill-libio.patch revision 216258 by tv, Thu Jan 12 20:34:26 2012 UTC updates/1/rpm/current/SOURCES/rpm-4.8.1-kill-libio.patch revision 216262 by pterjan, Wed Feb 29 21:55:50 2012 UTC
# Line 7  The header reading IO has been hardwired Line 7  The header reading IO has been hardwired
7    
8  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.  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.
9    
10  diff --git a/lib/header.c b/lib/header.c  diff -up rpm-4.8.1/lib/header.c.0160 rpm-4.8.1/lib/header.c
11  index 8bea91a..06eb59e 100644  --- rpm-4.8.1/lib/header.c.0160 2012-02-29 22:46:17.717223536 +0100
12  --- a/lib/header.c  +++ rpm-4.8.1/lib/header.c      2012-02-29 22:46:17.727223566 +0100
13  +++ b/lib/header.c  @@ -962,8 +962,7 @@ Header headerRead(FD_t fd, enum hMagic m
 @@ -983,8 +983,7 @@ Header headerRead(FD_t fd, int magicp)  
14       if (magicp == HEADER_MAGIC_YES)       if (magicp == HEADER_MAGIC_YES)
15          i += 2;          i += 2;
16    
# Line 21  index 8bea91a..06eb59e 100644 Line 20  index 8bea91a..06eb59e 100644
20          goto exit;          goto exit;
21    
22       i = 0;       i = 0;
23  @@ -1010,8 +1009,7 @@ Header headerRead(FD_t fd, int magicp)  @@ -989,8 +988,7 @@ Header headerRead(FD_t fd, enum hMagic m
24       ei[1] = htonl(dl);       ei[1] = htonl(dl);
25       len -= sizeof(il) + sizeof(dl);       len -= sizeof(il) + sizeof(dl);
26    
# Line 31  index 8bea91a..06eb59e 100644 Line 30  index 8bea91a..06eb59e 100644
30          goto exit;          goto exit;
31            
32       h = headerLoad(ei);       h = headerLoad(ei);
33  diff --git a/lib/package.c b/lib/package.c  diff -up rpm-4.8.1/lib/package.c.0160 rpm-4.8.1/lib/package.c
34  index e1795dd..51fd20b 100644  --- rpm-4.8.1/lib/package.c.0160        2010-06-11 10:45:34.000000000 +0200
35  --- a/lib/package.c  +++ rpm-4.8.1/lib/package.c     2012-02-29 22:46:17.727223566 +0100
36  +++ b/lib/package.c  @@ -468,7 +468,7 @@ static rpmRC rpmpkgReadHeader(rpmKeyring
 @@ -468,7 +468,7 @@ static rpmRC rpmpkgReadHeader(rpmKeyring keyring, rpmVSFlags vsflags,  
37          *msg = NULL;          *msg = NULL;
38    
39       memset(block, 0, sizeof(block));       memset(block, 0, sizeof(block));
# Line 44  index e1795dd..51fd20b 100644 Line 42  index e1795dd..51fd20b 100644
42          rasprintf(&buf,          rasprintf(&buf,
43                  _("hdr size(%d): BAD, read returned %d\n"), (int)sizeof(block), xx);                  _("hdr size(%d): BAD, read returned %d\n"), (int)sizeof(block), xx);
44          goto exit;          goto exit;
45  @@ -494,7 +494,7 @@ static rpmRC rpmpkgReadHeader(rpmKeyring keyring, rpmVSFlags vsflags,  @@ -494,7 +494,7 @@ static rpmRC rpmpkgReadHeader(rpmKeyring
46       ei = xmalloc(uc);       ei = xmalloc(uc);
47       ei[0] = block[2];       ei[0] = block[2];
48       ei[1] = block[3];       ei[1] = block[3];
# Line 53  index e1795dd..51fd20b 100644 Line 51  index e1795dd..51fd20b 100644
51          rasprintf(&buf, _("hdr blob(%zd): BAD, read returned %d\n"), nb, xx);          rasprintf(&buf, _("hdr blob(%zd): BAD, read returned %d\n"), nb, xx);
52          goto exit;          goto exit;
53       }       }
54  diff --git a/lib/rpmlead.c b/lib/rpmlead.c  diff -up rpm-4.8.1/lib/rpmlead.c.0160 rpm-4.8.1/lib/rpmlead.c
55  index d41a413..101d3ff 100644  --- rpm-4.8.1/lib/rpmlead.c.0160        2010-06-11 10:45:34.000000000 +0200
56  --- a/lib/rpmlead.c  +++ rpm-4.8.1/lib/rpmlead.c     2012-02-29 22:46:17.727223566 +0100
57  +++ b/lib/rpmlead.c  @@ -117,8 +117,7 @@ rpmRC rpmLeadRead(FD_t fd, rpmlead lead)
 @@ -116,8 +116,7 @@ rpmRC rpmLeadRead(FD_t fd, rpmlead lead)  
58   {   {
59       assert(lead != NULL);       assert(lead != NULL);
60       memset(lead, 0, sizeof(*lead));       memset(lead, 0, sizeof(*lead));
# Line 67  index d41a413..101d3ff 100644 Line 64  index d41a413..101d3ff 100644
64          if (Ferror(fd)) {          if (Ferror(fd)) {
65              rpmlog(RPMLOG_ERR, _("read failed: %s (%d)\n"),              rpmlog(RPMLOG_ERR, _("read failed: %s (%d)\n"),
66                          Fstrerror(fd), errno);                          Fstrerror(fd), errno);
67  diff --git a/lib/signature.c b/lib/signature.c  diff -up rpm-4.8.1/lib/signature.c.0160 rpm-4.8.1/lib/signature.c
68  index 74d74a4..5fb4493 100644  --- rpm-4.8.1/lib/signature.c.0160      2009-12-07 15:36:49.000000000 +0100
69  --- a/lib/signature.c  +++ rpm-4.8.1/lib/signature.c   2012-02-29 22:46:17.727223566 +0100
70  +++ b/lib/signature.c  @@ -124,7 +124,7 @@ rpmRC rpmReadSignature(FD_t fd, Header *
 @@ -86,7 +86,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * sighp, sigType sig_type, char ** msg)  
71          goto exit;          goto exit;
72    
73       memset(block, 0, sizeof(block));       memset(block, 0, sizeof(block));
# Line 80  index 74d74a4..5fb4493 100644 Line 76  index 74d74a4..5fb4493 100644
76          rasprintf(&buf, _("sigh size(%d): BAD, read returned %d\n"),          rasprintf(&buf, _("sigh size(%d): BAD, read returned %d\n"),
77                    (int)sizeof(block), xx);                    (int)sizeof(block), xx);
78          goto exit;          goto exit;
79  @@ -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 *
80       ei[1] = block[3];       ei[1] = block[3];
81       pe = (entryInfo) &ei[2];       pe = (entryInfo) &ei[2];
82       dataStart = (unsigned char *) (pe + il);       dataStart = (unsigned char *) (pe + il);
# Line 89  index 74d74a4..5fb4493 100644 Line 85  index 74d74a4..5fb4493 100644
85          rasprintf(&buf,          rasprintf(&buf,
86                    _("sigh blob(%d): BAD, read returned %d\n"), (int)nb, xx);                    _("sigh blob(%d): BAD, read returned %d\n"), (int)nb, xx);
87          goto exit;          goto exit;
88  @@ -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 *
89          rpm_loff_t archSize = 0;          rpm_loff_t archSize = 0;
90    
91          /* Position at beginning of header. */          /* Position at beginning of header. */
# Line 98  index 74d74a4..5fb4493 100644 Line 94  index 74d74a4..5fb4493 100644
94              rasprintf(&buf,              rasprintf(&buf,
95                        _("sigh pad(%zd): BAD, read %zd bytes\n"), pad, trc);                        _("sigh pad(%zd): BAD, read %zd bytes\n"), pad, trc);
96              goto exit;              goto exit;
97  diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c  diff -up rpm-4.8.1/rpmio/rpmio.c.0160 rpm-4.8.1/rpmio/rpmio.c
98  index 2fbbf91..9614c55 100644  --- rpm-4.8.1/rpmio/rpmio.c.0160        2009-12-07 15:36:49.000000000 +0100
99  --- a/rpmio/rpmio.c  +++ rpm-4.8.1/rpmio/rpmio.c     2012-02-29 22:46:38.537284284 +0100
100  +++ b/rpmio/rpmio.c  @@ -5,9 +5,7 @@
101  @@ -16,9 +16,7 @@   #include "system.h"
102     #include <stdarg.h>
  #include "debug.h"  
103    
104  -#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)  -#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
105  -#define        _USE_LIBIO      1  -#define        _USE_LIBIO      1
106  -#endif  -#endif
107  +#define        _USE_LIBIO      0  +#define        _USE_LIBIO      0
108    
109   typedef struct _FDSTACK_s {   #include <rpm/rpmlog.h>
110       FDIO_t             io;   #include <rpm/rpmmacro.h>
111  @@ -653,7 +651,7 @@ static const FDIO_t ufdio = &ufdio_s ;  @@ -765,7 +763,7 @@ static const FDIO_t ufdio = &ufdio_s ;
112    
113   ssize_t timedRead(FD_t fd, void * bufptr, size_t length)   ssize_t timedRead(FD_t fd, void * bufptr, size_t length)
114   {   {

Legend:
Removed from v.216258  
changed lines
  Added in v.216262

  ViewVC Help
Powered by ViewVC 1.1.28