New snapshot from upstream, fixes a number of bugs, important for f10 alpha

This commit is contained in:
Jesse Keating 2008-08-01 14:43:54 +00:00
parent e62394bdc9
commit 3bb32d657b
27 changed files with 118 additions and 3420 deletions

View File

@ -1 +1 @@
rpm-4.5.90.git8426.tar.bz2
rpm-4.5.90.git8444.tar.bz2

View File

@ -1,337 +0,0 @@
#!/bin/bash
#find-debuginfo.sh - automagically generate debug info and file list
#for inclusion in an rpm spec file.
#
# Usage: find-debuginfo.sh [-g] [--strict-build-id]
# [-o debugfiles.list]
# [[-l filelist]... [-p 'pattern'] -o debuginfo.list]
# [builddir]
#
# The -g flag says to use strip -g instead of full strip on DSOs.
# The --strict-build-id flag says to exit with failure status if
# any ELF binary processed fails to contain a build-id note.
#
# A single -o switch before any -l or -p switches simply renames
# the primary output file from debugfiles.list to something else.
# A -o switch that follows a -p switch or some -l switches produces
# an additional output file with the debuginfo for the files in
# the -l filelist file, or whose names match the -p pattern.
# The -p argument is an egrep-style regexp matching the a file name,
# and must not use anchors (^ or $).
#
# All file names in switches are relative to builddir (. if not given).
#
# With -g arg, pass it to strip on libraries.
strip_g=false
# Barf on missing build IDs.
# XXX temporarily on by default
strict=true
BUILDDIR=.
out=debugfiles.list
nout=0
while [ $# -gt 0 ]; do
case "$1" in
--strict-build-id)
strict=true
;;
-g)
strip_g=true
;;
-o)
if [ -z "${lists[$nout]}" -a -z "${ptns[$nout]}" ]; then
out=$2
else
outs[$nout]=$2
((nout++))
fi
shift
;;
-l)
lists[$nout]="${lists[$nout]} $2"
shift
;;
-p)
ptns[$nout]=$2
shift
;;
*)
BUILDDIR=$1
shift
break
;;
esac
shift
done
i=0
while ((i < nout)); do
outs[$i]="$BUILDDIR/${outs[$i]}"
l=''
for f in ${lists[$i]}; do
l="$l $BUILDDIR/$f"
done
lists[$i]=$l
((++i))
done
LISTFILE=$BUILDDIR/$out
SOURCEFILE=$BUILDDIR/debugsources.list
LINKSFILE=$BUILDDIR/debuglinks.list
> $SOURCEFILE
> $LISTFILE
> $LINKSFILE
debugdir="${RPM_BUILD_ROOT}/usr/lib/debug"
strip_to_debug()
{
local g=
$strip_g && case "$(file -bi "$2")" in
application/x-sharedlib,*) g=-g ;;
esac
eu-strip --remove-comment $g -f "$1" "$2" || exit
}
# Make a relative symlink to $1 called $3$2
shopt -s extglob
link_relative()
{
local t="$1" f="$2" pfx="$3"
local fn="${f#/}" tn="${t#/}"
local fd td d
while fd="${fn%%/*}"; td="${tn%%/*}"; [ "$fd" = "$td" ]; do
fn="${fn#*/}"
tn="${tn#*/}"
done
d="${fn%/*}"
if [ "$d" != "$fn" ]; then
d="${d//+([!\/])/..}"
tn="${d}/${tn}"
fi
mkdir -p "$(dirname "$pfx$f")" && ln -snf "$tn" "$pfx$f"
}
# Make a symlink in /usr/lib/debug/$2 to $1
debug_link()
{
local l="/usr/lib/debug$2"
local t="$1"
echo >> $LINKSFILE "$l $t"
link_relative "$t" "$l" "$RPM_BUILD_ROOT"
}
# Make a build-id symlink for id $1 with suffix $3 to file $2.
make_id_link()
{
local id="$1" file="$2"
local idfile=".build-id/${id:0:2}/${id:2}"
[ $# -eq 3 ] && idfile="${idfile}$3"
local root_idfile="$RPM_BUILD_ROOT/usr/lib/debug/$idfile"
if [ ! -L "$root_idfile" ]; then
debug_link "$file" "/$idfile"
return
fi
[ $# -eq 3 ] && return 0
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
eu-elfcmp -q "$root_idfile" "$RPM_BUILD_ROOT$file" 2> /dev/null; then
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
echo >&2 " and $other"
else
# This is pathological, break the build.
echo >&2 "*** ERROR: same build ID in nonidentical files!"
echo >&2 " $file"
echo >&2 " and $other"
exit 2
fi
}
get_debugfn()
{
dn=$(dirname "${1#$RPM_BUILD_ROOT}")
bn=$(basename "$1" .debug).debug
debugdn=${debugdir}${dn}
debugfn=${debugdn}/${bn}
}
set -o pipefail
strict_error=ERROR
$strict || strict_error=WARNING
# Strip ELF binaries
find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \
\( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
-print |
file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' |
xargs --no-run-if-empty stat -c '%h %D_%i %n' |
while read nlinks inum f; do
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
# If this file has multiple links, keep track and make
# the corresponding .debug files all links to one file too.
if [ $nlinks -gt 1 ]; then
eval linked=\$linked_$inum
if [ -n "$linked" ]; then
link=$debugfn
get_debugfn "$linked"
echo "hard linked $link to $debugfn"
ln -nf "$debugfn" "$link"
continue
else
eval linked_$inum=\$f
echo "file $f has $[$nlinks - 1] other hard links"
fi
fi
echo "extracting debug info from $f"
id=$(/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
-i -l "$SOURCEFILE" "$f") || exit
if [ -z "$id" ]; then
echo >&2 "*** ${strict_error}: No build ID note found in $f"
$strict && exit 2
fi
# A binary already copied into /usr/lib/debug doesn't get stripped,
# just has its file names collected and adjusted.
case "$dn" in
/usr/lib/debug/*)
[ -z "$id" ] || make_id_link "$id" "$dn/$(basename $f)"
continue ;;
esac
mkdir -p "${debugdn}"
if test -w "$f"; then
strip_to_debug "${debugfn}" "$f"
else
chmod u+w "$f"
strip_to_debug "${debugfn}" "$f"
chmod u-w "$f"
fi
if [ -n "$id" ]; then
make_id_link "$id" "$dn/$(basename $f)"
make_id_link "$id" "/usr/lib/debug$dn/$bn" .debug
fi
done || exit
# For each symlink whose target has a .debug file,
# make a .debug symlink to that file.
find $RPM_BUILD_ROOT ! -path "${debugdir}/*" -type l -print |
while read f
do
t=$(readlink -m "$f").debug
f=${f#$RPM_BUILD_ROOT}
t=${t#$RPM_BUILD_ROOT}
if [ -f "$debugdir$t" ]; then
echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
debug_link "/usr/lib/debug$t" "${f}.debug"
fi
done
if [ -s "$SOURCEFILE" ]; then
mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug
LC_ALL=C sort -z -u $SOURCEFILE | egrep -v -z '(<internal>|<built-in>)$' |
(cd $RPM_BUILD_DIR; cpio -pd0mL ${RPM_BUILD_ROOT}/usr/src/debug)
# stupid cpio creates new directories in mode 0700, fixup
find ${RPM_BUILD_ROOT}/usr/src/debug -type d -print0 |
xargs --no-run-if-empty -0 chmod a+rx
fi
if [ -d ${RPM_BUILD_ROOT}/usr/lib -o -d ${RPM_BUILD_ROOT}/usr/src ]; then
((nout > 0)) ||
test ! -d ${RPM_BUILD_ROOT}/usr/lib ||
(cd ${RPM_BUILD_ROOT}/usr/lib; find debug -type d) |
sed 's,^,%dir /usr/lib/,' >> $LISTFILE
(cd ${RPM_BUILD_ROOT}/usr
test ! -d lib/debug || find lib/debug ! -type d
test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
) | sed 's,^,/usr/,' >> $LISTFILE
fi
# Append to $1 only the lines from stdin not already in the file.
append_uniq()
{
fgrep -f "$1" -x -v >> "$1"
}
# Helper to generate list of corresponding .debug files from a file list.
filelist_debugfiles()
{
local extra="$1"
shift
sed 's/^%[a-z0-9_][a-z0-9_]*([^)]*) *//
s/^%[a-z0-9_][a-z0-9_]* *//
/^$/d
'"$extra" "$@"
}
# Write an output debuginfo file list based on given input file lists.
filtered_list()
{
local out="$1"
shift
test $# -gt 0 || return
fgrep -f <(filelist_debugfiles 's,^.*$,/usr/lib/debug&.debug,' "$@") \
-x $LISTFILE >> $out
sed -n -f <(filelist_debugfiles 's/[\\.*+#]/\\&/g
h
s,^.*$,s# &$##p,p
g
s,^.*$,s# /usr/lib/debug&.debug$##p,p
' "$@") $LINKSFILE | append_uniq "$out"
}
# Write an output debuginfo file list based on an egrep-style regexp.
pattern_list()
{
local out="$1" ptn="$2"
test -n "$ptn" || return
egrep -x -e "$ptn" $LISTFILE >> $out
sed -n -r "\#^$ptn #s/ .*\$//p" $LINKSFILE | append_uniq "$out"
}
#
# When given multiple -o switches, split up the output as directed.
#
i=0
while ((i < nout)); do
> ${outs[$i]}
filtered_list ${outs[$i]} ${lists[$i]}
pattern_list ${outs[$i]} "${ptns[$i]}"
fgrep -vx -f ${outs[$i]} $LISTFILE > ${LISTFILE}.new
mv ${LISTFILE}.new $LISTFILE
((++i))
done
if ((nout > 0)); then
# Now add the right %dir lines to each output list.
(cd ${RPM_BUILD_ROOT}; find usr/lib/debug -type d) |
sed 's#^.*$#\\@^/&/@{h;s@^.*$@%dir /&@p;g;}#' |
LC_ALL=C sort -ur > ${LISTFILE}.dirs.sed
i=0
while ((i < nout)); do
sed -n -f ${LISTFILE}.dirs.sed ${outs[$i]} | sort -u > ${outs[$i]}.new
cat ${outs[$i]} >> ${outs[$i]}.new
mv -f ${outs[$i]}.new ${outs[$i]}
((++i))
done
sed -n -f ${LISTFILE}.dirs.sed ${LISTFILE} | sort -u > ${LISTFILE}.new
cat $LISTFILE >> ${LISTFILE}.new
mv ${LISTFILE}.new $LISTFILE
fi

1
import.log Normal file
View File

@ -0,0 +1 @@
rpm-4_5_90-0_git8444_1:HEAD:rpm-4.5.90-0.git8444.1.src.rpm:1217601763

View File

@ -1,123 +0,0 @@
--- rpm-4.4.2/build/rpmfc.c 2006-04-27 21:35:41.000000000 -0400
+++ rpm/build/rpmfc.c 2006-04-27 21:33:48.000000000 -0400
@@ -492,7 +492,7 @@
{ "ASCII text", RPMFC_WHITE|RPMFC_INCLUDE },
{ "ISO-8859 text", RPMFC_WHITE|RPMFC_INCLUDE },
- { "symbolic link to", RPMFC_SYMLINK },
+ { "symbolic link to", RPMFC_SYMLINK|RPMFC_INCLUDE },
{ "socket", RPMFC_DEVICE },
{ "special", RPMFC_DEVICE },
@@ -642,6 +642,103 @@
}
/**
+ * Ensure that symlinks for shared libs generate a dep on the shared lib
+ * @param fc file classifier
+ * @return 0 on success
+ */
+static int rpmfcSYMLINK(rpmfc fc)
+{
+ const char * fn = fc->fn[fc->ix];
+ struct stat sb;
+ int fdno;
+
+ if (stat(fn, &sb) < 0)
+ return -1;
+ if (S_ISLNK(sb.st_mode))
+ return -1;
+
+ fdno = open(fn, O_RDONLY);
+ if (fdno < 0) {
+ return fdno;
+ }
+
+#if HAVE_GELF_H && HAVE_LIBELF
+ Elf * elf = NULL;
+ GElf_Ehdr ehdr_mem, * ehdr;
+ int isElf64;
+ int i, cnt;
+ char * soname = NULL;
+ char buf[BUFSIZ];
+ char * t;
+ rpmds ds;
+
+ (void) elf_version(EV_CURRENT);
+ elf = NULL;
+ if ((elf = elf_begin (fdno, ELF_C_READ_MMAP, NULL)) == NULL
+ || elf_kind(elf) != ELF_K_ELF
+ || (ehdr = gelf_getehdr(elf, &ehdr_mem)) == NULL
+ || ehdr->e_type != ET_DYN)
+ goto exit;
+
+ isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64;
+
+ for (i = 0; i < ehdr->e_phnum; ++i) {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
+ GElf_Shdr shdr_mem;
+ Elf_Data * data = NULL;
+ Elf_Scn * scn;
+ GElf_Shdr *shdr;
+
+ if (phdr == NULL || phdr->p_type != PT_DYNAMIC)
+ continue;
+
+ scn = gelf_offscn(elf, phdr->p_offset);
+ shdr = gelf_getshdr(scn, &shdr_mem);
+
+ if (shdr != NULL && shdr->sh_type == SHT_DYNAMIC)
+ data = elf_getdata (scn, NULL);
+ if (data == NULL)
+ continue;
+
+ for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) {
+ GElf_Dyn dynmem;
+ GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dynmem);
+ if (dyn == NULL)
+ break;
+ if (dyn->d_tag != DT_SONAME)
+ continue;
+
+ /* add the soname to package deps */
+ soname = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
+ if (soname == NULL)
+ break;
+ buf[0] = '\0';
+ t = buf;
+ t = stpcpy(t, soname);
+#if !defined(__alpha__)
+ if (isElf64)
+ t = stpcpy(t, "()(64bit)");
+#endif
+ t++;
+ /* Add to package dependencies. */
+ ds = rpmdsSingle(RPMTAG_REQUIRENAME,
+ buf, "", RPMSENSE_FIND_REQUIRES);
+ rpmdsMerge(&fc->requires, ds);
+ rpmfcSaveArg(&fc->ddict, rpmfcFileDep(t, fc->ix, ds));
+ ds = rpmdsFree(ds);
+ break;
+ }
+ }
+exit:
+ if (elf) (void) elf_end(elf);
+ close(fdno);
+ return 0;
+#endif
+ return -1;
+}
+
+/**
* Extract script dependencies.
* @param fc file classifier
* @return 0 on success
@@ -1069,6 +1166,7 @@
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) },
{ rpmfcSCRIPT, RPMFC_MONO },
+ { rpmfcSYMLINK, RPMFC_SYMLINK },
{ NULL, 0 }
};

View File

@ -1,28 +0,0 @@
--- rpm-4.4.2/lib/transaction.c.ghostconflicts 2005-06-11 15:37:34.000000000 -0400
+++ rpm-4.4.2/lib/transaction.c 2005-11-28 13:25:25.000000000 -0500
@@ -165,6 +165,7 @@
for (i = 0; i < sharedCount; i++, shared++) {
int otherFileNum, fileNum;
int isCfgFile;
+ int isGhostFile;
otherFileNum = shared->otherFileNum;
(void) rpmfiSetFX(otherFi, otherFileNum);
@@ -177,6 +178,7 @@
FColor &= tscolor;
isCfgFile = ((rpmfiFFlags(otherFi) | rpmfiFFlags(fi)) & RPMFILE_CONFIG);
+ isGhostFile = ((rpmfiFFlags(otherFi) & RPMFILE_GHOST) && (rpmfiFFlags(fi) & RPMFILE_GHOST));
#ifdef DYING
/* XXX another tedious segfault, assume file state normal. */
@@ -187,6 +189,9 @@
if (XFA_SKIPPING(fi->actions[fileNum]))
continue;
+ if (isGhostFile)
+ continue;
+
if (rpmfiCompare(otherFi, fi)) {
int rConflicts;

View File

@ -1,204 +0,0 @@
--- rpm-4.4.2/python/Makefile.am.matchpathcon 2005-02-16 19:18:37.000000000 -0500
+++ rpm-4.4.2/python/Makefile.am 2005-07-21 16:59:25.000000000 -0400
@@ -34,7 +34,8 @@
$(top_builddir)/rpmdb/librpmdb.la \
$(top_builddir)/rpmio/librpmio.la \
@WITH_POPT_LIB@ \
- @WITH_LIBELF_LIB@
+ @WITH_LIBELF_LIB@ \
+ @WITH_SELINUX_LIB@
LDADD =
--- rpm-4.4.2/python/rpmts-py.c.matchpathcon 2005-02-12 22:12:07.000000000 -0500
+++ rpm-4.4.2/python/rpmts-py.c 2005-07-21 16:47:11.000000000 -0400
@@ -1182,16 +1182,11 @@
/* Initialize security context patterns (if not already done). */
if (!(s->ts->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmsx sx = rpmtsREContext(s->ts);
- if (sx == NULL) {
- const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
- if (fn != NULL && *fn != '\0') {
- sx = rpmsxNew(fn);
- (void) rpmtsSetREContext(s->ts, sx);
- }
- fn = _free(fn);
+ const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+ if (fn != NULL && *fn != '\0') {
+ matchpathcon_init(fn);
}
- sx = rpmsxFree(sx);
+ fn = _free(fn);
}
if (_rpmts_debug)
--- rpm-4.4.2/lib/rpminstall.c.matchpathcon 2005-07-21 16:47:11.000000000 -0400
+++ rpm-4.4.2/lib/rpminstall.c 2005-07-21 16:47:11.000000000 -0400
@@ -310,16 +310,10 @@
/* Initialize security context patterns (if not already done). */
if (!(ia->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmsx sx = rpmtsREContext(ts);
- if (sx == NULL) {
- const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
- if (fn != NULL && *fn != '\0') {
- sx = rpmsxNew(fn);
- (void) rpmtsSetREContext(ts, sx);
- }
- fn = _free(fn);
- }
- sx = rpmsxFree(sx);
+ const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+ if (fn != NULL && *fn != '\0') {
+ matchpathcon_init(fn);
+ }
}
(void) rpmtsSetFlags(ts, ia->transFlags);
--- rpm-4.4.2/lib/rpmfi.c.matchpathcon 2005-02-10 03:30:28.000000000 -0500
+++ rpm-4.4.2/lib/rpmfi.c 2005-07-21 16:47:11.000000000 -0400
@@ -16,7 +16,7 @@
#define _RPMFI_INTERNAL
#include "rpmfi.h"
-#include "rpmsx.h"
+#include <selinux/selinux.h>
#define _RPMTE_INTERNAL /* relocations */
#include "rpmte.h"
@@ -1645,8 +1645,8 @@
{
int scareMem = 0;
rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem);
- rpmsx sx = NULL;
const char ** av = NULL;
+ const char * myfn = rpmGetPath("%{?__file_context_path}", NULL);
int ac;
size_t nb;
char * t;
@@ -1660,7 +1660,7 @@
}
/* Read security context patterns. */
- sx = rpmsxNew(NULL);
+ matchpathcon_init(myfn);
/* Compute size of argv array blob, concatenating file contexts. */
nb = ac * sizeof(*fcnb);
@@ -1671,10 +1671,9 @@
while (rpmfiNext(fi) >= 0) {
const char * fn = rpmfiFN(fi);
mode_t fmode = rpmfiFMode(fi);
- const char * scon;
+ security_context_t scon;
- scon = rpmsxFContext(sx, fn, fmode);
- if (scon != NULL) {
+ if (matchpathcon(fn, fmode, &scon) == 0) {
fcnb[ac] = strlen(scon) + 1;
/*@-branchstate@*/
if (fcnb[ac] > 0) {
@@ -1682,6 +1681,7 @@
memcpy(fctxt+fctxtlen, scon, fcnb[ac]);
fctxtlen += fcnb[ac];
}
+ freecon(scon);
/*@=branchstate@*/
}
ac++;
@@ -1707,7 +1707,6 @@
exit:
fi = rpmfiFree(fi);
- sx = rpmsxFree(sx);
/*@-branchstate@*/
if (fcontextp)
*fcontextp = av;
--- rpm-4.4.2/lib/fsm.c.matchpathcon 2004-10-09 15:40:09.000000000 -0400
+++ rpm-4.4.2/lib/fsm.c 2005-07-21 16:47:11.000000000 -0400
@@ -634,12 +634,11 @@
if (ts != NULL && rpmtsSELinuxEnabled(ts) == 1 &&
!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS))
{
- rpmsx sx = rpmtsREContext(ts);
+ security_context_t scon = NULL;
- if (sx != NULL) {
+ if ( matchpathcon(fsm->path, st->st_mode, &scon) == 0 && scon != NULL) {
/* Get file security context from patterns. */
- fsm->fcontext = rpmsxFContext(sx, fsm->path, st->st_mode);
- sx = rpmsxFree(sx);
+ fsm->fcontext = scon;
} else {
int i = fsm->ix;
--- rpm-4.4.2/build/Makefile.am.matchpathcon 2005-03-14 05:03:48.000000000 -0500
+++ rpm-4.4.2/build/Makefile.am 2005-07-21 16:47:11.000000000 -0400
@@ -35,6 +35,7 @@
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmdb/librpmdb.la \
$(top_builddir)/rpmio/librpmio.la \
+ @WITH_SELINUX_LIB@ \
@WITH_LIBELF_LIB@
rpmfile.h:
--- rpm-4.4.2/build/files.c.matchpathcon 2005-07-13 05:58:55.000000000 -0400
+++ rpm-4.4.2/build/files.c 2005-07-21 16:47:11.000000000 -0400
@@ -23,7 +23,7 @@
#define _RPMFI_INTERNAL
#include "rpmfi.h"
-#include "rpmsx.h"
+#include <selinux/selinux.h>
#define _RPMTE_INTERNAL
#include "rpmte.h"
@@ -1122,7 +1122,7 @@
int apathlen = 0;
int dpathlen = 0;
int skipLen = 0;
- rpmsx sx = NULL;
+ security_context_t scon = NULL;
const char * sxfn;
size_t fnlen;
FileListRec flp;
@@ -1142,7 +1142,7 @@
sxfn = rpmGetPath("%{?_build_file_context_path}", NULL);
if (sxfn != NULL && *sxfn != '\0')
- sx = rpmsxNew(sxfn);
+ matchpathcon_init(sxfn);
for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
const char *s;
@@ -1324,18 +1324,19 @@
&(flp->flags), 1);
/* Add file security context to package. */
-/*@-branchstate@*/
- if (sx != NULL) {
- mode_t fmode = (uint_16)flp->fl_mode;
- s = rpmsxFContext(sx, flp->fileURL, fmode);
- if (s == NULL) s = "";
- (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE,
- &s, 1);
- }
-/*@=branchstate@*/
+ mode_t fmode = (uint_16)flp->fl_mode;
+ int rc = matchpathcon(flp->fileURL, fmode, &scon);
+ if ( rc == 0 && scon != NULL) {
+ (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE, &scon, 1);
+ freecon(scon);
+ }
+ else {
+ const char *nocon = "";
+ (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE, &nocon, 1);
+ }
+
}
- sx = rpmsxFree(sx);
sxfn = _free(sxfn);
(void) headerAddEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE,

View File

@ -1,56 +0,0 @@
--- rpm-4.4.2/build/rpmfc.c.skip 2006-05-04 14:38:26.000000000 -0400
+++ rpm-4.4.2/build/rpmfc.c 2006-05-04 14:45:10.000000000 -0400
@@ -722,11 +722,13 @@
#endif
t++;
/* Add to package dependencies. */
- ds = rpmdsSingle(RPMTAG_REQUIRENAME,
+ if (!fc->skipReq) {
+ ds = rpmdsSingle(RPMTAG_REQUIRENAME,
buf, "", RPMSENSE_FIND_REQUIRES);
- rpmdsMerge(&fc->requires, ds);
- rpmfcSaveArg(&fc->ddict, rpmfcFileDep(t, fc->ix, ds));
- ds = rpmdsFree(ds);
+ rpmdsMerge(&fc->requires, ds);
+ rpmfcSaveArg(&fc->ddict, rpmfcFileDep(t, fc->ix, ds));
+ ds = rpmdsFree(ds);
+ }
break;
}
}
@@ -1187,6 +1189,7 @@
int ix;
int i;
int xx;
+ int skipping;
/* Generate package and per-file dependencies. */
for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
@@ -1234,15 +1237,18 @@
Flags = strtol(se, NULL, 16);
dix = -1;
+ skipping = 0;
switch (deptype) {
default:
/*@switchbreak@*/ break;
case 'P':
+ skipping = fc->skipProv;
ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags);
dix = rpmdsFind(fc->provides, ds);
ds = rpmdsFree(ds);
/*@switchbreak@*/ break;
case 'R':
+ skipping = fc->skipReq;
ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags);
dix = rpmdsFind(fc->requires, ds);
ds = rpmdsFree(ds);
@@ -1264,7 +1270,7 @@
previx = ix;
xx = argiAdd(&fc->fddictx, ix, argiCount(fc->ddictx)-1);
}
- if (fc->fddictn && fc->fddictn->vals)
+ if (fc->fddictn && fc->fddictn->vals && !skipping)
fc->fddictn->vals[ix]++;
}
/*@=boundswrite@*/

View File

@ -1,69 +0,0 @@
--- rpm-4.4.2/lib/poptQV.c.trust 2004-11-09 19:50:42.000000000 -0500
+++ rpm-4.4.2/lib/poptQV.c 2006-04-27 13:42:31.000000000 -0400
@@ -31,6 +31,10 @@
#define POPT_HDLIST -1011
#define POPT_FTSWALK -1012
+/* -1025 thrugh -1032 are common in rpmcli.h. */
+#define POPT_TARGETPLATFORM -1036
+#define POPT_TRUST -1037
+
/* ========== Query/Verify/Signature source args */
static void rpmQVSourceArgCallback( /*@unused@*/ poptContext con,
/*@unused@*/ enum poptCallbackReason reason,
@@ -240,6 +244,14 @@
qva->qva_flags |= VERIFY_SCRIPT;
break;
+ /* XXX perhaps POPT_ARG_INT instead of callback. */
+ case POPT_TRUST:
+ { char * end = NULL;
+ long trust = (int) strtol(arg, &end, 0);
+ /* XXX range checks on trust. */
+ /* XXX if (end && *end) argerror(_("non-numeric trust metric.")); */
+ qva->trust = trust;
+ } break;
}
}
@@ -376,14 +388,6 @@
N_("don't verify package signature(s)"), NULL },
#endif
-/** @todo Add --nogpg/--nopgp aliases to rpmpopt, eliminate. */
- { "nogpg", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
- &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
- N_("don't verify GPG V3 DSA signature(s)"), NULL },
- { "nopgp", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
- &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
- N_("don't verify PGP V3 RSA/MD5 signature(s)"), NULL },
-
POPT_TABLEEND
};
@@ -408,6 +412,15 @@
N_("sign package(s) (identical to --addsign)"), NULL },
{ "sign", '\0', POPT_ARGFLAG_DOC_HIDDEN, &rpmQVKArgs.sign, 0,
N_("generate signature"), NULL },
+ /* XXX perhaps POPT_ARG_INT instead of callback. */
+ { "trust", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_TRUST,
+ N_("specify trust metric"), "TRUST" },
+ { "trusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN,
+ &rpmQVKArgs.trust, 1,
+ N_("set ultimate trust when importing pubkey(s)"), NULL },
+ { "untrusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN,
+ &rpmQVKArgs.trust, -1,
+ N_("unset ultimate trust when importing pubkey(s)"), NULL },
{ "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST,
N_("don't verify package digest(s)"), NULL },
--- rpm-4.4.2/lib/rpmcli.h.trust 2005-01-04 11:35:05.000000000 -0500
+++ rpm-4.4.2/lib/rpmcli.h 2006-04-27 13:37:40.000000000 -0400
@@ -280,6 +280,7 @@
/*@only@*/ /*@null@*/
const char * qva_queryFormat;/*!< Format for headerSprintf(). */
int sign; /*!< Is a passphrase needed? */
+ int trust; /*!< Trust metric when importing pubkeys. */
/*@observer@*/
const char * passPhrase; /*!< Pass phrase. */
/*@observer@*/ /*@null@*/

