Bug 326794

Summary: yast2-users reports encrypted home setup failure
Product: [openSUSE] openSUSE 10.3 Reporter: Marius Tomaschewski <mt>
Component: YaST2Assignee: Chris Rivera <crivera>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: coolo, jsuchome, mc
Version: RC 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: patch for /usr/share/YaST2/modules/Users.pm
cryptconfig fix

Description Marius Tomaschewski 2007-09-20 12:35:49 UTC
/var/log/YaST2/y2log contains:

2007-09-20 13:39:43 <3> xanthos(22993) [bash] ShellCommand.cc(shellcommand):78 open: No such file or directory
2007-09-20 13:39:43 <3> xanthos(22993) [bash] ShellCommand.cc(shellcommand):78 Failed to setup pam_mount
2007-09-20 13:40:14 <3> xanthos(22993) [YCP] Report.ycp:484 open: No such file or directory
Failed to setup pam_mount
2007-09-20 13:40:15 <1> xanthos(22993) [YCP] clients/users.ycp:210 Users module finished with true
2007-09-20 13:40:15 <1> xanthos(22993) [YCP] clients/users.ycp:211 ----------------------------------------
Comment 1 Marius Tomaschewski 2007-09-20 12:39:07 UTC
yast2-users-2.15.36-22 on x86_64 -- do you need more info?
Comment 2 Jiří Suchomel 2007-09-21 06:26:51 UTC
What do you mean? You did setup encrypted homes and it failed or do you see this report although nothing was configured?
Comment 3 Marius Tomaschewski 2007-09-21 11:17:05 UTC
Yes, I tried to setup encrypted home.

First, in the second stage of the installation with the "initial user".
The request was completely ignored -- normal user home created.

Then, after the installation finished, I first deleted the user and
tried it again - request ignored. I may be wrong, but it seems, that
the request is always ignored for new users.

Then, I tried to modify the existing user and it reported a failure
(Failed to setup pam_mount) in the GUI and in the y2log file. But it
looks like that the setup was successful. The user image and key
created and the image gets mounted on login.

Just the logout does not work correctly - see Bug #326802.
Comment 4 Jiří Suchomel 2007-09-21 12:48:15 UTC
Created attachment 173866 [details]
patch for /usr/share/YaST2/modules/Users.pm

Could you test this patch?
Comment 5 Jiří Suchomel 2007-09-21 12:58:48 UTC
I was not able to reproduce that pam_mount error, but I can confirm that enabling encrypted directories for new users doesn't work...
Comment 6 Jiří Suchomel 2007-09-21 13:21:34 UTC
Stephan, it is not a blocker, but it is annoying and see in comment #4 how simple the patch is. Could I submit if Marius confirms it as fixed?
Comment 7 Stephan Kulow 2007-09-21 14:21:07 UTC
fine with me
Comment 8 Marius Tomaschewski 2007-09-21 14:25:01 UTC
Yes, the patch from comment #4 fixes the problem, but I'd also change
the order of the fixed lines:

      return 0 if ($home_size == 0 && $org_size == 0); # nothing to do
+    return 0 if (!defined $pw && !defined $new_pw); # no change without password provided :-(
      return 0 if ($home eq $org_home && $username eq $org_username && $home_size == $org_size && $pw eq $new_pw);
-    return 0 if (!defined $pw && !defined $new_pw); # no change without password provided :-(

Just to make the defined checks before $pw eq $new_pw are compared.

The "No such file or directory" and "Failed to setup pam_mount"
messages are from cryptconfig:

14039 execve("/usr/sbin/cryptconfig", ["cryptconfig", "pm-enable", "--replace", "mt"], [/* 61 vars */]) = 0

[...]

14039 open("/etc/pam.d/gnome-passwd", O_RDWR|O_APPEND) = -1 ENOENT (No such file or directory)
14039 open("/usr/lib64/charset.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
14039 open("/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 3
14039 fstat(3, {st_mode=S_IFREG|0644, st_size=25488, ...}) = 0
14039 mmap(NULL, 25488, PROT_READ, MAP_SHARED, 3, 0) = 0x2b19a571d000
14039 close(3)                          = 0
14039 write(2, "open: No such file or directory\n", 32) = 32
14039 write(2, "Failed to enable pam_mount\n", 27) = 27
14039 exit_group(1)                     = ?

So feel free to reassign to Chris Rivera.
Comment 9 Jiří Suchomel 2007-09-21 14:28:10 UTC
> Yes, the patch from comment #4 fixes the problem, but I'd also change
> the order of the fixed lines:


Oh, thanks, I'll include your change in the package. But I thought it shouldn't hurt to compare undefined values with "eq", or does it?

For the rest -> Chris.
Comment 10 Michael Calmer 2007-09-21 15:30:17 UTC
Chris: I thik it may happen that some files you expect in /etc/pam.d/ are not there. In Comment #8 it looks like gnome-passwd is not there.
This may happen when gnome is not installed. 

I think you have to add a check. If the file does not exist ignore it. 
Comment 11 Chris Rivera 2007-09-27 22:12:44 UTC
Created attachment 175327 [details]
cryptconfig fix
Comment 12 Chris Rivera 2007-09-27 22:13:33 UTC
The attached patch should fix the problem.  You can also edit the service list in /etc/cryptconfig.conf as a temporary work around. 
Comment 13 Chris Rivera 2007-11-02 16:31:02 UTC
The attached patch has been submitted to STABLE.