lclint fiddles.
authorjbj <devnull@localhost>
Fri, 7 Jul 2000 20:06:41 +0000 (20:06 +0000)
committerjbj <devnull@localhost>
Fri, 7 Jul 2000 20:06:41 +0000 (20:06 +0000)
avoid pathological buffer overflow in lib/rpmrc.c

CVS patchset: 3922
CVS date: 2000/07/07 20:06:41

16 files changed:
.lclintrc
Makefile.am
build/.lclintrc
lib/.lclintrc
lib/cpio.c
lib/cpio.h
lib/db1.c
lib/db3.c
lib/depends.c
lib/falloc.h
lib/rpmdb.c
lib/rpmdb.h
lib/rpmlib.h
lib/rpmrc.c
lib/transaction.c
po/rpm.pot

index 2c50006..2df835e 100644 (file)
--- a/.lclintrc
+++ b/.lclintrc
@@ -1,4 +1,4 @@
--I. -I./build -I./lib -I./popt -DHAVE_CONFIG_H -D_GNU_SOURCE
+-I. -I./build -I./lib -I./rpmio -I./popt -DHAVE_CONFIG_H -D_GNU_SOURCE
 
 +partial
 
@@ -7,6 +7,9 @@
 
 +unixlib
 
+# XXX ignore doxygen markings
+-unrecogcomments
+
 # don't-bother-me-yet parameters
 #-branchstate
 #-immediatetrans
index 35ac506..efe92a1 100644 (file)
@@ -97,7 +97,7 @@ $(PROGRAMS):          $(myLDADD)
 
 .PHONY:        lclint
 lclint:
-       lclint $(DEFS) $(INCLUDES) $(rpm_SOURCES)
+       lclint $(DEFS) $(INCLUDES) $(rpm_SOURCES) $(rpmb_SOURCES) rpmqv.c
 
 CVSTAG = r$(subst .,-,$(VERSION))
 
index 38330a2..d52e965 100644 (file)
@@ -1,4 +1,4 @@
--I. -I.. -I../build -I../lib -I../popt -DHAVE_CONFIG_H -D_GNU_SOURCE
+-I. -I.. -I../lib -I../rpmio -I../popt -DHAVE_CONFIG_H -D_GNU_SOURCE
 
 +partial
 
@@ -7,6 +7,9 @@
 
 +unixlib
 
+# XXX ignore doxygen markings
+-unrecogcomments
+
 # don't-bother-me-yet parameters
 -branchstate
 #-immediatetrans
index d4ad2d0..404b388 100644 (file)
@@ -1,4 +1,4 @@
--I. -I.. -I../build -I../popt -DHAVE_CONFIG_H -D_GNU_SOURCE
+-I. -I.. -I../build -I../rpmio -I../popt -DHAVE_CONFIG_H -D_GNU_SOURCE
 
 +partial
 
index cf6e1d1..719127e 100644 (file)
@@ -8,7 +8,6 @@
 
 #include "system.h"
 
-#include <rpmio_internal.h>
 #include "cpio.h"
 
 #define        xfree(_p)       free((void *)_p)
index d88b474..2a01b0c 100644 (file)
@@ -15,7 +15,7 @@
 #include <zlib.h>
 #include <sys/types.h>
 
-#include <rpmio.h>
+#include <rpmio_internal.h>
 
 /**
  * Note:  CPIO_CHECK_ERRNO bit is set only if errno is valid. These have to
index dcb8e94..2ef360d 100644 (file)
--- a/lib/db1.c
+++ b/lib/db1.c
@@ -20,6 +20,7 @@ static int _debug = 1;        /* XXX if < 0 debugging, > 0 unusual error returns */
 
 #define        DBC     void
 #include "rpmdb.h"
+/*@access rpmdb@*/
 /*@access dbiIndex@*/
 /*@access dbiIndexSet@*/
 
@@ -120,7 +121,7 @@ static int db1sync(dbiIndex dbi, unsigned int flags) {
     return rc;
 }
 
-static int db1byteswapped(dbiIndex dbi)
+static int db1byteswapped(/*@unused@*/dbiIndex dbi)
 {
     return 0;
 }
@@ -196,17 +197,18 @@ exit:
     return uh;
 }
 
