public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: - remove s-bits on upgrade too (#598775)
@ 2026-11-23  9:26 Panu Matilainen
  0 siblings, 0 replies; only message in thread
From: Panu Matilainen @ 2026-11-23  9:26 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 8c454e468a948fbabb264beaaf254889d324c270
Author : Panu Matilainen <pmatilai@fedoraproject.org>
Date   : 2010-06-02T06:27:47+00:00
Stats  : +49/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/8c454e468a948fbabb264beaaf254889d324c270?branch=pmatilai-v6

Log:
- remove s-bits on upgrade too (#598775)

---
diff --git a/rpm-4.8.0-fsm-sbits.patch b/rpm-4.8.0-fsm-sbits.patch
new file mode 100644
index 0000000..e1a7ab6
--- /dev/null
+++ b/rpm-4.8.0-fsm-sbits.patch
@@ -0,0 +1,43 @@
+diff -up rpm-4.8.0/lib/fsm.c.fsm-sbits rpm-4.8.0/lib/fsm.c
+--- rpm-4.8.0/lib/fsm.c.fsm-sbits	2009-12-07 16:36:49.000000000 +0200
++++ rpm-4.8.0/lib/fsm.c	2010-06-02 09:25:52.000000000 +0300
+@@ -1320,6 +1320,16 @@ static const char * rpmteTypeString(rpmt
+     }
+ }
+ 
++static void removeSBITS(const char *path)
++{
++    struct stat stb;
++    if (lstat(path, &stb) == 0) {
++	if (S_ISREG(stb.st_mode) && (stb.st_mode & 06000) != 0) {
++	    (void) chmod(path, stb.st_mode & 0777);
++	}
++    }
++}
++
+ #define	IS_DEV_LOG(_x)	\
+ 	((_x) != NULL && strlen(_x) >= (sizeof("/dev/log")-1) && \
+ 	rstreqn((_x), "/dev/log", sizeof("/dev/log")-1) && \
+@@ -2024,11 +2034,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,
+@@ -2037,6 +2044,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.spec b/rpm.spec
index 3515ad0..700fe6b 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -21,7 +21,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: 17%{?dist}
+Release: 18%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -53,6 +53,7 @@ Patch208: rpm-4.8.0-python-mibool.patch
 Patch209: rpm-4.8.0-python-emptyds.patch
 Patch210: rpm-4.8.0-findlang-localedirs.patch
 Patch211: rpm-4.8.0-spec-readline.patch
+Patch212: rpm-4.8.0-fsm-sbits.patch
 
 # These are not yet upstream
 Patch301: rpm-4.6.0-niagara.patch
@@ -212,6 +213,7 @@ packages on a system.
 %patch209 -p1 -b .python-emptyds
 %patch210 -p1 -b .findlang-localedirs
 %patch211 -p1 -b .spec-readline
+%patch212 -p1 -b .fsm-sbits
 
 %patch301 -p1 -b .niagara
 %patch302 -p1 -b .geode
@@ -428,6 +430,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Wed Jun 02 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-18
+- remove s-bits on upgrade too (#598775)
+
 * Thu May 27 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-17
 - fix segfault in spec parser (#597835)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:26 [rpms/rpm] pmatilai-v6: - remove s-bits on upgrade too (#598775) Panu Matilainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox