From 2c1ecda9eed31ed7a651a6629bdc71adebf50125 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: May 26 2011 14:33:31 +0000 Subject: auto-load ecryptfs module in ecryptfs-setup-private --- diff --git a/ecryptfs-utils-87-autoload.patch b/ecryptfs-utils-87-autoload.patch new file mode 100644 index 0000000..bb2229e --- /dev/null +++ b/ecryptfs-utils-87-autoload.patch @@ -0,0 +1,28 @@ +diff -up ecryptfs-utils-87/src/utils/ecryptfs-setup-private.autoload ecryptfs-utils-87/src/utils/ecryptfs-setup-private +--- ecryptfs-utils-87/src/utils/ecryptfs-setup-private.autoload 2011-05-26 15:03:03.716014960 +0200 ++++ ecryptfs-utils-87/src/utils/ecryptfs-setup-private 2011-05-26 15:03:03.676014684 +0200 +@@ -101,6 +101,7 @@ random_passphrase () { + } + + filename_encryption_available() { ++ [ ! -e /sys/fs/ecryptfs/version ] && ! lsmod | grep -q ecryptfs && /sbin/mount.ecryptfs_private --loadmodule + version=$(cat /sys/fs/ecryptfs/version 2>/dev/null) + [ -z "$version" ] && error "$(gettext 'Cannot get ecryptfs version, ecryptfs kernel module not loaded?')" + [ $(($version & 0x100)) -eq 0 ] && return 1 +diff -up ecryptfs-utils-87/src/utils/mount.ecryptfs_private.c.autoload ecryptfs-utils-87/src/utils/mount.ecryptfs_private.c +--- ecryptfs-utils-87/src/utils/mount.ecryptfs_private.c.autoload 2011-05-26 13:35:41.364468265 +0200 ++++ ecryptfs-utils-87/src/utils/mount.ecryptfs_private.c 2011-05-26 13:39:34.887345368 +0200 +@@ -387,6 +387,13 @@ int main(int argc, char *argv[]) { + char *sig, *sig_fnek; + FILE *fh_counter = NULL; + ++ if (argc == 2 && !strcmp(argv[1],"--loadmodule")) ++ { ++ execl("/sbin/modprobe","modprobe","ecryptfs",NULL); ++ perror("Unable to load ecryptfs module"); ++ return -1; ++ } ++ + uid = getuid(); + /* Non-privileged effective uid is sufficient for all but the code + * that mounts, unmounts, and updates /etc/mtab. diff --git a/ecryptfs-utils.spec b/ecryptfs-utils.spec index 893cf35..42a6376 100644 --- a/ecryptfs-utils.spec +++ b/ecryptfs-utils.spec @@ -5,7 +5,7 @@ Name: ecryptfs-utils Version: 87 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The eCryptfs mount helper and support libraries Group: System Environment/Base License: GPLv2+ @@ -32,6 +32,9 @@ Patch6: ecryptfs-utils-84-fgetc.patch # fix man pages Patch8: ecryptfs-utils-86-manpage.patch +# autoload ecryptfs module in ecryptfs-setup-private when needed, rhbz#707608 +Patch9: ecryptfs-utils-87-autoload.patch + # allow building with -Werror Patch999: ecryptfs-utils-75-werror.patch @@ -78,6 +81,7 @@ the interface supplied by the ecryptfs-utils library. %patch5 -p1 -b .fixsigness %patch6 -p1 -b .fgetc %patch8 -p1 -b .manfix +%patch9 -p1 -b .autoload %patch999 -p1 -b .werror %build @@ -206,6 +210,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitearch}/ecryptfs-utils/_libecryptfs.so %changelog +* Thu May 26 2011 Michal Hlavinka - 87-2 +- auto-load ecryptfs module in ecryptfs-setup-private + * Tue May 24 2011 Michal Hlavinka - 87-1 - updated tp v. 87