diff --git a/config/hooks/installed/encryption-validation.sh b/config/hooks/installed/encryption-validation.sh index 7d9d114..f62d4d9 100755 --- a/config/hooks/installed/encryption-validation.sh +++ b/config/hooks/installed/encryption-validation.sh @@ -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 diff --git a/config/hooks/installed/install-scripts.sh b/config/hooks/installed/install-scripts.sh index f6e2a56..58839ed 100755 --- a/config/hooks/installed/install-scripts.sh +++ b/config/hooks/installed/install-scripts.sh @@ -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." diff --git a/config/hooks/live/usb-automount.sh b/config/hooks/live/usb-automount.sh index e0cedd3..1b7fc96 100755 --- a/config/hooks/live/usb-automount.sh +++ b/config/hooks/live/usb-automount.sh @@ -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 diff --git a/tests/unit/encryption-validation_test.bats b/tests/unit/encryption-validation_test.bats index 7f9de46..e893542 100644 --- a/tests/unit/encryption-validation_test.bats +++ b/tests/unit/encryption-validation_test.bats @@ -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 +}