summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alonbl@gentoo.org>2007-12-14 18:14:22 +0000
committerAlon Bar-Lev <alonbl@gentoo.org>2007-12-14 18:14:22 +0000
commit11510dda3f63120f616d0c3dbcf5f3417ae10d88 (patch)
treefb87bdf153a23ef6f008648614b1f8bca78f67ec /sys-fs/ecryptfs-utils/files
parentNow installs zero-install native feed (Bug 202275) (diff)
downloadhistorical-11510dda3f63120f616d0c3dbcf5f3417ae10d88.tar.gz
historical-11510dda3f63120f616d0c3dbcf5f3417ae10d88.tar.bz2
historical-11510dda3f63120f616d0c3dbcf5f3417ae10d88.zip
Version bump
Package-Manager: portage-2.1.4_rc10
Diffstat (limited to 'sys-fs/ecryptfs-utils/files')
-rw-r--r--sys-fs/ecryptfs-utils/files/digest-ecryptfs-utils-323
-rw-r--r--sys-fs/ecryptfs-utils/files/digest-ecryptfs-utils-333
-rw-r--r--sys-fs/ecryptfs-utils/files/ecryptfs-utils-33-mkdir.patch122
3 files changed, 125 insertions, 3 deletions
diff --git a/sys-fs/ecryptfs-utils/files/digest-ecryptfs-utils-32 b/sys-fs/ecryptfs-utils/files/digest-ecryptfs-utils-32
deleted file mode 100644
index e62979f4d669..000000000000
--- a/sys-fs/ecryptfs-utils/files/digest-ecryptfs-utils-32
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 a8c8f4bc699fb19fcacaef15e64a0f92 ecryptfs-utils-32.tar.bz2 962484
-RMD160 53447dc84de69407e702af54ddcb45ec3c0f5f2a ecryptfs-utils-32.tar.bz2 962484
-SHA256 6b9d3e8c76df4406a2940479dd3acf43d15b6171dbf1b68126360f05511eea37 ecryptfs-utils-32.tar.bz2 962484
diff --git a/sys-fs/ecryptfs-utils/files/digest-ecryptfs-utils-33 b/sys-fs/ecryptfs-utils/files/digest-ecryptfs-utils-33
new file mode 100644
index 000000000000..1686e7c59168
--- /dev/null
+++ b/sys-fs/ecryptfs-utils/files/digest-ecryptfs-utils-33
@@ -0,0 +1,3 @@
+MD5 21fbaf2f4401715ffc29dd1696c2d46e ecryptfs-utils-33.tar.bz2 963259
+RMD160 6756752a5a4ce397a9f4f418b8a45d978d464a91 ecryptfs-utils-33.tar.bz2 963259
+SHA256 2e16fb9f25cac32e720aa18386ab041325f20b46283afa3f46b25f33713d046a ecryptfs-utils-33.tar.bz2 963259
diff --git a/sys-fs/ecryptfs-utils/files/ecryptfs-utils-33-mkdir.patch b/sys-fs/ecryptfs-utils/files/ecryptfs-utils-33-mkdir.patch
new file mode 100644
index 000000000000..12070ea46b1b
--- /dev/null
+++ b/sys-fs/ecryptfs-utils/files/ecryptfs-utils-33-mkdir.patch
@@ -0,0 +1,122 @@
+diff --git a/src/key_mod/ecryptfs_key_mod_openssl.c b/src/key_mod/ecryptfs_key_mod_openssl.c
+index e0cc4ed..941e6c0 100644
+--- a/src/key_mod/ecryptfs_key_mod_openssl.c
++++ b/src/key_mod/ecryptfs_key_mod_openssl.c
+@@ -27,6 +27,7 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <libgen.h>
+ #include <openssl/pem.h>
+ #include <openssl/rsa.h>
+ #include <openssl/err.h>
+@@ -182,56 +183,58 @@ out:
+ }
+
+ static int
++ecryptfs_openssl_mkdir_recursive(char *dir, mode_t mode)
++{
++ char *temp = NULL;
++ char *parent = NULL;
++ int rc;
++
++ if (!strcmp(dir, ".") || !strcmp(dir, "/"))
++ return 0;
++
++ temp = strdup(dir);
++ if (temp == NULL) {
++ rc = -ENOMEM;
++ goto out;
++ }
++
++ parent = dirname(temp);
++
++ rc = ecryptfs_openssl_mkdir_recursive(parent, mode);
++ if (rc)
++ goto out;
++
++ if (mkdir(dir, mode) == -1) {
++ if (errno != EEXIST) {
++ rc = -errno;
++ goto out;
++ }
++ }
++
++ rc = 0;
++
++out:
++ free(temp);
++ return rc;
++}
++
++static int
+ ecryptfs_openssl_write_key_to_file(RSA *rsa, char *filename, char *passphrase)
+ {
+- uid_t id;
+- struct passwd *pw;
+- char *ecryptfs_dir = NULL;
+- char *pki_dir = NULL;
+- char *openssl_dir = NULL;
++ char *dir = NULL;
+ BIO *out;
+ const EVP_CIPHER *enc = EVP_aes_256_cbc();
+ int rc = 0;
+
+- id = getuid();
+- pw = getpwuid(id);
+- if (!pw) {
+- syslog(LOG_ERR, "%s: Unable to get the current directory from "
+- "the passwd file on this system\n", __FUNCTION__);
+- rc = -EIO;
+- goto out_free_paths;
+- }
+- rc = asprintf(&ecryptfs_dir, "%s/.ecryptfs", pw->pw_dir);
+- if (rc == -1) {
++ dir = strdup(filename);
++ if (dir == NULL) {
+ rc = -ENOMEM;
+ goto out_free_paths;
+ }
+- rc = asprintf(&pki_dir, "%s/.ecryptfs/pki", pw->pw_dir);
+- if (rc == -1) {
+- rc = -ENOMEM;
+- goto out_free_paths;
+- }
+- rc = asprintf(&openssl_dir, "%s/.ecryptfs/pki/openssl", pw->pw_dir);
+- if (rc == -1) {
+- rc = -ENOMEM;
+- goto out_free_paths;
+- }
+- rc = mkdir(ecryptfs_dir, 0700);
+- if (rc && rc != EEXIST) {
+- syslog(LOG_ERR, "%s: Error attempting to mkdir [%s]; "
+- "rc = [%d]\n", __FUNCTION__, ecryptfs_dir, rc);
+- goto out_free_paths;
+- }
+- rc = mkdir(pki_dir, 0700);
+- if (rc && rc != EEXIST) {
+- syslog(LOG_ERR, "%s: Error attempting to mkdir [%s]; "
+- "rc = [%d]\n", __FUNCTION__, pki_dir, rc);
+- goto out_free_paths;
+- }
+- rc = mkdir(openssl_dir, 0700);
+- if (rc && rc != EEXIST) {
++ rc = ecryptfs_openssl_mkdir_recursive(dirname(dir), 0700);
++ if (rc) {
+ syslog(LOG_ERR, "%s: Error attempting to mkdir [%s]; "
+- "rc = [%d]\n", __FUNCTION__, openssl_dir, rc);
++ "rc = [%d]\n", __FUNCTION__, dir, rc);
+ goto out_free_paths;
+ }
+ if ((out = BIO_new(BIO_s_file())) == NULL) {
+@@ -253,9 +256,7 @@ ecryptfs_openssl_write_key_to_file(RSA *rsa, char *filename, char *passphrase)
+ out_free_bio:
+ BIO_free_all(out);
+ out_free_paths:
+- free(ecryptfs_dir);
+- free(pki_dir);
+- free(openssl_dir);
++ free(dir);
+ return rc;
+ }
+