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:
@@ -103,8 +103,8 @@ echo " Losing this passphrase will result in permanent data loss."
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Create a warning file in the user's home directory
|
# Create a warning file in the user's home directory
|
||||||
if [ -d /home/kneluser ]; then
|
if [ -d /home/football ]; then
|
||||||
cat > /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt <<'EOF'
|
cat > /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt <<'EOF'
|
||||||
================================================================================
|
================================================================================
|
||||||
KNEL-Football Secure OS - ENCRYPTION PASSPHRASE REMINDER
|
KNEL-Football Secure OS - ENCRYPTION PASSPHRASE REMINDER
|
||||||
================================================================================
|
================================================================================
|
||||||
@@ -144,10 +144,10 @@ DOCUMENTATION:
|
|||||||
================================================================================
|
================================================================================
|
||||||
EOF
|
EOF
|
||||||
# Add installation date after heredoc (variable expansion)
|
# Add installation date after heredoc (variable expansion)
|
||||||
echo "" >> /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt
|
echo "" >> /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt
|
||||||
echo "Date of installation: $(date)" >> /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt
|
echo "Date of installation: $(date)" >> /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt
|
||||||
chown kneluser:kneluser /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt
|
chown football:football /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt
|
||||||
chmod 600 /home/kneluser/ENCRYPTION-PASSPHRASE-REMINDER.txt
|
chmod 600 /home/football/ENCRYPTION-PASSPHRASE-REMINDER.txt
|
||||||
|
|
||||||
echo "Encryption reminder created: ~/ENCRYPTION-PASSPHRASE-REMINDER.txt"
|
echo "Encryption reminder created: ~/ENCRYPTION-PASSPHRASE-REMINDER.txt"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ EOF
|
|||||||
# Create WireGuard configuration directory
|
# Create WireGuard configuration directory
|
||||||
mkdir -p /etc/wireguard
|
mkdir -p /etc/wireguard
|
||||||
|
|
||||||
# Add kneluser to appropriate groups
|
# Add football to appropriate groups
|
||||||
usermod -a -G sudo,audio,video,plugdev,input,cdrom,floppy kneluser 2>/dev/null || true
|
usermod -a -G sudo,audio,video,plugdev,input,cdrom,floppy football 2>/dev/null || true
|
||||||
|
|
||||||
echo "Source scripts installed successfully."
|
echo "Source scripts installed successfully."
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ chmod +x /usr/local/bin/usb-automount.sh
|
|||||||
chmod +x /usr/local/bin/usb-unmount.sh
|
chmod +x /usr/local/bin/usb-unmount.sh
|
||||||
|
|
||||||
# Add user to plugdev group for USB access
|
# 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
|
# Create PCManFM configuration for better file management
|
||||||
mkdir -p /etc/skel/.config/pcmanfm
|
mkdir -p /etc/skel/.config/pcmanfm
|
||||||
|
|||||||
@@ -18,3 +18,32 @@
|
|||||||
@test "Validation script uses set -e for error handling" {
|
@test "Validation script uses set -e for error handling" {
|
||||||
grep -q "set -e" /workspace/config/hooks/installed/encryption-validation.sh
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user