summaryrefslogtreecommitdiff
path: root/lib/fsm.c
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/fsm.c
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/fsm.c')
-rw-r--r--lib/fsm.c9
1 files changed, 6 insertions, 3 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. */