-static int db1copen(dbiIndex dbi, DBC ** dbcp, unsigned int flags) {
+static int db1copen(/*@unused@*/ dbiIndex dbi, /*@unused@*/ DBC ** dbcp, /*@unused@*/ unsigned int flags) {
     return 0;
 }
 
-static int db1cclose(dbiIndex dbi, DBC * dbcursor, unsigned int flags) {
+static int db1cclose(dbiIndex dbi, /*@unused@*/ DBC * dbcursor, /*@unused@*/ unsigned int flags) {
     dbi->dbi_lastoffset = 0;
     return 0;
 }
 
-static int db1cget(dbiIndex dbi, DBC * dbcursor, void ** keyp, size_t * keylen,
-                void ** datap, size_t * datalen, unsigned int flags)
+static int db1cget(dbiIndex dbi, /*@unused@*/ DBC * dbcursor, void ** keyp,
+               size_t * keylen, void ** datap, size_t * datalen,
+               /*@unused@*/ unsigned int flags)
 {
     DBT key, data;
     int rc = 0;
@@ -283,8 +285,8 @@ static int db1cget(dbiIndex dbi, DBC * dbcursor, void ** keyp, size_t * keylen,
     return rc;
 }
 
-static int db1cdel(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen,
-               unsigned int flags)
+static int db1cdel(dbiIndex dbi, /*@unused@*/ DBC * dbcursor, const void * keyp,
+               size_t keylen, /*@unused@*/ unsigned int flags)
 {
     int rc = 0;
 
@@ -309,8 +311,10 @@ static int db1cdel(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keyle
     return rc;
 }
 
-static int db1cput(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen,
-               const void * datap, size_t datalen, unsigned int flags)
+static int db1cput(dbiIndex dbi, /*@unused@*/ DBC * dbcursor,
+               const void * keyp, size_t keylen,
+               const void * datap, size_t datalen,
+               /*@unused@*/ unsigned int flags)
 {
     DBT key, data;
     int rc = 0;
@@ -355,7 +359,8 @@ static int db1cput(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keyle
     return rc;
 }
 
-static int db1close(dbiIndex dbi, unsigned int flags) {
+static int db1close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags)
+{
     rpmdb rpmdb = dbi->dbi_rpmdb;
     const char * base = db1basename(dbi->dbi_rpmtag);
     const char * urlfn = rpmGenPath(rpmdb->db_root, rpmdb->db_home, base);
index d706201..35f6426 100644 (file)
--- a/lib/db3.c
+++ b/lib/db3.c
@@ -2,6 +2,13 @@
 
 static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
 
+#ifdef __LCLINT__
+typedef        unsigned int u_int32_t;
+typedef        unsigned short u_int16_t;
+typedef        unsigned char u_int8_t;
+typedef        int int32_t;
+#endif
+
 #include <db3/db.h>
 
 #include <rpmlib.h>
@@ -9,11 +16,10 @@ static int _debug = 1;       /* XXX if < 0 debugging, > 0 unusual error returns */
 #include <rpmurl.h>    /* XXX urlPath proto */
 
 #include "rpmdb.h"
+/*@access rpmdb@*/
 /*@access dbiIndex@*/
 /*@access dbiIndexSet@*/
 
-static const char * db3basename = "packages.db3";
-
 #if DB_VERSION_MAJOR == 3
 #define        __USE_DB3       1
 
@@ -29,6 +35,7 @@ struct dbOption {
 
 #define        _POPT_SET_BIT   (POPT_ARG_VAL|POPT_ARGFLAG_OR)
 
+/*@-immediatetrans@*/
 struct dbOption rdbOptions[] = {
  /* XXX DB_CXX_NO_EXCEPTIONS */
  { "xa_create",        _POPT_SET_BIT,          &db3dbi.dbi_cflags, DB_XA_CREATE },
@@ -133,8 +140,9 @@ struct dbOption rdbOptions[] = {
  { "re_pad",   POPT_ARG_INT,           &db3dbi.dbi_re_pad, 0 },
  { "re_source",        POPT_ARG_STRING,        &db3dbi.dbi_re_source, 0 },
 
- { NULL, 0 }
+ { NULL, 0, NULL, 0 }
 };
+/*@=immediatetrans@*/
 
 static int dbSaveLong(const struct dbOption * opt, long aLong) {
     if (opt->argInfo & POPT_ARGFLAG_NOT)
@@ -154,7 +162,7 @@ static int dbSaveLong(const struct dbOption * opt, long aLong) {
        break;
     default:
        return POPT_ERROR_BADOPERATION;
-       break;
+       /*@notreached@*/ break;
     }
     return 0;
 }
@@ -440,7 +448,7 @@ static int cvtdberr(dbiIndex dbi, const char * msg, int error, int printit) {
 }
 
 static int db_fini(dbiIndex dbi, const char * dbhome, const char * dbfile,
-               const char * dbsubfile)
+               /*@unused@*/ const char * dbsubfile)
 {
     rpmdb rpmdb = dbi->dbi_rpmdb;
     DB_ENV * dbenv = dbi->dbi_dbenv;
@@ -487,12 +495,12 @@ static int db_fini(dbiIndex dbi, const char * dbhome, const char * dbfile,
     return rc;
 }
 
-static int db3_fsync_disable(int fd) {
+static int db3_fsync_disable(/*@unused@*/ int fd) {
     return 0;
 }
 
 static int db_init(dbiIndex dbi, const char *dbhome, const char *dbfile,
-               const char * dbsubfile, DB_ENV **dbenvp)
+               /*@unused@*/ const char * dbsubfile, /*@out@*/ DB_ENV **dbenvp)
 {
     rpmdb rpmdb = dbi->dbi_rpmdb;
     DB_ENV *dbenv = NULL;
@@ -624,7 +632,8 @@ static int db3c_del(dbiIndex dbi, DBC * dbcursor, u_int32_t flags)
     return rc;
 }
 
-static int db3c_dup(dbiIndex dbi, DBC * dbcursor, DBC ** dbcp, u_int32_t flags)
+/*@unused@*/ static int db3c_dup(dbiIndex dbi, DBC * dbcursor, DBC ** dbcp,
+               u_int32_t flags)
 {
     int rc;
 
@@ -666,7 +675,7 @@ static int db3c_put(dbiIndex dbi, DBC * dbcursor,
     return rc;
 }
 
-static inline int db3c_close(dbiIndex dbi, DBC * dbcursor)
+static inline int db3c_close(dbiIndex dbi, /*@only@*/ DBC * dbcursor)
 {
     int rc;
 
@@ -675,7 +684,7 @@ static inline int db3c_close(dbiIndex dbi, DBC * dbcursor)
     return rc;
 }
 
-static inline int db3c_open(dbiIndex dbi, DBC ** dbcp)
+static inline int db3c_open(dbiIndex dbi, /*@out@*/ DBC ** dbcp)
 {
     DB * db = dbi->dbi_db;
     DB_TXN * txnid = NULL;
@@ -696,7 +705,8 @@ static inline int db3c_open(dbiIndex dbi, DBC ** dbcp)
     return rc;
 }
 
-static int db3cclose(dbiIndex dbi, DBC * dbcursor, unsigned int flags)
+static int db3cclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor,
+               /*@unused@*/ unsigned int flags)
 {
     int rc = 0;
 
@@ -706,14 +716,15 @@ static int db3cclose(dbiIndex dbi, DBC * dbcursor, unsigned int flags)
     if (dbcursor == NULL)
        dbcursor = dbi->dbi_rmw;
     if (dbcursor) {
-       rc = db3c_close(dbi, dbcursor);
        if (dbcursor == dbi->dbi_rmw)
            dbi->dbi_rmw = NULL;
+       rc = db3c_close(dbi, dbcursor);
     }
     return rc;
 }
 
-static int db3copen(dbiIndex dbi, DBC ** dbcp, unsigned int flags)
+static int db3copen(dbiIndex dbi, /*@out@*/ DBC ** dbcp,
+               /*@unused@*/ unsigned int flags)
 {
     DBC * dbcursor;
     int rc = 0;
@@ -734,8 +745,10 @@ static int db3copen(dbiIndex dbi, DBC ** dbcp, unsigned int flags)
     return rc;
 }
 
-static int db3cput(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen,
-               const void * datap, size_t datalen, unsigned int flags)
+static int db3cput(dbiIndex dbi, DBC * dbcursor,
+               const void * keyp, size_t keylen,
+               const void * datap, size_t datalen,
+               /*@unused@*/ unsigned int flags)
 {
     DB * db = dbi->dbi_db;
     DB_TXN * txnid = NULL;
@@ -761,7 +774,9 @@ static int db3cput(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keyle
     return rc;
 }
 
-static int db3cdel(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen, unsigned int flags)
+static int db3cdel(dbiIndex dbi, DBC * dbcursor,
+               const void * keyp, size_t keylen,
+               /*@unused@*/ unsigned int flags)
 {
     DB * db = dbi->dbi_db;
     DB_TXN * txnid = NULL;
@@ -791,8 +806,10 @@ static int db3cdel(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keyle
     return rc;
 }
 
-static int db3cget(dbiIndex dbi, DBC * dbcursor, void ** keyp, size_t * keylen,
-               void ** datap, size_t * datalen, unsigned int flags)
+static int db3cget(dbiIndex dbi, DBC * dbcursor,
+               /*@out@*/ void ** keyp, /*@out@*/ size_t * keylen,
+               /*@out@*/ void ** datap, /*@out@*/ size_t * datalen,
+               /*@unused@*/ unsigned int flags)
 {
     DB * db = dbi->dbi_db;
     DB_TXN * txnid = NULL;
@@ -842,7 +859,7 @@ static int db3byteswapped(dbiIndex dbi)
     return rc;
 }
 
-static int db3close(dbiIndex dbi, unsigned int flags)
+static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags)
 {
     rpmdb rpmdb = dbi->dbi_rpmdb;
     const char * urlfn = NULL;
@@ -908,7 +925,7 @@ static int db3close(dbiIndex dbi, unsigned int flags)
     return rc;
 }
 
-static int db3open(rpmdb rpmdb, int rpmtag, dbiIndex * dbip)
+static int db3open(/*@keep@*/ rpmdb rpmdb, int rpmtag, dbiIndex * dbip)
 {
     const char * urlfn = NULL;
     const char * dbhome;
@@ -1053,7 +1070,6 @@ static int db3open(rpmdb rpmdb, int rpmtag, dbiIndex * dbip)
 
            if (rc == 0 && dbi->dbi_get_rmw_cursor) {
                DBC * dbcursor = NULL;
-               int xx;
                xx = db->cursor(db, txnid, &dbcursor,
                        ((oflags & DB_RDONLY) ? 0 : DB_WRITECURSOR));
                xx = cvtdberr(dbi, "db->cursor", xx, _debug);
@@ -1072,6 +1088,7 @@ static int db3open(rpmdb rpmdb, int rpmtag, dbiIndex * dbip)
                    l.l_start = 0;
                    l.l_len = 0;
                    l.l_type = (dbi->dbi_mode & O_RDWR) ? F_WRLCK : F_RDLCK;
+                   l.l_pid = 0;
 
                    if (fcntl(fdno, F_SETLK, (void *) &l)) {
                        rpmError(RPMERR_FLOCK,
index d079284..0d400bd 100644 (file)
@@ -1488,16 +1488,19 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
     alMakeIndex(&rpmdep->addedPackages);
     alMakeIndex(&rpmdep->availablePackages);
 
-    /* look at all of the added packages and make sure their dependencies
-       are satisfied */
+    /* Look at all of the added packages and make sure their dependencies
+     * are satisfied.
+     */
     p = rpmdep->addedPackages.list;
     for (i = 0; i < rpmdep->addedPackages.size; i++, p++) {
 
-       if (checkPackageDeps(rpmdep, &ps, p->h, NULL, p->multiLib))
+       rc = checkPackageDeps(rpmdep, &ps, p->h, NULL, p->multiLib);
+       if (rc)
            goto exit;
 
        /* Adding: check name against conflicts matches. */
-       if (checkDependentConflicts(rpmdep, &ps, p->name))
+       rc = checkDependentConflicts(rpmdep, &ps, p->name);
+       if (rc)
            goto exit;
 
        if (p->providesCount == 0 || p->provides == NULL)
@@ -1511,7 +1514,8 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
                break;
            }
        }
-       if (rc) goto exit;
+       if (rc)
+           goto exit;
     }
 
     /* now look at the removed packages and make sure they aren't critical */
@@ -1525,7 +1529,8 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
            headerNVR(h, &name, NULL, NULL);
 
            /* Erasing: check name against requiredby matches. */
-           if (checkDependentPackages(rpmdep, &ps, name))
+           rc = checkDependentPackages(rpmdep, &ps, name);
+           if (rc)
                goto exit;
        }
 
@@ -1570,7 +1575,7 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
                        fileName = xrealloc(fileName, fileAlloced);
                    }
                    *fileName = '\0';
-                   stpcpy( stpcpy(fileName, dirNames[dirIndexes[j]]) , baseNames[j]);
+                   (void) stpcpy( stpcpy(fileName, dirNames[dirIndexes[j]]) , baseNames[j]);
                    /* Erasing: check filename against requiredby matches. */
                    if (checkDependentPackages(rpmdep, &ps, fileName)) {
                        rc = 1;
@@ -1588,6 +1593,7 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
 
       }
       rpmdbFreeIterator(mi);
+      mi = NULL;
     }
 
     if (!ps.num) {
@@ -1597,12 +1603,12 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
        *numConflicts = ps.num;
     }
     ps.problems = NULL;
-
-    return 0;
+    rc = 0;
 
 exit:
     if (mi)
        rpmdbFreeIterator(mi);
-    if (ps.problems)   free(ps.problems);
-    return 1;
+    if (ps.problems)
+       free(ps.problems);
+    return rc;
 }
index 0bb107b..c7c89eb 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef H_FALLOC
 #define H_FALLOC
 
+/*@access FD_t@*/
+
 /* File space allocation routines. Best fit allocation is used, free blocks
    are compacted. Minimal fragmentation is more important then speed. This
    uses 32 bit offsets on all platforms and should be byte order independent */
 extern "C" {
 #endif
 
-static inline long int fadGetFileSize(FD_t fd) {
+/*@unused@*/ static inline long int fadGetFileSize(FD_t fd) {
     return fd->fileSize;
 }
 
-static inline void fadSetFileSize(FD_t fd, long int fileSize) {
+/*@unused@*/ static inline void fadSetFileSize(FD_t fd, long int fileSize) {
     fd->fileSize = fileSize;
 }
 
-static inline unsigned int fadGetFirstFree(FD_t fd) {
+/*@unused@*/ static inline unsigned int fadGetFirstFree(FD_t fd) {
     return fd->firstFree;
 }
 
-static inline void fadSetFirstFree(FD_t fd, unsigned int firstFree) {
+/*@unused@*/ static inline void fadSetFirstFree(FD_t fd, unsigned int firstFree) {
     fd->firstFree = firstFree;
 }
 
index 7b72aa0..70116ec 100644 (file)
@@ -140,7 +140,7 @@ INLINE int dbiByteSwapped(dbiIndex dbi) {
     return (*dbi->dbi_vec->byteswapped) (dbi);
 }
 
-INLINE int XdbiCopen(dbiIndex dbi, DBC ** dbcp, unsigned int flags,
+INLINE int XdbiCopen(dbiIndex dbi, /*@out@*/ DBC ** dbcp, unsigned int flags,
        const char * f, unsigned int l)
 {
 if (_debug < 0 || dbi->dbi_debug)
@@ -148,7 +148,7 @@ fprintf(stderr, "+++ RMW %s (%s:%u)\n", tagName(dbi->dbi_rpmtag), f, l);
     return (*dbi->dbi_vec->copen) (dbi, dbcp, flags);
 }
 
-INLINE int XdbiCclose(dbiIndex dbi, DBC * dbcursor, unsigned int flags,
+INLINE int XdbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags,
        const char * f, unsigned int l)
 {
 if (_debug < 0 || dbi->dbi_debug)
@@ -229,7 +229,7 @@ fprintf(stderr, "    %s Close\n", tagName(dbi->dbi_rpmtag));
     return (*dbi->dbi_vec->close) (dbi, flags);
 }
 
-dbiIndex dbiOpen(rpmdb rpmdb, int rpmtag, unsigned int flags)
+dbiIndex dbiOpen(rpmdb rpmdb, int rpmtag, /*@unused@*/ unsigned int flags)
 {
     int dbix;
     dbiIndex dbi = NULL;
@@ -660,7 +660,7 @@ void dbiFreeIndexSet(dbiIndexSet set) {
 /**
  * Disable all signals, returning previous signal mask.
  */
-static void blockSignals(rpmdb rpmdb, sigset_t * oldMask)
+static void blockSignals(rpmdb rpmdb, /*@out@*/ sigset_t * oldMask)
 {
     sigset_t newMask;
 
@@ -801,7 +801,7 @@ errxit:
 }
 
 static int openDatabase(const char * prefix, const char * dbpath, int _dbapi,
-       rpmdb *dbp, int mode, int perms, int flags)
+       /*@out@*/ rpmdb *dbp, int mode, int perms, int flags)
 {
     rpmdb rpmdb;
     int rc;
@@ -944,6 +944,7 @@ static Header rpmdbGetRecord(rpmdb rpmdb, unsigned int offset)
     xx = dbiCopen(dbi, &dbcursor, 0);
     rc = dbiGet(dbi, dbcursor, &keyp, &keylen, &uh, &uhlen, 0);
     xx = dbiCclose(dbi, dbcursor, 0);
+    dbcursor = NULL;
     if (rc)
        return NULL;
     return headerLoad(uh);
@@ -1086,6 +1087,7 @@ int rpmdbCountPackages(rpmdb rpmdb, const char * name)
        xx = dbiCopen(dbi, &dbcursor, 0);
        rc = dbiSearch(dbi, dbcursor, name, 0, &matches);
        xx = dbiCclose(dbi, dbcursor, 0);
+       dbcursor = NULL;
     }
 
     if (rc == 0)       /* success */
@@ -1105,8 +1107,9 @@ int rpmdbCountPackages(rpmdb rpmdb, const char * name)
 /* 0 found matches */
 /* 1 no matches */
 /* 2 error */
-static int dbiFindMatches(dbiIndex dbi, DBC * dbcursor, const char * name, const char * version,
-                       const char * release, dbiIndexSet * matches)
+static int dbiFindMatches(dbiIndex dbi, DBC * dbcursor,
+       const char * name, const char * version, const char * release,
+       /*@out@*/ dbiIndexSet * matches)
 {
     int gotMatches;
     int rc;
@@ -1200,7 +1203,10 @@ static int dbiFindByLabel(dbiIndex dbi, DBC * dbcursor, const char * arg, dbiInd
     /* did they give us just a name? */
     rc = dbiFindMatches(dbi, dbcursor, arg, NULL, NULL, matches);
     if (rc != 1) return rc;
-    if (*matches) dbiFreeIndexSet(*matches);
+    if (*matches) {
+       dbiFreeIndexSet(*matches);
+       *matches = NULL;
+    }
 
     /* maybe a name and a release */
     localarg = alloca(strlen(arg) + 1);
@@ -1290,6 +1296,7 @@ void rpmdbFreeIterator(rpmdbMatchIterator mi)
            xx = dbiCopen(dbi, &dbcursor, 0);
            dbiUpdateRecord(dbi, dbcursor, mi->mi_prevoffset, mi->mi_h);
            xx = dbiCclose(dbi, dbcursor, 0);
+           dbcursor = NULL;
        }
        headerFree(mi->mi_h);
        mi->mi_h = NULL;
@@ -1467,7 +1474,7 @@ static int rpmdbGrowIterator(rpmdbMatchIterator mi,
        const void * keyp, size_t keylen, int fpNum)
 {
     dbiIndex dbi = NULL;
-    DBC * dbcursor;
+    DBC * dbcursor = NULL;
     dbiIndexSet set = NULL;
     int rc;
     int xx;
@@ -1482,10 +1489,10 @@ static int rpmdbGrowIterator(rpmdbMatchIterator mi,
     if (keylen == 0)
        keylen = strlen(keyp);
 
-    dbcursor = NULL;
     xx = dbiCopen(dbi, &dbcursor, 0);
     rc = dbiSearch(dbi, dbcursor, keyp, keylen, &set);
     xx = dbiCclose(dbi, dbcursor, 0);
+    dbcursor = NULL;
 
     if (rc == 0) {     /* success */
        int i;
@@ -1562,7 +1569,7 @@ fprintf(stderr, "*** RMW %s %p\n", tagName(rpmtag), dbi->dbi_rmw);
     dbi->dbi_lastoffset = 0;           /* db0: rewind to beginning */
 
     if (rpmtag != RPMDBI_PACKAGES && keyp) {
-       DBC * dbcursor;
+       DBC * dbcursor = NULL;
        int rc;
        int xx;
 
@@ -1571,12 +1578,14 @@ fprintf(stderr, "*** RMW %s %p\n", tagName(rpmtag), dbi->dbi_rmw);
            xx = dbiCopen(dbi, &dbcursor, 0);
            rc = dbiFindByLabel(dbi, dbcursor, keyp, &set);
            xx = dbiCclose(dbi, dbcursor, 0);
+           dbcursor = NULL;
        } else if (rpmtag == RPMTAG_BASENAMES) {
            rc = rpmdbFindByFile(rpmdb, keyp, &set);
        } else {
            xx = dbiCopen(dbi, &dbcursor, 0);
            rc = dbiSearch(dbi, dbcursor, keyp, keylen, &set);
            xx = dbiCclose(dbi, dbcursor, 0);
+           dbcursor = NULL;
        }
        if (rc) {       /* error/not found */
            if (set)
@@ -1679,7 +1688,7 @@ int rpmdbRemove(rpmdb rpmdb, unsigned int hdrNum)
 
        for (dbix = 0; dbix < dbiTagsMax; dbix++) {
            dbiIndex dbi;
-           DBC * dbcursor;
+           DBC * dbcursor = NULL;
            const char *av[1];
            const char ** rpmvals = NULL;
            int rpmtype = 0;
@@ -1704,6 +1713,7 @@ int rpmdbRemove(rpmdb rpmdb, unsigned int hdrNum)
                xx = dbiCopen(dbi, &dbcursor, 0);
                xx = dbiDel(dbi, dbcursor, &hdrNum, sizeof(hdrNum), 0);
                xx = dbiCclose(dbi, dbcursor, 0);
+               dbcursor = NULL;
                /* XXX HACK sync is on the bt with multiple db access */
                if (!dbi->dbi_no_dbsync)
                    xx = dbiSync(dbi, 0);
@@ -1753,6 +1763,7 @@ int rpmdbRemove(rpmdb rpmdb, unsigned int hdrNum)
            }
 
            xx = dbiCclose(dbi, dbcursor, 0);
+           dbcursor = NULL;
 
            /* XXX HACK sync is on the bt with multiple db access */
            if (!dbi->dbi_no_dbsync)
@@ -1837,7 +1848,7 @@ int rpmdbAdd(rpmdb rpmdb, Header h)
 
     {
        unsigned int firstkey = 0;
-       DBC * dbcursor;
+       DBC * dbcursor = NULL;
        void * keyp = &firstkey;
        size_t keylen = sizeof(firstkey);
        void * datap = NULL;
@@ -1870,6 +1881,7 @@ int rpmdbAdd(rpmdb rpmdb, Header h)
        xx = dbiSync(dbi, 0);
 
        xx = dbiCclose(dbi, dbcursor, 0);
+       dbcursor = NULL;
 
     }
 
@@ -1883,7 +1895,7 @@ int rpmdbAdd(rpmdb rpmdb, Header h)
     {  dbiIndexItem rec = dbiIndexNewItem(hdrNum, 0);
 
        for (dbix = 0; dbix < dbiTagsMax; dbix++) {
-           DBC * dbcursor;
+           DBC * dbcursor = NULL;
            const char *av[1];
            const char **rpmvals = NULL;
            int rpmtype = 0;
@@ -1907,6 +1919,7 @@ int rpmdbAdd(rpmdb rpmdb, Header h)
                xx = dbiCopen(dbi, &dbcursor, 0);
                xx = dbiUpdateRecord(dbi, dbcursor, hdrNum, h);
                xx = dbiCclose(dbi, dbcursor, 0);
+               dbcursor = NULL;
                if (!dbi->dbi_no_dbsync)
                    xx = dbiSync(dbi, 0);
                {   const char *n, *v, *r;
@@ -1988,6 +2001,7 @@ int rpmdbAdd(rpmdb rpmdb, Header h)
                rc += addIndexEntry(dbi, dbcursor, rpmvals[i], rec);
            }
            xx = dbiCclose(dbi, dbcursor, 0);
+           dbcursor = NULL;
 
            /* XXX HACK sync is on the bt with multiple db access */
            if (!dbi->dbi_no_dbsync)
index 8927ba9..582b5aa 100644 (file)
@@ -64,7 +64,7 @@ struct _dbiVec {
  * @param rpmtag       rpm tag
  * @return             0 on success
  */
-    int (*open) (rpmdb rpmdb, int rpmtag, dbiIndex * dbip);
+    int (*open) (rpmdb rpmdb, int rpmtag, /*@out@*/ dbiIndex * dbip);
 
 /**
  * Close index database.
@@ -72,7 +72,7 @@ struct _dbiVec {
  * @param flags                (unused)
  * @return             0 on success
  */
-    int (*close) (dbiIndex dbi, unsigned int flags);
+    int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags);
 
 /**
  * Flush pending operations to disk.
@@ -83,16 +83,25 @@ struct _dbiVec {
     int (*sync) (dbiIndex dbi, unsigned int flags);
 
 /**
+ * Open database cursor.
+ * @param dbi          index database handle
+ * @param dbcp         address of database cursor
+ * @param flags                (unused)
  */
-    int (*copen) (dbiIndex dbi, DBC ** dbcp, unsigned int flags);
+    int (*copen) (dbiIndex dbi, /*@out@*/ DBC ** dbcp, unsigned int flags);
 
 /**
+ * Close database cursor.
+ * @param dbi          index database handle
+ * @param dbcursor     database cursor
+ * @param flags                (unused)
  */
     int (*cclose) (dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags);
 
 /**
  * Delete (key,data) pair(s) using db->del or dbcursor->c_del.
  * @param dbi          index database handle
+ * @param dbcursor     database cursor
  * @param keyp         key data
  * @param keylen       key data length
  * @param flags                (unused)
@@ -103,6 +112,7 @@ struct _dbiVec {
 /**
  * Retrieve (key,data) pair using db->get or dbcursor->c_get.
  * @param dbi          index database handle
+ * @param dbcursor     database cursor
  * @param keypp                address of key data
  * @param keylenp      address of key data length
  * @param datapp       address of data pointer
@@ -110,12 +120,15 @@ struct _dbiVec {
  * @param flags                (unused)
  * @return             0 on success
  */
-    int (*cget) (dbiIndex dbi, DBC * dbcursor, void ** keypp, size_t * keylenp,
-                       void ** datapp, size_t * datalenp, unsigned int flags);
+    int (*cget) (dbiIndex dbi, DBC * dbcursor,
+                       /*@out@*/ void ** keypp, /*@out@*/ size_t * keylenp,
+                       /*@out@*/ void ** datapp, /*@out@*/ size_t * datalenp,
+                       unsigned int flags);
 
 /**
  * Store (key,data) pair using db->put or dbcursor->c_put.
  * @param dbi          index database handle
+ * @param dbcursor     database cursor
  * @param keyp         key data
  * @param keylen       key data length
  * @param datap                data pointer
@@ -123,8 +136,10 @@ struct _dbiVec {
  * @param flags                (unused)
  * @return             0 on success
  */
-    int (*cput) (dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen,
-                       const void * datap, size_t datalen, unsigned int flags);
+    int (*cput) (dbiIndex dbi, DBC * dbcursor,
+                       const void * keyp, size_t keylen,
+                       const void * datap, size_t datalen,
+                       unsigned int flags);
 
 /**
  * Is database byte swapped?
@@ -267,7 +282,7 @@ extern "C" {
  * Return new configured index database handle instance.
  * @param rpmdb                rpm database
  */
-/*@only@*/ /*@null@*/ dbiIndex db3New(rpmdb rpmdb, int rpmtag);
+/*@only@*/ /*@null@*/ dbiIndex db3New(/*@keep@*/ rpmdb rpmdb, int rpmtag);
 
 /**
  * Destroy index database handle instance.
@@ -282,21 +297,24 @@ void db3Free( /*@only@*/ /*@null@*/ dbiIndex dbi);
  * @param flags                (unused)
  * @return             index database handle
  */
-dbiIndex dbiOpen(rpmdb rpmdb, int rpmtag, unsigned int flags);
+/*@only@*/ /*@null@*/ dbiIndex dbiOpen(rpmdb rpmdb, int rpmtag,
+               unsigned int flags);
 
 /**
+ * @param dbi          index database handle
  * @param flags                (unused)
  */
-int dbiCopen(dbiIndex dbi, DBC ** dbcp, unsigned int flags);
-int XdbiCopen(dbiIndex dbi, DBC ** dbcp, unsigned int flags, const char *f, unsigned int l);
+int dbiCopen(dbiIndex dbi, /*@out@*/ DBC ** dbcp, unsigned int flags);
+int XdbiCopen(dbiIndex dbi, /*@out@*/ DBC ** dbcp, unsigned int flags, const char *f, unsigned int l);
 #define        dbiCopen(_a,_b,_c) \
        XdbiCopen(_a, _b, _c, __FILE__, __LINE__)
 
 /**
+ * @param dbi          index database handle
  * @param flags                (unused)
  */
-int dbiCclose(dbiIndex dbi, DBC * dbcursor, unsigned int flags);
-int XdbiCclose(dbiIndex dbi, DBC * dbcursor, unsigned int flags, const char *f, unsigned int l);
+int dbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags);
+int XdbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags, const char *f, unsigned int l);
 #define        dbiCclose(_a,_b,_c) \
        XdbiCclose(_a, _b, _c, __FILE__, __LINE__)
 
@@ -343,7 +361,7 @@ int dbiPut(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen,
  * @param flags                (unused)
  * @return             0 on success
  */
-int dbiClose(dbiIndex dbi, unsigned int flags);
+int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags);
 
 /**
  * Flush pending operations to disk.
index 51483b0..e08e956 100644 (file)
@@ -437,7 +437,7 @@ int rpmdbPruneIterator(rpmdbMatchIterator mi, int * hdrNums,
  * @param mi           rpm database iterator
  * @param version      version to check for
  */
-void rpmdbSetIteratorVersion(rpmdbMatchIterator mi, const char * version);
+void rpmdbSetIteratorVersion(rpmdbMatchIterator mi, /*@kept@*/ const char * version);
 
 /**
  * Modify iterator to filter out headers that do not match release.
@@ -445,7 +445,7 @@ void rpmdbSetIteratorVersion(rpmdbMatchIterator mi, const char * version);
  * @param mi           rpm database iterator
  * @param release      release to check for
  */
-void rpmdbSetIteratorRelease(rpmdbMatchIterator mi, const char * release);
+void rpmdbSetIteratorRelease(rpmdbMatchIterator mi, /*@kept@*/ const char * release);
 
 /**
  * Modify iterator to mark header for lazy write.
@@ -474,7 +474,8 @@ Header XrpmdbNextIterator(rpmdbMatchIterator mi, const char * f, unsigned int l)
  * @param keylen       key data length (0 will use strlen(keyp))
  * @return             NULL on failure
  */
-/*@only@*/ /*@null@*/ rpmdbMatchIterator rpmdbInitIterator(rpmdb rpmdb, int rpmtag,
+/*@only@*/ /*@null@*/ rpmdbMatchIterator rpmdbInitIterator(
+                       /*@kept@*/ rpmdb rpmdb, int rpmtag,
                        const void * key, size_t keylen);
 
 /**
index 8376766..d08f1b7 100644 (file)
@@ -543,7 +543,7 @@ int rpmReadRC(const char * rcfiles)
        /* Expand ~/ to $HOME/ */
        fn[0] = '\0';
        if (r[0] == '~' && r[1] == '/') {
-           char *home = getenv("HOME");
+           const char * home = getenv("HOME");
            if (home == NULL) {
            /* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */
                if (rcfiles == defrcfiles && myrcfiles != r)
@@ -552,10 +552,17 @@ int rpmReadRC(const char * rcfiles)
                rc = 1;
                break;
            }
+           if (strlen(home) > (sizeof(fn) - strlen(r))) {
+               rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME is too large."),
+                               r);
+               rc = 1;
+               break;
+           }
            strcpy(fn, home);
            r++;
        }
-       strcat(fn, r);
+       strncat(fn, r, sizeof(fn) - (strlen(fn) + 1));
+       fn[sizeof(fn)-1] = '\0';
 
        /* Read another rcfile */
        fd = Fopen(fn, "r.fpio");
index d8290ab..b492753 100644 (file)
@@ -38,18 +38,19 @@ typedef struct transactionFileInfo {
   /* for all packages */
     enum rpmTransactionType type;
     enum fileActions * actions;
-    fingerPrint * fps;
-    uint_32 * fflags, * fsizes;
+/*@dependent@*/ fingerPrint * fps;
+    uint_32 * fflags;
+    uint_32 * fsizes;
     const char ** bnl;     /* base names */
     const char ** dnl;     /* dir names */
     const int * dil;       /* dir index list */
-    char ** fmd5s;
+    const char ** fmd5s;
     uint_16 * fmodes;
     Header h;
     int fc;
     char * fstates;
   /* these are for TR_ADDED packages */
-    char ** flinks;
+    const char ** flinks;
     struct availablePackage * ap;
     struct sharedFileInfo * replaced;
     uint_32 * replacedSizes;
@@ -425,7 +426,7 @@ static Header relocateFileList(struct availablePackage * alp,
            fileAlloced = len * 2;
            filespec = xrealloc(filespec, fileAlloced);
        }
-       stpcpy( stpcpy(filespec, dirNames[dirIndexes[i]]) , baseNames[i]);
+       (void) stpcpy( stpcpy(filespec, dirNames[dirIndexes[i]]) , baseNames[i]);
 
        for (j = numRelocations - 1; j >= 0; j--)
            if (!strcmp(relocations[j].oldPath, filespec)) break;
@@ -510,7 +511,7 @@ static Header relocateFileList(struct availablePackage * alp,
                const char *s = relocations[j].newPath;
                char *t = alloca(strlen(s) + strlen(dirNames[i]) - oplen + 1);
 
-               stpcpy( stpcpy(t, s) , dirNames[i] + oplen);
+               (void) stpcpy( stpcpy(t, s) , dirNames[i] + oplen);
                rpmMessage(RPMMESS_DEBUG, _("relocating directory %s to %s\n"),
                        dirNames[i], t);
                dirNames[i] = t;
@@ -1083,7 +1084,7 @@ static void handleOverlappedFiles(TFI_t * fi, hashTable ht,
     if (filespec) free(filespec);
 }
 
-static int ensureOlder(rpmdb db, Header new, Header old, rpmProblemSet probs,
+static int ensureOlder(/*@unused@*/ rpmdb rpmdb, Header new, Header old, rpmProblemSet probs,
                        /*@dependent@*/ const void * key)
 {
     int result, rc = 0;
@@ -1107,7 +1108,7 @@ static void skipFiles(TFI_t * fi, int noDocs)
     char ** netsharedPaths = NULL;
     const char ** fileLangs;
     const char ** languages;
-    const char *s;
+    const char * s;
 
     if (!noDocs)
        noDocs = rpmExpandNumeric("%{_excludedocs}");
@@ -1241,6 +1242,7 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
        for (i = 0; (i < filesystemCount) && di; i++) {
 #if STATFS_IN_SYS_STATVFS
            struct statvfs sfb;
+           memset(&sfb, 0, sizeof(sfb));
            if (statvfs(filesystems[i], &sfb))
 #else
            struct statfs sfb;
@@ -1250,8 +1252,10 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
  * filesystem type, and is always 0 when statfs is called on a mounted
  * filesystem, as we're doing.
  */
+           memset(&sfb, 0, sizeof(sfb));
            if (statfs(filesystems[i], &sfb, sizeof(sfb), 0))
 #  else
+           memset(&sfb, 0, sizeof(sfb));
            if (statfs(filesystems[i], &sfb))
 #  endif
 #endif
index 32b2109..1a4ccca 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-07-05 16:33-0400\n"
+"POT-Creation-Date: 2000-07-07 15:55-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2187,51 +2187,51 @@ msgstr ""
 msgid "line %d: Bad %s number: %s\n"
 msgstr ""
 
-#: lib/cpio.c:359
+#: lib/cpio.c:358
 #, c-format
 msgid "can't rename %s to %s: %s\n"
 msgstr ""
 
-#: lib/cpio.c:365
+#: lib/cpio.c:364
 #, c-format
 msgid "can't unlink %s: %s\n"
 msgstr ""
 
-#: lib/cpio.c:609
+#: lib/cpio.c:608
 #, c-format
 msgid "getNextHeader: %s\n"
 msgstr ""
 
-#: lib/cpio.c:1070
+#: lib/cpio.c:1069
 #, c-format
 msgid "(error 0x%x)"
 msgstr ""
 
-#: lib/cpio.c:1073
+#: lib/cpio.c:1072
 msgid "Bad magic"
 msgstr ""
 
-#: lib/cpio.c:1074
+#: lib/cpio.c:1073
 msgid "Bad/unreadable  header"
 msgstr ""
 
-#: lib/cpio.c:1092
+#: lib/cpio.c:1091
 msgid "Header size too big"
 msgstr ""
 
-#: lib/cpio.c:1093
+#: lib/cpio.c:1092
 msgid "Unknown file type"
 msgstr ""
 
-#: lib/cpio.c:1094
+#: lib/cpio.c:1093
 msgid "Missing hard link"
 msgstr ""
 
-#: lib/cpio.c:1095
+#: lib/cpio.c:1094
 msgid "Internal error"
 msgstr ""
 
-#: lib/cpio.c:1104
+#: lib/cpio.c:1103
 msgid " failed - "
 msgstr ""
 
@@ -2325,51 +2325,51 @@ msgstr ""
 msgid "loop in prerequisite chain: %s"
 msgstr ""
 
-#: lib/db1.c:95 lib/db3.c:433
+#: lib/db1.c:96 lib/db3.c:441
 #, c-format
 msgid "db%d error(%d)"
 msgstr ""
 
-#: lib/db1.c:97 lib/db3.c:435
+#: lib/db1.c:98 lib/db3.c:443
 #, c-format
 msgid " performing %s"
 msgstr ""
 
-#: lib/db1.c:382
+#: lib/db1.c:387
 #, c-format
 msgid "closed  db file        %s\n"
 msgstr ""
 
-#: lib/db1.c:385
+#: lib/db1.c:390
 #, c-format
 msgid "removed db file        %s\n"
 msgstr ""
 
-#: lib/db1.c:416
+#: lib/db1.c:421
 #, c-format
 msgid "bad db file %s"
 msgstr ""
 
-#: lib/db1.c:421
+#: lib/db1.c:426
 #, c-format
 msgid "opening db file        %s mode 0x%x\n"
 msgstr ""
 
-#: lib/db1.c:430 rpmio/url.c:445
+#: lib/db1.c:435 rpmio/url.c:445
 #, c-format
 msgid "failed to open %s: %s\n"
 msgstr ""
 
-#: lib/db1.c:446
+#: lib/db1.c:451
 #, c-format
 msgid "cannot get %s lock on database"
 msgstr ""
 
-#: lib/db1.c:447 lib/db3.c:1080
+#: lib/db1.c:452 lib/db3.c:1097
 msgid "exclusive"
 msgstr ""
 
-#: lib/db1.c:447 lib/db3.c:1080
+#: lib/db1.c:452 lib/db3.c:1097
 msgid "shared"
 msgstr ""
 
@@ -2398,57 +2398,57 @@ msgstr ""
 msgid "opening db index       %s/%s(%s) %s mode=0x%x\n"
 msgstr ""
 
-#: lib/db3.c:249
+#: lib/db3.c:257
 #, c-format
 msgid "dbiSetConfig: unrecognized db option: \"%s\" ignored\n"
 msgstr ""
 
-#: lib/db3.c:277
+#: lib/db3.c:285
 #, c-format
 msgid "%s has invalid numeric value, skipped\n"
 msgstr ""
 
-#: lib/db3.c:285
+#: lib/db3.c:293
 #, c-format
 msgid "%s has too large or too small long value, skipped\n"
 msgstr ""
 
-#: lib/db3.c:293
+#: lib/db3.c:301
 #, c-format
 msgid "%s has too large or too small integer value, skipped\n"
 msgstr ""
 
-#: lib/db3.c:460
+#: lib/db3.c:468
 #, c-format
 msgid "closed  db environment %s/%s\n"
 msgstr ""
 
-#: lib/db3.c:476
+#: lib/db3.c:484
 #, c-format
 msgid "removed db environment %s/%s\n"
 msgstr ""
 
-#: lib/db3.c:513
+#: lib/db3.c:521
 #, c-format
 msgid "opening db environment %s/%s %s\n"
 msgstr ""
 
-#: lib/db3.c:883
+#: lib/db3.c:900
 #, c-format
 msgid "closed  db index       %s/%s\n"
 msgstr ""
 
-#: lib/db3.c:973
+#: lib/db3.c:990
 #, c-format
 msgid "opening db index       %s/%s %s mode=0x%x\n"
 msgstr ""
 
-#: lib/db3.c:1078
+#: lib/db3.c:1095
 #, c-format
 msgid "cannot get %s lock on %s/%s\n"
 msgstr ""
 
-#: lib/db3.c:1085
+#: lib/db3.c:1102
 #, c-format
 msgid "locked  db index       %s/%s\n"
 msgstr ""
@@ -3208,7 +3208,7 @@ msgstr ""
 msgid "error(%d) removing record %s from %s"
 msgstr ""
 
-#: lib/rpmdb.c:785 lib/rpmdb.c:2291
+#: lib/rpmdb.c:785 lib/rpmdb.c:2305
 msgid "no dbpath has been set"
 msgstr ""
 
@@ -3219,110 +3219,110 @@ msgid ""
 msgstr ""
 
 #. error
-#: lib/rpmdb.c:1094
+#: lib/rpmdb.c:1096
 #, c-format
 msgid "error(%d) counting packages"
 msgstr ""
 
-#: lib/rpmdb.c:1152 lib/rpmdb.c:1665 lib/uninstall.c:91
+#: lib/rpmdb.c:1155 lib/rpmdb.c:1674 lib/uninstall.c:91
 #, c-format
 msgid "%s: cannot read header at 0x%x"
 msgstr ""
 
-#: lib/rpmdb.c:1717
+#: lib/rpmdb.c:1727
 #, c-format
 msgid "removing 0 %s entries.\n"
 msgstr ""
 
-#: lib/rpmdb.c:1728
+#: lib/rpmdb.c:1738
 #, c-format
 msgid "removing \"%s\" from %s index.\n"
 msgstr ""
 
-#: lib/rpmdb.c:1737
+#: lib/rpmdb.c:1747
 #, c-format
 msgid "removing %d entries from %s index:\n"
 msgstr ""
 
-#: lib/rpmdb.c:1877
+#: lib/rpmdb.c:1889
 #, c-format
 msgid "error(%d) allocating new package instance"
 msgstr ""
 
-#: lib/rpmdb.c:1933
+#: lib/rpmdb.c:1946
 #, c-format
 msgid "adding 0 %s entries.\n"
 msgstr ""
 
-#: lib/rpmdb.c:1949
+#: lib/rpmdb.c:1962
 #, c-format
 msgid "adding \"%s\" to %s index.\n"
 msgstr ""
 
-#: lib/rpmdb.c:1958
+#: lib/rpmdb.c:1971
 #, c-format
 msgid "adding %d entries to %s index:\n"
 msgstr ""
 
-#: lib/rpmdb.c:2316
+#: lib/rpmdb.c:2330
 #, c-format
 msgid "rebuilding database %s into %s\n"
 msgstr ""
 
-#: lib/rpmdb.c:2320
+#: lib/rpmdb.c:2334
 #, c-format
 msgid "temporary database %s already exists"
 msgstr ""
 
-#: lib/rpmdb.c:2326
+#: lib/rpmdb.c:2340
 #, c-format
 msgid "creating directory %s\n"
 msgstr ""
 
-#: lib/rpmdb.c:2328
+#: lib/rpmdb.c:2342
 #, c-format
 msgid "error creating directory %s: %s"
 msgstr ""
 
-#: lib/rpmdb.c:2335
+#: lib/rpmdb.c:2349
 #, c-format
 msgid "opening old database with dbapi %d\n"
 msgstr ""
 
-#: lib/rpmdb.c:2344
+#: lib/rpmdb.c:2358
 #, c-format
 msgid "opening new database with dbapi %d\n"
 msgstr ""
 
-#: lib/rpmdb.c:2367
+#: lib/rpmdb.c:2381
 #, c-format
 msgid "record number %d in database is bad -- skipping."
 msgstr ""
 
-#: lib/rpmdb.c:2399
+#: lib/rpmdb.c:2413
 #, c-format
 msgid "cannot add record originally at %d"
 msgstr ""
 
-#: lib/rpmdb.c:2417
+#: lib/rpmdb.c:2431
 msgid "failed to rebuild database: original database remains in place\n"
 msgstr ""
 
-#: lib/rpmdb.c:2425
+#: lib/rpmdb.c:2439
 msgid "failed to replace old database with new database!\n"
 msgstr ""
 
-#: lib/rpmdb.c:2427
+#: lib/rpmdb.c:2441
 #, c-format
 msgid "replace files in %s with files from %s to recover"
 msgstr ""
 
-#: lib/rpmdb.c:2437
+#: lib/rpmdb.c:2451
 #, c-format
 msgid "removing directory %s\n"
 msgstr ""
 
-#: lib/rpmdb.c:2439
+#: lib/rpmdb.c:2453
 #, c-format
 msgid "failed to remove directory %s: %s\n"
 msgstr ""
@@ -3469,53 +3469,58 @@ msgstr ""
 msgid "Cannot expand %s"
 msgstr ""
 
-#: lib/rpmrc.c:566
+#: lib/rpmrc.c:556
+#, c-format
+msgid "Cannot read %s, HOME is too large."
+msgstr ""
+
+#: lib/rpmrc.c:573
 #, c-format
 msgid "Unable to open %s for reading: %s."
 msgstr ""
 
 #. XXX Feof(fd)
-#: lib/rpmrc.c:611
+#: lib/rpmrc.c:618
 #, c-format
 msgid "Failed to read %s: %s."
 msgstr ""
 
-#: lib/rpmrc.c:648
+#: lib/rpmrc.c:655
 #, c-format
 msgid "missing ':' (found 0x%02x) at %s:%d"
 msgstr ""
 
-#: lib/rpmrc.c:665 lib/rpmrc.c:739
+#: lib/rpmrc.c:672 lib/rpmrc.c:746
 #, c-format
 msgid "missing argument for %s at %s:%d"
 msgstr ""
 
-#: lib/rpmrc.c:682 lib/rpmrc.c:704
+#: lib/rpmrc.c:689 lib/rpmrc.c:711
 #, c-format
 msgid "%s expansion failed at %s:%d \"%s\""
 msgstr ""
 
-#: lib/rpmrc.c:691
+#: lib/rpmrc.c:698
 #, c-format
 msgid "cannot open %s at %s:%d: %s"
 msgstr ""
 
-#: lib/rpmrc.c:731
+#: lib/rpmrc.c:738
 #, c-format
 msgid "missing architecture for %s at %s:%d"
 msgstr ""
 
-#: lib/rpmrc.c:798
+#: lib/rpmrc.c:805
 #, c-format
 msgid "bad option '%s' at %s:%d"
 msgstr ""
 
-#: lib/rpmrc.c:1169
+#: lib/rpmrc.c:1176
 #, c-format
 msgid "Unknown system: %s\n"
 msgstr ""
 
-#: lib/rpmrc.c:1170
+#: lib/rpmrc.c:1177
 msgid "Please contact rpm-list@redhat.com\n"
 msgstr ""
 
@@ -3656,27 +3661,27 @@ msgstr ""
 msgid "You must set \"%%_pgp_name\" in your macro file"
 msgstr ""
 
-#: lib/transaction.c:412
+#: lib/transaction.c:413
 #, c-format
 msgid "excluding file %s%s\n"
 msgstr ""
 
-#: lib/transaction.c:438 lib/transaction.c:521
+#: lib/transaction.c:439 lib/transaction.c:522
 #, c-format
 msgid "excluding directory %s\n"
 msgstr ""
 
-#: lib/transaction.c:443
+#: lib/transaction.c:444
 #, c-format
 msgid "relocating %s to %s\n"
 msgstr ""
 
-#: lib/transaction.c:514
+#: lib/transaction.c:515
 #, c-format
 msgid "relocating directory %s to %s\n"
 msgstr ""
 
-#: lib/transaction.c:666
+#: lib/transaction.c:667
 #, c-format
 msgid "%s skipped due to missingok flag\n"
 msgstr ""