Package: ecryptfs-utils
Version: 87-1
Severity: important
Tags: patch
File: /usr/bin/ecryptfs-mount-private

If /etc/mtab is a symlink to /proc/self/mounts, mounting fails because
addmntent returns an error.  As a consequence, the Private directory is
unusable.  Included is a patch which checks if /etc/mtab is a symlink,
and if so, doesn't try to call addmntent.  This fixes the problem
successfully for me.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-rc4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ecryptfs-utils depends on:
ii  gettext-base                  0.18.1.1-3 GNU Internationalization utilities
ii  keyutils                      1.4-6      Linux Key Management Utilities
ii  libc6                         2.13-10    Embedded GNU C Library: Shared lib
ii  libecryptfs0                  87-1       ecryptfs cryptographic filesystem 
ii  libgpg-error0                 1.10-0.3   library for common error values an
ii  libgpgme11                    1.2.0-1.4  GPGME - GnuPG Made Easy
ii  libkeyutils1                  1.4-6      Linux Key Management Utilities (li
ii  libnss3-1d                    3.12.10-2  Network Security Service libraries
ii  libpam-runtime                1.1.3-2    Runtime support for the PAM librar
ii  libpam0g                      1.1.3-2    Pluggable Authentication Modules l

ecryptfs-utils recommends no packages.

Versions of packages ecryptfs-utils suggests:
pn  cryptsetup                    <none>     (no description available)
pn  opencryptoki                  <none>     (no description available)

-- no debconf information

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
diff -ur ecryptfs-utils.old/src/utils/mount.ecryptfs_private.c ecryptfs-utils-87/src/utils/mount.ecryptfs_private.c
--- ecryptfs-utils.old/src/utils/mount.ecryptfs_private.c	2011-07-22 21:11:40.897428515 +0000
+++ ecryptfs-utils-87/src/utils/mount.ecryptfs_private.c	2011-07-22 22:21:37.000000000 +0000
@@ -223,7 +223,15 @@
  */
 	FILE *fh;
 	struct mntent m;
-	fh = setmntent("/etc/mtab", "a");
+	struct stat st;
+	const char *filename = "/etc/mtab";
+	if (!lstat(filename, &st) && S_ISLNK(st.st_mode)) {
+		/* Assume that /etc/mtab is a link to /proc/self/mounts, so it should be
+		 * handled automatically.
+		 */
+		return 0;
+	}
+	fh = setmntent(filename, "a");
 	if (fh == NULL) {
 		perror("setmntent");
 		/* Unmount if mtab cannot be updated */

Attachment: signature.asc
Description: Digital signature

Reply via email to