0 length files are bad only if the files are regular ones -- it may be
authorewt <devnull@localhost>
Tue, 6 Jan 1998 03:20:24 +0000 (03:20 +0000)
committerewt <devnull@localhost>
Tue, 6 Jan 1998 03:20:24 +0000 (03:20 +0000)
fine for sockets

CVS patchset: 1916
CVS date: 1998/01/06 03:20:24

CHANGES
lib/package.c

diff --git a/CHANGES b/CHANGES
index 3c6b197..6b97f24 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@
        - fixed error messages displayed when opening the database
          fails during package installation and removal
        - query format of the form '[A%{}]' would drop the static string
+       - fixed fix in 2.4.9 for empty packages which broke -qip on ftp URL's
 
 2.4.10 -> 2.4.11:
        - HAVE_SYS_SOCKET_H was mistakingly MACHINE_SYS_SOCKET_H in
index 9e288dc..bde14bd 100644 (file)
@@ -41,7 +41,8 @@ static int readPackageHeaders(int fd, struct rpmlead * leadPtr,
     oldLead = (struct oldrpmlead *) lead;
 
     fstat(fd, &sb);
-    if (sb.st_size < 4) return 1;
+    /* if fd points to a socket, pipe, etc, sb.st_size is *always* zero */
+    if (S_ISREG(sb.st_mode) && sb.st_size < 4) return 1;
 
     if (readLead(fd, lead)) {
        return 2;