set uid/gid of source files to the same as the process's

CVS patchset: 1879
CVS date: 1997/10/29 20:08:20
This commit is contained in:
ewt 1997-10-29 20:08:20 +00:00
parent 2048155a4b
commit b3a2b23fce
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2.4.9 -> 2.4.10:
- obsolete entries could cause segv's during upgrades
- sources now installed with uid/gid of process rather then
the ids used when the src rpm was created
2.4.8 -> 2.4.9:
- fix for verification on systems where a single group id
maps to mulitiple group names (Benedict Lofstedt)

View File

@ -1160,6 +1160,8 @@ static int installSources(Header h, char * rootdir, int fd,
char * chptr;
char * currDir;
int currDirLen;
uid_t currUid = getuid();
gid_t currGid = getgid();
rpmMessage(RPMMESS_DEBUG, "installing a source package\n");
@ -1193,8 +1195,11 @@ static int installSources(Header h, char * rootdir, int fd,
/* we can't remap v1 packages */
assembleFileList(h, &fileMem, &fileCount, &files, 0);
for (i = 0; i < fileCount; i++)
for (i = 0; i < fileCount; i++) {
files[i].relativePath = files[i].relativePath;
files[i].uid = currUid;
files[i].gid = currGid;
}
if (headerIsEntry(h, RPMTAG_COOKIE))
for (i = 0; i < fileCount; i++)