diff options
author | Brian Behlendorf <[email protected]> | 2011-06-14 16:25:29 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-06-14 16:48:38 -0700 |
commit | e130330a874f4dec6628c094455180d4113c6aa1 (patch) | |
tree | 7b952a3cfcb843657dd477eb42199da15afb46a6 /cmd/mount_zfs | |
parent | 2e08aedba456dccddf6418908a55014e56cad226 (diff) |
Handle /etc/mtab -> /proc/mounts symlink
Under Fedora 15 /etc/mtab is now a symlink to /proc/mounts by
default. When /etc/mtab is a symlink the mount.zfs helper
should not update it. There was code in place to handle this
case but it used stat() which traverses the link and then issues
the stat on /proc/mounts. We need to use lstat() to prevent the
link traversal and instead stat /etc/mtab.
Closes #270
Diffstat (limited to 'cmd/mount_zfs')
-rw-r--r-- | cmd/mount_zfs/mount_zfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c index e97b2b8a5..7173f5698 100644 --- a/cmd/mount_zfs/mount_zfs.c +++ b/cmd/mount_zfs/mount_zfs.c @@ -252,7 +252,7 @@ mtab_is_writeable(void) struct stat st; int error, fd; - error = stat(MNTTAB, &st); + error = lstat(MNTTAB, &st); if (error || S_ISLNK(st.st_mode)) return (0); |