Project

General

Profile

Actions

Bug #8807

open

root password handling is broken

Added by Ohad Levy almost 10 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Host creation
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

while trying to set root password on a hostgroup and a host, i was unable to properly use a hostgroup based root_pass hash.

one potential issue is the following code block (from https://github.com/theforeman/foreman/blob/develop/app/models/concerns/host_common.rb#L109)

   unencrypted_pass = if kind_of?(Hostgroup)
                         read_attribute(:root_pass)
                       else
                         root_pass
                       end

since root_pass will always return value (as its either the host specific pass or the parent hostgroup pass), this has a potential side effect of creating a new hash, based on the parent hash, therefor disconnecting the host root_password (without the ability to reconnect in the ui).

steps to reproduce:

1. set a hostgroup password.
2. create a new host without a root password but associated to the hostgroup from step 1.

notice that host has a root password value in its db record.

warning, there might be other issues :)


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #8739: default root_pass not used if password field is an empty stringClosedDominic Cleal12/17/2014Actions
Actions #1

Updated by Dominic Cleal almost 10 years ago

  • Related to Bug #8739: default root_pass not used if password field is an empty string added
Actions #2

Updated by Dominic Cleal almost 10 years ago

  • Category set to Host creation

The behaviour of copying the password into the host was deliberate in my change, just because that's how it's always worked in my experience (similar to other host group attributes on host creation). The method should detect that it's already crypted and not recrypt it at least.

Actions

Also available in: Atom PDF