View | Details | Raw Unified | Return to bug 96744
Collapse All | Expand All

(-)sysutils/ntfsprogs/Makefile (-3 / +3 lines)
Lines 6-13 Link Here
6
#
6
#
7
7
8
PORTNAME=	ntfsprogs
8
PORTNAME=	ntfsprogs
9
PORTVERSION=	1.12.1
9
PORTVERSION=	1.13.0
10
PORTREVISION=	1
11
CATEGORIES=	sysutils
10
CATEGORIES=	sysutils
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
11
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITE_SUBDIR=	linux-ntfs
12
MASTER_SITE_SUBDIR=	linux-ntfs
Lines 22-27 Link Here
22
WANT_GNOME=	yes
21
WANT_GNOME=	yes
23
INSTALLS_SHLIB=	yes
22
INSTALLS_SHLIB=	yes
24
CONFIGURE_ARGS=	--program-transform-name=""
23
CONFIGURE_ARGS=	--program-transform-name=""
24
CONFIGURE_ENV+= PKG_CONFIG=${LOCALBASE}/bin/pkg-config
25
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
25
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
26
26
27
OPTIONS=	GNOMEVFS2 "Install GnomeVFS 2.0 libntfs interface" off \
27
OPTIONS=	GNOMEVFS2 "Install GnomeVFS 2.0 libntfs interface" off \
Lines 59-65 Link Here
59
CONFIGURE_ARGS+=--enable-fuse-module
59
CONFIGURE_ARGS+=--enable-fuse-module
60
PLIST_SUB+=	FUSE=""
60
PLIST_SUB+=	FUSE=""
61
USE_GNOME+=	pkgconfig
61
USE_GNOME+=	pkgconfig
62
BUILD_DEPENDS+=	fusefs-libs>2.4:${PORTSDIR}/sysutils/fusefs-libs
62
BUILD_DEPENDS+=	fusefs-libs>2.5:${PORTSDIR}/sysutils/fusefs-libs
63
MLINKS+=	ntfsmount.8 mount.ntfs-fuse.8
63
MLINKS+=	ntfsmount.8 mount.ntfs-fuse.8
64
.else
64
.else
65
CONFIGURE_ARGS+=--disable-fuse-module
65
CONFIGURE_ARGS+=--disable-fuse-module
(-)sysutils/ntfsprogs/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (ntfsprogs-1.12.1.tar.gz) = 607b86d45ab65cf9db2255669545006e
1
MD5 (ntfsprogs-1.13.0.tar.gz) = 4679cf54fb37527503d7ad44ec5376a8
2
SHA256 (ntfsprogs-1.12.1.tar.gz) = 819085b87b48d8cac5bee125f2b56b93ae08354ca2cf212bf381ea001e1e490a
2
SHA256 (ntfsprogs-1.13.0.tar.gz) = a74aa19dca47c4744d0e1245687b54f0a0028e80a9b6e2ce99ba19fd8e168d57
3
SIZE (ntfsprogs-1.12.1.tar.gz) = 801124
3
SIZE (ntfsprogs-1.13.0.tar.gz) = 860532
(-)sysutils/ntfsprogs/files/patch-512b_blocks (-84 lines)
Lines 1-84 Link Here
1
--- libntfs/attrib.c	Sat Sep  4 13:16:32 2004
2
+++ libntfs/attrib.c	Fri Jul 22 01:05:09 2005
3
@@ -709,9 +709,9 @@
4
  */
5
 s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b)
