Blob Blame History Raw
diff -up ecryptfs-utils-93/src/utils/ecryptfs-mount-private.autoload ecryptfs-utils-93/src/utils/ecryptfs-mount-private
--- ecryptfs-utils-93/src/utils/ecryptfs-mount-private.autoload	2011-10-27 17:53:07.000000000 +0200
+++ ecryptfs-utils-93/src/utils/ecryptfs-mount-private	2011-10-31 12:40:46.066315002 +0100
@@ -33,6 +33,9 @@ if /sbin/mount.ecryptfs_private >/dev/nu
 	exit 0
 fi
 
+#load kernel module if it's missing, FNE support check would fail otherwise
+[ ! -e /sys/fs/ecryptfs/version ] && modinfo ecryptfs >/dev/null 2>&1 && /sbin/mount.ecryptfs_private --loadmodule
+
 # Otherwise, interactively prompt for the user's password
 if [ -f "$WRAPPED_PASSPHRASE_FILE" -a -f "$MOUNT_PASSPHRASE_SIG_FILE" ]; then
 	tries=0
diff -up ecryptfs-utils-93/src/utils/ecryptfs-setup-private.autoload ecryptfs-utils-93/src/utils/ecryptfs-setup-private
--- ecryptfs-utils-93/src/utils/ecryptfs-setup-private.autoload	2011-10-27 17:53:07.000000000 +0200
+++ ecryptfs-utils-93/src/utils/ecryptfs-setup-private	2011-10-31 12:40:46.066315002 +0100
@@ -101,6 +101,7 @@ random_passphrase () {
 }
 
 filename_encryption_available() {
+	[ ! -e /sys/fs/ecryptfs/version ] && modinfo ecryptfs >/dev/null 2>&1 && /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-93/src/utils/mount.ecryptfs_private.c.autoload ecryptfs-utils-93/src/utils/mount.ecryptfs_private.c
--- ecryptfs-utils-93/src/utils/mount.ecryptfs_private.c.autoload	2011-10-31 12:40:46.000000000 +0100
+++ ecryptfs-utils-93/src/utils/mount.ecryptfs_private.c	2011-10-31 13:40:14.990679286 +0100
@@ -489,6 +489,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();
 	gid = getgid();
 	/* Non-privileged effective uid is sufficient for all but the code