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 the user's home creation [bsc#1134970] #206

Merged
merged 2 commits into from
May 17, 2019

Conversation

dgdavid
Copy link
Member

@dgdavid dgdavid commented May 16, 2019

Problem

The user creation does not respect the desired behavior: to create the user's home as a plain directory (default) or as a Btrfs subvolume (ticking the "Create as Btrfs Subvolume" option added in 4.1.7). Instead, it is always - in an installed system - trying to create a Btrfs subvolume (unsuccessfully when the chosen path is no in a Btrfs filesystem).

Why?

Simply because Perl understands the Yast::YCP::Boolean as a true thing even when its ->value() is false. That's the reason why it must be used the bool subroutine, which returns the right value.

Solution

To initialize the $use_btrfs_subvolume"variable properly, using the bool subroutine mentioned above.

Tests

  • Tested manually,
    • The user creation in an installed system, placing its home in a XFS partition
    • The manual installation of the system, with a DUD. Just to check that everything works as expected.

The use "use_btrfs_subvolume" in the `Users` Perl module variable must
behave as a boolean value. So, it must be managed using the `bool`
subroutine to deal "Yast::YCP::Boolean" correctly.

Related to https://bugzilla.suse.com/show_bug.cgi?id=1134970
@dgdavid dgdavid changed the title Feature/fix bsc 1134970 Fix the user's home creation [bsc#1134970] May 16, 2019
@dgdavid dgdavid requested a review from schubi2 May 16, 2019 15:49
@coveralls
Copy link

Pull Request Test Coverage Report for Build 762

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 31.823%

Totals Coverage Status
Change from base Build 749: 0.0%
Covered Lines: 1089
Relevant Lines: 3422

💛 - Coveralls

Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -4483,7 +4483,7 @@ sub Write {

my %user = %{$modified_users{$type}{$username}};
my $home = $user{"homeDirectory"} || "";
my $use_btrfs_subvolume = $user{"btrfs_subvolume"} || 0;
my $use_btrfs_subvolume = bool($user{"btrfs_subvolume"});
Copy link
Member Author

Choose a reason for hiding this comment

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

Note for reviewers: the bool Perl subroutine already returns 0 if $user{"btrfs_subvolume"} is not defined.

@dgdavid dgdavid merged commit 3433426 into SLE-15-SP1 May 17, 2019
@dgdavid dgdavid deleted the feature/fix-bsc-1134970 branch May 17, 2019 07:29
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.

None yet

3 participants