public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rear] rawhide: Mark ISO filesystem labels as write protected
@ 2026-10-01  8:48 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-10-01  8:48 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rear
            Branch : rawhide
            Commit : 53622e06d596712d0c99c5ab246ff09201e7b81b
            Author : Lukáš Zaoral <lzaoral@redhat.com>
            Date   : 2026-10-01T10:45:05+02:00
            Stats  : +69/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rear/c/53622e06d596712d0c99c5ab246ff09201e7b81b?branch=rawhide

            Log:
            Mark ISO filesystem labels as write protected

Resolves: RHEL-143987

---
diff --git a/rear-mark-ISO-labels-write-protected-RHEL-143987.patch b/rear-mark-ISO-labels-write-protected-RHEL-143987.patch
new file mode 100644
index 0000000..e5fb815
--- /dev/null
+++ b/rear-mark-ISO-labels-write-protected-RHEL-143987.patch
@@ -0,0 +1,65 @@
+From cc5fdf86845923414ff44e6636ee261b6a495897 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
+Date: Fri, 27 Mar 2026 20:23:34 +0100
+Subject: [PATCH] ISO: mark ISO filesystem labels as write protected
+
+The majority of these changes have been made using Claude.
+
+Assisted-by: Cursor with Claude Opus 4.6
+---
+ usr/share/rear/conf/default.conf              |  5 ++++-
+ .../480_initialize_write_protect_settings.sh  | 19 +++++++++++++++++++
+ 2 files changed, 23 insertions(+), 1 deletion(-)
+ create mode 100644 usr/share/rear/prep/ISO/default/480_initialize_write_protect_settings.sh
+
+diff --git a/usr/share/rear/conf/default.conf b/usr/share/rear/conf/default.conf
+index e170b21ea..a8e6990a6 100644
+--- a/usr/share/rear/conf/default.conf
++++ b/usr/share/rear/conf/default.conf
+@@ -717,7 +717,7 @@ AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE=10
+ 
+ ####
+ # Write-protection during "rear recover"
+-# for OUTPUT=USB and OUTPUT=RAWDISK
++# for OUTPUT=USB, OUTPUT=ISO and OUTPUT=RAWDISK
+ #
+ # Designate disks via disk specific IDs or file system labels as write-protected
+ # to avoid that those disks could get used as target disk during "rear recover"
+@@ -755,6 +755,9 @@ WRITE_PROTECTED_IDS=()
+ # Example: WRITE_PROTECTED_FS_LABEL_PATTERNS+=( "Backup *" )
+ # For OUTPUT=USB the file system label of the ReaR data partition on the ReaR recovery system disk
+ # is automatically added to WRITE_PROTECTED_FS_LABEL_PATTERNS during "rear mkrescue/mkbackup".
++# For OUTPUT=ISO the ISO filesystem label (ISO_VOLID, default 'REAR-ISO') and patterns
++# for split ISOs (${ISO_VOLID}_*) are automatically added during "rear mkrescue/mkbackup"
++# so that a device from which the ISO was booted is protected from being overwritten.
+ WRITE_PROTECTED_FS_LABEL_PATTERNS=()
+ ####
+ 
+diff --git a/usr/share/rear/prep/ISO/default/480_initialize_write_protect_settings.sh b/usr/share/rear/prep/ISO/default/480_initialize_write_protect_settings.sh
+new file mode 100644
+index 000000000..7bd1bc600
+--- /dev/null
++++ b/usr/share/rear/prep/ISO/default/480_initialize_write_protect_settings.sh
+@@ -0,0 +1,19 @@
++# Generated by Cursor with Claude Opus 4.6
++#
++# ISO output may be written to a writable medium (e.g. USB stick) which
++# should be protected against overwriting by "rear recover"
++# cf. https://github.com/rear/rear/issues/1271
++# This code registers the ISO filesystem label as write-protected.
++# CD/DVD media (sr0, sr1, ...) are inherently protected by the removable device
++# check in layout/prepare/default/250_compare_disks.sh and 300_map_disks.sh
++# but ISOs booted from writable media (e.g. USB sticks or hard disks) need
++# explicit write protection, analogous to what OUTPUT=USB does.
++
++# The ISO_VOLID label (default 'REAR-ISO', see default.conf) is added
++# to WRITE_PROTECTED_FS_LABEL_PATTERNS.
++# When the backup is split on multiple ISOs (cf. ISO_MAX_SIZE)
++# the first ISO has the label $ISO_VOLID and subsequent ISOs get
++# the labels ${ISO_VOLID}_01 ${ISO_VOLID}_02 ... respectively
++# so the glob pattern '${ISO_VOLID}_*' is used to match all of them.
++WRITE_PROTECTED_FS_LABEL_PATTERNS+=( "${ISO_VOLID}" "${ISO_VOLID}_*" )
++DebugPrint "ISO filesystem label patterns '${ISO_VOLID}' and '${ISO_VOLID}_*' added to WRITE_PROTECTED_FS_LABEL_PATTERNS"
+-- 
+2.55.0
+

diff --git a/rear.spec b/rear.spec
index 66858b4..ef3ae7f 100644
--- a/rear.spec
+++ b/rear.spec
@@ -81,6 +81,10 @@ Patch132: rear-dbus-broker-RHEL-134213.patch
 # https://github.com/rear/rear/commit/626701843a32070080856c960b9e4202102b81d1
 Patch137: rear-respect-EXCLUDE_COMPONENTS-in-extract_partitions-RHEL-235767.patch
 
+# mark ISO filesystem labels as write protected
+# https://github.com/rear/rear/commit/014a7653b56f9ab8471af591ddf3698d08f0f290
+Patch138: rear-mark-ISO-labels-write-protected-RHEL-143987.patch
+
 ######################
 # downstream patches #
 ######################

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

only message in thread, other threads:[~2026-10-01  8:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01  8:48 [rpms/rear] rawhide: Mark ISO filesystem labels as write protected 

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