diff options
author | root <root@rshg054.dnsready.net> | 2012-05-31 00:03:48 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-05-31 00:03:48 +0000 |
commit | f1ae949e08a764ac063703dc9bb7f0afd7c16e96 (patch) | |
tree | b542ace0cdaf945c5e495f31e3c87537017c614d /community/ecryptfs-utils/symlinked_mtab.patch | |
parent | f676c2f568b9c75daa3e2b688978b877f950953d (diff) |
Thu May 31 00:03:48 UTC 2012
Diffstat (limited to 'community/ecryptfs-utils/symlinked_mtab.patch')
-rw-r--r-- | community/ecryptfs-utils/symlinked_mtab.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/community/ecryptfs-utils/symlinked_mtab.patch b/community/ecryptfs-utils/symlinked_mtab.patch new file mode 100644 index 000000000..2ba0aa8bf --- /dev/null +++ b/community/ecryptfs-utils/symlinked_mtab.patch @@ -0,0 +1,25 @@ +--- ecryptfs-utils/src/ecryptfs-utils-96/src/libecryptfs/main.c.orig ++++ ecryptfs-utils/src/ecryptfs-utils-96/src/libecryptfs/main.c +@@ -387,6 +387,8 @@ + char *fullpath_source = NULL; + char *fullpath_target = NULL; + int rc; ++ char dummy; ++ int useMtab; + + mountent.mnt_opts = NULL; + if (!source) { +@@ -425,6 +427,13 @@ + syslog(LOG_ERR, "Failed to perform eCryptfs mount: [%m]\n"); + goto out; + } ++ /* Check if mtab is a symlink */ ++ useMtab = (readlink("/etc/mtab", &dummy, 1) < 0); ++ if (!useMtab) { ++ /* No need updating mtab */ ++ rc = 0; ++ goto out; ++ } + mtab_fd = setmntent("/etc/mtab", "a"); + if (!mtab_fd) { + rc = -EACCES; |