Accepting request 41140 from Base:System

Copy from Base:System/rpm based on submit request 41140 from user mlschroe

OBS-URL: https://build.opensuse.org/request/show/41140
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=97
This commit is contained in:
OBS User autobuild 2010-06-04 14:12:17 +00:00 committed by Git OBS Bridge
commit 9cce58f10e
4 changed files with 58 additions and 3 deletions

47
fixsbits.diff Normal file
View File

@ -0,0 +1,47 @@
--- ./lib/fsm.c.orig 2010-06-04 13:47:57.000000000 +0000
+++ ./lib/fsm.c 2010-06-04 13:48:07.000000000 +0000
@@ -1323,6 +1323,21 @@ static const char * rpmteTypeString(rpmt
}
}
+static void removeSBITS(const char *path)
+{
+ struct stat stb;
+ if (lstat(path, &stb) == 0 && S_ISREG(stb.st_mode)) {
+ if ((stb.st_mode & 06000) != 0) {
+ (void) chmod(path, stb.st_mode & 0777);
+ }
+#if WITH_CAP
+ if (stb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) {
+ (void) cap_set_file(path, NULL);
+ }
+#endif
+ }
+}
+
#define IS_DEV_LOG(_x) \
((_x) != NULL && strlen(_x) >= (sizeof("/dev/log")-1) && \
rstreqn((_x), "/dev/log", sizeof("/dev/log")-1) && \
@@ -2027,11 +2042,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
break;
case FSM_UNLINK:
- if (fsm->mapFlags & CPIO_SBIT_CHECK) {
- struct stat stb;
- if (lstat(fsm->path, &stb) == 0 && S_ISREG(stb.st_mode) && (stb.st_mode & 06000) != 0)
- chmod(fsm->path, stb.st_mode & 0777);
- }
+ if (fsm->mapFlags & CPIO_SBIT_CHECK)
+ removeSBITS(fsm->path);
rc = unlink(fsm->path);
if (_fsm_debug && (stage & FSM_SYSCALL))
rpmlog(RPMLOG_DEBUG, " %8s (%s) %s\n", cur,
@@ -2040,6 +2052,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
rc = (errno == ENOENT ? CPIOERR_ENOENT : CPIOERR_UNLINK_FAILED);
break;
case FSM_RENAME:
+ if (fsm->mapFlags & CPIO_SBIT_CHECK)
+ removeSBITS(fsm->path);
rc = rename(fsm->opath, fsm->path);
#if defined(ETXTBSY) && defined(__HPUX__)
if (rc && errno == ETXTBSY) {

View File

@ -25,7 +25,7 @@ License: GPLv2+
Group: System/Packages Group: System/Packages
Summary: Python Bindings for Manipulating RPM Packages Summary: Python Bindings for Manipulating RPM Packages
Version: 4.8.0 Version: 4.8.0
Release: 2 Release: 3
Requires: rpm = %{version} Requires: rpm = %{version}
%py_requires %py_requires
Source99: rpm.spec Source99: rpm.spec

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 4 15:00:54 CEST 2010 - mls@suse.de
- fix sbit removal code [bnc#610941]
- sort permlist file
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Apr 9 12:00:29 CEST 2010 - mls@suse.de Fri Apr 9 12:00:29 CEST 2010 - mls@suse.de

View File

@ -28,7 +28,7 @@ PreReq: %insserv_prereq %fillup_prereq permissions
AutoReqProv: on AutoReqProv: on
Summary: The RPM Package Manager Summary: The RPM Package Manager
Version: 4.8.0 Version: 4.8.0
Release: 2 Release: 3
Source: rpm-%{version}.tar.bz2 Source: rpm-%{version}.tar.bz2
Source1: RPM-HOWTO.tar.bz2 Source1: RPM-HOWTO.tar.bz2
Source2: RPM-Tips.html.tar.bz2 Source2: RPM-Tips.html.tar.bz2
@ -113,6 +113,7 @@ Patch76: pythondeps.diff
Patch77: fontprovides.diff Patch77: fontprovides.diff
Patch78: nosource.diff Patch78: nosource.diff
Patch79: nosignature.diff Patch79: nosignature.diff
Patch80: fixsbits.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# #
# avoid bootstrapping problem # avoid bootstrapping problem
@ -174,6 +175,7 @@ rm -f rpmdb/db.h
%patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59 %patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59
%patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 %patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69
%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 %patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79
%patch -P 80
#chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-supplements{,.ksyms}
#chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms
#chmod 755 scripts/firmware.prov #chmod 755 scripts/firmware.prov
@ -245,7 +247,7 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/share/locale/de/LC_MESSAGES/rpm.mo
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -c -m0644 %{SOURCE9} $RPM_BUILD_ROOT/var/adm/fillup-templates/ install -c -m0644 %{SOURCE9} $RPM_BUILD_ROOT/var/adm/fillup-templates/
rm -f $RPM_BUILD_ROOT/usr/lib/rpm/cpanflute $RPM_BUILD_ROOT/usr/lib/rpm/cpanflute2 rm -f $RPM_BUILD_ROOT/usr/lib/rpm/cpanflute $RPM_BUILD_ROOT/usr/lib/rpm/cpanflute2
find $RPM_BUILD_ROOT/usr/src/packages/* -type d | sed -e "s@$RPM_BUILD_ROOT@@" > $RPM_BUILD_ROOT/usr/lib/rpm/permlist find $RPM_BUILD_ROOT/usr/src/packages/* -type d | sed -e "s@$RPM_BUILD_ROOT@@" | sort > $RPM_BUILD_ROOT/usr/lib/rpm/permlist
install -m 755 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/rpm install -m 755 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/rpm
install -m 755 %{SOURCE6} $RPM_BUILD_ROOT/usr/lib/rpm install -m 755 %{SOURCE6} $RPM_BUILD_ROOT/usr/lib/rpm
install -m 755 scripts/find-supplements{,.ksyms} $RPM_BUILD_ROOT/usr/lib/rpm install -m 755 scripts/find-supplements{,.ksyms} $RPM_BUILD_ROOT/usr/lib/rpm