summaryrefslogtreecommitdiff
path: root/lib/rpmfi.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-12-19 17:44:33 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-12-19 17:44:33 +0200
commit31a2eac384b7527471d25f1f93be017882c98aea (patch)
treef2a703338db9ca97188f7389eb3d9e65a6debe88 /lib/rpmfi.c
parent1c20dc3aa1de5c2f73a49ed0a2d40b1ef5c005af (diff)
downloadlibrpm-tizen-31a2eac384b7527471d25f1f93be017882c98aea.tar.gz
librpm-tizen-31a2eac384b7527471d25f1f93be017882c98aea.tar.bz2
librpm-tizen-31a2eac384b7527471d25f1f93be017882c98aea.zip
Sanitize file modes handling in relocation
- we dont modify fi->fmodes so fi->scareFlags is irrelevant, just use minmem always - use rpmtd accessors instead of direct access
Diffstat (limited to 'lib/rpmfi.c')
-rw-r--r--lib/rpmfi.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
index 7d923476d..574c53a41 100644
--- a/lib/rpmfi.c
+++ b/lib/rpmfi.c
@@ -768,7 +768,6 @@ Header relocateFileList(const rpmts ts, rpmfi fi,
char ** dirNames;
uint32_t * dirIndexes;
rpm_count_t fileCount, dirCount, numValid = 0;
- rpm_mode_t * fModes = NULL;
Header h;
int nrelocated = 0;
int fileAlloced = 0;
@@ -940,11 +939,10 @@ assert(p != NULL);
headerGet(h, RPMTAG_BASENAMES, &bnames, fi->scareFlags);
headerGet(h, RPMTAG_DIRINDEXES, &dindexes, HEADERGET_ALLOC);
headerGet(h, RPMTAG_DIRNAMES, &dnames, fi->scareFlags);
- headerGet(h, RPMTAG_FILEMODES, &fmodes, fi->scareFlags);
+ headerGet(h, RPMTAG_FILEMODES, &fmodes, HEADERGET_MINMEM);
/* TODO XXX ugh.. use rpmtd iterators & friends instead */
baseNames = bnames.data;
dirIndexes = dindexes.data;
- fModes = fmodes.data;
fileCount = rpmtdCount(&bnames);
dirCount = rpmtdCount(&dnames);
/* XXX TODO: use rpmtdDup() instead */
@@ -1003,8 +1001,8 @@ assert(fn != NULL); /* XXX can't happen */
}
if (j < 0) continue;
-/* FIX: fModes may be NULL */
- ft = rpmfiWhatis(fModes[i]);
+ rpmtdSetIndex(&fmodes, i);
+ ft = rpmfiWhatis(rpmtdGetNumber(&fmodes));
/* On install, a relocate to NULL means skip the path. */
if (relocations[j].newPath == NULL) {