Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix superuser for EFI boot #51

Closed
wants to merge 1 commit into from

Conversation

JSurf
Copy link
Contributor

@JSurf JSurf commented Sep 7, 2021

Overall Review of Changes:
current way of setting the superuser directly in grub.cfg does not work, the way it is set, it will be ignored, the following config is generated:

### BEGIN /etc/grub.d/01_users ###
set superusers="someuser"
if [ -f ${prefix}/user.cfg ]; then
  source ${prefix}/user.cfg
  if [ -n "${GRUB2_PASSWORD}" ]; then
    set superusers="root"
    export superusers
    password_pbkdf2 root ${GRUB2_PASSWORD}
  fi
fi
 ### END /etc/grub.d/01_users ###

grub.cfg should not be edited directly, files in /etc/grub.d should be used (in this case /etc/grub.d/01_users

with this pull request config is generated as follows and handlers are correctly fired to generate grub.cfg:

### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
  source ${prefix}/user.cfg
  if [ -n "${GRUB2_PASSWORD}" ]; then
    set superusers="someuser"
    export superusers
    password_pbkdf2 someuser ${GRUB2_PASSWORD}
  fi
fi
 ### END /etc/grub.d/01_users ###

Issue Fixes:

Enhancements:

How has this been tested?:

  1. Set vars rhel8stig_bootloader_password_hash and rhel8stig_boot_superuser use any other username than 'root'
  2. Run playbook
  3. Reboot, press e in grub boot menu
  4. enter username
  5. enter password
  6. boot entry should be able to edit

Without this pull request, only username 'root' works, any other username will not work/will be ignored and 'root' will be used

Signed-off-by: jviebig <[email protected]>
@georgenalen
Copy link
Contributor

Addressed in release 2.3.0

@georgenalen georgenalen closed this Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants