fix: standardize username to 'football' in all hooks (FINDING-008)

The preseed.cfg creates user 'football' but hooks referenced 'kneluser'.
This inconsistency would cause runtime failures during installation.

Changes:
- config/hooks/installed/encryption-validation.sh: s/kneluser/football/g
- config/hooks/live/usb-automount.sh: s/kneluser/football/g
- config/hooks/installed/install-scripts.sh: s/kneluser/football/g
- tests/unit/encryption-validation_test.bats: Add 5 tests for username consistency

Fixes: FINDING-008 (User account inconsistency)
Reference: PRD.md user account requirements

💘 Generated with Crush

Assisted-by: Claude via Crush <crush@charm.land>
This commit is contained in:
Charles N Wyble
2026-02-20 10:49:47 -05:00
parent 09b4f12026
commit 589c14833d
4 changed files with 38 additions and 9 deletions

View File

@@ -103,8 +103,8 @@ echo " Losing this passphrase will result in permanent data loss."
echo ""
# Create a warning file in the user's home directory
if [ -d /home/kneluser ]; then
cat > /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt <<'EOF'
if [ -d /home/football ]; then
cat > /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt <<'EOF'
================================================================================
KNEL-Football Secure OS - ENCRYPTION PASSPHRASE REMINDER
================================================================================
@@ -144,10 +144,10 @@ DOCUMENTATION:
================================================================================
EOF
# Add installation date after heredoc (variable expansion)
echo "" >> /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt
echo "Date of installation: $(date)" >> /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt
chown kneluser:kneluser /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt
chmod 600 /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt
echo "" >> /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt
echo "Date of installation: $(date)" >> /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt
chown football:football /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt
chmod 600 /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt
echo "Encryption reminder created: ~/ENCRYPTION-PASSPHRASE-REMINDER.txt"
fi

View File

@@ -73,7 +73,7 @@ EOF
# Create WireGuard configuration directory
mkdir -p /etc/wireguard
# Add kneluser to appropriate groups
usermod -a -G sudo,audio,video,plugdev,input,cdrom,floppy kneluser 2>/dev/null || true
# Add football to appropriate groups
usermod -a -G sudo,audio,video,plugdev,input,cdrom,floppy football 2>/dev/null || true
echo "Source scripts installed successfully."

View File

@@ -62,7 +62,7 @@ chmod +x /usr/local/bin/usb-automount.sh
chmod +x /usr/local/bin/usb-unmount.sh
# Add user to plugdev group for USB access
usermod -a -G plugdev kneluser 2>/dev/null || true
usermod -a -G plugdev football 2>/dev/null || true
# Create PCManFM configuration for better file management
mkdir -p /etc/skel/.config/pcmanfm

View File

@@ -18,3 +18,32 @@
@test "Validation script uses set -e for error handling" {
grep -q "set -e" /workspace/config/hooks/installed/encryption-validation.sh
}
# =============================================================================
# USERNAME CONSISTENCY (FINDING-008)
# =============================================================================
@test "Username 'football' is consistent across all hook files" {
# preseed.cfg creates user 'football', hooks should reference same username
run grep -r "kneluser" /workspace/config/hooks/
[ "$status" -ne 0 ]
}
@test "Username in preseed.cfg is 'football'" {
grep -q "passwd/username string football" /workspace/config/includes.installer/preseed.cfg
}
@test "encryption-validation.sh uses correct username 'football'" {
# Should NOT reference 'kneluser'
! grep -q "kneluser" /workspace/config/hooks/installed/encryption-validation.sh
}
@test "usb-automount.sh uses correct username 'football'" {
# Should NOT reference 'kneluser'
! grep -q "kneluser" /workspace/config/hooks/live/usb-automount.sh
}
@test "install-scripts.sh uses correct username 'football'" {
# Should NOT reference 'kneluser'
! grep -q "kneluser" /workspace/config/hooks/installed/install-scripts.sh
}