--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
+unixlib
+# XXX ignore doxygen markings
+-unrecogcomments
+
# don't-bother-me-yet parameters
#-branchstate
#-immediatetrans
.PHONY: lclint
lclint:
- lclint $(DEFS) $(INCLUDES) $(rpm_SOURCES)
+ lclint $(DEFS) $(INCLUDES) $(rpm_SOURCES) $(rpmb_SOURCES) rpmqv.c
CVSTAG = r$(subst .,-,$(VERSION))
--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
+unixlib
+# XXX ignore doxygen markings
+-unrecogcomments
+
# don't-bother-me-yet parameters
-branchstate
#-immediatetrans
--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
#include "system.h"
-#include <rpmio_internal.h>
#include "cpio.h"
#define xfree(_p) free((void *)_p)
#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
#define DBC void
#include "rpmdb.h"
+/*@access rpmdb@*/
/*@access dbiIndex@*/
/*@access dbiIndexSet@*/
return rc;
}
-static int db1byteswapped(dbiIndex dbi)
+static int db1byteswapped(/*@unused@*/dbiIndex dbi)
{
return 0;
}
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;
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;
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;
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);
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>
#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
#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 },
{ "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)
break;
default:
return POPT_ERROR_BADOPERATION;
- break;
+ /*@notreached@*/ break;
}
return 0;
}
}
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;
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;
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;
return rc;
}
-static inline int db3c_close(dbiIndex dbi, DBC * dbcursor)
+static inline int db3c_close(dbiIndex dbi, /*@only@*/ DBC * dbcursor)
{
int rc;
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;
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;
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;
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;
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;
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;
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;
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;
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);
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,
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)
break;
}
}
- if (rc) goto exit;
+ if (rc)
+ goto exit;
}
/* now look at the removed packages and make sure they aren't critical */
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;
}
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;
}
rpmdbFreeIterator(mi);
+ mi = NULL;
}
if (!ps.num) {
*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;
}
#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;
}
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)
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)
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;
/**
* 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;
}
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;
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);
xx = dbiCopen(dbi, &dbcursor, 0);
rc = dbiSearch(dbi, dbcursor, name, 0, &matches);
xx = dbiCclose(dbi, dbcursor, 0);
+ dbcursor = NULL;
}
if (rc == 0) /* success */
/* 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;
/* 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);
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;
const void * keyp, size_t keylen, int fpNum)
{
dbiIndex dbi = NULL;
- DBC * dbcursor;
+ DBC * dbcursor = NULL;
dbiIndexSet set = NULL;
int rc;
int xx;
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;
dbi->dbi_lastoffset = 0; /* db0: rewind to beginning */
if (rpmtag != RPMDBI_PACKAGES && keyp) {
- DBC * dbcursor;
+ DBC * dbcursor = NULL;
int rc;
int xx;
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)
for (dbix = 0; dbix < dbiTagsMax; dbix++) {
dbiIndex dbi;
- DBC * dbcursor;
+ DBC * dbcursor = NULL;
const char *av[1];
const char ** rpmvals = NULL;
int rpmtype = 0;
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);
}
xx = dbiCclose(dbi, dbcursor, 0);
+ dbcursor = NULL;
/* XXX HACK sync is on the bt with multiple db access */
if (!dbi->dbi_no_dbsync)
{
unsigned int firstkey = 0;
- DBC * dbcursor;
+ DBC * dbcursor = NULL;
void * keyp = &firstkey;
size_t keylen = sizeof(firstkey);
void * datap = NULL;
xx = dbiSync(dbi, 0);
xx = dbiCclose(dbi, dbcursor, 0);
+ dbcursor = NULL;
}
{ 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;
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;
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)
* @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.
* @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.
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)
/**
* 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
* @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
* @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?
* 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.
* @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__)
* @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.
* @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.
* @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.
* @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);
/**
/* 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)
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");
/* 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;
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;
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;
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;
char ** netsharedPaths = NULL;
const char ** fileLangs;
const char ** languages;
- const char *s;
+ const char * s;
if (!noDocs)
noDocs = rpmExpandNumeric("%{_excludedocs}");
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;
* 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
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"
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""