Comment 4 for bug 402222

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 402222] Re: Encrypted Private Directory Not Mounted at Logon

The bug is in commit 407, this part of the patch and hunk.

I'm testing a fix that changes this patch...

=== modified file 'src/libecryptfs/key_management.c'
--- src/libecryptfs/key_management.c 2009-07-17 05:32:26 +0000
+++ src/libecryptfs/key_management.c 2009-07-17 07:32:40 +0000
@@ -583,23 +583,25 @@
        /* If the kernel supports filename encryption, add the associated
         * filename encryption key to the keyring as well
         */
- if (ecryptfs_get_version(&version) == 0 &&
+ if (ecryptfs_get_version(&version) != 0 ||
            ecryptfs_supports_filename_encryption(version)) {
                if ((rc = ecryptfs_add_passphrase_key_to_keyring(
                                        auth_tok_sig,
                                        decrypted_passphrase,
- ECRYPTFS_DEFAULT_SALT_FNEK_HEX))) {
+ ECRYPTFS_DEFAULT_SALT_FNEK_HEX)) < 0) {
                        syslog(LOG_ERR,
                           "Error attempting to add filename encryption key to "
                           "user session keyring; rc = [%d]\n", rc);
+ goto out;
                }
        }
        if ((rc = ecryptfs_add_passphrase_key_to_keyring(auth_tok_sig,
                                                         decrypted_passphrase,
- salt))) {
+ salt)) < 0) {
                syslog(LOG_ERR, "Error attempting to add passphrase key to "
                       "user session keyring; rc = [%d]\n", rc);
- }
+ } else
+ rc = 0;
 out:
        return rc;
 }