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

Home directory of root user is not hard-coded any more. #2334

Merged
merged 2 commits into from Feb 22, 2020

Conversation

gozora
Copy link
Member

@gozora gozora commented Feb 18, 2020

  • Type: Enhancement

  • Impact: Normal

  • Reference to related issue (URL): Hard-coded home directory of root #2331

  • How was this pull request tested?
    Full backup/restore with:

    • root home directory set to /root
    • root home directory set to /root/home/root
  • Brief description of the changes in this pull request:
    This patch removes hard-coded location of root home directory (/root) from ReaR code, and replaces it with global configuration variable ROOT_HOME_DIR. This allows to correctly track home directory of root user even when a non-default location is used.

Real home directory of root user is used instead of "/root" string.
@gozora gozora added enhancement Adaptions and new features cleanup labels Feb 18, 2020
@gozora gozora added this to the ReaR v2.6 milestone Feb 18, 2020
@gozora gozora requested review from gdha and jsmeix February 18, 2020 20:59
@gozora gozora self-assigned this Feb 18, 2020
@gozora gozora linked an issue Feb 18, 2020 that may be closed by this pull request
Copy link
Member

@jsmeix jsmeix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From plain looking at the changes all looks good to me.

I found another place where a hardcoded /root is used:
usr/share/rear/wrapup/default/990_copy_logfile.sh

recovery_system_roots_home_dir=$TARGET_FS_ROOT/root

I think also in this case it must be

recovery_system_roots_home_dir=$TARGET_FS_ROOT/$ROOT_HOME_DIR

FYI: The variable name recovery_system_roots_home_dir means
"path to root's home dir in the restored system from within the recovery system"
and not "root's home dir in the recovery system".
I failed to construct a not too long variable name that is unambiguous what it is.
Perhaps target_system_roots_home_dir would be a better name?

@gozora
Copy link
Member Author

gozora commented Feb 19, 2020

Hello @jsmeix

Thanks, I'll fix that, too!

V.

@gozora gozora merged commit cc8f29d into rear:master Feb 22, 2020
@gozora gozora deleted the root_home branch February 22, 2020 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hard-coded home directory of root
3 participants