summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-12-14 22:03:14 +0000
committerjbj <devnull@localhost>2002-12-14 22:03:14 +0000
commitbecf1f7abaaf5304384490f8ef256f744f0c8dfc (patch)
tree465bbddc65acf7589504b38be0d06abb31322507
parent96f4a259b507751db2d51b43978ba7b69a149c3a (diff)
downloadrpm-becf1f7abaaf5304384490f8ef256f744f0c8dfc.tar.gz
rpm-becf1f7abaaf5304384490f8ef256f744f0c8dfc.tar.bz2
rpm-becf1f7abaaf5304384490f8ef256f744f0c8dfc.zip
- generate Elf provides even if file is not executable.
CVS patchset: 5942 CVS date: 2002/12/14 22:03:14
-rw-r--r--CHANGES1
-rw-r--r--build/rpmfc.c19
-rw-r--r--rpm.spec.in1
3 files changed, 12 insertions, 9 deletions
diff --git a/CHANGES b/CHANGES
index 363b69df4..4ce34bbd4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -48,6 +48,7 @@
- debug_packages "works", but non-noarch w/o %setup has empty payload.
- make dependency generation "opt-in" in order to build in distro.
- fix: make sure each library has DT_NEEDED for all unresolved syms.
+ - generate Elf provides even if file is not executable.
4.0.4 -> 4.1:
- loosely wire beecrypt library into rpm.
diff --git a/build/rpmfc.c b/build/rpmfc.c
index a3e7621a4..9bc236990 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -737,6 +737,7 @@ static int rpmfcELF(rpmfc fc)
char buf[BUFSIZ];
const char * s;
unsigned char deptype;
+ struct stat sb, * st = &sb;
const char * soname = NULL;
rpmds * depsp, this;
int_32 tagN, dsContext;
@@ -744,6 +745,10 @@ static int rpmfcELF(rpmfc fc)
int xx;
int isElf64;
+ /* Files with executable bit set only. */
+ if (stat(fn, st) != 0)
+ return(-1);
+
fdno = open(fn, O_RDONLY);
if (fdno < 0)
return fdno;
@@ -831,7 +836,8 @@ static int rpmfcELF(rpmfc fc)
case SHT_GNU_verneed:
deptype = 'R';
data = NULL;
- if (!fc->skipReq)
+ /* Files with executable bit set only. */
+ if (!fc->skipReq && (st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
while ((data = elf_getdata (scn, data)) != NULL) {
offset = 0;
for (cnt = shdr->sh_info; --cnt >= 0; ) {
@@ -895,9 +901,10 @@ static int rpmfcELF(rpmfc fc)
/*@innercontinue@*/ continue;
/*@notreached@*/ /*@switchbreak@*/ break;
case DT_NEEDED:
- /* Add to package requires. */
- if (fc->skipReq)
+ /* Files with executable bit set only. */
+ if (fc->skipReq || !(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
/*@innercontinue@*/ continue;
+ /* Add to package requires. */
deptype = 'R';
depsp = &fc->requires;
tagN = RPMTAG_REQUIRENAME;
@@ -978,7 +985,6 @@ int rpmfcApply(rpmfc fc)
const char * N;
const char * EVR;
int_32 Flags;
- struct stat sb, * st = &sb;
unsigned char deptype;
int nddict;
int previx;
@@ -992,11 +998,6 @@ int rpmfcApply(rpmfc fc)
for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
rpmfcApplyTbl fcat;
- /* Files with executable bit set only. */
- if (stat(fc->fn[fc->ix], st) != 0
- || !(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
- continue;
-
for (fcat = rpmfcApplyTable; fcat->func != NULL; fcat++) {
if (!(fc->fcolor->vals[fc->ix] & fcat->colormask))
/*@innercontinue@*/ continue;
diff --git a/rpm.spec.in b/rpm.spec.in
index 3638d87a9..c34421cd2 100644
--- a/rpm.spec.in
+++ b/rpm.spec.in
@@ -463,6 +463,7 @@ exit 0
* Sat Dec 14 2002 Jeff Johnson <jbj@redhat.com> 4.2-0.25
- rebuild rpm with internal dependency generation enabled.
- fix: make sure each library has DT_NEEDED for all unresolved syms.
+- generate Elf provides even if file is not executable.
* Fri Dec 13 2002 Jeff Johnson <jbj@redhat.com> 4.2-0.24
- debug_packages "works", but non-noarch w/o %setup has empty payload.