From e7d0fef0bbf7b8cfb3fcc0557c92c4d775ffbc1e7a11336310529963fc41a9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Fri, 4 Jun 2010 13:02:14 +0000 Subject: [PATCH 1/4] - fix sbit removal code [bnc#610941] - sort permlist file OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=51 --- fixsbits.diff | 47 +++++++++++++++++++++++++++++++++++++++++++++++ rpm.changes | 6 ++++++ rpm.spec | 4 +++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 fixsbits.diff diff --git a/fixsbits.diff b/fixsbits.diff new file mode 100644 index 0000000..d2e75bc --- /dev/null +++ b/fixsbits.diff @@ -0,0 +1,47 @@ +--- ./lib/fsm.c.orig 2010-06-04 12:34:06.000000000 +0000 ++++ ./lib/fsm.c 2010-06-04 12:36:46.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) && \ + !strncmp((_x), "/dev/log", sizeof("/dev/log")-1) && \ +@@ -2028,11 +2043,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, +@@ -2041,6 +2053,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) { diff --git a/rpm.changes b/rpm.changes index 91e629b..9b98906 100644 --- a/rpm.changes +++ b/rpm.changes @@ -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 diff --git a/rpm.spec b/rpm.spec index 50db57e..bcbba21 100644 --- a/rpm.spec +++ b/rpm.spec @@ -113,6 +113,7 @@ Patch76: pythondeps.diff Patch77: fontprovides.diff Patch78: nosource.diff Patch79: nosignature.diff +Patch80: fixsbits.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # 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 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 80 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #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 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 -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 %{SOURCE6} $RPM_BUILD_ROOT/usr/lib/rpm install -m 755 scripts/find-supplements{,.ksyms} $RPM_BUILD_ROOT/usr/lib/rpm From 1bb203d6bb4185067fdd65644ad57603050df5560057314c6ed6424b101b2352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Fri, 4 Jun 2010 13:48:58 +0000 Subject: [PATCH 2/4] OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=52 --- fixsbits.diff | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fixsbits.diff b/fixsbits.diff index d2e75bc..e54690e 100644 --- a/fixsbits.diff +++ b/fixsbits.diff @@ -1,5 +1,5 @@ ---- ./lib/fsm.c.orig 2010-06-04 12:34:06.000000000 +0000 -+++ ./lib/fsm.c 2010-06-04 12:36:46.000000000 +0000 +--- ./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 } } @@ -21,8 +21,8 @@ + #define IS_DEV_LOG(_x) \ ((_x) != NULL && strlen(_x) >= (sizeof("/dev/log")-1) && \ - !strncmp((_x), "/dev/log", sizeof("/dev/log")-1) && \ -@@ -2028,11 +2043,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS + rstreqn((_x), "/dev/log", sizeof("/dev/log")-1) && \ +@@ -2027,11 +2042,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS break; case FSM_UNLINK: @@ -36,7 +36,7 @@ rc = unlink(fsm->path); if (_fsm_debug && (stage & FSM_SYSCALL)) rpmlog(RPMLOG_DEBUG, " %8s (%s) %s\n", cur, -@@ -2041,6 +2053,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS +@@ -2040,6 +2052,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS rc = (errno == ENOENT ? CPIOERR_ENOENT : CPIOERR_UNLINK_FAILED); break; case FSM_RENAME: From acb2b5a12a5d5d1327290549f5f8e232a433db0fe17e75e1469733fe92e4d704 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 4 Jun 2010 14:12:15 +0000 Subject: [PATCH 3/4] checked in (request 41140) OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=53 --- fixsbits.diff | 47 ----------------------------------------------- rpm.changes | 6 ------ rpm.spec | 4 +--- 3 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 fixsbits.diff diff --git a/fixsbits.diff b/fixsbits.diff deleted file mode 100644 index e54690e..0000000 --- a/fixsbits.diff +++ /dev/null @@ -1,47 +0,0 @@ ---- ./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) { diff --git a/rpm.changes b/rpm.changes index 9b98906..91e629b 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,9 +1,3 @@ -------------------------------------------------------------------- -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 diff --git a/rpm.spec b/rpm.spec index bcbba21..50db57e 100644 --- a/rpm.spec +++ b/rpm.spec @@ -113,7 +113,6 @@ Patch76: pythondeps.diff Patch77: fontprovides.diff Patch78: nosource.diff Patch79: nosignature.diff -Patch80: fixsbits.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -175,7 +174,6 @@ 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 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 80 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/firmware.prov @@ -247,7 +245,7 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/share/locale/de/LC_MESSAGES/rpm.mo mkdir -p $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 -find $RPM_BUILD_ROOT/usr/src/packages/* -type d | sed -e "s@$RPM_BUILD_ROOT@@" | sort > $RPM_BUILD_ROOT/usr/lib/rpm/permlist +find $RPM_BUILD_ROOT/usr/src/packages/* -type d | sed -e "s@$RPM_BUILD_ROOT@@" > $RPM_BUILD_ROOT/usr/lib/rpm/permlist install -m 755 %{SOURCE5} $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 From 5c6203cf674083ccb2f012d3a7e5da8b2615a639a8c1af3bba072c42461e41b0 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Fri, 4 Jun 2010 14:12:17 +0000 Subject: [PATCH 4/4] Updating link to change in openSUSE:Factory/rpm revision 97.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=306b01b222f3abeb89d2f75787b240c5 --- fixsbits.diff | 47 +++++++++++++++++++++++++++++++++++++++++++++++ rpm-python.spec | 2 +- rpm.changes | 6 ++++++ rpm.spec | 6 ++++-- 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 fixsbits.diff diff --git a/fixsbits.diff b/fixsbits.diff new file mode 100644 index 0000000..e54690e --- /dev/null +++ b/fixsbits.diff @@ -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) { diff --git a/rpm-python.spec b/rpm-python.spec index b4b29ad..1a168e3 100644 --- a/rpm-python.spec +++ b/rpm-python.spec @@ -25,7 +25,7 @@ License: GPLv2+ Group: System/Packages Summary: Python Bindings for Manipulating RPM Packages Version: 4.8.0 -Release: 2 +Release: 3 Requires: rpm = %{version} %py_requires Source99: rpm.spec diff --git a/rpm.changes b/rpm.changes index 91e629b..9b98906 100644 --- a/rpm.changes +++ b/rpm.changes @@ -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 diff --git a/rpm.spec b/rpm.spec index 50db57e..7b6421e 100644 --- a/rpm.spec +++ b/rpm.spec @@ -28,7 +28,7 @@ PreReq: %insserv_prereq %fillup_prereq permissions AutoReqProv: on Summary: The RPM Package Manager Version: 4.8.0 -Release: 2 +Release: 3 Source: rpm-%{version}.tar.bz2 Source1: RPM-HOWTO.tar.bz2 Source2: RPM-Tips.html.tar.bz2 @@ -113,6 +113,7 @@ Patch76: pythondeps.diff Patch77: fontprovides.diff Patch78: nosource.diff Patch79: nosignature.diff +Patch80: fixsbits.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # 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 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 80 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #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 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 -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 %{SOURCE6} $RPM_BUILD_ROOT/usr/lib/rpm install -m 755 scripts/find-supplements{,.ksyms} $RPM_BUILD_ROOT/usr/lib/rpm