summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-05 15:18:43 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-05 15:18:43 +0200
commitb43998c374abae3b689a3698a2006fdafac1146a (patch)
tree63f6206225c22a81daca049e033cfe8eddae06a1 /lib
parent52d53b8bf91c8a9ed28257ec9ed1b65fd5b98fbc (diff)
downloadrpm-b43998c374abae3b689a3698a2006fdafac1146a.tar.gz
rpm-b43998c374abae3b689a3698a2006fdafac1146a.tar.bz2
rpm-b43998c374abae3b689a3698a2006fdafac1146a.zip
Remove fperms and dperms from rpmfi struct
- only fsm internals need and just use straightforward defaults, move the defaults there...
Diffstat (limited to 'lib')
-rw-r--r--lib/fsm.c9
-rw-r--r--lib/rpmfi.c3
-rw-r--r--lib/rpmfi_internal.h2
3 files changed, 6 insertions, 8 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index fb2b5df39..d4cfdef7d 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -77,6 +77,10 @@ static rpmfi fsmGetFi(const FSM_t fsm)
#define SUFFIX_RPMSAVE ".rpmsave"
#define SUFFIX_RPMNEW ".rpmnew"
+/* Default directory and file permissions if not mapped */
+#define _dirPerms 0755
+#define _filePerms 0644
+
/*
* XXX Forward declarations for previously exported functions to avoid moving
* things around needlessly
@@ -718,7 +722,7 @@ static int fsmMapAttrs(FSM_t fsm)
int i = fsm->ix;
if (fi && i >= 0 && i < fi->fc) {
- mode_t perms = (S_ISDIR(st->st_mode) ? fi->dperms : fi->fperms);
+ mode_t perms = (S_ISDIR(st->st_mode) ? _dirPerms : _filePerms);
mode_t finalMode = (fi->fmodes ? fi->fmodes[i] : perms);
dev_t finalRdev = (fi->frdevs ? fi->frdevs[i] : 0);
rpm_time_t finalMtime = (fi->fmtimes ? fi->fmtimes[i] : 0);
@@ -1214,9 +1218,8 @@ static int fsmMkdirs(FSM_t fsm)
/* Move pre-existing path marker forward. */
fsm->dnlx[dc] = (te - dn);
} else if (rc == CPIOERR_ENOENT) {
- rpmfi fi = fsmGetFi(fsm);
*te = '\0';
- st->st_mode = S_IFDIR | (fi->dperms & 07777);
+ st->st_mode = S_IFDIR | (_dirPerms & 07777);
rc = fsmNext(fsm, FSM_MKDIR);
if (!rc) {
/* XXX FIXME? only new dir will have context set. */
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
index 26159f79e..ec27f5518 100644
--- a/lib/rpmfi.c
+++ b/lib/rpmfi.c
@@ -1359,9 +1359,6 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags)
fi->fnlen = dnlmax + bnlmax + 1;
fi->fn = NULL;
- fi->dperms = 0755;
- fi->fperms = 0644;
-
exit:
if (_rpmfi_debug < 0)
fprintf(stderr, "*** fi %p\t%s[%d]\n", fi, Type, (fi ? fi->fc : 0));
diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h
index e12a2d3ca..2cb9d3bb5 100644
--- a/lib/rpmfi_internal.h
+++ b/lib/rpmfi_internal.h
@@ -105,8 +105,6 @@ struct rpmfi_s {
size_t striplen;
rpm_loff_t archivePos;
rpm_loff_t archiveSize;
- mode_t dperms; /*!< Directory perms (0755) if not mapped. */
- mode_t fperms; /*!< File perms (0644) if not mapped. */
const char ** apath;
cpioMapFlags mapflags;
FSM_t fsm; /*!< File state machine data. */