Match the CUPS directives being rewritten the way cupsd reads them

cupsd compares directive names with _cups_strcasecmp, so a hand-edited "systemgroup sys root wheel" is live configuration, but matching $1 against the canonical spelling skipped it and appended a second directive at the end of the file. parse_groups accumulates the groups of every SystemGroup directive it reads rather than replacing them, so both lines took effect and wheel kept the passwordless administration this is meant to remove, with the migration reporting success.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Codex XHigh <noreply@openai.com>
This commit is contained in:
omabot
2026-08-27 19:55:36 +02:00
co-authored by Claude Opus 5 Codex XHigh
parent 521f1ae9ac
commit 68fc0cf6e6
2 changed files with 31 additions and 3 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ elif [[ -f $cups_files_conf ]]; then
if ! awk '
NR == FNR {
if ($1 == "SystemGroup") {
if (tolower($1) == "systemgroup") {
for (i = 2; i <= NF; i++) {
if (substr($i, 1, 1) == "#")
break
@@ -29,7 +29,7 @@ elif [[ -f $cups_files_conf ]]; then
next
}
$1 == "SystemGroup" {
tolower($1) == "systemgroup" {
comment_start = index($0, "#")
if (!wrote_system_group) {
printf "SystemGroup"
@@ -47,7 +47,7 @@ elif [[ -f $cups_files_conf ]]; then
next
}
$1 == "PeerCred" {
tolower($1) == "peercred" {
comment_start = index($0, "#")
if (!saw_peer_cred) {
printf "PeerCred on"