View File

@ -1,21 +0,0 @@
--- rpm-4.4.2.1/configure.ac.no-popt 2007-08-23 10:24:17.000000000 +0300
+++ rpm-4.4.2.1/configure.ac 2007-08-23 10:26:41.000000000 +0300
@@ -1302,7 +1302,7 @@
dnl # XXX Propagate -lucb to popt ...
dnl export LIBS INCPATH CONFIG_SITE
-AC_CONFIG_SUBDIRS(popt file db3)
+AC_CONFIG_SUBDIRS(file db3)
AC_CONFIG_FILES([ Doxyfile Makefile rpmrc macros platform rpmpopt
rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
@@ -1322,8 +1322,6 @@
python/rpm/Makefile
lua/Makefile
])
-AC_CONFIG_COMMANDS([default],[[ echo timestamp > popt/stamp-h.in
- echo timestamp > stamp-h.in
-
+AC_CONFIG_COMMANDS([default],[[ echo timestamp > stamp-h.in
]],[[]])
AC_OUTPUT

View File

@ -1,12 +0,0 @@
diff -up rpm-4.4.2.2/Makefile.am.xxxx rpm-4.4.2.2/Makefile.am
--- rpm-4.4.2.2/Makefile.am.xxxx 2008-01-15 08:07:50.000000000 -0500
+++ rpm-4.4.2.2/Makefile.am 2008-01-15 08:08:03.000000000 -0500
@@ -94,7 +94,7 @@ rpm2cpio_SOURCES = $(top_srcdir)/rpm2cpi
rpm2cpio_LDFLAGS = $(myLDFLAGS)
rpm2cpio_LDADD = $(myLDADD) @LIBMISC@
-$(PROGRAMS): $(myLDADD) @WITH_APIDOCS_TARGET@
+$(PROGRAMS): @WITH_APIDOCS_TARGET@
.PHONY: splint
splint:

View File

@ -1,130 +0,0 @@
diff -up rpm-4.4.2.2/build/rpmfc.c.develdeps rpm-4.4.2.2/build/rpmfc.c
--- rpm-4.4.2.2/build/rpmfc.c.develdeps 2007-09-11 09:28:12.000000000 +0300
+++ rpm-4.4.2.2/build/rpmfc.c 2007-12-21 14:22:55.000000000 +0200
@@ -497,7 +497,7 @@ static struct rpmfcTokens_s rpmfcTokens[
{ "ASCII text", RPMFC_WHITE|RPMFC_INCLUDE },
{ "ISO-8859 text", RPMFC_WHITE|RPMFC_INCLUDE },
- { "symbolic link to", RPMFC_SYMLINK },
+ { "symbolic link to", RPMFC_SYMLINK|RPMFC_INCLUDE },
{ "socket", RPMFC_DEVICE },
{ "special", RPMFC_DEVICE },
@@ -647,6 +647,109 @@ rpmfc rpmfcNew(void)
}
/**
+ * Ensure that symlinks for shared libs generate a dep on the shared lib
+ * @param fc file classifier
+ * @return 0 on success
+ */
+static int rpmfcSYMLINK(rpmfc fc)
+{
+ const char * fn = fc->fn[fc->ix];
+ struct stat sb;
+ int fdno;
+
+ if (stat(fn, &sb) < 0)
+ return -1;
+ if (S_ISLNK(sb.st_mode))
+ return -1;
+
+ fdno = open(fn, O_RDONLY);
+ if (fdno < 0) {
+ return fdno;
+ }
+
+#if HAVE_GELF_H && HAVE_LIBELF
+ Elf * elf = NULL;
+ GElf_Ehdr ehdr_mem, * ehdr;
+ int isElf64;
+ int i, cnt;
+ char * soname = NULL;
+ char buf[BUFSIZ];
+ char * t;
+ rpmds ds;
+
+ (void) elf_version(EV_CURRENT);
+ elf = NULL;
+ if ((elf = elf_begin (fdno, ELF_C_READ_MMAP, NULL)) == NULL
+ || elf_kind(elf) != ELF_K_ELF
+ || (ehdr = gelf_getehdr(elf, &ehdr_mem)) == NULL
+ || ehdr->e_type != ET_DYN)
+ goto exit;
+
+ isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64;
+
+ for (i = 0; i < ehdr->e_phnum; ++i) {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
+ GElf_Shdr shdr_mem;
+ Elf_Data * data = NULL;
+ Elf_Scn * scn = NULL;
+ GElf_Shdr *shdr = NULL;
+
+ if (phdr == NULL || phdr->p_type != PT_DYNAMIC)
+ continue;
+
+ while ((scn = elf_nextscn(elf, scn)) != NULL) {
+ shdr = gelf_getshdr(scn, &shdr_mem);
+ if (shdr->sh_offset == phdr->p_offset)
+ break;
+ }
+
+ scn = gelf_offscn(elf, phdr->p_offset);
+ shdr = gelf_getshdr(scn, &shdr_mem);
+
+ if (scn != NULL && shdr != NULL && shdr->sh_type == SHT_DYNAMIC)
+ data = elf_getdata (scn, NULL);
+ if (data == NULL)
+ continue;
+
+ for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) {
+ GElf_Dyn dynmem;
+ GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dynmem);
+ if (dyn == NULL)
+ break;
+ if (dyn->d_tag != DT_SONAME)
+ continue;
+
+ /* add the soname to package deps */
+ soname = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
+ if (soname == NULL)
+ break;
+ buf[0] = '\0';
+ t = buf;
+ t = stpcpy(t, soname);
+#if !defined(__alpha__)
+ if (isElf64)
+ t = stpcpy(t, "()(64bit)");
+#endif
+ t++;
+ /* Add to package dependencies. */
+ ds = rpmdsSingle(RPMTAG_REQUIRENAME,
+ buf, "", RPMSENSE_FIND_REQUIRES);
+ rpmdsMerge(&fc->requires, ds);
+ rpmfcSaveArg(&fc->ddict, rpmfcFileDep(t, fc->ix, ds));
+ ds = rpmdsFree(ds);
+ break;
+ }
+ }
+exit:
+ if (elf) (void) elf_end(elf);
+ close(fdno);
+ return 0;
+#endif
+ return -1;
+}
+
+/**
* Extract script dependencies.
* @param fc file classifier
* @return 0 on success
@@ -1094,6 +1197,7 @@ static struct rpmfcApplyTbl_s rpmfcApply
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) },
{ rpmfcSCRIPT, RPMFC_MONO },
+ { rpmfcSYMLINK, RPMFC_SYMLINK },
{ NULL, 0 }
};

View File

@ -1,253 +0,0 @@
diff -up rpm-4.4.2.2-rc2/python/Makefile.am.matchpathcon rpm-4.4.2.2-rc2/python/Makefile.am
--- rpm-4.4.2.2-rc2/python/Makefile.am.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/python/Makefile.am 2007-09-27 11:05:29.000000000 +0300
@@ -34,7 +34,8 @@ mylibs= \
$(top_builddir)/rpmdb/librpmdb.la \
$(top_builddir)/rpmio/librpmio.la \
@WITH_POPT_LIB@ \
- @WITH_LIBELF_LIB@
+ @WITH_LIBELF_LIB@ \
+ @WITH_SELINUX_LIB@
LDADD =
diff -up rpm-4.4.2.2-rc2/python/rpmts-py.c.matchpathcon rpm-4.4.2.2-rc2/python/rpmts-py.c
--- rpm-4.4.2.2-rc2/python/rpmts-py.c.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/python/rpmts-py.c 2007-09-27 11:25:29.000000000 +0300
@@ -1187,17 +1187,13 @@ rpmts_Run(rpmtsObject * s, PyObject * ar
}
/* Initialize security context patterns (if not already done). */
- if (!(s->ts->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmsx sx = rpmtsREContext(s->ts);
- if (sx == NULL) {
- const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
- if (fn != NULL && *fn != '\0') {
- sx = rpmsxNew(fn);
- (void) rpmtsSetREContext(s->ts, sx);
- }
- fn = _free(fn);
+ if (rpmtsSELinuxEnabled(s->ts) &&
+ !(s->ts->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
+ const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+ if (fn != NULL && *fn != '\0') {
+ matchpathcon_init(fn);
}
- sx = rpmsxFree(sx);
+ fn = _free(fn);
}
if (_rpmts_debug)
diff -up rpm-4.4.2.2-rc2/build/Makefile.am.matchpathcon rpm-4.4.2.2-rc2/build/Makefile.am
--- rpm-4.4.2.2-rc2/build/Makefile.am.matchpathcon 2007-09-11 09:28:12.000000000 +0300
+++ rpm-4.4.2.2-rc2/build/Makefile.am 2007-09-27 11:05:29.000000000 +0300
@@ -35,6 +35,7 @@ librpmbuild_la_LDFLAGS = -release 4.4 $(
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmdb/librpmdb.la \
$(top_builddir)/rpmio/librpmio.la \
+ @WITH_SELINUX_LIB@ \
@WITH_LIBELF_LIB@
rpmfile.h:
diff -up rpm-4.4.2.2-rc2/build/files.c.matchpathcon rpm-4.4.2.2-rc2/build/files.c
--- rpm-4.4.2.2-rc2/build/files.c.matchpathcon 2007-09-11 09:28:12.000000000 +0300
+++ rpm-4.4.2.2-rc2/build/files.c 2007-09-27 11:05:29.000000000 +0300
@@ -23,7 +23,7 @@
#define _RPMFI_INTERNAL
#include "rpmfi.h"
-#include "rpmsx.h"
+#include <selinux/selinux.h>
#define _RPMTE_INTERNAL
#include "rpmte.h"
@@ -1136,7 +1136,7 @@ static void genCpioListAndHeader(/*@part
int apathlen = 0;
int dpathlen = 0;
int skipLen = 0;
- rpmsx sx = NULL;
+ security_context_t scon = NULL;
const char * sxfn;
size_t fnlen;
FileListRec flp;
@@ -1156,7 +1156,7 @@ static void genCpioListAndHeader(/*@part
sxfn = rpmGetPath("%{?_build_file_context_path}", NULL);
if (sxfn != NULL && *sxfn != '\0')
- sx = rpmsxNew(sxfn);
+ matchpathcon_init(sxfn);
for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
const char *s;
@@ -1338,18 +1338,19 @@ static void genCpioListAndHeader(/*@part
&(flp->flags), 1);
/* Add file security context to package. */
-/*@-branchstate@*/
- if (sx != NULL) {
- mode_t fmode = (uint_16)flp->fl_mode;
- s = rpmsxFContext(sx, flp->fileURL, fmode);
- if (s == NULL) s = "";
- (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE,
- &s, 1);
- }
-/*@=branchstate@*/
+ mode_t fmode = (uint_16)flp->fl_mode;
+ int rc = matchpathcon(flp->fileURL, fmode, &scon);
+ if ( rc == 0 && scon != NULL) {
+ (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE, &scon, 1);
+ freecon(scon);
+ }
+ else {
+ const char *nocon = "";
+ (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE, &nocon, 1);
+ }
+
}
- sx = rpmsxFree(sx);
sxfn = _free(sxfn);
(void) headerAddEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE,
diff -up rpm-4.4.2.2-rc2/lib/fsm.c.matchpathcon rpm-4.4.2.2-rc2/lib/fsm.c
--- rpm-4.4.2.2-rc2/lib/fsm.c.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/lib/fsm.c 2007-09-27 11:28:30.000000000 +0300
@@ -634,12 +634,11 @@ static int fsmMapFContext(FSM_t fsm)
if (ts != NULL && rpmtsSELinuxEnabled(ts) == 1 &&
!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS))
{
- rpmsx sx = rpmtsREContext(ts);
+ security_context_t scon = NULL;
- if (sx != NULL) {
+ if ( matchpathcon(fsm->path, st->st_mode, &scon) == 0 && scon != NULL) {
/* Get file security context from patterns. */
- fsm->fcontext = rpmsxFContext(sx, fsm->path, st->st_mode);
- sx = rpmsxFree(sx);
+ fsm->fcontext = scon;
} else {
int i = fsm->ix;
@@ -1277,7 +1276,7 @@ static int fsmMkdirs(/*@special@*/ /*@pa
/*@-compdef@*/
rpmts ts = fsmGetTs(fsm);
/*@=compdef@*/
- rpmsx sx = rpmtsREContext(ts);
+ security_context_t scon = NULL;
fsm->path = NULL;
@@ -1341,10 +1340,15 @@ static int fsmMkdirs(/*@special@*/ /*@pa
if (!rc) {
/* XXX FIXME? only new dir will have context set. */
/* Get file security context from patterns. */
- if (sx != NULL) {
- fsm->fcontext = rpmsxFContext(sx, fsm->path, st->st_mode);
- rc = fsmNext(fsm, FSM_LSETFCON);
+ if (rpmtsSELinuxEnabled(ts) &&
+ ! rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS) {
+ if (matchpathcon(fsm->path, st->st_mode, &scon) == 0 &&
+ scon != NULL) {
+ fsm->fcontext = scon;
+ rc = fsmNext(fsm, FSM_LSETFCON);
+ }
}
+
if (fsm->fcontext == NULL)
rpmMessage(RPMMESS_DEBUG,
_("%s directory created with perms %04o, no context.\n"),
@@ -1377,7 +1381,6 @@ static int fsmMkdirs(/*@special@*/ /*@pa
}
/*@=boundswrite@*/
dnli = dnlFreeIterator(dnli);
- sx = rpmsxFree(sx);
/*@=observertrans =dependenttrans@*/
fsm->path = path;
diff -up rpm-4.4.2.2-rc2/lib/rpmfi.c.matchpathcon rpm-4.4.2.2-rc2/lib/rpmfi.c
--- rpm-4.4.2.2-rc2/lib/rpmfi.c.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/lib/rpmfi.c 2007-09-27 11:05:29.000000000 +0300
@@ -16,7 +16,7 @@
#define _RPMFI_INTERNAL
#include "rpmfi.h"
-#include "rpmsx.h"
+#include <selinux/selinux.h>
#define _RPMTE_INTERNAL /* relocations */
#include "rpmte.h"
@@ -1697,8 +1697,8 @@ void rpmfiBuildREContexts(Header h,
{
int scareMem = 0;
rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem);
- rpmsx sx = NULL;
const char ** av = NULL;
+ const char * myfn = rpmGetPath("%{?__file_context_path}", NULL);
int ac;
size_t nb;
char * t;
@@ -1712,7 +1712,7 @@ void rpmfiBuildREContexts(Header h,
}
/* Read security context patterns. */
- sx = rpmsxNew(NULL);
+ matchpathcon_init(myfn);
/* Compute size of argv array blob, concatenating file contexts. */
nb = ac * sizeof(*fcnb);
@@ -1723,10 +1723,9 @@ void rpmfiBuildREContexts(Header h,
while (rpmfiNext(fi) >= 0) {
const char * fn = rpmfiFN(fi);
mode_t fmode = rpmfiFMode(fi);
- const char * scon;
+ security_context_t scon;
- scon = rpmsxFContext(sx, fn, fmode);
- if (scon != NULL) {
+ if (matchpathcon(fn, fmode, &scon) == 0) {
fcnb[ac] = strlen(scon) + 1;
/*@-branchstate@*/
if (fcnb[ac] > 0) {
@@ -1734,6 +1733,7 @@ void rpmfiBuildREContexts(Header h,
memcpy(fctxt+fctxtlen, scon, fcnb[ac]);
fctxtlen += fcnb[ac];
}
+ freecon(scon);
/*@=branchstate@*/
}
ac++;
@@ -1759,7 +1759,6 @@ void rpmfiBuildREContexts(Header h,
exit:
fi = rpmfiFree(fi);
- sx = rpmsxFree(sx);
/*@-branchstate@*/
if (fcontextp)
*fcontextp = av;
diff -up rpm-4.4.2.2-rc2/lib/rpminstall.c.matchpathcon rpm-4.4.2.2-rc2/lib/rpminstall.c
--- rpm-4.4.2.2-rc2/lib/rpminstall.c.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/lib/rpminstall.c 2007-09-27 11:27:46.000000000 +0300
@@ -309,17 +309,12 @@ int rpmInstall(rpmts ts,
ia->transFlags |= RPMTRANS_FLAG_REPACKAGE;
/* Initialize security context patterns (if not already done). */
- if (!(ia->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmsx sx = rpmtsREContext(ts);
- if (sx == NULL) {
- const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
- if (fn != NULL && *fn != '\0') {
- sx = rpmsxNew(fn);
- (void) rpmtsSetREContext(ts, sx);
- }
- fn = _free(fn);
- }
- sx = rpmsxFree(sx);
+ if (rpmtsSELinuxEnabled(ts) &&
+ !(ia->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
+ const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+ if (fn != NULL && *fn != '\0') {
+ matchpathcon_init(fn);
+ }
}
(void) rpmtsSetFlags(ts, ia->transFlags);

View File

@ -1,14 +0,0 @@
Set PKG_CONFIG_PATH correctly wrt target arch.
Optimally belongs in redhat-rpm-config but easier to just add here...
--- rpm-4.4.2/macros.in.pkgconfigpath 2007-01-30 15:57:37.000000000 -0500
+++ rpm-4.4.2/macros.in 2007-01-30 16:04:25.000000000 -0500
@@ -926,6 +926,8 @@
export RPM_BUILD_ROOT}\
%{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
export CLASSPATH}\
+ PKG_CONFIG_PATH=\"%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
+ export PKG_CONFIG_PATH\
\
%{verbose:set -x}%{!verbose:exec > /dev/null}\
umask 022\

View File

@ -1,20 +0,0 @@
diff --git a/autodeps/linux.req b/autodeps/linux.req
index c0a0cc9..70f627d 100644
--- a/autodeps/linux.req
+++ b/autodeps/linux.req
@@ -105,6 +104,7 @@ for f in $liblist $exelist ; do
print $2 ;
}
}
+ (START==2) && /^[A-Za-z]/ { START=3; }
/^Version References:$/ { START=2; }
(START==2) && /required from/ {
sub(/:/, "", $3);
@@ -113,7 +113,6 @@ for f in $liblist $exelist ; do
(START==2) && (LIBNAME!="") && ($4!="") && (($4~/^GLIBC_*/) || ($4~/^GCC_*/)) {
print LIBNAME "(" $4 ")'$lib64'";
}
- /^[A-Za-z]/ { START=3; }
'
done | sort -u

View File

@ -1,23 +0,0 @@
changeset: 6240:77473bfeaa7a
tag: tip
user: Panu Matilainen <pmatilai@redhat.com>
date: Fri Jan 25 17:33:35 2008 +0200
files: installplatform
description:
Urgh, add geode to x86_64 secondary arch subst-crack...
(transplanted from 1196f54f1c475819b16c419f3f060c9fe3ff1e91)
diff -r 8e1c3b69d2af -r 77473bfeaa7a installplatform
--- a/installplatform Fri Jan 25 14:08:27 2008 +0200
+++ b/installplatform Fri Jan 25 17:33:35 2008 +0200
@@ -36,7 +36,7 @@ case "$arch" in
sparc*) SUBSTS='s_sparc\(64\|64v\|v9v\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6ip]\|$\)_ppc64\1_ s_ppc\([^6ip]\|$\)_ppciseries_ s_ppc\([^6ip]\|$\)_ppcpseries_ s_ppc\([^6ip]\|$\)_ppc64iseries_ s_ppc\([^6ip]\|$\)_ppc64pseries_' ;;
s390*) SUBSTS='s_s390x_s390_ s_s390\([^x]\|$\)_s390x\1_' ;;
- x86_64|amd64|ia32e) SUBSTS='s,x86_64,x86_64, s,x86_64,ia32e, s,x86_64,amd64, s,x86_64,i386, s,x86_64,i486, s,x86_64,i586, s,x86_64,i686, s,x86_64,pentium3, s,x86_64,pentium4, s,x86_64,athlon,' ;;
+ x86_64|amd64|ia32e) SUBSTS='s,x86_64,x86_64, s,x86_64,ia32e, s,x86_64,amd64, s,x86_64,i386, s,x86_64,i486, s,x86_64,i586, s,x86_64,i686, s,x86_64,pentium3, s,x86_64,pentium4, s,x86_64,athlon, s,x86_64,geode,' ;;
*) SUBSTS=y___ ;;
esac

View File

@ -1,25 +0,0 @@
diff -up rpm-4.4.2.3-rc1/lib/depends.c.no-limit rpm-4.4.2.3-rc1/lib/depends.c
--- rpm-4.4.2.3-rc1/lib/depends.c.no-limit 2008-03-12 08:40:08.000000000 +0200
+++ rpm-4.4.2.3-rc1/lib/depends.c 2008-03-12 08:58:15.000000000 +0200
@@ -1229,7 +1229,7 @@ int rpmtsOrder(rpmts ts)
int numOrderList;
int npeer = 128; /* XXX more than deep enough for now. */
int * peer = memset(alloca(npeer*sizeof(*peer)), 0, (npeer*sizeof(*peer)));
- int nrescans = 10;
+ int nrescans = 0;
int _printed = 0;
char deptypechar;
size_t tsbytes;
@@ -1563,8 +1563,10 @@ rescan:
/* If a relation was eliminated, then continue sorting. */
/* XXX TODO: add control bit. */
- if (nzaps && nrescans-- > 0) {
- rpmMessage(RPMMESS_DEBUG, _("========== continuing tsort ...\n"));
+ if (nzaps > 0) {
+ rpmMessage(RPMMESS_DEBUG,
+ _("========== continuing tsort ... (rescan %d)\n"),
+ ++nrescans);
goto rescan;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +0,0 @@
diff -up rpm-4.4.2.3/build/rpmfc.c.prereq rpm-4.4.2.3/build/rpmfc.c
--- rpm-4.4.2.3/build/rpmfc.c.prereq 2008-04-01 09:47:42.000000000 +0300
+++ rpm-4.4.2.3/build/rpmfc.c 2008-04-01 09:54:54.000000000 +0300
@@ -1488,7 +1488,7 @@ static struct DepMsg_s depMsgs[] = {
_notpre(RPMSENSE_SCRIPT_POSTUN), 0 },
{ "Requires", { "%{?__find_requires}", NULL, NULL, NULL },
-1, -1, RPMTAG_REQUIREFLAGS, /* XXX inherit name/version arrays */
- RPMSENSE_FIND_REQUIRES|RPMSENSE_TRIGGERIN|RPMSENSE_TRIGGERUN|RPMSENSE_TRIGGERPOSTUN|RPMSENSE_TRIGGERPREIN, 0 },
+ RPMSENSE_PREREQ, RPMSENSE_PREREQ },
{ "Conflicts", { "%{?__find_conflicts}", NULL, NULL, NULL },
RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_CONFLICTFLAGS,
0, -1 },
diff -up rpm-4.4.2.3/lib/rpmlib.h.prereq rpm-4.4.2.3/lib/rpmlib.h
--- rpm-4.4.2.3/lib/rpmlib.h.prereq 2008-04-01 09:13:04.000000000 +0300
+++ rpm-4.4.2.3/lib/rpmlib.h 2008-04-01 09:47:42.000000000 +0300
@@ -505,8 +505,7 @@ typedef enum rpmsenseFlags_e {
RPMSENSE_EQUAL = (1 << 3),
RPMSENSE_PROVIDES = (1 << 4), /* only used internally by builds */
RPMSENSE_CONFLICTS = (1 << 5), /* only used internally by builds */
- /* bit 6 used to be RPMSENSE_PREREQ */
-#define RPMSENSE_PREREQ RPMSENSE_ANY
+ RPMSENSE_PREREQ = (1 << 6), /*!< @todo Legacy. */
RPMSENSE_OBSOLETES = (1 << 7), /* only used internally by builds */
RPMSENSE_INTERP = (1 << 8), /*!< Interpreter used by scriptlet. */
RPMSENSE_SCRIPT_PRE = ((1 << 9)|RPMSENSE_PREREQ), /*!< %pre dependency. */

View File

@ -1,12 +0,0 @@
diff -up rpm-4.4.2.3-rc1/macros.in.qfmt rpm-4.4.2.3-rc1/macros.in
--- rpm-4.4.2.3-rc1/macros.in.qfmt 2008-01-25 16:52:39.000000000 +0200
+++ rpm-4.4.2.3-rc1/macros.in 2008-01-25 16:57:31.000000000 +0200
@@ -791,7 +791,7 @@ print (t)\
# Default headerSprintf() output format string for rpm -qa
#
# XXX Note: escaped %% for use in headerSprintf()
-%_query_all_fmt %%{name}-%%{version}-%%{release}
+%_query_all_fmt %%{name}-%%{version}-%%{release}%%|arch?{.%%{arch}}:{}|
#
# Default path to the file used for transaction fcmtl lock.

View File

@ -1,18 +0,0 @@
diff -up rpm-4.4.2.3-rc1/rpmrc.in.BAD rpm-4.4.2.3-rc1/rpmrc.in
--- rpm-4.4.2.3-rc1/rpmrc.in.BAD 2008-03-27 10:49:49.000000000 -0500
+++ rpm-4.4.2.3-rc1/rpmrc.in 2008-03-27 10:50:27.000000000 -0500
@@ -37,10 +37,10 @@ optflags: alphaev67 -O2 -g -mieee -march
optflags: sparc -O2 -g -m32 -mtune=ultrasparc
optflags: sparcv8 -O2 -g -m32 -mtune=ultrasparc -mv8
-optflags: sparcv9 -O2 -g -m32 -march=ultrasparc
-optflags: sparcv9v -O2 -g -m32 -march=niagara
-optflags: sparc64 -O2 -g -m64 -march=ultrasparc
-optflags: sparc64v -O2 -g -m64 -march=niagara
+optflags: sparcv9 -O2 -g -m32 -mcpu=ultrasparc
+optflags: sparcv9v -O2 -g -m32 -mcpu=niagara
+optflags: sparc64 -O2 -g -m64 -mcpu=ultrasparc
+optflags: sparc64v -O2 -g -m64 -mcpu=niagara
optflags: m68k -O2 -g -fomit-frame-pointer

View File

@ -1,13 +0,0 @@
diff --git a/rpmio/digest.c b/rpmio/digest.c
index c360919..64b678b 100644
--- a/rpmio/digest.c
+++ b/rpmio/digest.c
@@ -123,7 +123,7 @@ int
rpmDigestFinal(DIGEST_CTX ctx, void ** datap, size_t *lenp, int asAscii)
{
unsigned char * digest;
- size_t digestlen;
+ unsigned int digestlen;
if (ctx == NULL)
return -1;

View File

@ -1,17 +0,0 @@
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 14d4565..cc0638a 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -797,8 +797,10 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
{ ARGV_t av = NULL;
char *s = xcalloc((lastc-se)+1, sizeof(*s));
- memmove(s, se, (lastc-se));
- ret = se + strlen(s) + 1;
+ /* XXX expandMacro() expects next \0 which can be beyond lastc */
+ ret = strchr(se, '\0');
+ memcpy(s, se, (lastc-se));
+
argvSplit(&av, s, " ");
argvAppend(&argv, av);

View File

@ -1,22 +0,0 @@
commit b3bd21e9f07272a37c2259070f95b167e6301c79
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Mon Jul 14 11:53:10 2008 +0300
Fix mono dependency extraction
- use "Mono/.Net assembly" instead of "PE executable" for detection,
later file reports bitness (eg "PE32 executable"), we just care if its
mono or not. This is compatible with older libmagic too.
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 3cc2d6d..6f15b2c 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -490,7 +490,7 @@ static const struct rpmfcTokens_s const rpmfcTokens[] = {
/* XXX .NET executables and libraries. file(1) cannot differ from win32
* executables unfortunately :( */
- { "PE executable", RPMFC_MONO|RPMFC_INCLUDE },
+ { "Mono/.Net assembly", RPMFC_MONO|RPMFC_INCLUDE },
{ "current ar archive", RPMFC_STATIC|RPMFC_LIBRARY|RPMFC_ARCHIVE|RPMFC_INCLUDE },

View File

@ -1,32 +0,0 @@
commit 6df78d16a68ff508a965ba2166f3b376e850b138
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Sat Jul 19 15:27:42 2008 +0300
Fix regression in %patch handling (rhbz#455872)
- popt doesn't think of "008" as an integer, let popt think it's a string
as we do our own conversion to number anyway
diff --git a/build/parsePrep.c b/build/parsePrep.c
index 4b0ccdf..fcc28c8 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -403,16 +403,16 @@ static int doSetupMacro(rpmSpec spec, const char *line)
*/
static rpmRC doPatchMacro(rpmSpec spec, const char *line)
{
- char *opt_b;
+ char *opt_b, *opt_P;
char *buf = NULL;
- int opt_P, opt_p, opt_R, opt_E, opt_F;
+ int opt_p, opt_R, opt_E, opt_F;
int argc, c;
const char **argv = NULL;
ARGV_t patch, patchnums = NULL;
rpmRC rc = RPMRC_FAIL; /* assume failure */
struct poptOption const patchOpts[] = {
- { NULL, 'P', POPT_ARG_INT, &opt_P, 'P', NULL, NULL },
+ { NULL, 'P', POPT_ARG_STRING, &opt_P, 'P', NULL, NULL },
{ NULL, 'p', POPT_ARG_INT, &opt_p, 'p', NULL, NULL },
{ NULL, 'R', POPT_ARG_NONE, &opt_R, 'R', NULL, NULL },
{ NULL, 'E', POPT_ARG_NONE, &opt_E, 'E', NULL, NULL },

101
rpm-4.5.90-posttrans.patch Normal file
View File

@ -0,0 +1,101 @@
diff --git a/lib/transaction.c b/lib/transaction.c
index 7e432a3..42f1b12 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -910,33 +910,51 @@ static int runTransScripts(rpmts ts, rpmTag stag)
if (script == NULL && scriptprog == NULL)
continue;
- p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_OPEN_FILE, 0, 0);
- p->h = NULL;
- if (rpmteFd(p) != NULL) {
- rpmVSFlags ovsflags = rpmtsVSFlags(ts);
- rpmVSFlags vsflags = ovsflags | RPMVSF_NEEDPAYLOAD;
- rpmRC rpmrc;
- ovsflags = rpmtsSetVSFlags(ts, vsflags);
- rpmrc = rpmReadPackageFile(ts, rpmteFd(p),
- rpmteNEVR(p), &p->h);
- vsflags = rpmtsSetVSFlags(ts, ovsflags);
- switch (rpmrc) {
- default:
- /* FIX: notify annotations */
- p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
- p->fd = NULL;
- break;
- case RPMRC_NOTTRUSTED:
- case RPMRC_NOKEY:
- case RPMRC_OK:
- break;
+ if (stag==RPMTAG_POSTTRANS) {
+ /* get (already installed) header from rpmdb */
+ rpmdbMatchIterator mi;
+ mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(p), 0);
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP,
+ rpmteE(p));
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_STRCMP,
+ rpmteV(p));
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP,
+ rpmteR(p));
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP,
+ rpmteA(p));
+
+ p->h = headerCopy(rpmdbNextIterator(mi));
+ mi = rpmdbFreeIterator(mi);
+ } else {
+ /* reread rpm file */
+ p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_OPEN_FILE, 0, 0);
+ p->h = NULL;
+ if (rpmteFd(p) != NULL) {
+ rpmVSFlags ovsflags = rpmtsVSFlags(ts);
+ rpmVSFlags vsflags = ovsflags | RPMVSF_NEEDPAYLOAD;
+ rpmRC rpmrc;
+ ovsflags = rpmtsSetVSFlags(ts, vsflags);
+ rpmrc = rpmReadPackageFile(ts, rpmteFd(p),
+ rpmteNEVR(p), &p->h);
+ vsflags = rpmtsSetVSFlags(ts, ovsflags);
+ switch (rpmrc) {
+ default:
+ /* FIX: notify annotations */
+ p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
+ p->fd = NULL;
+ break;
+ case RPMRC_NOTTRUSTED:
+ case RPMRC_NOKEY:
+ case RPMRC_OK:
+ break;
+ }
}
- }
+ }
- if (rpmteFd(p) != NULL) {
- fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1);
+ if (p->h) {
+ fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1);
if (fi != NULL) { /* XXX can't happen */
- if (stag == RPMTAG_PRETRANS) {
+ if (stag == RPMTAG_PRETRANS) { /* isn't this the same? */
fi->te = p;
p->fi = fi;
} else {
@@ -944,14 +962,16 @@ static int runTransScripts(rpmts ts, rpmTag stag)
p->fi->te = p;
}
}
+ fi->h = p->h; // is this right?
psm = rpmpsmNew(ts, p, p->fi);
assert(psm != NULL);
xx = rpmpsmScriptStage(psm, stag, progtag);
psm = rpmpsmFree(psm);
-
- (void) rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
- p->fd = NULL;
- p->h = headerFree(p->h);
+ if (p->fd != NULL) {
+ (void) rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
+ p->fd = NULL;
+ }
+ p->h = fi->h = headerFree(p->h);
}
}
pi = rpmtsiFree(pi);

View File

@ -10,7 +10,7 @@
%define rpmhome /usr/lib/rpm
%define rpmver 4.5.90
%define snapver git8426
%define snapver git8444
%define srcver %{rpmver}.%{snapver}
%define bdbver 4.5.20
@ -18,7 +18,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
Release: 0.%{snapver}.9
Release: 0.%{snapver}.1
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@ -31,11 +31,8 @@ Patch1: rpm-4.5.90-pkgconfig-path.patch
# XXX only create provides for pkgconfig and libtool initially
Patch100: rpm-4.6.x-no-pkgconfig-reqs.patch
# These are already upstream, drop on next snapshot update:
Patch200: rpm-4.5.90-digestlen.patch
Patch201: rpm-4.5.90-mono-magic.patch
Patch202: rpm-4.5.90-macroarg.patch
Patch203: rpm-4.5.90-patchnum.patch
# These are not yet upstream
Patch200: rpm-4.5.90-posttrans.patch
# Partially GPL/LGPL dual-licensed and some bits with BSD
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
@ -163,10 +160,7 @@ that will manipulate RPM packages and databases.
%patch1 -p1 -b .pkgconfig-path
%patch100 -p1 -b .pkgconfig-deps
%patch200 -p1 -b .diglen
%patch201 -p1 -b .mono-magic
%patch202 -p1 -b .macroarg
%patch203 -p1 -b .patchnum
%patch200 -p1 -b .posttrans
%if %{with int_bdb}
ln -s db-%{bdbver} db
@ -342,6 +336,15 @@ exit 0
%doc doc/librpm/html/*
%changelog
* Thu Jul 31 2008 Florian Festi <ffesti@redhat.com>
- 4.5.90-0.git8427.1
- new snapshot from upstream
* Thu Jul 31 2008 Florian Festi <ffesti@redhat.com>
- 4.5.90-0.git8426.10
- rpm-4.5.90-posttrans.patch
- use header from rpmdb in posttrans to make anaconda happy
* Sat Jul 19 2008 Panu Matilainen <pmatilai@redhat.com>
- 4.5.90-0.git8426.9
- fix regression in patch number handling (#455872)

View File

@ -1 +1 @@
019294e156d2a3acefee118e38f65836 rpm-4.5.90.git8426.tar.bz2
c753868c909cb711d1f06a9fedf092cc rpm-4.5.90.git8444.tar.bz2