6
 {
7
-	s64 br, to_read, ofs, total, total2;
8
+	s64 br, old_to_read, to_read, ofs, total, total2;
9
 	ntfs_volume *vol;
10
 	runlist_element *rl;
11
 
12
 	Dprintf("%s(): Entering for inode 0x%llx, attr 0x%x, pos 0x%llx, "
13
 			"count 0x%llx.\n", __FUNCTION__,
14
@@ -741,6 +744,7 @@
15
 	if (pos + count > na->data_size) {
16
 		if (pos >= na->data_size)
17
 			return 0;
18
+		Dprintf("trunacting read pos=%lld, na->data_size=%lld, (old) count=%lld\n", pos, na->data_size, count);
19
 		count = na->data_size - pos;
20
 	}
21
 	vol = na->ni->vol;
22
@@ -820,6 +825,10 @@
23
 		/* It is a real lcn, read it into @dst. */
24
 		to_read = min(count, (rl->length << vol->cluster_size_bits) -
25
 				ofs);
26
+		old_to_read = to_read;
27
+		to_read = (to_read + 511) / 512 * 512;
28
+		if(old_to_read != to_read)
29
+			Dprintf("adjusted %lld->%lld\n", old_to_read, to_read);
30
 retry:
31
 		Dprintf("%s(): Reading 0x%llx bytes from vcn 0x%llx, lcn 0x%llx, "
32
 				"ofs 0x%llx.\n", __FUNCTION__, to_read,
33
@@ -828,6 +837,8 @@
34
 				ofs, to_read, b);
35
 		/* If everything ok, update progress counters and continue. */
36
 		if (br > 0) {
37
+			if(br > old_to_read)
38
+				br = old_to_read;
39
 			total += br;
40
 			count -= br;
41
 			b = (u8*)b + br;
42
--- libntfs/device.c	Sat Sep  4 13:16:32 2004
43
+++ libntfs/device.c	Mon Jul 11 23:27:55 2005
44
@@ -441,10 +441,10 @@
45
  */
46
 static inline int ntfs_device_offset_valid(struct ntfs_device *dev, s64 ofs)
47
 {
48
-	char ch;
49
+	char ch[512];
50
 
51
 	if (dev->d_ops->seek(dev, ofs, SEEK_SET) >= 0 &&
52
-			dev->d_ops->read(dev, &ch, 1) == 1)
53
+			dev->d_ops->read(dev, &ch, 512) > 0)
54
 		return 0;
55
 	return -1;
56
 }
57
--- ntfsprogs/ntfsclone.c	Mon Jul 25 12:31:30 2005
58
+++ ntfsprogs/ntfsclone.c	Mon Jul 25 12:33:32 2005
59
@@ -1080,9 +1080,9 @@
60
 
61
 static int device_offset_valid(int fd, s64 ofs)
62
 {
63
-	char ch;
64
+	char ch[512];
65
 
66
-	if (lseek(fd, ofs, SEEK_SET) >= 0 && read(fd, &ch, 1) == 1)
67
+	if (lseek(fd, ofs, SEEK_SET) >= 0 && read(fd, &ch, 512) > 0)
68
 		return 0;
69
 	return -1;
70
 }
71
--- ntfsprogs/ntfsresize.c      Fri Oct  7 23:57:31 2005
72
+++ ntfsprogs/ntfsresize.c      Tue Oct 11 13:35:09 2005
73
@@ -1971,6 +1971,11 @@
74
		err_exit("Resident attribute in $Bitmap isn't supported!\n");
75
 
76
	bm_bsize = nr_clusters_to_bitmap_byte_size(resize->new_volume_size);
77
+	if(bm_bsize % 512 != 0) {
78
+		s64 old_bm_bsize = bm_bsize;
79
+		bm_bsize = (bm_bsize + 511) / 512 * 512;
80
+		Dprintf("adjusted bm_bsize: %lld->%lld\n", old_bm_bsize, bm_bsize);
81
+	}
82
 	nr_bm_clusters = rounded_up_division(bm_bsize, vol->cluster_size);
83
 
84
	if (resize->shrink) {
(-)sysutils/ntfsprogs/files/patch-libntfs::attrib.c (+39 lines)
Line 0 Link Here
1
--- libntfs/attrib.c.orig	Fri Feb 24 10:17:49 2006
2
+++ libntfs/attrib.c	Thu May  4 04:44:07 2006
3
@@ -763,7 +763,7 @@
4
  */
5
 s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b)
6
 {
7
-	s64 br, to_read, ofs, total, total2;
8
+	s64 br, old_to_read, to_read, ofs, total, total2;
9
 	ntfs_volume *vol;
10
 	runlist_element *rl;
11
 
12
@@ -799,6 +799,7 @@
13
 	if (pos + count > na->data_size) {
14
 		if (pos >= na->data_size)
15
 			return 0;
16
+		ntfs_log_trace("trunacting read pos=%lld, na->data_size=%lld, (old) count=%lld\n", pos, na->data_size, count);
17
 		count = na->data_size - pos;
18
 	}
19
 	/* If it is a resident attribute, get the value from the mft record. */
20
@@ -887,6 +888,10 @@
21
 		/* It is a real lcn, read it into @dst. */
22
 		to_read = min(count, (rl->length << vol->cluster_size_bits) -
23
 				ofs);
24
+		old_to_read = to_read;
25
+		to_read = (to_read + 511) / 512 * 512;
26
+		if(old_to_read != to_read)
27
+			ntfs_log_trace("adjusted %lld->%lld\n", old_to_read, to_read);
28
 retry:
29
 		ntfs_log_trace("Reading 0x%llx bytes from vcn 0x%llx, lcn 0x%llx, "
30
 				"ofs 0x%llx.\n", to_read, rl->vcn, rl->lcn, ofs);
31
@@ -894,6 +899,8 @@
32
 				ofs, to_read, b);
33
 		/* If everything ok, update progress counters and continue. */
34
 		if (br > 0) {
35
+			if(br > old_to_read)
36
+				br = old_to_read;
37
 			total += br;
38
 			count -= br;
39
 			b = (u8*)b + br;
(-)sysutils/ntfsprogs/files/patch-libntfs::device.c (+15 lines)
Line 0 Link Here
1
--- libntfs/device.c	Sat Sep  4 13:16:32 2004
2
+++ libntfs/device.c	Mon Jul 11 23:27:55 2005
3
@@ -441,10 +441,10 @@
4
  */
5
 static inline int ntfs_device_offset_valid(struct ntfs_device *dev, s64 ofs)
6
 {
7
-	char ch;
8
+	char ch[512];
9
 
10
 	if (dev->d_ops->seek(dev, ofs, SEEK_SET) >= 0 &&
11
-			dev->d_ops->read(dev, &ch, 1) == 1)
12
+			dev->d_ops->read(dev, &ch, 512) > 0)
13
 		return 0;
14
 	return -1;
15
 }
(-)sysutils/ntfsprogs/files/patch-libntfs::unix_io.c (-12 / +12 lines)
Lines 1-29 Link Here
1
--- libntfs/unix_io.c.orig	Mon Mar 21 12:16:42 2005
1
--- libntfs/unix_io.c.orig	Sat Feb  4 03:42:15 2006
2
+++ libntfs/unix_io.c	Mon Mar 21 12:17:19 2005
2
+++ libntfs/unix_io.c	Thu May  4 03:59:59 2006
3
@@ -72,6 +72,7 @@
3
@@ -110,6 +110,7 @@
4
 		flk.l_type = F_WRLCK;
4
 		flk.l_type = F_WRLCK;
5
 	flk.l_whence = SEEK_SET;
5
 	flk.l_whence = SEEK_SET;
6
 	flk.l_start = flk.l_len = 0LL;
6
 	flk.l_start = flk.l_len = 0LL;
7
+#if 0
7
+#if 0
8
 	if (fcntl(DEV_FD(dev), F_SETLK, &flk)) {
8
 	if (fcntl(DEV_FD(dev), F_SETLK, &flk)) {
9
 		err = errno;
9
 		err = errno;
10
 		Dprintf("ntfs_device_unix_io_open: Could not lock %s for %s: "
10
 		ntfs_log_debug("ntfs_device_unix_io_open: Could not lock %s for %s\n",
11
@@ -83,6 +84,7 @@
11
@@ -119,6 +120,7 @@
12
 					strerror(errno));
12
 					"close %s", dev->d_name);
13
 		goto err_out;
13
 		goto err_out;
14
 	}
14
 	}
15
+#endif
15
+#endif
16
 	/* Set our open flag. */
16
 	/* Determine if device is a block device or not, ignoring errors. */
17
 	NDevSetOpen(dev);
17
 	if (!fstat(DEV_FD(dev), &sbuf) && S_ISBLK(sbuf.st_mode))
18
 	return 0;
18
 		NDevSetBlock(dev);
19
@@ -108,9 +110,11 @@
19
@@ -155,9 +157,11 @@
20
 	flk.l_type = F_UNLCK;
20
 	flk.l_type = F_UNLCK;
21
 	flk.l_whence = SEEK_SET;
21
 	flk.l_whence = SEEK_SET;
22
 	flk.l_start = flk.l_len = 0LL;
22
 	flk.l_start = flk.l_len = 0LL;
23
+#if 0
23
+#if 0
24
 	if (fcntl(DEV_FD(dev), F_SETLK, &flk))
24
 	if (fcntl(DEV_FD(dev), F_SETLK, &flk))
25
 		Dprintf("ntfs_device_unix_io_close: Warning: Could not unlock "
25
 		ntfs_log_perror("ntfs_device_unix_io_close: Warning: Could not "
26
 				"%s: %s\n", dev->d_name, strerror(errno));
26
 				"unlock %s", dev->d_name);
27
+#endif
27
+#endif
28
 	/* Close the file descriptor and clear our open flag. */
28
 	/* Close the file descriptor and clear our open flag. */
29
 	if (close(DEV_FD(dev)))
29
 	if (close(DEV_FD(dev)))
(-)sysutils/ntfsprogs/files/patch-ntfsprogs::ntfsclone.c (+14 lines)
Line 0 Link Here
1
--- ntfsprogs/ntfsclone.c	Mon Jul 25 12:31:30 2005
2
+++ ntfsprogs/ntfsclone.c	Mon Jul 25 12:33:32 2005
3
@@ -1080,9 +1080,9 @@
4
 
5
 static int device_offset_valid(int fd, s64 ofs)
6
 {
7
-	char ch;
8
+	char ch[512];
9
 
10
-	if (lseek(fd, ofs, SEEK_SET) >= 0 && read(fd, &ch, 1) == 1)
11
+	if (lseek(fd, ofs, SEEK_SET) >= 0 && read(fd, &ch, 512) > 0)
12
 		return 0;
13
 	return -1;
14
 }
(-)sysutils/ntfsprogs/files/patch-ntfsprogs::ntfsresize.c (+14 lines)
Line 0 Link Here
1
--- ntfsprogs/ntfsresize.c.orig	Tue Feb 14 12:17:52 2006
2
+++ ntfsprogs/ntfsresize.c	Thu May  4 04:46:10 2006
3
@@ -1974,6 +1974,11 @@
4
 		err_exit("Resident attribute in $Bitmap isn't supported!\n");
5
 
6
 	bm_bsize = nr_clusters_to_bitmap_byte_size(resize->new_volume_size);
7
+	if(bm_bsize % 512 != 0) {
8
+		s64 old_bm_bsize = bm_bsize;
9
+		bm_bsize = (bm_bsize + 511) / 512 * 512;
10
+		ntfs_log_verbose("adjusted bm_bsize: %lld->%lld\n", old_bm_bsize, bm_bsize);
11
+	}
12
 	nr_bm_clusters = rounded_up_division(bm_bsize, vol->cluster_size);
13
 
14
 	if (resize->shrink) {
(-)sysutils/ntfsprogs/files/patch-ntfsprogs_ntfsmount.c (-103 lines)
Lines 1-103 Link Here
1
--- ntfsprogs/Makefile.am.orig	Sat Oct  8 00:35:40 2005
2
+++ ntfsprogs/Makefile.am	Fri Jan 20 11:26:37 2006
3
@@ -88,7 +88,7 @@
4
 ntfsmount_SOURCES	= ntfsmount.c utils.c utils.h
5
 ntfsmount_LDADD		= $(AM_LIBS) $(FUSE_MODULE_LIBS)
6
 ntfsmount_LDFLAGS	= $(AM_LFLAGS)
7
-ntfsmount_CFLAGS	= $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=22
8
+ntfsmount_CFLAGS	= $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=25
9
 endif
10
 
11
 # We don't distribute these
12
--- ntfsprogs/Makefile.in.orig	Fri Jan 20 11:24:48 2006
13
+++ ntfsprogs/Makefile.in	Fri Jan 20 11:26:40 2006
14
@@ -366,7 +366,7 @@
15
 @ENABLE_FUSE_MODULE_TRUE@ntfsmount_SOURCES = ntfsmount.c utils.c utils.h
16
 @ENABLE_FUSE_MODULE_TRUE@ntfsmount_LDADD = $(AM_LIBS) $(FUSE_MODULE_LIBS)
17
 @ENABLE_FUSE_MODULE_TRUE@ntfsmount_LDFLAGS = $(AM_LFLAGS)
18
-@ENABLE_FUSE_MODULE_TRUE@ntfsmount_CFLAGS = $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=22
19
+@ENABLE_FUSE_MODULE_TRUE@ntfsmount_CFLAGS = $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=25
20
 
21
 # We don't distribute these
22
 ntfsrm_SOURCES = ntfsrm.c ntfsrm.h utils.c utils.h
23
--- ntfsprogs/ntfsmount.c.orig	Mon Oct 10 14:47:38 2005
24
+++ ntfsprogs/ntfsmount.c	Fri Jan 20 11:42:09 2006
25
@@ -81,10 +81,10 @@
26
 	int state;
27
 	long free_clusters;
28
 	long free_mft;
29
-	uid_t uid;
30
-	gid_t gid;
31
-	mode_t fmask;
32
-	mode_t dmask;
33
+	unsigned int uid;
34
+	unsigned int gid;
35
+	unsigned int fmask;
36
+	unsigned int dmask;
37
 	BOOL ro;
38
 	BOOL show_sys_files;
39
 	BOOL succeed_chmod;
40
@@ -196,7 +196,7 @@
41
  * Return 0 on success or -errno on error.
42
  */
43
 static int ntfs_fuse_statfs(const char *path __attribute__((unused)),
44
-		struct statfs *sfs)
45
+		struct statvfs *sfs)
46
 {
47
 	long size;
48
 	ntfs_volume *vol;
49
@@ -204,10 +204,10 @@
50
 	vol = ctx->vol;
51
 	if (!vol)
52
 		return -ENODEV;
53
-	/* Type of filesystem. */
54
-	sfs->f_type = NTFS_SB_MAGIC;
55
 	/* Optimal transfer block size. */
56
 	sfs->f_bsize = vol->cluster_size;
57
+	/* XXX This field needs to be filled, I guess it's fine this way... */
58
+	sfs->f_frsize = vol->cluster_size;
59
 	/*
60
 	 * Total data blocks in file system in units of f_bsize and since
61
 	 * inodes are also stored in data blocs ($MFT is a file) this is just
62
@@ -228,7 +228,7 @@
63
 		size = 0;
64
 	sfs->f_ffree = size;
65
 	/* Maximum length of filenames. */
66
-	sfs->f_namelen = NTFS_MAX_NAME_LEN;
67
+	sfs->f_namemax = NTFS_MAX_NAME_LEN;
68
 	return 0;
69
 }
70
 
71
@@ -1462,8 +1462,9 @@
72
 int main(int argc, char *argv[])
73
 {
74
 	char *parsed_options;
75
+	struct fuse_args margs = FUSE_ARGS_INIT(0, NULL);
76
 	struct fuse *fh;
77
-	int ffd;
78
+	int ffd = 0;
79
 
80
 	utils_set_locale();
81
 	signal(SIGINT, signal_handler);
82
@@ -1491,7 +1492,20 @@
83
 	}
84
 	free(opts.device);
85
 	/* Create filesystem. */
86
-	ffd = fuse_mount(opts.mnt_point, parsed_options);
87
+	/*
88
+	 * XXX Eventually, ntfsmount should drop it's homebrew option parsing
89
+	 * routines and use stock ones. Here we don't go that far, we just use the
90
+	 * FUSE opt parsing API to dummily create the structure which satisfies
91
+	 * fuse_mount's current signature (that is, revert all the work which
92
+	 * has been accomplished by the homebrew routine... silly, eh?).
93
+	 */
94
+	if ((fuse_opt_add_arg(&margs, "") == -1 ||
95
+	     fuse_opt_add_arg(&margs, "-o") == -1 ||
96
+	     fuse_opt_add_arg(&margs, parsed_options) == -1))
97
+		ffd = -1;
98
+	if (ffd != -1)
99
+		ffd = fuse_mount(opts.mnt_point, &margs);
100
+	fuse_opt_free_args(&margs);
101
 	if (ffd == -1) {
102
 		Eprintf("fuse_mount failed.\n");
103
 		ntfs_fuse_destroy();
(-)sysutils/ntfsprogs/pkg-plist (-1 / +1 lines)
Lines 37-43 Link Here
37
lib/libntfs.a
37
lib/libntfs.a
38
lib/libntfs.la
38
lib/libntfs.la
39
lib/libntfs.so
39
lib/libntfs.so
40
lib/libntfs.so.8
40
lib/libntfs.so.9
41
sbin/mkntfs
41
sbin/mkntfs
42
sbin/mkfs.ntfs
42
sbin/mkfs.ntfs
43
%%FUSE%%sbin/mount.ntfs-fuse
43
%%FUSE%%sbin/mount.ntfs-fuse

Return to bug 96744