--- ntfs-3g-2011.1.15/src/ntfs-3g.c.1 2011-04-21 00:06:33.689917258 +0400 +++ ntfs-3g-2011.1.15/src/ntfs-3g.c 2011-04-21 00:16:31.786577463 +0400 @@ -3766,6 +3766,8 @@ EXEC_NAME, ntfs_home); } +extern char *canonicalize_path(const char *path); + #ifndef HAVE_REALPATH /* If there is no realpath() on the system, provide a dummy one. */ static char *realpath(const char *path, char *resolved_path) @@ -3802,16 +3804,11 @@ switch (c) { case 1: /* A non-option argument */ if (!opts.device) { - opts.device = ntfs_malloc(PATH_MAX + 1); - if (!opts.device) - return -1; - /* Canonicalize device name (mtab, etc) */ - if (!realpath(optarg, opts.device)) { + opts.device = canonicalize_path(optarg); + if (!opts.device) { ntfs_log_perror("%s: Failed to access " "volume '%s'", EXEC_NAME, optarg); - free(opts.device); - opts.device = NULL; return -1; } } else if (!opts.mnt_point) { --- ntfs-3g-2011.1.15/src/Makefile.am.1 2011-04-21 00:29:56.319902105 +0400 +++ ntfs-3g-2011.1.15/src/Makefile.am 2011-04-21 00:29:58.996568743 +0400 @@ -20,7 +20,7 @@ ntfs-3g.usermap.8 \ ntfs-3g.secaudit.8 -ntfs_3g_LDADD = $(FUSE_LIBS) $(top_builddir)/libntfs-3g/libntfs-3g.la +ntfs_3g_LDADD = $(FUSE_LIBS) /usr/lib/libmount.a $(top_builddir)/libntfs-3g/libntfs-3g.la if REALLYSTATIC ntfs_3g_LDFLAGS = $(AM_LDFLAGS) -all-static endif --- ntfs-3g-2011.1.15/src/Makefile.in.1 2011-04-21 00:26:13.699904510 +0400 +++ ntfs-3g-2011.1.15/src/Makefile.in 2011-04-21 00:30:00.183235398 +0400 @@ -260,7 +260,7 @@ ntfs-3g.usermap.8 \ ntfs-3g.secaudit.8 -ntfs_3g_LDADD = $(FUSE_LIBS) $(top_builddir)/libntfs-3g/libntfs-3g.la +ntfs_3g_LDADD = $(FUSE_LIBS) /usr/lib/libmount.a $(top_builddir)/libntfs-3g/libntfs-3g.la @REALLYSTATIC_TRUE@ntfs_3g_LDFLAGS = $(AM_LDFLAGS) -all-static ntfs_3g_CFLAGS = \ $(AM_CFLAGS) \