Adds call to finalize() of key modules at manager.

Signed-off-by: Alon Bar-Lev <[EMAIL PROTECTED]>

---

diff -urNp ecryptfs-utils-23/src/libecryptfs/key_mod.c 
ecryptfs-utils-24_beta1/src/libecryptfs/key_mod.c
--- ecryptfs-utils-23/src/libecryptfs/key_mod.c 2007-08-20 14:54:16.000000000 
+0300
+++ ecryptfs-utils-24_beta1/src/libecryptfs/key_mod.c   2007-10-04 
22:53:44.000000000 +0200
@@ -417,6 +417,8 @@ int ecryptfs_free_key_mod_list(struct ec
        struct ecryptfs_key_mod *temp;
 
        while (curr) {
+               curr->ops->finalize ();
+               dlclose (curr->lib_handle);
                free(curr->lib_path);
                temp = curr;
                curr = curr->next;
diff -urNp ecryptfs-utils-23/src/utils/manager.c 
ecryptfs-utils-24_beta1/src/utils/manager.c
--- ecryptfs-utils-23/src/utils/manager.c       2007-08-20 14:54:16.000000000 
+0300
+++ ecryptfs-utils-24_beta1/src/utils/manager.c 2007-10-04 22:34:37.000000000 
+0200
@@ -70,7 +70,6 @@ selection:
                memset(salt, 0, ECRYPTFS_SALT_SIZE);
                break;
        case MME_MOUNT_PUBKEY:
-               memset(&ecryptfs_ctx, 0, sizeof(struct ecryptfs_ctx));
                if ((rc = ecryptfs_get_version(&version))) {
                        printf("\nUnable to get the version number of the 
kernel\n");
                        printf("module. Please make sure that you have the 
eCryptfs\n");
@@ -96,6 +95,9 @@ selection:
                               " rc = [%d]\n", rc);
                        goto out;
                }
+               if ((rc = ecryptfs_free_key_mod_list(&ecryptfs_ctx))) {
+                       printf("\nUnable to free key modules\n");
+               }
                printf("Returning to main menu\n");
                break;
        case MME_GEN_PUBKEY:
@@ -119,6 +121,9 @@ selection:
                               " rc = [%d]\n", rc);
                        goto out;
                }
+               if ((rc = ecryptfs_free_key_mod_list(&ecryptfs_ctx))) {
+                       printf("\nUnable to free key modules\n");
+               }
                printf("Returning to main menu\n");
                goto selection;
        case MME_ABORT:
@@ -136,7 +141,7 @@ out_wipe:
        if (!quit)
                goto selection;
 out:
-       if (selection == MME_MOUNT_PUBKEY)
+       if (selection == MME_MOUNT_PUBKEY || selection == MME_GEN_PUBKEY)
                rc = ecryptfs_free_key_mod_list(&ecryptfs_ctx);
        return rc;
 }

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
eCryptfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ecryptfs-devel

Reply via email to