Bug 365547

Summary: Unchecking 'Use Encrypted Home Directory' fails in some cases
Product: [openSUSE] openSUSE 11.0 Reporter: Forgotten User O36P--M6FC <forgotten_O36P--M6FC>
Component: YaST2Assignee: Jiří Suchomel <jsuchome>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: jsuchome
Version: Alpha 2   
Target Milestone: Alpha 3   
Hardware: i686   
OS: openSUSE 10.3   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2logs
patch for /usr/share/YaST2/modules/UsersRoutines.pm
y2logs after 1st patch

Description Forgotten User O36P--M6FC 2008-02-28 11:49:03 UTC
The version of yast2-users is 2.15.38-7

I have activated the encryption of a home directory on a laptop. Then after several days, I noticed that some processes (like my VMWare images) where freezing regularly for several seconds.

I went in Yast2 to switch off the usage of encrypted home directory and this what I ended up with:

- no warning message from what would happen from Yast;
- the previous copy of the home directory has been cleaned up;
- the encrypted image has been left;
- activating againt he usage of encrypted home directory would not work (for this user);


Basicly, the user is left with a broken home directory and his files lost.

I feel like a warning message is missing for those actions.
Comment 1 Jiří Suchomel 2008-02-28 11:55:19 UTC
The problem is not with missing warning message, but with the unsuccessful change to non-encrypted directory.

Please attach the log files: http://en.opensuse.org/Bugs/YaST#I_reported_a_YaST2_bug.2C_and_now_I_am_asked_to_.22attach_y2logs.22._What_does_that_mean.2C_and_how_do_I_do_that.3F
Comment 2 Forgotten User O36P--M6FC 2008-02-28 12:22:42 UTC
Created attachment 197644 [details]
y2logs
Comment 3 Forgotten User O36P--M6FC 2008-02-28 12:35:19 UTC
I could not fully reproduce the problem, but here's what I did

- Logged with user 'test';
- open up yast2;
- remove encryption of home directory selection;
- save the changes;

The results are
- I cannot log in on X with user 'test', some files are missing plus other errors

"User's $HOME/.dmrc file is being ignored. This prevents the default session and language from being saved. File should be owned by user and have 644 permissions. User's $HOME direcroty must be owned by user not writable by other users."

"The GNOME session manager was unable to lock the file '/home/test/.ICEauthority'. Please report this ......."


When I say that I could not fully reproduce the problem, it is because the first encounter of this problem was with a encrypted home directory file of 20GB. When I wanted to revert back to unencrypted home directory, nothing was left of the previous home directory (which is not deleted when you apply for encrypted home directory). I did not manage to mount back the encrypted home directory.



Note that when I do this procedure on user 'test' while being loggeg with another user, then everything works without any problem.

I must also add that a warning message is not the problem as you say - but this process is fragile and dangerous and when it breaks, the user gets his home directory corrupted.
Comment 4 Jiří Suchomel 2008-02-28 13:38:12 UTC
Created attachment 197663 [details]
patch for /usr/share/YaST2/modules/UsersRoutines.pm

Please patch your /usr/share/YaST2/modules/UsersRoutines.pm, try to reproduce the buggy behavior again and attach the new log files.
Comment 5 Jiří Suchomel 2008-02-28 13:39:03 UTC
And, what was the name of the user with the first problem (comment 0)? I'm asking to find it quicker in the logs (if it is there).
Comment 6 Forgotten User O36P--M6FC 2008-02-28 13:47:16 UTC
Unfortunately, I did cleared up folder /var/log before making this new test, so you will not find the problem I had with the 20GB in the logs...
Comment 7 Jiří Suchomel 2008-02-28 13:51:57 UTC
(In reply to comment #6 from Issa Gorissen)
> Unfortunately, I did cleared up folder /var/log before making this new test, so
> you will not find the problem I had with the 20GB in the logs...

OK, try at least the 'test' problem with the enhanced logging with the patch.

Comment 8 Forgotten User O36P--M6FC 2008-02-28 14:14:12 UTC
Created attachment 197670 [details]
y2logs after 1st patch
Comment 9 Jiří Suchomel 2008-02-28 14:21:27 UTC
'test' was logged in during the test, right? Is the result different when it is logged out?
Comment 10 Jiří Suchomel 2008-03-04 12:51:11 UTC
OK. I tested myself and

a) was not able to reproduce the behavior described in comment 0. 
b) was able to reproduce the behavior with user "test": the problem was that "test" was logged while yast tried to uncompress 

In other words, disabling encrypted directory always works for me if the user is not logged in. Could you please confirm this?


Solution (for openSUSE11) is to disable the operation when user is logged in. 

Additionally, I could add some more checks if some operations (like mount, mkdir etc.) fail during the decompression. This is actually my only idea why the case from comment 0 happened.

Comment 11 Forgotten User O36P--M6FC 2008-03-04 13:36:09 UTC
Yes I confirm that when done with a user different from the one being manipulated, then the procedure works.
Comment 12 Jiří Suchomel 2008-03-05 12:20:58 UTC
OK, so I will move the bug to openSUSE, and the only fix will be, not allowing to uncheck Encrypted directory when the user is logged in.

Just another hint to your original problem: even if something failed during decrypting, maybe there left the files $HOME/<your_user>.img and $HOME/<your_user>.key. It is possible to extract the data from the img file using the key file via "cryptconfig open" command.
Comment 13 Jiří Suchomel 2008-03-05 14:58:52 UTC
(In reply to comment #12 from Jiří­ Suchomel)
> OK, so I will move the bug to openSUSE, and the only fix will be, not allowing
> to uncheck Encrypted directory when the user is logged in.

Done in yast2-users-2.16.16