From 891606dc27390cff5082db4c10aa10c517052f5f Mon Sep 17 00:00:00 2001 From: drinkingoutofcups Date: Thu, 13 Aug 2026 20:47:32 -0500 Subject: [PATCH] Added new matches for SSID, IPv6, MAC, UUID, "file://", and ignores "cachyos" hostname. Some tidying up elsewhere --- usr/bin/cachyos-bugreport.sh | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/usr/bin/cachyos-bugreport.sh b/usr/bin/cachyos-bugreport.sh index 6b02102..bb8be50 100755 --- a/usr/bin/cachyos-bugreport.sh +++ b/usr/bin/cachyos-bugreport.sh @@ -67,32 +67,27 @@ bugreport() { cat << EOF >"$LOG_FILENAME" ____________________________________________ - Start of CachyOS bug report log file. Please send this report, along with a description of your bug, to CachyOS. Date: $(date) uname: $(uname -a) cmdline: $(cat /proc/cmdline) - ____________________________________________ -Getting Hardware Information +Getting hardware information $(inxi -Farz) ____________________________________________ -Getting Scheduler information +Getting scheduler information sched-ext: $(grep -R "" /sys/kernel/sched_ext/ 2>/dev/null || echo "sched_ext not available") $(journalctl --output cat -k | grep -i scheduler || true) - ____________________________________________ - dmesg $(dmesg) - ____________________________________________ journalctl of current boot @@ -102,11 +97,10 @@ journalctl of previous boot $(journalctl -b -1 -p 4..1 2>/dev/null || echo "No previous boot log available") ____________________________________________ - Installed packages $(get_installed_packages) --------------------------------------------- +____________________________________________ EOF } @@ -121,7 +115,9 @@ redact() { # Redact hostname (appears in uname, dmesg, journalctl) local hn hn=$(hostname) - sed_args+=(-e "s|$(sed_escape "$hn")||g") + if [[ $hn != "cachyos" ]]; then + sed_args+=(-e "s|$(sed_escape "$hn")||g") + fi # Redact real username and home directory (SUDO_USER is set when run via sudo) local real_user="${SUDO_USER:-}" @@ -132,15 +128,32 @@ redact() { sed_args+=(-e "s|${escaped_user}||g") fi + # Redact SSIDs + local ssid_list + ssid_list="$(nmcli -t -f name,type c | sed -nE 's/(.*)\:.*wireless/\1/p')" + + while IFS= read -r ssid; do + sed_args+=(-e "s|$(sed_escape "$ssid")||g") + done <<< "${ssid_list}" + # Redact IPv4 addresses (inxi -z handles its own output; this covers dmesg/journal) sed_args+=(-e 's/\b\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\b//g') + # Redact IPv6 addresses (standard unshortened format only) + sed_args+=(-e 's/\b\([0-9a-fA-F]\{4\}\:\)\{7\}[0-9a-fA-F]\{4\}\b//g') + # Redact MAC addresses (fallback for anything inxi -z may have missed) sed_args+=(-e 's/\b\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}\b//g') # Redact email addresses sed_args+=(-e 's/[a-zA-Z0-9._%+-]\+@[a-zA-Z0-9.-]\+\.[a-zA-Z]\{2,\}//g') + # Redact UUIDs + sed_args+=(-e 's/[0-9a-fA-F]\{8\}-\([0-9a-fA-F]\{4\}-\)\{3\}[0-9a-fA-F]\{12\}//g') + + # Redact some irrelevant files quoted and prefixed with file://, such as those output by xdg-desktop-portal-kde + sed_args+=(-e 's/\"file:\/\/.\+\"/\"file:\/\/\"/g') + # Single sed pass for all substitutions sed -i "${sed_args[@]}" "$LOG_FILENAME" }