diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/ChangeLog /tmp/P0FDp6eeZz/ntfs-3g-1.913/ChangeLog --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/ChangeLog 2007-07-10 01:40:15.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/ChangeLog 2007-09-01 14:39:53.000000000 +0300 @@ -1,1045 +1,7 @@ -2007-07-10 01:41 szaka - * configure.ac: +Detailed ChangeLog can be found at http://mercurial.creo.hu/repos/ntfs-3g-hg/ - release 1.710 - -2007-07-10 01:25 szaka - - * src/ntfs-3g.c: - - portability fixes - -2007-07-10 01:18 szaka - - * libntfs-3g/volume.c: - - ntfs_attr_free()/ntfs_inode_free(): don't scare users with bogus errors - -2007-07-10 00:49 szaka - - * src/: ntfs-3g.c, utils.c: - - Give more hints what the problem could be during mount - -2007-07-10 00:03 szaka - - * src/ntfs-3g.c: - - portability fixes - -2007-07-08 23:47 szaka - - * libntfs-3g/logging.c: - - ntfs_log_handler_syslog(): don't lose errno in an error path - -2007-07-08 23:45 szaka - - * libntfs-3g/attrib.c, libntfs-3g/index.c, src/ntfs-3g.c: - - No need to check for ENOSPC because ntfs_log_perror() does it now - -2007-07-08 23:38 szaka - - * libntfs-3g/logging.c: - - Log ENOSPC (full disk) errors only during debug - -2007-07-08 21:41 szaka - - * libntfs-3g/index.c: - - fix very rare, recoverable directory corruption - -2007-07-08 18:02 szaka - - * libntfs-3g/lcnalloc.c, src/ntfs-3g.c: - - fix trace logging - -2007-07-08 17:56 szaka - - * libntfs-3g/attrib.c: - - ntfs_resident_attr_resize(), ntfs_non_resident_attr_expand(): log all errors - -2007-07-08 17:27 szaka - - * src/ntfs-3g.c: - - fix: move & hard link input/output error in 1.616 (Nicolò Chieffo, Szaka) - -2007-07-08 02:11 szaka - - * libntfs-3g/index.c: - - ntfs_ir_truncate(): log all errors - -2007-07-08 02:10 szaka - - * libntfs-3g/index.c: - - ntfs_index_add_filename(): don't lose errno - -2007-06-28 10:17 szaka - - * libntfs-3g/index.c: - - ntfs_ib_write(): don't log ENOSPC error (full disk) - -2007-06-28 10:17 szaka - - * libntfs-3g/dir.c: - - ntfs_readdir(): log errors - -2007-06-17 00:35 szaka - - * configure.ac: - - update to 1.616 - -2007-06-17 00:34 szaka - - * src/ntfs-3g.c: - - use kernel cache also for the 'debug' option - -2007-06-17 00:31 szaka - - * src/ntfs-3g.8.in: - - update manual - -2007-06-12 00:10 szaka - - * configure.ac: - - update to 1.612-RC - -2007-06-11 23:37 szaka - - * configure.ac: - - update to 1.612 - -2007-06-11 23:36 szaka - - * configure.ac: - - warn if FUSE is not installed on the root file system - -2007-06-11 23:05 szaka - - * configure.ac: - - use --exec-prefix=/ otherwise automounting NTFS can fail during boot - -2007-06-10 02:24 szaka - - * src/ntfs-3g.c: - - fix: truncate() always returned "Operation not permitted" on error - -2007-06-10 02:00 szaka - - * src/ntfs-3g.c: - - check and handle ntfs_inode_close() errors - -2007-06-09 03:10 szaka - - * src/: utils.c, utils.h: - - remove unused utils_* code - -2007-06-09 02:30 szaka - - * src/ntfs-3g.c: - - ntfs_fuse_destroy(): clearer error message - -2007-06-09 02:11 szaka - - * include/ntfs-3g/volume.h, libntfs-3g/volume.c: - - remove unused ntfs_device_umount() - -2007-06-09 02:09 szaka - - * libntfs-3g/volume.c: - - ntfs_umount() can return error - -2007-06-09 01:45 szaka - - * libntfs-3g/volume.c: - - check ntfs_inode_close() return values - __ntfs_volume_release() can return error - add ntfs_attr_free(), ntfs_error_set() and ntfs_inode_free() helpers - -2007-06-09 00:35 szaka - - * libntfs-3g/unix_io.c: - - ntfs_device_unix_io_close(), ntfs_device_unix_io_sync(): log all errors - -2007-06-06 21:55 szaka - - * src/ntfs-3g.c: - - pass file system name to the fuse layer (Alistair Crooks) - -2007-06-06 21:41 szaka - - * configure.ac: - - compilation works under OS X and NetBSD too - -2007-06-05 03:14 szaka - - * libntfs-3g/dir.c: - - check and handle ntfs_inode_close() return value - -2007-06-05 02:00 szaka - - * libntfs-3g/inode.c: - - __ntfs_inode_release(): void function, don't return error - -2007-06-05 01:58 szaka - - * libntfs-3g/inode.c: - - ntfs_inode_sync_file_name(): log errors - -2007-06-05 00:32 szaka - - * libntfs-3g/inode.c: - - ntfs_inode_close(), __ntfs_inode_release(): log errors - -2007-06-05 00:02 szaka - - * libntfs-3g/inode.c: - - ntfs_inode_sync(): log errors - -2007-06-01 02:54 szaka - - * configure.ac: - - update to 1.601 - -2007-06-01 02:52 szaka - - * libntfs-3g/mft.c: - - fix: file creation always gave "I/O error" if $MFT Bitmap wasn't up-to-date - -2007-06-01 02:07 szaka - - * libntfs-3g/mft.c: - - ntfs_mft_record_alloc(): factor out ntfs_mft_record_init() - -2007-05-30 00:04 szaka - - * libntfs-3g/dir.c: - - ntfs_pathname_to_inode(): converting long file names to Unicode may failed - -2007-05-29 23:41 szaka - - * libntfs-3g/index.c: - - ntfs_ie_add(): cleanup - -2007-05-29 23:38 szaka - - * libntfs-3g/logging.c: - - ntfs_log_handler_syslog(): fix missing errno - -2007-05-16 00:22 szaka - - * configure.ac: - - update to 1.516 - -2007-05-16 00:19 szaka - - * src/ntfs-3g.c: - - Fix Linux exploit if ntfs-3g is setuid and the FUSE kernel driver isn't - loaded (Jochen Schmitt, Tom "spot" Callaway, Szaka) - -2007-05-16 00:13 szaka - - * libntfs-3g/dir.c: - - ntfs_link(): remove redundant log - -2007-04-23 00:03 szaka - - * src/ntfs-3g.c: - - ntfs_fuse_read(): log the details if it fails - -2007-04-23 00:00 szaka - - * libntfs-3g/: dir.c, mft.c: - - don't flood log with redundant info if MFT record allocation fails - -2007-04-22 23:56 szaka - - * libntfs-3g/attrib.c: - - ntfs_attr_map_whole_runlist(): log failing inode - -2007-04-16 02:52 szaka - - * configure.ac: - - update to 1.417 - -2007-04-16 02:52 szaka - - * src/ntfs-3g.c: - - handle the -v (verbose) command line option because mount(8) can pass it - -2007-04-15 21:12 szaka - - * configure.ac: - - update to 1.416 - -2007-04-12 01:16 szaka - - * src/ntfs-3g.c: - - fix: option parsing may failed due to a bug introduced in 1.411-RC - -2007-04-10 21:26 szaka - - * configure.ac: - - update to 1.411-RC - -2007-04-10 21:09 szaka - - * libntfs-3g/dir.c: - - fix: catch and deny all junction/reparse point write operations - -2007-04-08 23:32 szaka - - * libntfs-3g/volume.c: - - support any size $MFTMirr - -2007-04-08 23:23 szaka - - * include/ntfs-3g/volume.h, libntfs-3g/logfile.c, - libntfs-3g/volume.c, src/ntfs-3g.8.in, src/ntfs-3g.c, - src/utils.c: - - support read-write mount with the --force option if logfile is unclean - -2007-04-08 22:09 szaka - - * src/ntfs-3g.8.in: - - manual update: command line syntax, options update - -2007-04-07 22:42 szaka - - * src/: ntfs-3g.c, utils.c: - - parse_options(), usage() cleanup; removed unused command line options - -2007-04-06 23:32 szaka - - * src/ntfs-3g.c: - - log command line options - -2007-04-06 23:22 szaka - - * configure.ac, libntfs-3g/Makefile.am: - - new: libntfs-3g is versioned - -2007-04-06 23:19 szaka - - * src/ntfs-3g.8.in: - - remove fusermount example since the binary will move entirely into libfuse - -2007-04-06 23:17 szaka - - * src/ntfs-3g.c: - - don't run surely failing Linux specific code on non-Linux OSes - -2007-04-06 23:13 szaka - - * src/ntfs-3g.c: - - support multiply -o options to make FreeBSD's mount(8) work (Dmitri Tarasov, Szaka) - -2007-04-03 00:09 szaka - - * src/utils.c: - - fix typo in hibernated volume message - -2007-04-03 00:08 szaka - - * src/ntfs-3g.c: - - fix default uid/gid of file for suid-root user mounts (Laszlo Dvornik, Szaka) - -2007-03-28 00:25 szaka - - * configure.ac: - - update to version 1.328 - -2007-03-28 00:09 szaka - - * src/ntfs-3g.c: - - Emphasize the kernel problem which typically is believed to be a user space one - -2007-03-27 23:55 szaka - - * src/utils.c: - - refer to the latest ntfsfix, some earlier versions don't always work - -2007-03-27 23:36 szaka - - * src/: ntfs-3g.c, utils.c, utils.h: - - give examples for the 'force' mount option usage - -2007-03-27 23:31 szaka - - * src/ntfs-3g.8.in: - - fix the privilege typos - -2007-03-20 00:01 szaka - - * configure.ac: - - update to 1.320-RC - -2007-03-17 05:11 szaka - - * configure.ac: - - update to 1.317-BETA - -2007-03-17 05:03 szaka - - * libntfs-3g/volume.c: - - set mft zone to be the minimum of 12.5% of the disk size and 200 MB - -2007-03-17 04:58 szaka - - * libntfs-3g/lcnalloc.c: - - performance: replaced cluster allocator to minimize file fragmentation - -2007-03-16 03:31 szaka - - * libntfs-3g/attrib.c, src/ntfs-3g.c: - - don't flood logs with ENOSPC errors (full disk) - -2007-03-16 03:28 szaka - - * src/ntfs-3g.8.in: - - OS natural manual: ntfs-3g runs on many OSes - -2007-03-10 04:01 szaka - - * src/ntfs-3g.c: - - don't log errno reason after fuse_mount() since it's undefined, misleading - -2007-03-04 02:42 szaka - - * src/ntfs-3g.c: - - Use the 'nonempty' FUSE mount option by default, so we behave as in-kernel - filesystems, moreover HAL and pmount won't refuse to mount if they create - hidden .created-by-xxx file in the mount point directory before mount. - -2007-03-04 02:36 szaka - - * src/ntfs-3g.c: - - parse_mount_options(): don't parse empty options string - -2007-03-04 02:31 szaka - - * src/utils.c: - - fix fakeraid/softraid detection (Cyberjean, Szaka) - -2007-03-04 02:30 szaka - - * src/ntfs-3g.8.in: - - manual: added access handling, security section; other minor updates - -2007-03-03 13:52 szaka - - * configure.ac, src/Makefile.am: - - add --disable-ldconfig configure option and reorganize *-hook rules to - *-local and *-hook ones in src/Makefile.am for simplicity and to be more - compatible with older automake versions (Andreas Hanke) - -2007-02-23 22:52 szaka - - * configure.ac: - - don't check for unused gcrypt.h and gnutls/pkcs12.h headers (Andreas Hanke) - -2007-02-20 23:16 szaka - - * configure.ac: - - update to 1.0 - -2007-02-20 23:14 szaka - - * README: - - release candidate -> stable - -2007-02-20 22:09 szaka - - * libntfs-3g/bootsect.c: - - Don't calculate bootsector checksum, ntfs doesn't use it and it's often off - -2007-02-20 21:53 szaka - - * libntfs-3g/dir.c: - - ntfs_delete(): don't log non-empty dir deleted attempts - -2007-02-06 22:44 szaka - - * README: - - beta -> release candinate - -2007-02-06 22:41 szaka - - * configure.ac: - - update to 0.20070207-RC1 - -2007-02-06 22:25 szaka - - * README, configure.ac: - - update to 0.20070207-PREVIEW - -2007-02-06 22:08 szaka - - * src/ntfs-3g.c: - - ignore user specified blksize option - -2007-02-06 21:56 szaka - - * src/: ntfs-3g.8.in, ntfs-3g.c: - - use FUSE default_permissions option when users expect things to work that way - -2007-02-06 18:11 szaka - - * libntfs-3g/attrib.c: - - fix: don't update ->name_offset if it would underflow - -2007-02-04 23:01 szaka - - * libntfs-3g/logfile.c: - - ntfs_is_logfile_clean: no need to report more unlean logfile data - -2007-02-04 22:56 szaka - - * src/ntfs-3g.c: - - update fuse26_kmod_msg: FUSE 2.6.2 kmod lacks fuseblk for old kernels - -2007-02-04 16:25 szaka - - * src/ntfs-3g.c: - - portability fix: use getuid/geteuid instead of getresuid - -2007-02-04 16:20 szaka - - * src/ntfs-3g.c: - - fix uids related compilation warnings (bigboss, Szaka) - -2007-01-18 00:57 szaka - - * configure.ac: - - update to version 0.20070118-BETA - -2007-01-18 00:52 szaka - - * libntfs-3g/inode.c: - - fix mtime, ctime update - -2007-01-18 00:44 szaka - - * src/ntfs-3g.c: - - main(): cleanup exit paths - -2007-01-18 00:25 szaka - - * src/ntfs-3g.c: - - setuid root support - -2007-01-17 23:59 szaka - - * src/ntfs-3g.c: - - remove redundant struct fuse_arg variable initialization - -2007-01-17 23:55 szaka - - * src/ntfs-3g.c: - - fix a memory leak on an error path before exit - -2007-01-16 01:32 szaka - - * configure.ac: - - update to version 0.20070116-BETA - -2007-01-16 01:31 szaka - - * src/ntfs-3g.8.in: - - man page update - -2007-01-16 00:58 szaka - - * libntfs-3g/logfile.c, src/utils.c: - - report logfile check errors - -2007-01-16 00:46 szaka - - * include/ntfs-3g/volume.h, src/ntfs-3g.c: - - support older than FUSE 2.6 kernel modules - -2007-01-10 00:22 szaka - - * libntfs-3g/bootsect.c, libntfs-3g/device.c, libntfs-3g/dir.c, - libntfs-3g/index.c, libntfs-3g/mft.c, libntfs-3g/runlist.c, - libntfs-3g/volume.c, src/ntfs-3g.c: - - fix 64-bit warnings (Yuval) - -2007-01-10 00:00 szaka - - * libntfs-3g/lcnalloc.c: - - ntfs_cluster_set_zone_pos(): fix unused 'zone' variable warning - -2007-01-09 23:54 szaka - - * libntfs-3g/lcnalloc.c: - - fix "no previous prototype" warnings (Yuval) - -2007-01-09 23:38 szaka - - * src/ntfs-3g.c: - - fix: make ActiveSync work via Samba 3.0 (Rein Ketelaars, Yuval, Szaka) - -2007-01-01 23:24 szaka - - * configure.ac: - - update to version 0.20070102-BETA - -2007-01-01 23:21 szaka - - * configure.ac: - - Point FreeBSD users to http://www.freshports.org/sysutils/fusefs-ntfs - -2007-01-01 22:32 szaka - - * src/utils.c: - - print some help if device is fakeraid - -2007-01-01 20:59 szaka - - * libntfs-3g/lcnalloc.c: - - ntfs_cluster_alloc(): scatter new and concurrent writes - -2007-01-01 20:35 szaka - - * libntfs-3g/lcnalloc.c: - - ntfs_cluster_alloc(): factor out codes related to positioning in zones - -2007-01-01 20:17 szaka - - * libntfs-3g/lcnalloc.c: - - ntfs_cluster_alloc(): log errors - -2007-01-01 20:12 szaka - - * libntfs-3g/lcnalloc.c: - - ntfs_cluster_alloc(): use 512 bytes NTFS_LCNALLOC_BSIZE instead of 8kB - -2007-01-01 20:02 szaka - - * libntfs-3g/attrib.c: - - fix: invalid argument error when writing randomly into sparse files - -2007-01-01 19:55 szaka - - * autogen.sh: - - autogen.sh doesn't require bash, sh is enough - -2006-12-17 22:56 szaka - - * configure.ac: - - update to version 0.20061218-BETA - -2006-12-17 22:48 szaka - - * src/ntfs-3g.c: - - fix: inode number wasn't filled in dirent structures (Ted Anderson, Szaka) - -2006-12-17 05:18 szaka - - * libntfs-3g/runlist.c: - - ntfs_rl_pwrite: don't check buffer for sparse runs - -2006-12-17 05:10 szaka - - * libntfs-3g/attrib.c: - - ntfs_attr_fill_hole: fix occasional high memory usage - -2006-12-17 04:48 szaka - - * libntfs-3g/attrib.c: - - ntfs_attr_fill_hole(): factor out ntfs_attr_fill_zero() - -2006-12-15 03:21 szaka - - * src/ntfs-3g.c: - - fix: fuse 2.6.x kernel module detection wasn't reliable - -2006-12-13 02:16 szaka - - * libntfs-3g/: device.c, unix_io.c: - - ntfs_read/ntfs_write: use pread/pwrite => 2-8% speed increase (Henk, Szaka) - -2006-12-12 03:20 szaka - - * configure.ac: - - update to version 0.20061212-BETA - -2006-12-12 03:13 szaka - - * src/ntfs-3g.c: - - be a bit helpful if fuseblk is not available - -2006-12-12 01:40 szaka - - * src/utils.c: - - unclean_journal_msg: try to make it more understandable - -2006-12-12 00:47 szaka - - * AUTHORS, CREDITS: - - update AUTHORS & CREDITS - -2006-12-12 00:15 szaka - - * src/ntfs-3g.c: - - parse_mount_options(): point to some help regards to locale setup - -2006-12-11 21:33 szaka - - * src/ntfs-3g.c: - - try_fuse_mount(): log why the FUSE mount point creation failed - -2006-12-09 03:02 szaka - - * libntfs-3g/bootsect.c: - - ntfs_boot_sector_parse: check sectors value & last sector seekability - -2006-12-09 02:55 szaka - - * include/ntfs-3g/bootsect.h, libntfs-3g/bootsect.c, - libntfs-3g/volume.c: - - ntfs_boot_sector_is_ntfs/ntfs_boot_sector_parse: log errors - -2006-12-09 02:47 szaka - - * configure.ac, src/Makefile.am: - - fix: 'make install' failed if ldconfig wasn't in the $PATH - -2006-12-07 04:11 szaka - - * include/ntfs-3g/layout.h, libntfs-3g/dir.c: - - fix: directories were unreadable if the cluster size was bigger than 4kB - -2006-12-07 04:09 szaka - - * configure.ac, src/Makefile.am: - - fix: static linking failed because FUSE forgot to require -lrt - -2006-12-07 04:06 szaka - - * libntfs-3g/volume.c: - - ntfs_device_mount: more verbose error message - -2006-11-22 00:26 szaka - - * src/ntfs-3g.c: - - fix: POSIX requires st_blocks to be in 512 byte unites (Yuval, Yura) - -2006-11-14 23:14 szaka - - * configure.ac: - - update to version 0.20061115-BETA - -2006-11-14 23:07 szaka - - * libntfs-3g/logging.c, src/ntfs-3g.c: - - fix compilation warnings - -2006-11-14 21:47 szaka - - * src/ntfs-3g.c: - - point users to FUSE setup/install problem instead suggesting an NTFS issue - -2006-11-14 02:05 szaka - - * src/ntfs-3g.c: - - new: bmap() -- safe swap file support, LILO bootability (Szeredi, Szaka) - -2006-11-13 02:34 szaka - - * libntfs-3g/unix_io.c, src/ntfs-3g.c: - - fix: unmount wasn't synchronous for block devices - -2006-11-13 00:29 szaka - - * libntfs-3g/unix_io.c: - - ntfs_device_unix_io_open: check for block device early on - -2006-11-12 18:24 szaka - - * src/ntfs-3g.c: - - compilation requires FUSE API version 26 - -2006-11-12 18:23 szaka - - * src/ntfs-3g.c: - - fix: arguments were missing on the 2nd fuse mount attempt - -2006-11-11 23:12 szaka - - * src/ntfs-3g.c: - - fix FUSE API 26 crash during exit (Szeredi, Szaka) - -2006-11-11 02:36 szaka - - * configure.ac, src/Makefile.am, src/ntfs-3g.c: - - upgrade to FUSE API version 26 (FUSE 2.6.0) -- features, fixes require this - -2006-11-11 02:08 szaka - - * libntfs-3g/: unix_io.c, volume.c: - - unconditionally sync device - -2006-11-11 02:02 szaka - - * libntfs-3g/: bootsect.c, volume.c: - - unconditionally log errors - -2006-11-09 00:36 szaka - - * include/ntfs-3g/attrib.h, libntfs-3g/attrib.c, libntfs-3g/dir.c, - src/ntfs-3g.c: - - add ntfs_attr_remove(); convert its users - -2006-11-08 23:27 szaka - - * src/ntfs-3g.c: - - ntfs_fuse_removexattr(): reorder free space outdating - -2006-11-08 23:00 szaka - - * libntfs-3g/attrib.c, libntfs-3g/dir.c, src/ntfs-3g.c: - - ntfs_attr_rm(): fix inconsistent deallocation of *na; adapt its users - -2006-11-07 02:17 szaka - - * libntfs-3g/index.c: - - big-endian fixes (zhanglinbao, yuval, szaka) - -2006-11-07 01:27 szaka - - * src/ntfs-3g.8.in: - - Fix Yuval's name (yuval) - -2006-11-07 01:26 szaka - - * libntfs-3g/index.c: - - ntfs_ie_dup_novcn(): fix null pointer dereference if malloc failed (Yuval) - -2006-10-31 01:36 szaka - - * AUTHORS, ChangeLog, NEWS: - - add AUTHORS, ChangeLog, and NEWS files - -2006-10-31 01:32 szaka - - * CREDITS, Makefile.am, README, autogen.sh, configure.ac, - include/Makefile.am, include/ntfs-3g/Makefile.am, - include/ntfs-3g/attrib.h, include/ntfs-3g/attrlist.h, - include/ntfs-3g/bitmap.h, include/ntfs-3g/bootsect.h, - include/ntfs-3g/collate.h, include/ntfs-3g/compat.h, - include/ntfs-3g/compress.h, include/ntfs-3g/debug.h, - include/ntfs-3g/device.h, include/ntfs-3g/device_io.h, - include/ntfs-3g/dir.h, include/ntfs-3g/endians.h, - include/ntfs-3g/index.h, include/ntfs-3g/inode.h, - include/ntfs-3g/layout.h, include/ntfs-3g/lcnalloc.h, - include/ntfs-3g/list.h, include/ntfs-3g/logfile.h, - include/ntfs-3g/logging.h, include/ntfs-3g/mft.h, - include/ntfs-3g/misc.h, include/ntfs-3g/mst.h, - include/ntfs-3g/ntfstime.h, include/ntfs-3g/runlist.h, - include/ntfs-3g/security.h, include/ntfs-3g/support.h, - include/ntfs-3g/types.h, include/ntfs-3g/unistr.h, - include/ntfs-3g/version.h, include/ntfs-3g/volume.h, - libntfs-3g/Makefile.am, libntfs-3g/attrib.c, - libntfs-3g/attrlist.c, libntfs-3g/bitmap.c, - libntfs-3g/bootsect.c, libntfs-3g/collate.c, libntfs-3g/compat.c, - libntfs-3g/compress.c, libntfs-3g/debug.c, libntfs-3g/device.c, - libntfs-3g/device_io.c, libntfs-3g/dir.c, libntfs-3g/index.c, - libntfs-3g/inode.c, libntfs-3g/lcnalloc.c, libntfs-3g/logfile.c, - libntfs-3g/logging.c, libntfs-3g/mft.c, libntfs-3g/misc.c, - libntfs-3g/mst.c, libntfs-3g/runlist.c, libntfs-3g/security.c, - libntfs-3g/unistr.c, libntfs-3g/unix_io.c, libntfs-3g/version.c, - libntfs-3g/volume.c, libntfs-3g/win32_io.c, src/Makefile.am, - src/ntfs-3g.8.in, src/ntfs-3g.c, src/utils.c, src/utils.h: - - Initial revision - -2006-10-31 01:32 szaka - - * CREDITS, Makefile.am, README, autogen.sh, configure.ac, - include/Makefile.am, include/ntfs-3g/Makefile.am, - include/ntfs-3g/attrib.h, include/ntfs-3g/attrlist.h, - include/ntfs-3g/bitmap.h, include/ntfs-3g/bootsect.h, - include/ntfs-3g/collate.h, include/ntfs-3g/compat.h, - include/ntfs-3g/compress.h, include/ntfs-3g/debug.h, - include/ntfs-3g/device.h, include/ntfs-3g/device_io.h, - include/ntfs-3g/dir.h, include/ntfs-3g/endians.h, - include/ntfs-3g/index.h, include/ntfs-3g/inode.h, - include/ntfs-3g/layout.h, include/ntfs-3g/lcnalloc.h, - include/ntfs-3g/list.h, include/ntfs-3g/logfile.h, - include/ntfs-3g/logging.h, include/ntfs-3g/mft.h, - include/ntfs-3g/misc.h, include/ntfs-3g/mst.h, - include/ntfs-3g/ntfstime.h, include/ntfs-3g/runlist.h, - include/ntfs-3g/security.h, include/ntfs-3g/support.h, - include/ntfs-3g/types.h, include/ntfs-3g/unistr.h, - include/ntfs-3g/version.h, include/ntfs-3g/volume.h, - libntfs-3g/Makefile.am, libntfs-3g/attrib.c, - libntfs-3g/attrlist.c, libntfs-3g/bitmap.c, - libntfs-3g/bootsect.c, libntfs-3g/collate.c, libntfs-3g/compat.c, - libntfs-3g/compress.c, libntfs-3g/debug.c, libntfs-3g/device.c, - libntfs-3g/device_io.c, libntfs-3g/dir.c, libntfs-3g/index.c, - libntfs-3g/inode.c, libntfs-3g/lcnalloc.c, libntfs-3g/logfile.c, - libntfs-3g/logging.c, libntfs-3g/mft.c, libntfs-3g/misc.c, - libntfs-3g/mst.c, libntfs-3g/runlist.c, libntfs-3g/security.c, - libntfs-3g/unistr.c, libntfs-3g/unix_io.c, libntfs-3g/version.c, - libntfs-3g/volume.c, libntfs-3g/win32_io.c, src/Makefile.am, - src/ntfs-3g.8.in, src/ntfs-3g.c, src/utils.c, src/utils.h: - - initial CVS import +Alternatively it can be generated from the CVS source repository by cvs2cl.pl. +Instructions for CVS access: http://sourceforge.net/cvs/?group_id=181143 +Home of the cvs2cl.pl utility: http://www.red-bean.com/cvs2cl/ diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/config.guess /tmp/P0FDp6eeZz/ntfs-3g-1.913/config.guess --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/config.guess 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/config.guess 2007-09-28 17:10:53.000000000 +0300 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2007-03-06' +timestamp='2007-07-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -330,7 +330,7 @@ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:*) + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -793,7 +793,7 @@ exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in - x86) + x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/config.sub /tmp/P0FDp6eeZz/ntfs-3g-1.913/config.sub --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/config.sub 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/config.sub 2007-09-28 17:10:53.000000000 +0300 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2007-01-18' +timestamp='2007-06-28' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -475,8 +475,8 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16c) - basic_machine=cr16c-unknown + cr16) + basic_machine=cr16-unknown os=-elf ;; crds | unos) @@ -683,6 +683,10 @@ basic_machine=i386-pc os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/configure /tmp/P0FDp6eeZz/ntfs-3g-1.913/configure --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/configure 2007-07-10 01:40:34.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/configure 2007-09-13 00:18:08.000000000 +0300 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for ntfs-3g 1.710. +# Generated by GNU Autoconf 2.61 for ntfs-3g 1.913. # # Report bugs to . # @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='ntfs-3g' PACKAGE_TARNAME='ntfs-3g' -PACKAGE_VERSION='1.710' -PACKAGE_STRING='ntfs-3g 1.710' +PACKAGE_VERSION='1.913' +PACKAGE_STRING='ntfs-3g 1.913' PACKAGE_BUGREPORT='ntfs-3g-devel@lists.sf.net' ac_unique_file="config.h.in" @@ -846,6 +846,8 @@ MAINT REALLYSTATIC_TRUE REALLYSTATIC_FALSE +INSTALL_LIBRARY_TRUE +INSTALL_LIBRARY_FALSE RUN_LDCONFIG_TRUE RUN_LDCONFIG_FALSE CC @@ -1416,7 +1418,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntfs-3g 1.710 to adapt to many kinds of systems. +\`configure' configures ntfs-3g 1.913 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1487,7 +1489,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntfs-3g 1.710:";; + short | recursive ) echo "Configuration of ntfs-3g 1.913:";; esac cat <<\_ACEOF @@ -1502,6 +1504,7 @@ --enable-really-static create static binaries for the utilities --enable-warnings enable additional compiler warnings --disable-ldconfig do not update dynamic linker cache using ldconfig + --disable-library do not install libntfs-3g but link it into ntfs-3g --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-fast-install[=PKGS] @@ -1601,7 +1604,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntfs-3g configure 1.710 +ntfs-3g configure 1.913 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1615,7 +1618,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntfs-3g $as_me 1.710, which was +It was created by ntfs-3g $as_me 1.913, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1969,7 +1972,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -LIBNTFS_3G_VERSION=5:0:0 +LIBNTFS_3G_VERSION=12:0:0 ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2417,7 +2420,7 @@ # Define the identity of the package. PACKAGE='ntfs-3g' - VERSION='1.710' + VERSION='1.913' cat >>confdefs.h <<_ACEOF @@ -2700,6 +2703,31 @@ fi +# Check whether --enable-library was given. +if test "${enable_library+set}" = set; then + enableval=$enable_library; +else + enable_library=yes + +fi + +if test "$enable_library" != yes; then + enable_shared=no + enable_ldconfig=no +fi + + +if test "$enable_library" = yes; then + INSTALL_LIBRARY_TRUE= + INSTALL_LIBRARY_FALSE='#' +else + INSTALL_LIBRARY_TRUE='#' + INSTALL_LIBRARY_FALSE= +fi + + +# --disable-library will disable to run ldconfig since no point to do so. + if test "$enable_ldconfig" = yes; then RUN_LDCONFIG_TRUE= @@ -4953,7 +4981,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4956 "configure"' > conftest.$ac_ext + echo '#line 4984 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7454,11 +7482,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7457: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7485: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7461: \$? = $ac_status" >&5 + echo "$as_me:7489: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7722,11 +7750,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7725: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7753: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7729: \$? = $ac_status" >&5 + echo "$as_me:7757: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7826,11 +7854,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7829: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7857: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7833: \$? = $ac_status" >&5 + echo "$as_me:7861: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9291,7 +9319,7 @@ libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 9294 "configure"' > conftest.$ac_ext + echo '#line 9322 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10155,7 +10183,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12625: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12601: \$? = $ac_status" >&5 + echo "$as_me:12629: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12698,11 +12726,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12701: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12729: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12705: \$? = $ac_status" >&5 + echo "$as_me:12733: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13234,7 +13262,7 @@ libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 13237 "configure"' > conftest.$ac_ext + echo '#line 13265 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14292,11 +14320,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14295: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14323: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14299: \$? = $ac_status" >&5 + echo "$as_me:14327: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14396,11 +14424,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14399: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14427: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14403: \$? = $ac_status" >&5 + echo "$as_me:14431: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15841,7 +15869,7 @@ libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 15844 "configure"' > conftest.$ac_ext + echo '#line 15872 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -16619,11 +16647,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16622: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16650: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16626: \$? = $ac_status" >&5 + echo "$as_me:16654: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16887,11 +16915,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16890: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16918: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16894: \$? = $ac_status" >&5 + echo "$as_me:16922: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16991,11 +17019,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16994: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17022: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16998: \$? = $ac_status" >&5 + echo "$as_me:17026: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18456,7 +18484,7 @@ libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 18459 "configure"' > conftest.$ac_ext + echo '#line 18487 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -22913,6 +22941,13 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${INSTALL_LIBRARY_TRUE}" && test -z "${INSTALL_LIBRARY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LIBRARY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"INSTALL_LIBRARY\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${RUN_LDCONFIG_TRUE}" && test -z "${RUN_LDCONFIG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"RUN_LDCONFIG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -23241,7 +23276,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntfs-3g $as_me 1.710, which was +This file was extended by ntfs-3g $as_me 1.913, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23294,7 +23329,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -ntfs-3g config.status 1.710 +ntfs-3g config.status 1.913 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -23552,6 +23587,8 @@ MAINT!$MAINT$ac_delim REALLYSTATIC_TRUE!$REALLYSTATIC_TRUE$ac_delim REALLYSTATIC_FALSE!$REALLYSTATIC_FALSE$ac_delim +INSTALL_LIBRARY_TRUE!$INSTALL_LIBRARY_TRUE$ac_delim +INSTALL_LIBRARY_FALSE!$INSTALL_LIBRARY_FALSE$ac_delim RUN_LDCONFIG_TRUE!$RUN_LDCONFIG_TRUE$ac_delim RUN_LDCONFIG_FALSE!$RUN_LDCONFIG_FALSE$ac_delim CC!$CC$ac_delim @@ -23572,8 +23609,6 @@ am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -RM!$RM$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -23615,6 +23650,8 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +EGREP!$EGREP$ac_delim +RM!$RM$ac_delim LDCONFIG!$LDCONFIG$ac_delim LN_S!$LN_S$ac_delim ECHO!$ECHO$ac_delim @@ -23644,7 +23681,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 27; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 29; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -24240,10 +24277,12 @@ cat < Fri, 28 Sep 2007 09:06:32 +0300 + +ntfs-3g (1:1.913-1) unstable; urgency=low + + * New upstream release. + * Bump library package name to match current soname. + + -- Adam Cécile (Le_Vert) Thu, 13 Sep 2007 11:31:59 +0200 + +ntfs-3g (1:1.826-1) unstable; urgency=low + + * New upstream release. + * Bump library package name to match current soname. + + -- Adam Cécile (Le_Vert) Tue, 28 Aug 2007 09:17:34 +0200 + +ntfs-3g (1:1.810-1) unstable; urgency=low + + * New upstream release (Closes: #434128). + * Bump libfuse-dev build depends to >= 2.7 (Needed to really fix #434128). + * Bump library package name to match current soname. + + -- Adam Cécile (Le_Vert) Fri, 10 Aug 2007 17:00:02 +0200 + +ntfs-3g (1:1.710-2) unstable; urgency=low + + * Update long description, ntfs-3g works fine on any architecture (Closes: #436435). + * ntfs-3g binary is now 4754, according to debian policy (Closes: #436658). + + -- Adam Cécile (Le_Vert) Wed, 08 Aug 2007 19:22:08 +0200 + ntfs-3g (1:1.710-1ubuntu4) gutsy; urgency=low * Add udeb shlibs entries for libntfs-3g5-udeb. diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/control /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/control --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/control 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/control 2007-09-28 17:10:53.000000000 +0300 @@ -12,10 +12,9 @@ Depends: ${shlibs:Depends} Description: read-write NTFS driver for FUSE The ntfs-3g driver is an open source, GPL licensed, third generation Linux - NTFS driver for 32-bit, little-endian architectures which was implemented - by the Linux-NTFS project. It provides full read-write access to NTFS, - excluding access to encrypted files, writing compressed files, changing - file ownership, access right. + NTFS driver which was implemented by the Linux-NTFS project. It provides + full read-write access to NTFS, excluding access to encrypted files, writing + compressed files, changing file ownership, access right. . Technically it's based on and a major improvement to the third generation Linux NTFS driver, ntfsmount. The improvements includes functionality, @@ -29,13 +28,12 @@ Package: libntfs-3g-dev Section: libdevel Architecture: any -Depends: libntfs-3g5 (= ${binary:Version}) +Depends: libntfs-3g12 (= ${binary:Version}) Description: ntfs-3g filesystem in userspace (FUSE) library headers The ntfs-3g driver is an open source, GPL licensed, third generation Linux - NTFS driver for 32-bit, little-endian architectures which was implemented - by the Linux-NTFS project. It provides full read-write access to NTFS, - excluding access to encrypted files, writing compressed files, changing - file ownership, access right. + NTFS driver which was implemented by the Linux-NTFS project. It provides + full read-write access to NTFS, excluding access to encrypted files, writing + compressed files, changing file ownership, access right. . Technically it's based on and a major improvement to the third generation Linux NTFS driver, ntfsmount. The improvements includes functionality, @@ -45,20 +43,19 @@ you will have to prepare fuse kernel module to be able to use it. . This package contains the library headers for developing programs using - libntfs-3g5. + libntfs-3g12. . Homepage: http://www.ntfs-3g.org/ -Package: libntfs-3g5 +Package: libntfs-3g12 Section: libs Architecture: any Depends: ${shlibs:Depends} Description: ntfs-3g filesystem in userspace (FUSE) library The ntfs-3g driver is an open source, GPL licensed, third generation Linux - NTFS driver for 32-bit, little-endian architectures which was implemented - by the Linux-NTFS project. It provides full read-write access to NTFS, - excluding access to encrypted files, writing compressed files, changing - file ownership, access right. + NTFS driver which was implemented by the Linux-NTFS project. It provides + full read-write access to NTFS, excluding access to encrypted files, writing + compressed files, changing file ownership, access right. . Technically it's based on and a major improvement to the third generation Linux NTFS driver, ntfsmount. The improvements includes functionality, @@ -78,7 +75,7 @@ Depends: fuse-utils-udeb, ${shlibs:Depends} Description: read-write NTFS driver for FUSE -Package: libntfs-3g5-udeb +Package: libntfs-3g12-udeb Section: debian-installer Architecture: any XC-Package-Type: udeb diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g12.docs /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g12.docs --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g12.docs 1970-01-01 02:00:00.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g12.docs 2007-09-28 17:10:53.000000000 +0300 @@ -0,0 +1,3 @@ +NEWS +README +debian/README.Debian diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g12.install /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g12.install --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g12.install 1970-01-01 02:00:00.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g12.install 2007-09-28 17:10:53.000000000 +0300 @@ -0,0 +1 @@ +lib/lib*.so.* diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g12-udeb.install /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g12-udeb.install --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g12-udeb.install 1970-01-01 02:00:00.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g12-udeb.install 2007-09-28 17:10:53.000000000 +0300 @@ -0,0 +1 @@ +lib/lib*.so.* diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g5.docs /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g5.docs --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g5.docs 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g5.docs 1970-01-01 02:00:00.000000000 +0200 @@ -1,3 +0,0 @@ -NEWS -README -debian/README.Debian diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g5.install /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g5.install --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g5.install 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g5.install 1970-01-01 02:00:00.000000000 +0200 @@ -1 +0,0 @@ -lib/lib*.so.* diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g5-udeb.install /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g5-udeb.install --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g5-udeb.install 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g5-udeb.install 1970-01-01 02:00:00.000000000 +0200 @@ -1 +0,0 @@ -lib/lib*.so.* diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g-dev.links /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g-dev.links --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/libntfs-3g-dev.links 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/libntfs-3g-dev.links 2007-09-28 17:10:53.000000000 +0300 @@ -1 +1 @@ -usr/share/doc/libntfs-3g5 usr/share/doc/libntfs-3g-dev +usr/share/doc/libntfs-3g12 usr/share/doc/libntfs-3g-dev diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/ntfs-3g.links /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/ntfs-3g.links --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/ntfs-3g.links 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/ntfs-3g.links 2007-09-28 17:10:53.000000000 +0300 @@ -1,3 +1,3 @@ -usr/share/doc/libntfs-3g5 usr/share/doc/ntfs-3g +usr/share/doc/libntfs-3g12 usr/share/doc/ntfs-3g bin/ntfs-3g sbin/mount.ntfs usr/share/man/man8/ntfs-3g.8.gz usr/share/man/man8/mount.ntfs.8.gz diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/ntfs-3g.postinst /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/ntfs-3g.postinst --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/ntfs-3g.postinst 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/ntfs-3g.postinst 2007-09-28 17:10:53.000000000 +0300 @@ -6,7 +6,7 @@ # Set ntfs-3g binary suid root with group fuse echo -n "Setting ntfs-3g suid root with group fuse..." chown root:fuse /bin/ntfs-3g || true -chmod 4750 /bin/ntfs-3g || true +chmod 4754 /bin/ntfs-3g || true echo "done" echo "Users from 'fuse' group can now mount NTFS volume." diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/rules /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/rules --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/debian/rules 2007-09-28 17:10:53.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/debian/rules 2007-09-28 17:10:53.000000000 +0300 @@ -10,7 +10,7 @@ DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -# We'll symlink /usr/share/doc/ to the libntfs-3g5 one +# We'll symlink /usr/share/doc/ to the libntfs-3g12 one # So we need a list of available packages PKG_LIST = libntfs-3g-dev ntfs-3g @@ -89,9 +89,9 @@ dh_strip dh_compress dh_fixperms - dh_makeshlibs --add-udeb=libntfs-3g5-udeb + dh_makeshlibs --add-udeb=libntfs-3g12-udeb dh_installdeb - dh_shlibdeps -Llibntfs-3g5 -ldebian/libntfs-3g5/lib + dh_shlibdeps -Llibntfs-3g12 -ldebian/libntfs-3g12/lib dh_gencontrol dh_md5sums dh_builddeb diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/Makefile.in /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/Makefile.in --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/Makefile.in 2007-07-10 01:40:42.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/Makefile.in 2007-09-13 00:18:17.000000000 +0300 @@ -91,6 +91,8 @@ FUSE_MODULE_LIBS = @FUSE_MODULE_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LIBRARY_FALSE = @INSTALL_LIBRARY_FALSE@ +INSTALL_LIBRARY_TRUE = @INSTALL_LIBRARY_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/bitmap.h /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/bitmap.h --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/bitmap.h 2006-10-31 00:32:45.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/bitmap.h 2007-09-02 15:36:33.000000000 +0300 @@ -70,5 +70,27 @@ return ntfs_bitmap_clear_run(na, bit, 1); } +/* + * rol32 - rotate a 32-bit value left + * + * @word: value to rotate + * @shift: bits to roll + */ +static __inline__ u32 ntfs_rol32(u32 word, unsigned int shift) +{ + return (word << shift) | (word >> (32 - shift)); +} + +/* + * ror32 - rotate a 32-bit value right + * + * @word: value to rotate + * @shift: bits to roll + */ +static __inline__ u32 ntfs_ror32(u32 word, unsigned int shift) +{ + return (word >> shift) | (word << (32 - shift)); +} + #endif /* defined _NTFS_BITMAP_H */ diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/inode.h /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/inode.h --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/inode.h 2006-10-31 00:32:46.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/inode.h 2007-08-10 18:01:20.000000000 +0300 @@ -48,6 +48,8 @@ mft record and then to disk. */ NI_FileNameDirty, /* 1: FILE_NAME attributes need to be updated in the index. */ + NI_NoMtimeUpdate, /* 1: Don't update modifiction time. */ + NI_NoParentMtimeUpdate, /* 1: Don't update parent dir's mtime. */ } ntfs_inode_state_bits; #define test_nino_flag(ni, flag) test_bit(NI_##flag, (ni)->state) @@ -96,6 +98,16 @@ #define NInoFileNameTestAndClearDirty(ni) \ test_and_clear_nino_flag(ni, FileNameDirty) +#define NInoNoMtimeUpdate(ni) test_nino_flag(ni, NoMtimeUpdate) +#define NInoSetNoMtimeUpdate(ni) set_nino_flag(ni, NoMtimeUpdate) +#define NInoClearNoMtimeUpdate(ni) clear_nino_flag(ni, NoMtimeUpdate) +#define NInoMtimeUpdate(ni) (!NInoNoMtimeUpdate(ni)) + +#define NInoNoParentMtimeUpdate(ni) test_nino_flag(ni, NoMtimeUpdate) +#define NInoSetNoParentMtimeUpdate(ni) set_nino_flag(ni, NoMtimeUpdate) +#define NInoClearNoParentMtimeUpdate(ni) clear_nino_flag(ni, NoMtimeUpdate) +#define NInoParentMtimeUpdate(ni) (!NInoNoParentMtimeUpdate(ni)) + /** * struct _ntfs_inode - The NTFS in-memory inode structure. * @@ -149,6 +161,8 @@ time_t last_access_time; }; +extern ntfs_inode *ntfs_inode_base(ntfs_inode *ni); + extern ntfs_inode *ntfs_inode_allocate(ntfs_volume *vol); extern ntfs_inode *ntfs_inode_open(ntfs_volume *vol, const MFT_REF mref); diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/list.h /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/list.h --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/list.h 2006-10-31 00:32:46.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/list.h 1970-01-01 02:00:00.000000000 +0200 @@ -1,192 +0,0 @@ -/* - * list.h - Linked list implementation. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2002 Anton Altaparmakov and others - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_LIST_H -#define _NTFS_LIST_H - -/** - * struct list_head - Simple doubly linked list implementation. - * - * Copied from Linux kernel 2.4.2-ac18 into Linux-NTFS (with minor - * modifications). - AIA - * - * Some of the internal functions ("__xxx") are useful when - * manipulating whole lists rather than single entries, as - * sometimes we already know the next/prev entries and we can - * generate better code by using them directly rather than - * using the generic single-entry routines. - */ -struct list_head { - struct list_head *next, *prev; -}; - -#define LIST_HEAD_INIT(name) { &(name), &(name) } - -#define LIST_HEAD(name) \ - struct list_head name = LIST_HEAD_INIT(name) - -#define INIT_LIST_HEAD(ptr) do { \ - (ptr)->next = (ptr); (ptr)->prev = (ptr); \ -} while (0) - -/** - * __list_add - Insert a new entry between two known consecutive entries. - * @new: - * @prev: - * @next: - * - * This is only for internal list manipulation where we know the prev/next - * entries already! - */ -static void __list_add(struct list_head * new, - struct list_head * prev, struct list_head * next) -{ - next->prev = new; - new->next = next; - new->prev = prev; - prev->next = new; -} - -/** - * list_add - add a new entry - * @new: new entry to be added - * @head: list head to add it after - * - * Insert a new entry after the specified head. - * This is good for implementing stacks. - */ -static __inline__ void list_add(struct list_head *new, struct list_head *head) -{ - __list_add(new, head, head->next); -} - -/** - * list_add_tail - add a new entry - * @new: new entry to be added - * @head: list head to add it before - * - * Insert a new entry before the specified head. - * This is useful for implementing queues. - */ -static __inline__ void list_add_tail(struct list_head *new, struct list_head *head) -{ - __list_add(new, head->prev, head); -} - -/** - * __list_del - - * @prev: - * @next: - * - * Delete a list entry by making the prev/next entries point to each other. - * - * This is only for internal list manipulation where we know the prev/next - * entries already! - */ -static __inline__ void __list_del(struct list_head * prev, - struct list_head * next) -{ - next->prev = prev; - prev->next = next; -} - -/** - * list_del - deletes entry from list. - * @entry: the element to delete from the list. - * - * Note: list_empty on entry does not return true after this, the entry is in - * an undefined state. - */ -static __inline__ void list_del(struct list_head *entry) -{ - __list_del(entry->prev, entry->next); -} - -/** - * list_del_init - deletes entry from list and reinitialize it. - * @entry: the element to delete from the list. - */ -static __inline__ void list_del_init(struct list_head *entry) -{ - __list_del(entry->prev, entry->next); - INIT_LIST_HEAD(entry); -} - -/** - * list_empty - tests whether a list is empty - * @head: the list to test. - */ -static __inline__ int list_empty(struct list_head *head) -{ - return head->next == head; -} - -/** - * list_splice - join two lists - * @list: the new list to add. - * @head: the place to add it in the first list. - */ -static void list_splice(struct list_head *list, - struct list_head *head) -{ - struct list_head *first = list->next; - - if (first != list) { - struct list_head *last = list->prev; - struct list_head *at = head->next; - - first->prev = head; - head->next = first; - - last->next = at; - at->prev = last; - } -} - -/** - * list_entry - get the struct for this entry - * @ptr: the &struct list_head pointer. - * @type: the type of the struct this is embedded in. - * @member: the name of the list_struct within the struct. - */ -#define list_entry(ptr, type, member) \ - ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) - -/** - * list_for_each - iterate over a list - * @pos: the &struct list_head to use as a loop counter. - * @head: the head for your list. - */ -#define list_for_each(pos, head) \ - for (pos = (head)->next; pos != (head); pos = pos->next) - -/** - * list_for_each_safe - iterate over a list safe against removal of list entry - * @pos: the &struct list_head to use as a loop counter. - * @n: another &struct list_head to use as temporary storage - * @head: the head for your list. - */ -#define list_for_each_safe(pos, n, head) \ - for (pos = (head)->next, n = pos->next; pos != (head); \ - pos = n, n = pos->next) - -#endif /* defined _NTFS_LIST_H */ - diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/Makefile.am /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/Makefile.am --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/Makefile.am 2006-10-31 00:32:45.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/Makefile.am 2007-09-01 14:28:43.000000000 +0300 @@ -1,4 +1,5 @@ +if INSTALL_LIBRARY linux_ntfsincludedir = $(includedir)/ntfs-3g linux_ntfsinclude_HEADERS = \ attrib.h \ @@ -17,7 +18,6 @@ inode.h \ layout.h \ lcnalloc.h \ - list.h \ logfile.h \ logging.h \ mft.h \ @@ -30,5 +30,6 @@ unistr.h \ version.h \ volume.h +endif MAINTAINERCLEANFILES = Makefile.in diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/Makefile.in /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/Makefile.in --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/Makefile.in 2007-07-10 01:40:42.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/Makefile.in 2007-09-13 00:18:17.000000000 +0300 @@ -38,8 +38,8 @@ host_triplet = @host@ target_triplet = @target@ subdir = include/ntfs-3g -DIST_COMMON = $(linux_ntfsinclude_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in +DIST_COMMON = $(am__linux_ntfsinclude_HEADERS_DIST) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -49,6 +49,12 @@ CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = +am__linux_ntfsinclude_HEADERS_DIST = attrib.h attrlist.h bitmap.h \ + bootsect.h collate.h compat.h compress.h debug.h device.h \ + device_io.h dir.h endians.h index.h inode.h layout.h \ + lcnalloc.h logfile.h logging.h mft.h mst.h ntfstime.h \ + runlist.h security.h support.h types.h unistr.h version.h \ + volume.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -95,6 +101,8 @@ FUSE_MODULE_LIBS = @FUSE_MODULE_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LIBRARY_FALSE = @INSTALL_LIBRARY_FALSE@ +INSTALL_LIBRARY_TRUE = @INSTALL_LIBRARY_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ @@ -184,37 +192,36 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ -linux_ntfsincludedir = $(includedir)/ntfs-3g -linux_ntfsinclude_HEADERS = \ - attrib.h \ - attrlist.h \ - bitmap.h \ - bootsect.h \ - collate.h \ - compat.h \ - compress.h \ - debug.h \ - device.h \ - device_io.h \ - dir.h \ - endians.h \ - index.h \ - inode.h \ - layout.h \ - lcnalloc.h \ - list.h \ - logfile.h \ - logging.h \ - mft.h \ - mst.h \ - ntfstime.h \ - runlist.h \ - security.h \ - support.h \ - types.h \ - unistr.h \ - version.h \ - volume.h +@INSTALL_LIBRARY_TRUE@linux_ntfsincludedir = $(includedir)/ntfs-3g +@INSTALL_LIBRARY_TRUE@linux_ntfsinclude_HEADERS = \ +@INSTALL_LIBRARY_TRUE@ attrib.h \ +@INSTALL_LIBRARY_TRUE@ attrlist.h \ +@INSTALL_LIBRARY_TRUE@ bitmap.h \ +@INSTALL_LIBRARY_TRUE@ bootsect.h \ +@INSTALL_LIBRARY_TRUE@ collate.h \ +@INSTALL_LIBRARY_TRUE@ compat.h \ +@INSTALL_LIBRARY_TRUE@ compress.h \ +@INSTALL_LIBRARY_TRUE@ debug.h \ +@INSTALL_LIBRARY_TRUE@ device.h \ +@INSTALL_LIBRARY_TRUE@ device_io.h \ +@INSTALL_LIBRARY_TRUE@ dir.h \ +@INSTALL_LIBRARY_TRUE@ endians.h \ +@INSTALL_LIBRARY_TRUE@ index.h \ +@INSTALL_LIBRARY_TRUE@ inode.h \ +@INSTALL_LIBRARY_TRUE@ layout.h \ +@INSTALL_LIBRARY_TRUE@ lcnalloc.h \ +@INSTALL_LIBRARY_TRUE@ logfile.h \ +@INSTALL_LIBRARY_TRUE@ logging.h \ +@INSTALL_LIBRARY_TRUE@ mft.h \ +@INSTALL_LIBRARY_TRUE@ mst.h \ +@INSTALL_LIBRARY_TRUE@ ntfstime.h \ +@INSTALL_LIBRARY_TRUE@ runlist.h \ +@INSTALL_LIBRARY_TRUE@ security.h \ +@INSTALL_LIBRARY_TRUE@ support.h \ +@INSTALL_LIBRARY_TRUE@ types.h \ +@INSTALL_LIBRARY_TRUE@ unistr.h \ +@INSTALL_LIBRARY_TRUE@ version.h \ +@INSTALL_LIBRARY_TRUE@ volume.h MAINTAINERCLEANFILES = Makefile.in all: all-am diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/security.h /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/security.h --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/security.h 2006-10-31 00:32:46.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/security.h 2007-09-02 15:38:29.000000000 +0300 @@ -55,4 +55,7 @@ extern void ntfs_generate_guid(GUID *guid); extern int ntfs_sd_add_everyone(ntfs_inode *ni); +extern le32 ntfs_security_hash(const SECURITY_DESCRIPTOR_RELATIVE *sd, + const u32 len); + #endif /* defined _NTFS_SECURITY_H */ diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/volume.h /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/volume.h --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/include/ntfs-3g/volume.h 2007-06-09 02:11:55.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/include/ntfs-3g/volume.h 2007-09-12 23:51:06.000000000 +0300 @@ -212,6 +212,9 @@ s32 attrdef_len; /* Size of the attribute definition table in bytes. */ + s64 free_clusters; /* Track the number of free clusters which + greatly improves statfs() performance */ + /* Temp: for directory handling */ void *private_data; /* ntfs_dir for . */ void *private_bmp1; /* ntfs_bmp for $MFT/$BITMAP */ diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/attrib.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/attrib.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/attrib.c 2007-07-08 23:45:14.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/attrib.c 2007-09-10 00:39:37.000000000 +0300 @@ -751,13 +751,17 @@ ntfs_volume *vol; runlist_element *rl; - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, pos 0x%llx, count " - "0x%llx.\n", (unsigned long long)na->ni->mft_no, - na->type, (long long)pos, (long long)count); if (!na || !na->ni || !na->ni->vol || !b || pos < 0 || count < 0) { errno = EINVAL; + ntfs_log_perror("%s: na=%p b=%p pos=%lld count=%lld", + __FUNCTION__, na, b, pos, count); return -1; } + + ntfs_log_trace("Entering for inode %lld attr 0x%x pos %lld count " + "%lld\n", (unsigned long long)na->ni->mft_no, + na->type, (long long)pos, (long long)count); + /* * If this is a compressed attribute it needs special treatment, but * only if it is non-resident. @@ -804,6 +808,7 @@ le32_to_cpu(ctx->attr->value_length) > (char*)ctx->mrec + vol->mft_record_size) { errno = EIO; + ntfs_log_perror("%s: Sanity check failed", __FUNCTION__); goto res_err_out; } memcpy(b, val + pos, count); @@ -829,8 +834,10 @@ * However, we already truncated the read to the data_size, * so getting this here is an error. */ - if (errno == ENOENT) + if (errno == ENOENT) { errno = EIO; + ntfs_log_perror("%s: Failed to find VCN #1", __FUNCTION__); + } return -1; } /* @@ -843,18 +850,27 @@ if (rl->lcn == LCN_RL_NOT_MAPPED) { rl = ntfs_attr_find_vcn(na, rl->vcn); if (!rl) { - if (errno == ENOENT) + if (errno == ENOENT) { errno = EIO; + ntfs_log_perror("%s: Failed to find VCN #2", + __FUNCTION__); + } goto rl_err_out; } /* Needed for case when runs merged. */ ofs = pos + total - (rl->vcn << vol->cluster_size_bits); } - if (!rl->length) + if (!rl->length) { + errno = EIO; + ntfs_log_perror("%s: Zero run length", __FUNCTION__); goto rl_err_out; + } if (rl->lcn < (LCN)0) { - if (rl->lcn != (LCN)LCN_HOLE) + if (rl->lcn != (LCN)LCN_HOLE) { + ntfs_log_perror("%s: Bad run (%lld)", + __FUNCTION__, rl->lcn); goto rl_err_out; + } /* It is a hole, just zero the matching @b range. */ to_read = min(count, (rl->length << vol->cluster_size_bits) - ofs); @@ -887,6 +903,7 @@ return total; if (!br) errno = EIO; + ntfs_log_perror("%s: ntfs_pread failed", __FUNCTION__); return -1; } /* Finally, return the number of bytes read. */ @@ -1092,6 +1109,7 @@ (long long)count); if (!na || !na->ni || !na->ni->vol || !b || pos < 0 || count < 0) { errno = EINVAL; + ntfs_log_perror("%s", __FUNCTION__); goto errno_set; } vol = na->ni->vol; @@ -1135,13 +1153,16 @@ if (!ctx) goto err_out; if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, - 0, NULL, 0, ctx)) + 0, NULL, 0, ctx)) { + ntfs_log_perror("%s: lookup failed", __FUNCTION__); goto err_out; + } val = (char*)ctx->attr + le16_to_cpu(ctx->attr->value_offset); if (val < (char*)ctx->attr || val + le32_to_cpu(ctx->attr->value_length) > (char*)ctx->mrec + vol->mft_record_size) { errno = EIO; + ntfs_log_perror("%s: Sanity check failed", __FUNCTION__); goto err_out; } memcpy(val + pos, b, count); @@ -1154,6 +1175,7 @@ * it is unlikely to fail writing it, so is ok to just * return error here... (AIA) */ + ntfs_log_perror("%s: failed to write mft record", __FUNCTION__); goto err_out; } ntfs_attr_put_search_ctx(ctx); @@ -1211,8 +1233,10 @@ * However, we already extended the size of the attribute, * so getting this here must be an error of some kind. */ - if (errno == ENOENT) + if (errno == ENOENT) { errno = EIO; + ntfs_log_perror("%s: Failed to find VCN #1", __FUNCTION__); + } goto err_out; } /* @@ -1225,8 +1249,11 @@ if (rl->lcn == LCN_RL_NOT_MAPPED) { rl = ntfs_attr_find_vcn(na, rl->vcn); if (!rl) { - if (errno == ENOENT) + if (errno == ENOENT) { errno = EIO; + ntfs_log_perror("%s: Failed to find VCN" + " #2", __FUNCTION__); + } goto rl_err_out; } /* Needed for case when runs merged. */ @@ -1234,12 +1261,15 @@ } if (!rl->length) { errno = EIO; + ntfs_log_perror("%s: Zero run length", __FUNCTION__); goto rl_err_out; } if (rl->lcn < (LCN)0) { if (rl->lcn != (LCN)LCN_HOLE) { errno = EIO; + ntfs_log_perror("%s: Unexpected LCN (%lld)", + __FUNCTION__, rl->lcn); goto rl_err_out; } @@ -1251,11 +1281,37 @@ retry: ntfs_log_trace("Writing %lld bytes to vcn %lld, lcn %lld, ofs " "%lld.\n", to_write, rl->vcn, rl->lcn, ofs); - if (!NVolReadOnly(vol)) - written = ntfs_pwrite(vol->dev, (rl->lcn << - vol->cluster_size_bits) + ofs, - to_write, b); - else + if (!NVolReadOnly(vol)) { + + s64 pos = (rl->lcn << vol->cluster_size_bits) + ofs; + int bsize = vol->cluster_size; + + /* + * Write cluster size blocks if it's possible. This will + * cause the kernel not to seek and read disk blocks for + * filling the end of the buffer which increases write + * speed at least by 2-11 fold typically. + */ + if (!(ofs % bsize) && (to_write % bsize) && + ((ofs + to_write) == na->initialized_size)) { + + s64 rounded = (to_write + bsize - 1) & ~(bsize - 1); + char *cb = ntfs_malloc(rounded); + + if (!cb) + goto err_out; + + memcpy(cb, b, to_write); + memset(cb + to_write, 0, rounded - to_write); + + written = ntfs_pwrite(vol->dev, pos, rounded, cb); + if (written == rounded) + written = to_write; + + free(cb); + } else + written = ntfs_pwrite(vol->dev, pos, to_write, b); + } else written = to_write; /* If everything ok, update progress counters and continue. */ if (written > 0) { @@ -1276,7 +1332,13 @@ ntfs_attr_put_search_ctx(ctx); /* Update mapping pairs if needed. */ if (update_from != -1) - ntfs_attr_update_mapping_pairs(na, 0 /*update_from*/); + if (ntfs_attr_update_mapping_pairs(na, 0 /*update_from*/)) { + /* + * FIXME: trying to recover by goto rl_err_out; + * could cause driver hang by infinite looping. + */ + return -1; + } out: return total; rl_err_out: @@ -1384,6 +1446,7 @@ (long long)pos); if (bk_cnt < 0 || bk_size % NTFS_BLOCK_SIZE) { errno = EINVAL; + ntfs_log_perror("%s", __FUNCTION__); return -1; } br = ntfs_attr_pread(na, pos, bk_cnt * bk_size, dst); @@ -1449,6 +1512,7 @@ ((u8*)src + i * bk_size), bk_size); if (err < 0) { /* Abort write at this position. */ + ntfs_log_perror("%s #1", __FUNCTION__); if (!i) return err; bk_cnt = i; @@ -1457,6 +1521,9 @@ } /* Write the prepared data. */ written = ntfs_attr_pwrite(na, pos, bk_cnt * bk_size, src); + if (written <= 0) { + ntfs_log_perror("%s: written=%lld", __FUNCTION__, written); + } /* Quickly deprotect the data again. */ for (i = 0; i < bk_cnt; ++i) ntfs_mst_post_write_fixup((NTFS_RECORD*)((u8*)src + i * @@ -2313,6 +2380,7 @@ if (!vol || !vol->attrdef || !type) { errno = EINVAL; + ntfs_log_perror("%s: type=%d", __FUNCTION__, type); return NULL; } for (ad = vol->attrdef; (u8*)ad - (u8*)vol->attrdef < @@ -2326,8 +2394,8 @@ /* We have gone too far already. No point in continuing. */ break; } - /* Attribute not found?!? */ errno = ENOENT; + ntfs_log_perror("%s: type=%d", __FUNCTION__, type); return NULL; } @@ -2350,31 +2418,36 @@ const s64 size) { ATTR_DEF *ad; + s64 min_size, max_size; if (size < 0) { errno = EINVAL; + ntfs_log_perror("%s: size=%lld", __FUNCTION__, size); return -1; } /* - * $ATTRIBUTE_LIST should be not greater than 0x40000, but this is not - * listed in the AttrDef. + * $ATTRIBUTE_LIST shouldn't be greater than 0x40000, otherwise + * Windows would crash. This is not listed in the AttrDef. */ if (type == AT_ATTRIBUTE_LIST && size > 0x40000) { errno = ERANGE; + ntfs_log_perror("Too large attrlist (%lld)", size); return -1; } ad = ntfs_attr_find_in_attrdef(vol, type); if (!ad) return -1; - /* We found the attribute. - Do the bounds check. */ - if ((sle64_to_cpu(ad->min_size) && size < - sle64_to_cpu(ad->min_size)) || - ((sle64_to_cpu(ad->max_size) > 0) && size > - sle64_to_cpu(ad->max_size))) { - /* @size is out of range! */ + + min_size = sle64_to_cpu(ad->min_size); + max_size = sle64_to_cpu(ad->max_size); + + if ((min_size && (size < min_size)) || + ((max_size > 0) && (size > max_size))) { errno = ERANGE; + ntfs_log_perror("Attr type %d size check failed (min,size,max=" + "%lld,%lld,%lld)", type, min_size, size, max_size); return -1; } return 0; @@ -2664,9 +2737,9 @@ if (ntfs_attr_can_be_non_resident(ni->vol, type)) { if (errno == EPERM) - ntfs_log_trace("Attribute can't be non resident.\n"); + ntfs_log_perror("Attribute can't be non resident"); else - ntfs_log_trace("ntfs_attr_can_be_non_resident failed.\n"); + ntfs_log_perror("ntfs_attr_can_be_non_resident failed"); return -1; } @@ -2682,10 +2755,11 @@ if (!ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, NULL, 0, ctx)) { err = EEXIST; - ntfs_log_trace("Attribute already present.\n"); + ntfs_log_perror("Attribute 0x%x already present", type); goto put_err_out; } if (errno != ENOENT) { + ntfs_log_perror("ntfs_attr_find failed"); err = EIO; goto put_err_out; } @@ -2700,7 +2774,7 @@ sizeof(a->compressed_size) : 0); if (ntfs_make_room_for_attr(ctx->mrec, (u8*) ctx->attr, length)) { err = errno; - ntfs_log_trace("Failed to make room for attribute.\n"); + ntfs_log_perror("Failed to make room for attribute"); goto put_err_out; } @@ -2738,9 +2812,8 @@ if (type != AT_ATTRIBUTE_LIST && NInoAttrList(base_ni)) { if (ntfs_attrlist_entry_add(ni, a)) { err = errno; + ntfs_log_perror("Failed add attr entry to attrlist"); ntfs_attr_record_resize(m, a, 0); - ntfs_log_trace("Failed add attribute entry to " - "ATTRIBUTE_LIST.\n"); goto put_err_out; } } @@ -2753,8 +2826,7 @@ ntfs_attr_reinit_search_ctx(ctx); if (ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE, lowest_vcn, NULL, 0, ctx)) { - ntfs_log_trace("Attribute lookup failed. Probably leaving inconstant " - "metadata.\n"); + ntfs_log_perror("%s: attribute lookup failed", __FUNCTION__); ntfs_attr_put_search_ctx(ctx); return -1; @@ -2935,8 +3007,8 @@ ntfs_attr *na; if (!ni || size < 0 || type == AT_ATTRIBUTE_LIST) { - ntfs_log_trace("Invalid arguments passed.\n"); errno = EINVAL; + ntfs_log_perror("%s: ni=%p size=%lld", __FUNCTION__, ni, size); return -1; } @@ -2948,12 +3020,8 @@ /* Check the attribute type and the size. */ if (ntfs_attr_size_bounds_check(ni->vol, type, size)) { - if (errno == ERANGE) { - ntfs_log_trace("Size bounds check failed. Aborting...\n"); - } else if (errno == ENOENT) { - ntfs_log_trace("Invalid attribute type. Aborting...\n"); + if (errno == ENOENT) errno = EIO; - } return -1; } @@ -2961,19 +3029,19 @@ if (ntfs_attr_can_be_non_resident(ni->vol, type)) { if (errno != EPERM) { err = errno; - ntfs_log_trace("ntfs_attr_can_be_non_resident failed.\n"); + ntfs_log_perror("ntfs_attr_can_be_non_resident failed"); goto err_out; } /* @val is mandatory. */ if (!val) { - ntfs_log_trace("val is mandatory for always resident " - "attributes.\n"); errno = EINVAL; + ntfs_log_perror("val is mandatory for always resident " + "attributes"); return -1; } if (size > ni->vol->mft_record_size) { - ntfs_log_trace("Attribute is too big.\n"); errno = ERANGE; + ntfs_log_perror("Attribute is too big"); return -1; } } @@ -2987,7 +3055,7 @@ } else { if (errno != EPERM) { err = errno; - ntfs_log_trace("ntfs_attr_can_be_resident failed.\n"); + ntfs_log_perror("ntfs_attr_can_be_resident failed"); goto err_out; } is_resident = FALSE; @@ -3014,7 +3082,7 @@ /* Try to add to extent inodes. */ if (ntfs_inode_attach_all_extents(ni)) { err = errno; - ntfs_log_trace("Failed to attach all extents to inode.\n"); + ntfs_log_perror("Failed to attach all extents to inode"); goto err_out; } for (i = 0; i < ni->nr_extents; i++) { @@ -3030,7 +3098,7 @@ /* Add attribute list not present, add it and retry. */ if (ntfs_inode_add_attrlist(ni)) { err = errno; - ntfs_log_trace("Failed to add attribute list.\n"); + ntfs_log_perror("Failed to add attribute list"); goto err_out; } return ntfs_attr_add(ni, type, name, name_len, val, size); @@ -3039,7 +3107,7 @@ attr_ni = ntfs_mft_record_alloc(ni->vol, ni); if (!attr_ni) { err = errno; - ntfs_log_trace("Failed to allocate extent record.\n"); + ntfs_log_perror("Failed to allocate extent record"); goto err_out; } @@ -3050,7 +3118,7 @@ name_len, val, size, 0); if (offset < 0) { err = errno; - ntfs_log_trace("Failed to add resident attribute.\n"); + ntfs_log_perror("Failed to add resident attribute"); goto free_err_out; } return 0; @@ -3061,7 +3129,7 @@ name_len, 0, 8, 0); if (offset < 0) { err = errno; - ntfs_log_trace("Failed to add non resident attribute.\n"); + ntfs_log_perror("Failed to add non resident attribute"); goto free_err_out; } @@ -3073,17 +3141,16 @@ na = ntfs_attr_open(ni, type, name, name_len); if (!na) { err = errno; - ntfs_log_trace("Failed to open just added attribute.\n"); + ntfs_log_perror("Failed to open just added attribute"); goto rm_attr_err_out; } /* Resize and set attribute value. */ if (ntfs_attr_truncate(na, size) || (val && (ntfs_attr_pwrite(na, 0, size, val) != size))) { err = errno; - ntfs_log_trace("Failed to initialize just added attribute.\n"); + ntfs_log_perror("Failed to initialize just added attribute"); if (ntfs_attr_rm(na)) - ntfs_log_trace("Failed to remove just added attribute. " - "Probably leaving inconstant metadata.\n"); + ntfs_log_perror("Failed to remove just added attribute"); ntfs_attr_close(na); goto err_out; } @@ -3093,18 +3160,14 @@ rm_attr_err_out: /* Remove just added attribute. */ if (ntfs_attr_record_resize(attr_ni->mrec, - (ATTR_RECORD*)((u8*)attr_ni->mrec + offset), 0)) { - ntfs_log_trace("Failed to remove just added attribute.\n"); - } + (ATTR_RECORD*)((u8*)attr_ni->mrec + offset), 0)) + ntfs_log_perror("Failed to remove just added attribute #2"); free_err_out: /* Free MFT record, if it isn't contain attributes. */ if (le32_to_cpu(attr_ni->mrec->bytes_in_use) - - le32_to_cpu(attr_ni->mrec->attrs_offset) == 8) { - if (ntfs_mft_record_free(attr_ni->vol, attr_ni)) { - ntfs_log_trace("Failed to free MFT record. Leaving " - "inconstant metadata.\n"); - } - } + le32_to_cpu(attr_ni->mrec->attrs_offset) == 8) + if (ntfs_mft_record_free(attr_ni->vol, attr_ni)) + ntfs_log_perror("Failed to free MFT record"); err_out: errno = err; return -1; @@ -3302,10 +3365,9 @@ /* Find place in MFT record where attribute will be moved. */ a = ctx->attr; nctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!nctx) { - ntfs_log_trace("Couldn't obtain search context.\n"); + if (!nctx) return -1; - } + /* * Use ntfs_attr_find instead of ntfs_attr_lookup to find place for * attribute in @ni->mrec, not any extent inode in case if @ni is base @@ -3374,14 +3436,15 @@ int i; if (!ctx || !ctx->attr || !ctx->ntfs_ino || extra < 0) { - ntfs_log_trace("Invalid arguments passed.\n"); errno = EINVAL; + ntfs_log_perror("%s: ctx=%p ctx->attr=%p extra=%d", __FUNCTION__, + ctx, ctx ? ctx->attr : NULL, extra); return -1; } - ntfs_log_trace("Entering for attr 0x%x, inode 0x%llx.\n", + ntfs_log_trace("Entering for attr 0x%x, inode %llu\n", (unsigned) le32_to_cpu(ctx->attr->type), - (long long) ctx->ntfs_ino->mft_no); + (unsigned long long)ctx->ntfs_ino->mft_no); if (ctx->ntfs_ino->nr_extents == -1) base_ni = ctx->base_ntfs_ino; @@ -3389,14 +3452,15 @@ base_ni = ctx->ntfs_ino; if (!NInoAttrList(base_ni)) { - ntfs_log_trace("Inode should contain attribute list to use this " - "function.\n"); errno = EINVAL; + ntfs_log_perror("Inode %llu has no attrlist", + (unsigned long long)base_ni->mft_no); return -1; } if (ntfs_inode_attach_all_extents(ctx->ntfs_ino)) { - ntfs_log_trace("Couldn't attach extent inode.\n"); + ntfs_log_perror("Couldn't attach extents, inode=%llu", + (unsigned long long)base_ni->mft_no); return -1; } @@ -3428,11 +3492,11 @@ */ ni = ntfs_mft_record_alloc(base_ni->vol, base_ni); if (!ni) { - ntfs_log_trace("Couldn't allocate new MFT record.\n"); + ntfs_log_perror("Couldn't allocate MFT record"); return -1; } if (ntfs_attr_record_move_to(ctx, ni)) { - ntfs_log_trace("Couldn't move attribute to new MFT record.\n"); + ntfs_log_perror("Couldn't move attribute to MFT record"); return -1; } return 0; @@ -3983,6 +4047,125 @@ return 0; } +/* + * If we are in the first extent, then set/clean sparse bit, + * update allocated and compressed size. + */ +static int ntfs_attr_update_meta(ATTR_RECORD *a, ntfs_attr *na, MFT_RECORD *m, + ntfs_attr_search_ctx *ctx) +{ + int sparse, ret = 0; + + ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x\n", + (unsigned long long)na->ni->mft_no, na->type); + + if (a->lowest_vcn) + goto out; + + a->allocated_size = cpu_to_sle64(na->allocated_size); + + /* Update sparse bit. */ + sparse = ntfs_rl_sparse(na->rl); + if (sparse == -1) { + errno = EIO; + goto error; + } + + /* Attribute become sparse. */ + if (sparse && !(a->flags & (ATTR_IS_SPARSE | ATTR_IS_COMPRESSED))) { + /* + * Move attribute to another mft record, if attribute is too + * small to add compressed_size field to it and we have no + * free space in the current mft record. + */ + if ((le32_to_cpu(a->length) - + le16_to_cpu(a->mapping_pairs_offset) == 8) + && !(le32_to_cpu(m->bytes_allocated) - + le32_to_cpu(m->bytes_in_use))) { + + if (!NInoAttrList(na->ni)) { + ntfs_attr_put_search_ctx(ctx); + if (ntfs_inode_add_attrlist(na->ni)) + goto leave; + goto retry; + } + if (ntfs_attr_record_move_away(ctx, 8)) { + ntfs_log_perror("Failed to move attribute"); + goto error; + } + ntfs_attr_put_search_ctx(ctx); + goto retry; + } + if (!(le32_to_cpu(a->length) - le16_to_cpu( + a->mapping_pairs_offset))) { + errno = EIO; + ntfs_log_perror("Mapping pairs space is 0"); + goto error; + } + + NAttrSetSparse(na); + a->flags |= ATTR_IS_SPARSE; + a->compression_unit = 4; /* Windows set it so, even if attribute + is not actually compressed. */ + + memmove((u8*)a + le16_to_cpu(a->name_offset) + 8, + (u8*)a + le16_to_cpu(a->name_offset), + a->name_length * sizeof(ntfschar)); + + a->name_offset = cpu_to_le16(le16_to_cpu(a->name_offset) + 8); + + a->mapping_pairs_offset = + cpu_to_le16(le16_to_cpu(a->mapping_pairs_offset) + 8); + } + + /* Attribute no longer sparse. */ + if (!sparse && (a->flags & ATTR_IS_SPARSE) && + !(a->flags & ATTR_IS_COMPRESSED)) { + + NAttrClearSparse(na); + a->flags &= ~ATTR_IS_SPARSE; + a->compression_unit = 0; + + memmove((u8*)a + le16_to_cpu(a->name_offset) - 8, + (u8*)a + le16_to_cpu(a->name_offset), + a->name_length * sizeof(ntfschar)); + + if (le16_to_cpu(a->name_offset) >= 8) + a->name_offset = cpu_to_le16(le16_to_cpu(a->name_offset) - 8); + + a->mapping_pairs_offset = + cpu_to_le16(le16_to_cpu(a->mapping_pairs_offset) - 8); + } + + /* Update compressed size if required. */ + if (sparse) { + s64 new_compr_size; + + new_compr_size = ntfs_rl_get_compressed_size(na->ni->vol, na->rl); + if (new_compr_size == -1) + goto error; + + na->compressed_size = new_compr_size; + a->compressed_size = cpu_to_sle64(new_compr_size); + } + /* + * Set FILE_NAME dirty flag, to update sparse bit and + * allocated size in the index. + */ + if (na->type == AT_DATA && na->name == AT_UNNAMED) { + if (sparse) + na->ni->allocated_size = na->compressed_size; + else + na->ni->allocated_size = na->allocated_size; + NInoFileNameSetDirty(na->ni); + } +out: + return ret; +leave: ret = -1; goto out; /* return -1 */ +retry: ret = -2; goto out; +error: ret = -3; goto out; +} + #define NTFS_VCN_DELETE_MARK -2 /** * ntfs_attr_update_mapping_pairs - update mapping pairs for ntfs attribute @@ -4018,33 +4201,30 @@ VCN stop_vcn; int err, mp_size, cur_max_mp_size, exp_max_mp_size, ret = -1; BOOL finished_build; - retry: if (!na || !na->rl || from_vcn) { - ntfs_log_trace("Invalid parameters passed.\n"); errno = EINVAL; + ntfs_log_perror("%s: na=%p", __FUNCTION__, na); return -1; } + ntfs_log_trace("Entering for inode %llu, attr 0x%x\n", + (unsigned long long)na->ni->mft_no, na->type); + if (!NAttrNonResident(na)) { - ntfs_log_trace("Attribute should be non resident.\n"); errno = EINVAL; + ntfs_log_perror("%s: resident attribute", __FUNCTION__); return -1; } - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long - long)na->ni->mft_no, na->type); - if (na->ni->nr_extents == -1) base_ni = na->ni->base_ni; else base_ni = na->ni; ctx = ntfs_attr_get_search_ctx(base_ni, NULL); - if (!ctx) { - ntfs_log_trace("Couldn't get search context.\n"); + if (!ctx) return -1; - } /* Fill attribute records with new mapping pairs. */ stop_vcn = 0; @@ -4071,8 +4251,8 @@ */ first_lcn = ntfs_rl_vcn_to_lcn(na->rl, stop_vcn); if (first_lcn == LCN_EINVAL) { - ntfs_log_trace("BUG! Incorrect runlist.\n"); err = EIO; + ntfs_log_perror("Bad runlist"); goto put_err_out; } if (first_lcn == LCN_ENOENT || @@ -4095,130 +4275,19 @@ continue; } - /* - * If we in the first extent, then set/clean sparse bit, - * update allocated and compressed size. - */ - if (!a->lowest_vcn) { - int sparse; - - /* Update allocated size. */ - a->allocated_size = cpu_to_sle64(na->allocated_size); - /* Update sparse bit. */ - sparse = ntfs_rl_sparse(na->rl); - if (sparse == -1) { - ntfs_log_trace("Bad runlist.\n"); - err = EIO; - goto put_err_out; - } - /* Attribute become sparse. */ - if (sparse && !(a->flags & (ATTR_IS_SPARSE | - ATTR_IS_COMPRESSED))) { - /* - * We need to move attribute to another mft - * record, if attribute is to small to add - * compressed_size field to it and we have no - * free space in the current mft record. - */ - if ((le32_to_cpu(a->length) - le16_to_cpu( - a->mapping_pairs_offset) - == 8) && !(le32_to_cpu( - m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use))) { - if (!NInoAttrList(na->ni)) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_add_attrlist( - na->ni)) - return -1; - goto retry; - } - if (ntfs_attr_record_move_away(ctx, - 8)) { - ntfs_log_trace("Failed to move " - "attribute to another " - "extent. Aborting..\n"); - err = errno; - goto put_err_out; - } - ntfs_attr_put_search_ctx(ctx); - goto retry; - } - if (!(le32_to_cpu(a->length) - le16_to_cpu( - a->mapping_pairs_offset))) { - ntfs_log_trace("Size of the space " - "allocated for mapping " - "pairs should not be 0." - " Aborting ...\n"); - err = EIO; - goto put_err_out; - } - NAttrSetSparse(na); - a->flags |= ATTR_IS_SPARSE; - a->compression_unit = 4; /* Windows set it so, - even if attribute - is not actually - compressed. */ - memmove((u8*)a + le16_to_cpu(a->name_offset) + - 8, (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - a->name_offset = cpu_to_le16(le16_to_cpu( - a->name_offset) + 8); - a->mapping_pairs_offset = - cpu_to_le16(le16_to_cpu( - a->mapping_pairs_offset) + 8); - } - /* Attribute no longer sparse. */ - if (!sparse && (a->flags & ATTR_IS_SPARSE) && - !(a->flags & ATTR_IS_COMPRESSED)) { - NAttrClearSparse(na); - a->flags &= ~ATTR_IS_SPARSE; - a->compression_unit = 0; - memmove((u8*)a + le16_to_cpu(a->name_offset) - - 8, (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - if (le16_to_cpu(a->name_offset) >= 8) - a->name_offset = cpu_to_le16( - le16_to_cpu(a->name_offset) - 8); - a->mapping_pairs_offset = - cpu_to_le16(le16_to_cpu( - a->mapping_pairs_offset) - 8); - } - /* Update compressed size if required. */ - if (sparse) { - s64 new_compr_size; - - new_compr_size = ntfs_rl_get_compressed_size( - na->ni->vol, na->rl); - if (new_compr_size == -1) { - err = errno; - ntfs_log_trace("BUG! Leaving inconstant" - " metadata.\n"); - goto put_err_out; - } - na->compressed_size = new_compr_size; - a->compressed_size = cpu_to_sle64( - new_compr_size); - } - /* - * Set FILE_NAME dirty flag, to update sparse bit and - * allocated size in the index. - */ - if (na->type == AT_DATA && na->name == AT_UNNAMED) { - if (sparse) - na->ni->allocated_size = - na->compressed_size; - else - na->ni->allocated_size = - na->allocated_size; - NInoFileNameSetDirty(na->ni); - } + err = ntfs_attr_update_meta(a, na, m, ctx); + switch (err) { + case -1: return -1; + case -2: goto retry; + case -3: goto put_err_out; } + /* Get the size for the rest of mapping pairs array. */ mp_size = ntfs_get_size_for_mapping_pairs(na->ni->vol, na->rl, stop_vcn); if (mp_size <= 0) { err = errno; - ntfs_log_trace("Get size for mapping pairs failed.\n"); + ntfs_log_perror("%s: get MP size failed", __FUNCTION__); goto put_err_out; } /* @@ -4245,12 +4314,9 @@ ntfs_attr_put_search_ctx(ctx); if (ntfs_inode_free_space(na->ni, mp_size - cur_max_mp_size)) { - ntfs_log_perror("Attribute list mapping" - " pairs size to big, " - "can't fit them in the " - "base MFT record. " - "Defragment volume and " - "try once again.\n"); + ntfs_log_perror("Attribute list is too " + "big. Defragment the " + "volume\n"); return -1; } goto retry; @@ -4260,8 +4326,7 @@ if (!NInoAttrList(base_ni)) { ntfs_attr_put_search_ctx(ctx); if (ntfs_inode_add_attrlist(base_ni)) { - ntfs_log_trace("Couldn't add attribute " - "list.\n"); + ntfs_log_perror("Can not add attrlist"); return -1; } goto retry; @@ -4280,12 +4345,7 @@ if (ntfs_attr_record_resize(m, a, le16_to_cpu(a->mapping_pairs_offset) + mp_size)) { - ntfs_log_error("BUG! Ran out of space in mft " - "record. Please run chkdsk and " - "if that doesn't find any " - "errors please report you saw " - "this message to %s.\n", - NTFS_DEV_LIST); + ntfs_log_perror("Failed to resize attribute"); err = EIO; goto put_err_out; } @@ -4311,10 +4371,7 @@ finished_build = TRUE; if (!finished_build && errno != ENOSPC) { err = errno; - ntfs_log_error("BUG! Mapping pairs build failed. " - "Please run chkdsk and if that doesn't " - "find any errors please report you saw " - "this message to %s.\n", NTFS_DEV_LIST); + ntfs_log_perror("Failed to build mapping pairs"); goto put_err_out; } a->highest_vcn = cpu_to_sle64(stop_vcn - 1); @@ -4322,7 +4379,7 @@ /* Check whether error occurred. */ if (errno != ENOENT) { err = errno; - ntfs_log_trace("Attribute lookup failed.\n"); + ntfs_log_perror("%s: Attribute lookup failed", __FUNCTION__); goto put_err_out; } @@ -4338,15 +4395,14 @@ /* Remove unused attribute record. */ if (ntfs_attr_record_rm(ctx)) { err = errno; - ntfs_log_trace("Couldn't remove unused " - "attribute record.\n"); + ntfs_log_perror("Could not remove unused attr"); goto put_err_out; } ntfs_attr_reinit_search_ctx(ctx); } if (errno != ENOENT) { err = errno; - ntfs_log_trace("Attribute lookup failed.\n"); + ntfs_log_perror("%s: Attr lookup failed", __FUNCTION__); goto put_err_out; } ntfs_log_trace("Deallocate done.\n"); @@ -4363,14 +4419,14 @@ na->rl, stop_vcn); if (mp_size <= 0) { err = errno; - ntfs_log_trace("Get size for mapping pairs failed.\n"); + ntfs_log_perror("%s: get mp size failed", __FUNCTION__); goto put_err_out; } /* Allocate new mft record. */ ni = ntfs_mft_record_alloc(na->ni->vol, base_ni); if (!ni) { err = errno; - ntfs_log_trace("Couldn't allocate new MFT record.\n"); + ntfs_log_perror("Could not allocate new MFT record"); goto put_err_out; } m = ni->mrec; @@ -4391,11 +4447,9 @@ na->name, na->name_len, stop_vcn, mp_size, 0); if (err == -1) { err = errno; - ntfs_log_trace("Couldn't add attribute extent into the " - "MFT record.\n"); - if (ntfs_mft_record_free(na->ni->vol, ni)) { - ntfs_log_trace("Couldn't free MFT record.\n"); - } + ntfs_log_perror("Could not add attribute extent"); + if (ntfs_mft_record_free(na->ni->vol, ni)) + ntfs_log_perror("Could not free MFT record"); goto put_err_out; } a = (ATTR_RECORD*)((u8*)m + err); @@ -4405,12 +4459,9 @@ stop_vcn, &stop_vcn); if (err < 0 && errno != ENOSPC) { err = errno; - ntfs_log_error("BUG! Mapping pairs build failed. " - "Please run chkdsk and if that doesn't " - "find any errors please report you saw " - "this message to %s.\n", NTFS_DEV_LIST); + ntfs_log_perror("Failed to build MP"); if (ntfs_mft_record_free(na->ni->vol, ni)) - ntfs_log_trace("Couldn't free MFT record.\n"); + ntfs_log_perror("Couldn't free MFT record"); goto put_err_out; } a->highest_vcn = cpu_to_sle64(stop_vcn - 1); @@ -4516,10 +4567,9 @@ /* Get the first attribute record. */ ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) { - ntfs_log_trace("Couldn't get attribute search context.\n"); + if (!ctx) return -1; - } + if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, 0, NULL, 0, ctx)) { err = errno; @@ -4669,7 +4719,10 @@ vol->cluster_size_bits), lcn_seek_from, DATA_ZONE); if (!rl) { - ntfs_log_perror("Cluster allocation failed"); + ntfs_log_perror("Cluster allocation failed " + "(%lld)", first_free_vcn - + (na->allocated_size >> + vol->cluster_size_bits)); return -1; } } @@ -4701,7 +4754,6 @@ ctx = ntfs_attr_get_search_ctx(na->ni, NULL); if (!ctx) { err = errno; - ntfs_log_perror("Failed to get search context"); if (na->allocated_size == org_alloc_size) { errno = err; return -1; diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/attrlist.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/attrlist.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/attrlist.c 2006-10-31 00:32:46.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/attrlist.c 2007-07-13 23:05:48.000000000 +0300 @@ -145,7 +145,6 @@ ctx = ntfs_attr_get_search_ctx(ni, NULL); if (!ctx) { err = errno; - ntfs_log_trace("Failed to obtain attribute search context.\n"); goto err_out; } if (!ntfs_attr_lookup(attr->type, (attr->name_length) ? (ntfschar*) diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/dir.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/dir.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/dir.c 2007-06-28 10:17:00.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/dir.c 2007-08-08 19:15:15.000000000 +0300 @@ -724,7 +724,7 @@ le16_to_cpu(dir_ni->mrec->sequence_number)), NTFS_DT_DIR); if (rc) - goto done; + goto err_out; ++*pos; } if (*pos == 1) { @@ -739,7 +739,7 @@ rc = filldir(dirent, dotdot, 2, FILE_NAME_POSIX, *pos, parent_mref, NTFS_DT_DIR); if (rc) - goto done; + goto err_out; ++*pos; } @@ -816,7 +816,7 @@ if (rc) { ntfs_attr_put_search_ctx(ctx); ctx = NULL; - goto done; + goto err_out; } } ntfs_attr_put_search_ctx(ctx); @@ -965,7 +965,7 @@ rc = ntfs_filldir(dir_ni, pos, index_vcn_size_bits, INDEX_TYPE_ALLOCATION, ia, ie, dirent, filldir); if (rc) - goto done; + goto err_out; } goto find_next_index_buffer; EOD: @@ -978,13 +978,7 @@ ntfs_attr_close(bmp_na); if (ia_na) ntfs_attr_close(ia_na); -#ifdef DEBUG - if (!rc) - ntfs_log_debug("EOD, *pos 0x%llx, returning 0.\n", (long long)*pos); - else - ntfs_log_debug("filldir returned %i, *pos 0x%llx, returning 0.\n", - rc, (long long)*pos); -#endif + ntfs_log_debug("EOD, *pos 0x%llx, returning 0.\n", (long long)*pos); return 0; dir_err_out: errno = EIO; diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/index.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/index.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/index.c 2007-07-08 23:45:14.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/index.c 2007-07-13 23:05:48.000000000 +0300 @@ -433,10 +433,8 @@ ntfs_log_trace("Entering\n"); *ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!*ctx) { - ntfs_log_perror("Failed to get $INDEX_ROOT search context"); + if (!*ctx) return NULL; - } if (ntfs_attr_lookup(AT_INDEX_ROOT, name, name_len, CASE_SENSITIVE, 0, NULL, 0, *ctx)) { diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/inode.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/inode.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/inode.c 2007-06-05 02:00:06.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/inode.c 2007-08-10 18:01:21.000000000 +0300 @@ -51,6 +51,13 @@ #include "logging.h" #include "misc.h" +ntfs_inode *ntfs_inode_base(ntfs_inode *ni) +{ + if (ni->nr_extents == -1) + return ni->base_ni; + return ni; +} + /** * ntfs_inode_mark_dirty - set the inode (and its base inode if it exists) dirty * @ni: ntfs inode to set dirty @@ -379,11 +386,14 @@ if (!base_ni) { errno = EINVAL; + ntfs_log_perror("%s", __FUNCTION__); return NULL; } + ntfs_log_trace("Opening extent inode 0x%llx (base mft record 0x%llx).\n", (unsigned long long)mft_no, (unsigned long long)base_ni->mft_no); + /* Is the extent inode already open and attached to the base inode? */ if (base_ni->nr_extents > 0) { extent_nis = base_ni->extent_nis; @@ -397,12 +407,11 @@ seq_no = MSEQNO_LE(mref); if (seq_no && seq_no != le16_to_cpu( ni->mrec->sequence_number)) { - ntfs_log_debug("Found stale extent mft reference! " - "Corrupt file system. Run chkdsk.\n"); errno = EIO; + ntfs_log_perror("Found stale extent mft " + "reference mft=%lld", ni->mft_no); return NULL; } - /* We are done, return the extent inode. */ return ni; } } @@ -411,8 +420,10 @@ if (!ni) return NULL; if (ntfs_file_record_read(base_ni->vol, le64_to_cpu(mref), &ni->mrec, - NULL)) + NULL)) { + ntfs_log_perror("ntfs_file_record_read failed #2"); goto err_out; + } ni->mft_no = mft_no; ni->nr_extents = -1; ni->base_ni = base_ni; @@ -434,7 +445,6 @@ return ni; err_out: __ntfs_inode_release(ni); - ntfs_log_perror("Failed to open extent inode"); return NULL; } @@ -676,6 +686,7 @@ /* Update FILE_NAME's in the index. */ if ((ni->mrec->flags & MFT_RECORD_IN_USE) && ni->nr_extents != -1 && NInoFileNameTestAndClearDirty(ni) && + NInoParentMtimeUpdate(ni) && ntfs_inode_sync_file_name(ni)) { if (!err || errno == EIO) { err = errno; @@ -797,16 +808,16 @@ ntfs_attr *na; if (!ni) { - ntfs_log_trace("Invalid arguments.\n"); errno = EINVAL; + ntfs_log_perror("%s", __FUNCTION__); return -1; } - ntfs_log_trace("Entering for inode 0x%llx.\n", (long long) ni->mft_no); + ntfs_log_trace("inode %llu\n", (unsigned long long) ni->mft_no); if (NInoAttrList(ni) || ni->nr_extents) { - ntfs_log_trace("Inode already has got attribute list.\n"); errno = EEXIST; + ntfs_log_perror("Inode already has attribute list"); return -1; } @@ -814,7 +825,6 @@ ctx = ntfs_attr_get_search_ctx(ni, NULL); if (!ctx) { err = errno; - ntfs_log_trace("Couldn't get search context.\n"); goto err_out; } /* Walk through all attributes. */ @@ -824,7 +834,7 @@ if (ctx->attr->type == AT_ATTRIBUTE_LIST) { err = EIO; - ntfs_log_trace("Eeek! Attribute list already present.\n"); + ntfs_log_perror("Attribute list already present"); goto put_err_out; } @@ -864,7 +874,8 @@ /* Check for real error occurred. */ if (errno != ENOENT) { err = errno; - ntfs_log_trace("Attribute lookup failed.\n"); + ntfs_log_perror("%s: Attribute lookup failed, inode %lld", + __FUNCTION__, (long long)ni->mft_no); goto put_err_out; } @@ -882,8 +893,7 @@ offsetof(ATTR_RECORD, resident_end))) { /* Failed to free space. */ err = errno; - ntfs_log_trace("Failed to free space for " - "$ATTRIBUTE_LIST.\n"); + ntfs_log_perror("Failed to free space for attrlist"); goto rollback; } } @@ -892,7 +902,7 @@ if (ntfs_resident_attr_record_add(ni, AT_ATTRIBUTE_LIST, NULL, 0, NULL, 0, 0) < 0) { err = errno; - ntfs_log_trace("Couldn't add $ATTRIBUTE_LIST to MFT record.\n"); + ntfs_log_perror("Couldn't add $ATTRIBUTE_LIST to MFT"); goto rollback; } @@ -900,12 +910,12 @@ na = ntfs_attr_open(ni, AT_ATTRIBUTE_LIST, AT_UNNAMED, 0); if (!na) { err = errno; - ntfs_log_trace("Failed to open just added $ATTRIBUTE_LIST.\n"); + ntfs_log_perror("Failed to open just added $ATTRIBUTE_LIST"); goto remove_attrlist_record; } if (ntfs_attr_truncate(na, al_len)) { err = errno; - ntfs_log_trace("Failed to resize just added $ATTRIBUTE_LIST.\n"); + ntfs_log_perror("Failed to resize just added $ATTRIBUTE_LIST"); ntfs_attr_close(na); goto remove_attrlist_record;; } @@ -923,11 +933,9 @@ if (!ntfs_attr_lookup(AT_ATTRIBUTE_LIST, NULL, 0, CASE_SENSITIVE, 0, NULL, 0, ctx)) { if (ntfs_attr_record_rm(ctx)) - ntfs_log_trace("Rollback failed. Failed to remove attribute " - "list record.\n"); + ntfs_log_perror("Rollback failed to remove attrlist"); } else - ntfs_log_trace("Rollback failed. Couldn't find attribute list " - "record.\n"); + ntfs_log_perror("Rollback failed to find attrlist"); /* Setup back in-memory runlist. */ ni->attr_list = al; ni->attr_list_size = al_len; @@ -947,11 +955,10 @@ sle64_to_cpu(ale->lowest_vcn), NULL, 0, ctx)) { if (ntfs_attr_record_move_to(ctx, ni)) - ntfs_log_trace("Rollback failed. Couldn't " - "back attribute to base MFT record.\n"); + ntfs_log_perror("Rollback failed to " + "move attribute"); } else - ntfs_log_trace("Rollback failed. ntfs_attr_lookup " - "failed.\n"); + ntfs_log_perror("Rollback failed to find attr"); ntfs_attr_reinit_search_ctx(ctx); } ale = (ATTR_LIST_ENTRY*)((u8*)ale + le16_to_cpu(ale->length)); @@ -982,13 +989,13 @@ int freed, err; if (!ni || size < 0) { - ntfs_log_trace("Invalid arguments.\n"); errno = EINVAL; + ntfs_log_perror("%s: ni=%p size=%d", __FUNCTION__, ni, size); return -1; } - ntfs_log_trace("Entering for inode 0x%llx, size %d.\n", - (long long) ni->mft_no, size); + ntfs_log_trace("Entering for inode %lld, size %d\n", + (unsigned long long)ni->mft_no, size); freed = (le32_to_cpu(ni->mrec->bytes_allocated) - le32_to_cpu(ni->mrec->bytes_in_use)); @@ -997,12 +1004,8 @@ return 0; ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) { - err = errno; - ntfs_log_trace("Failed to get attribute search context.\n"); - errno = err; + if (!ctx) return -1; - } /* * Chkdsk complain if $STANDARD_INFORMATION is not in the base MFT @@ -1022,7 +1025,7 @@ 0, ctx)) { if (errno != ENOENT) { err = errno; - ntfs_log_trace("Attribute lookup failed.\n"); + ntfs_log_perror("%s: attr lookup failed #2", __FUNCTION__); goto put_err_out; } if (ctx->attr->type == AT_END) { @@ -1043,7 +1046,7 @@ 0, NULL, 0, ctx)) { err = errno; if (errno != ENOENT) { - ntfs_log_trace("Attribute lookup failed.\n"); + ntfs_log_perror("Attr lookup failed #2"); } else err = ENOSPC; goto put_err_out; @@ -1055,7 +1058,7 @@ /* Move away attribute. */ if (ntfs_attr_record_move_away(ctx, 0)) { err = errno; - ntfs_log_trace("Failed to move out attribute.\n"); + ntfs_log_perror("Failed to move out attribute #2"); break; } freed += record_size; @@ -1075,7 +1078,7 @@ NULL, 0, ctx)) { if (errno != ENOENT) { err = errno; - ntfs_log_trace("Attribute lookup failed.\n"); + ntfs_log_perror("Attr lookup #2 failed"); break; } if (ctx->attr->type == AT_END) { @@ -1119,7 +1122,7 @@ */ void ntfs_inode_update_time(ntfs_inode *ni) { - if (!NVolReadOnly(ni->vol) && + if (!NVolReadOnly(ni->vol) && NInoMtimeUpdate(ni) && (ni->mft_no >= FILE_first_user || ni->mft_no == FILE_root)) { time_t now; diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/lcnalloc.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/lcnalloc.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/lcnalloc.c 2007-07-08 18:02:49.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/lcnalloc.c 2007-09-12 23:51:06.000000000 +0300 @@ -51,7 +51,7 @@ * the update of the mapping pairs which converges to the cubic Faulhaber's * formula as the function of the number of extents (fragments, runs). */ -#define NTFS_LCNALLOC_BSIZE 1024 +#define NTFS_LCNALLOC_BSIZE 8192 #define NTFS_LCNALLOC_SKIP NTFS_LCNALLOC_BSIZE static void ntfs_cluster_set_zone_pos(LCN start, LCN end, LCN *pos, LCN tc) @@ -305,6 +305,11 @@ /* Allocate the bitmap bit. */ *byte |= bit; writeback = 1; + if (vol->free_clusters <= 0) + ntfs_log_error("Non-positive free clusters " + "(%lld)!\n", vol->free_clusters); + else + vol->free_clusters--; /* * Coalesce with previous run if adjacent LCNs. @@ -490,6 +495,9 @@ */ int ntfs_cluster_free_from_rl(ntfs_volume *vol, runlist *rl) { + s64 nr_freed = 0; + int ret = -1; + ntfs_log_trace("Entering.\n"); for (; rl->length; rl++) { @@ -497,15 +505,26 @@ ntfs_log_trace("Dealloc lcn 0x%llx, len 0x%llx.\n", (long long)rl->lcn, (long long)rl->length); - if (rl->lcn >= 0 && ntfs_bitmap_clear_run(vol->lcnbmp_na, - rl->lcn, rl->length)) { - int eo = errno; - ntfs_log_trace("Eeek! Deallocation of clusters failed.\n"); - errno = eo; - return -1; + if (rl->lcn >= 0) { + if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn, + rl->length)) { + ntfs_log_perror("Cluster deallocation failed " + "(%lld, %lld)", rl->lcn, + rl->length); + goto out; + } + nr_freed += rl->length ; } } - return 0; + + ret = 0; +out: + vol->free_clusters += nr_freed; + if (vol->free_clusters > vol->nr_clusters) + ntfs_log_error("Too many free clusters (%lld > %lld)!", + (long long)vol->free_clusters, + (long long)vol->nr_clusters); + return ret; } /** @@ -527,7 +546,8 @@ int ntfs_cluster_free(ntfs_volume *vol, ntfs_attr *na, VCN start_vcn, s64 count) { runlist *rl; - s64 nr_freed, delta, to_free; + s64 delta, to_free, nr_freed = 0; + int ret = -1; if (!vol || !vol->lcnbmp_na || !na || start_vcn < 0 || (count < 0 && count != -1)) { @@ -543,12 +563,13 @@ if (!rl) { if (errno == ENOENT) return 0; - else - return -1; + return -1; } if (rl->lcn < 0 && rl->lcn != LCN_HOLE) { errno = EIO; + ntfs_log_perror("%s: Unexpected lcn (%lld)", __FUNCTION__, + (long long)rl->lcn); return -1; } @@ -563,14 +584,10 @@ if (rl->lcn != LCN_HOLE) { /* Do the actual freeing of the clusters in this run. */ if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn + delta, - to_free)) + to_free)) return -1; - /* We have freed @to_free real clusters. */ nr_freed = to_free; - } else { - /* No real clusters were freed. */ - nr_freed = 0; - } + } /* Go to the next run and adjust the number of clusters left to free. */ ++rl; @@ -586,11 +603,10 @@ // list support! (AIA) if (rl->lcn < 0 && rl->lcn != LCN_HOLE) { // FIXME: Eeek! We need rollback! (AIA) - ntfs_log_trace("Eeek! invalid lcn (= %lli). Should attempt " - "to map runlist! Leaving inconsistent " - "metadata!\n", (long long)rl->lcn); errno = EIO; - return -1; + ntfs_log_perror("%s: Invalid lcn (%lli)", + __FUNCTION__, (long long)rl->lcn); + goto out; } /* The number of clusters in this run that need freeing. */ @@ -599,18 +615,13 @@ to_free = count; if (rl->lcn != LCN_HOLE) { - /* Do the actual freeing of the clusters in the run. */ if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn, to_free)) { - int eo = errno; - // FIXME: Eeek! We need rollback! (AIA) - ntfs_log_trace("Eeek! bitmap clear run failed. " - "Leaving inconsistent metadata!\n"); - errno = eo; - return -1; + ntfs_log_perror("%s: Clearing bitmap run failed", + __FUNCTION__); + goto out; } - /* We have freed @to_free real clusters. */ nr_freed += to_free; } @@ -620,12 +631,18 @@ if (count != -1 && count != 0) { // FIXME: Eeek! BUG() - ntfs_log_trace("Eeek! count still not zero (= %lli). Leaving " - "inconsistent metadata!\n", (long long)count); errno = EIO; - return -1; + ntfs_log_perror("%s: count still not zero (%lld)", __FUNCTION__, + (long long)count); + goto out; } - /* Done. Return the number of actual clusters that were freed. */ - return nr_freed; + ret = nr_freed; +out: + vol->free_clusters += nr_freed ; + if (vol->free_clusters > vol->nr_clusters) + ntfs_log_error("Too many free clusters (%lld > %lld)!", + (long long)vol->free_clusters, + (long long)vol->nr_clusters); + return ret; } diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/Makefile.am /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/Makefile.am --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/Makefile.am 2007-04-06 23:22:09.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/Makefile.am 2007-08-24 01:32:25.000000000 +0300 @@ -27,7 +27,12 @@ linux_ntfsincludedir = -I$(top_srcdir)/include/ntfs-3g +if INSTALL_LIBRARY lib_LTLIBRARIES = libntfs-3g.la +else +noinst_LTLIBRARIES = libntfs-3g.la +endif + libntfs_3g_la_LDFLAGS = -version-number $(LIBNTFS_3G_VERSION) libntfs_3g_la_CFLAGS = $(LIBNTFS_3G_CFLAGS) libntfs_3g_la_SOURCES = \ diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/Makefile.in /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/Makefile.in --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/Makefile.in 2007-07-10 01:40:42.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/Makefile.in 2007-09-13 00:18:18.000000000 +0300 @@ -81,7 +81,7 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libntfs_3g_la_LIBADD = am_libntfs_3g_la_OBJECTS = libntfs_3g_la-attrib.lo \ libntfs_3g_la-attrlist.lo libntfs_3g_la-bitmap.lo \ @@ -97,6 +97,8 @@ libntfs_3g_la-unistr.lo libntfs_3g_la-version.lo \ libntfs_3g_la-volume.lo libntfs_3g_la_OBJECTS = $(am_libntfs_3g_la_OBJECTS) +@INSTALL_LIBRARY_FALSE@am_libntfs_3g_la_rpath = +@INSTALL_LIBRARY_TRUE@am_libntfs_3g_la_rpath = -rpath $(libdir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -147,6 +149,8 @@ FUSE_MODULE_LIBS = @FUSE_MODULE_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LIBRARY_FALSE = @INSTALL_LIBRARY_FALSE@ +INSTALL_LIBRARY_TRUE = @INSTALL_LIBRARY_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ @@ -237,7 +241,8 @@ target_os = @target_os@ target_vendor = @target_vendor@ linux_ntfsincludedir = -I$(top_srcdir)/include/ntfs-3g -lib_LTLIBRARIES = libntfs-3g.la +@INSTALL_LIBRARY_TRUE@lib_LTLIBRARIES = libntfs-3g.la +@INSTALL_LIBRARY_FALSE@noinst_LTLIBRARIES = libntfs-3g.la libntfs_3g_la_LDFLAGS = -version-number $(LIBNTFS_3G_VERSION) libntfs_3g_la_CFLAGS = $(LIBNTFS_3G_CFLAGS) libntfs_3g_la_SOURCES = \ @@ -329,8 +334,17 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done libntfs-3g.la: $(libntfs_3g_la_OBJECTS) $(libntfs_3g_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libntfs_3g_la_LDFLAGS) $(libntfs_3g_la_OBJECTS) $(libntfs_3g_la_LIBADD) $(LIBS) + $(LINK) $(am_libntfs_3g_la_rpath) $(libntfs_3g_la_LDFLAGS) $(libntfs_3g_la_OBJECTS) $(libntfs_3g_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -672,7 +686,7 @@ clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am + clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -721,17 +735,17 @@ uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-libLTLIBRARIES + clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am uninstall-libLTLIBRARIES libs: $(lib_LTLIBRARIES) diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/mft.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/mft.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/mft.c 2007-06-01 02:52:41.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/mft.c 2007-09-12 23:51:06.000000000 +0300 @@ -81,9 +81,12 @@ s64 br; VCN m; - ntfs_log_trace("Entering for inode 0x%llx.\n", MREF(mref)); + ntfs_log_trace("Entering for inode %lld\n", MREF(mref)); + if (!vol || !vol->mft_na || !b || count < 0) { errno = EINVAL; + ntfs_log_perror("%s: b=%p count=%lld mft=%lld", __FUNCTION__, + b, count, MREF(mref)); return -1; } m = MREF(mref); @@ -246,6 +249,7 @@ if (!vol || !mrec) { errno = EINVAL; + ntfs_log_perror("%s: mrec=%p", __FUNCTION__, mrec); return -1; } m = *mrec; @@ -256,23 +260,28 @@ } if (ntfs_mft_record_read(vol, mref, m)) { err = errno; - goto read_failed; + ntfs_log_perror("ntfs_mft_record_read failed"); + goto err_out; + } + err = EIO; + if (!ntfs_is_file_record(m->magic)) { + ntfs_log_perror("Record %llu has no FILE magic", MREF(mref)); + goto err_out; + } + if (MSEQNO(mref) && MSEQNO(mref) != le16_to_cpu(m->sequence_number)) { + ntfs_log_perror("Record %llu has wrong SeqNo", MREF(mref)); + goto err_out; } - if (!ntfs_is_file_record(m->magic)) - goto file_corrupt; - if (MSEQNO(mref) && MSEQNO(mref) != le16_to_cpu(m->sequence_number)) - goto file_corrupt; a = (ATTR_RECORD*)((char*)m + le16_to_cpu(m->attrs_offset)); - if (p2n(a) < p2n(m) || (char*)a > (char*)m + vol->mft_record_size) - goto file_corrupt; + if (p2n(a) < p2n(m) || (char*)a > (char*)m + vol->mft_record_size) { + ntfs_log_perror("Record %llu is corrupt", MREF(mref)); + goto err_out; + } *mrec = m; if (attr) *attr = a; return 0; -file_corrupt: - ntfs_log_debug("ntfs_file_record_read(): file is corrupt.\n"); - err = EIO; -read_failed: +err_out: if (m != *mrec) free(m); errno = err; @@ -299,6 +308,7 @@ if (!vol || !mrec) { errno = EINVAL; + ntfs_log_perror("%s: mrec=%p", __FUNCTION__, mrec); return -1; } /* Aligned to 2-byte boundary. */ @@ -307,8 +317,8 @@ else { /* Abort if mref is > 32 bits. */ if (MREF(mref) & 0x0000ffff00000000ull) { - ntfs_log_debug("Mft reference exceeds 32 bits!\n"); errno = ERANGE; + ntfs_log_perror("Mft reference exceeds 32 bits"); return -1; } mrec->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD) + 1) & ~1); @@ -371,29 +381,22 @@ int ntfs_mft_record_format(const ntfs_volume *vol, const MFT_REF mref) { MFT_RECORD *m; - int err; + int ret = -1; - if (!vol || !vol->mft_na) { - errno = EINVAL; - return -1; - } m = ntfs_calloc(vol->mft_record_size); if (!m) return -1; - if (ntfs_mft_record_layout(vol, mref, m)) { - err = errno; - free(m); - errno = err; - return -1; - } - if (ntfs_mft_record_write(vol, mref, m)) { - err = errno; - free(m); - errno = err; - return -1; - } + + if (ntfs_mft_record_layout(vol, mref, m)) + goto free_m; + + if (ntfs_mft_record_write(vol, mref, m)) + goto free_m; + + ret = 0; +free_m: free(m); - return 0; + return ret; } static const char *es = " Leaving inconsistent metadata. Run chkdsk."; @@ -488,8 +491,7 @@ size = ll; ll = ntfs_attr_pread(mftbmp_na, ofs, size, buf); if (ll < 0) { - ntfs_log_error("Failed to read mft bitmap " - "attribute, aborting.\n"); + ntfs_log_perror("Failed to read $MFT bitmap"); free(buf); return -1; } @@ -566,22 +568,16 @@ { LCN lcn; s64 ll = 0; /* silence compiler warning */ - ntfs_attr *mftbmp_na, *lcnbmp_na; + ntfs_attr *mftbmp_na; runlist_element *rl, *rl2 = NULL; /* silence compiler warning */ ntfs_attr_search_ctx *ctx; MFT_RECORD *m = NULL; /* silence compiler warning */ ATTR_RECORD *a = NULL; /* silence compiler warning */ - int ret, mp_size; + int err, mp_size; u32 old_alen = 0; /* silence compiler warning */ - u8 b, tb; - struct { - u8 added_cluster:1; - u8 added_run:1; - u8 mp_rebuilt:1; - } status = { 0, 0, 0 }; + BOOL mp_rebuilt = FALSE; mftbmp_na = vol->mftbmp_na; - lcnbmp_na = vol->lcnbmp_na; /* * Determine the last lcn of the mft bitmap. The allocated size of the * mft bitmap cannot be zero so we are ok to do this. @@ -596,70 +592,38 @@ return -1; } lcn = rl->lcn + rl->length; - /* - * Attempt to get the cluster following the last allocated cluster by - * hand as it may be in the MFT zone so the allocator would not give it - * to us. - */ - ret = (int)ntfs_attr_pread(lcnbmp_na, lcn >> 3, 1, &b); - if (ret < 0) { - ntfs_log_error("Failed to read from lcn bitmap.\n"); + + rl2 = ntfs_cluster_alloc(vol, rl[1].vcn, 1, lcn, DATA_ZONE); + if (!rl2) { + ntfs_log_error("Failed to allocate a cluster for " + "the mft bitmap.\n"); return -1; } - ntfs_log_debug("Read %i byte%s.\n", ret, ret == 1 ? "" : "s"); - tb = 1 << (lcn & 7ull); - if (ret == 1 && b != 0xff && !(b & tb)) { - /* Next cluster is free, allocate it. */ - b |= tb; - ret = (int)ntfs_attr_pwrite(lcnbmp_na, lcn >> 3, 1, &b); - if (ret < 1) { - ntfs_log_error("Failed to write to lcn " - "bitmap.\n"); - if (!ret) - errno = EIO; - return -1; - } - /* Update the mft bitmap runlist. */ - rl->length++; - rl[1].vcn++; - status.added_cluster = 1; - ntfs_log_debug("Appending one cluster to mft bitmap.\n"); - } else { - /* Allocate a cluster from the DATA_ZONE. */ - rl2 = ntfs_cluster_alloc(vol, rl[1].vcn, 1, lcn, DATA_ZONE); - if (!rl2) { - ntfs_log_error("Failed to allocate a cluster for " - "the mft bitmap.\n"); - return -1; - } - rl = ntfs_runlists_merge(mftbmp_na->rl, rl2); - if (!rl) { - ret = errno; - ntfs_log_error("Failed to merge runlists for mft " - "bitmap.\n"); - if (ntfs_cluster_free_from_rl(vol, rl2)) - ntfs_log_error("Failed to deallocate " - "cluster.%s\n", es); - free(rl2); - errno = ret; - return -1; - } - mftbmp_na->rl = rl; - status.added_run = 1; - ntfs_log_debug("Adding one run to mft bitmap.\n"); - /* Find the last run in the new runlist. */ - for (; rl[1].length; rl++) - ; + rl = ntfs_runlists_merge(mftbmp_na->rl, rl2); + if (!rl) { + err = errno; + ntfs_log_error("Failed to merge runlists for mft " + "bitmap.\n"); + if (ntfs_cluster_free_from_rl(vol, rl2)) + ntfs_log_error("Failed to deallocate " + "cluster.%s\n", es); + free(rl2); + errno = err; + return -1; } + mftbmp_na->rl = rl; + ntfs_log_debug("Adding one run to mft bitmap.\n"); + /* Find the last run in the new runlist. */ + for (; rl[1].length; rl++) + ; /* * Update the attribute record as well. Note: @rl is the last * (non-terminator) runlist element of mft bitmap. */ ctx = ntfs_attr_get_search_ctx(mftbmp_na->ni, NULL); - if (!ctx) { - ntfs_log_error("Failed to get search context.\n"); + if (!ctx) goto undo_alloc; - } + if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, mftbmp_na->name_len, 0, rl[1].vcn, NULL, 0, ctx)) { ntfs_log_error("Failed to find last attribute extent of " @@ -696,7 +660,7 @@ errno = EOPNOTSUPP; goto undo_alloc; } - status.mp_rebuilt = 1; + mp_rebuilt = TRUE; /* Generate the mapping pairs array directly into the attr record. */ if (ntfs_mapping_pairs_build(vol, (u8*)a + le16_to_cpu(a->mapping_pairs_offset), mp_size, rl2, ll, @@ -734,7 +698,7 @@ ntfs_attr_put_search_ctx(ctx); return 0; restore_undo_alloc: - ret = errno; + err = errno; ntfs_attr_reinit_search_ctx(ctx); if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, mftbmp_na->name_len, 0, rl[1].vcn, NULL, 0, ctx)) { @@ -746,29 +710,27 @@ * The only thing that is now wrong is ->allocated_size of the * base attribute extent which chkdsk should be able to fix. */ - errno = ret; + errno = err; return -1; } m = ctx->mrec; a = ctx->attr; a->highest_vcn = cpu_to_sle64(rl[1].vcn - 2); - errno = ret; + errno = err; undo_alloc: - ret = errno; - if (status.added_cluster) { - /* Truncate the last run in the runlist by one cluster. */ - rl->length--; - rl[1].vcn--; - } else if (status.added_run) { - lcn = rl->lcn; - /* Remove the last run from the runlist. */ - rl->lcn = rl[1].lcn; - rl->length = 0; - } - /* Deallocate the cluster. */ - if (ntfs_bitmap_clear_bit(lcnbmp_na, lcn)) + err = errno; + + /* Remove the last run from the runlist. */ + lcn = rl->lcn; + rl->lcn = rl[1].lcn; + rl->length = 0; + + /* FIXME: use an ntfs_cluster_free_* function */ + if (ntfs_bitmap_clear_bit(vol->lcnbmp_na, lcn)) ntfs_log_error("Failed to free cluster.%s\n", es); - if (status.mp_rebuilt) { + else + vol->free_clusters++; + if (mp_rebuilt) { if (ntfs_mapping_pairs_build(vol, (u8*)a + le16_to_cpu(a->mapping_pairs_offset), old_alen - le16_to_cpu(a->mapping_pairs_offset), @@ -782,7 +744,7 @@ } if (ctx) ntfs_attr_put_search_ctx(ctx); - errno = ret; + errno = err; return -1; } @@ -808,10 +770,9 @@ mftbmp_na = vol->mftbmp_na; ctx = ntfs_attr_get_search_ctx(mftbmp_na->ni, NULL); - if (!ctx) { - ntfs_log_error("Failed to get search context.\n"); + if (!ctx) return -1; - } + if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, mftbmp_na->name_len, 0, 0, NULL, 0, ctx)) { ntfs_log_error("Failed to find first attribute extent of " @@ -844,10 +805,9 @@ err = EIO; /* Try to recover from the error. */ ctx = ntfs_attr_get_search_ctx(mftbmp_na->ni, NULL); - if (!ctx) { - ntfs_log_error("Failed to get search context.%s\n", es); + if (!ctx) goto err_out; - } + if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, mftbmp_na->name_len, 0, 0, NULL, 0, ctx)) { ntfs_log_error("Failed to find first attribute extent of " @@ -936,7 +896,7 @@ if (rl2) break; if (errno != ENOSPC || nr == min_nr) { - ntfs_log_error("Failed to allocate the minimal " + ntfs_log_perror("Failed to allocate the minimal " "number of clusters (%lli) for the " "mft data attribute.\n", (long long)nr); return -1; @@ -969,10 +929,9 @@ ; /* Update the attribute record as well. */ ctx = ntfs_attr_get_search_ctx(mft_na->ni, NULL); - if (!ctx) { - ntfs_log_error("Failed to get search context.\n"); + if (!ctx) goto undo_alloc; - } + if (ntfs_attr_lookup(mft_na->type, mft_na->name, mft_na->name_len, 0, rl[1].vcn, NULL, 0, ctx)) { ntfs_log_error("Failed to find last attribute extent of " @@ -1152,17 +1111,16 @@ mft_na->data_size = mft_na->initialized_size; ntfs_log_debug("Initializing mft record 0x%llx.\n", (long long)ll2); if (ntfs_mft_record_format(vol, ll2) < 0) { - ntfs_log_error("Failed to format mft record.\n"); + ntfs_log_perror("Failed to format mft record"); goto undo_data_init; } } /* Update the mft data attribute record to reflect the new sizes. */ ctx = ntfs_attr_get_search_ctx(mft_na->ni, NULL); - if (!ctx) { - ntfs_log_error("Failed to get search context.\n"); + if (!ctx) goto undo_data_init; - } + if (ntfs_attr_lookup(mft_na->type, mft_na->name, mft_na->name_len, 0, 0, NULL, 0, ctx)) { ntfs_log_error("Failed to find first attribute extent of " diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/runlist.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/runlist.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/runlist.c 2007-01-09 23:22:58.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/runlist.c 2007-07-16 23:47:48.000000000 +0300 @@ -544,9 +544,8 @@ /* Can't have an entirely unmapped source runlist. */ if (!srl[si].length) { - ntfs_log_debug("Eeek! ntfs_runlists_merge() received entirely " - "unmapped source runlist.\n"); errno = EINVAL; + ntfs_log_perror("%s: unmapped source runlist", __FUNCTION__); return NULL; } @@ -567,8 +566,8 @@ /* Sanity check for illegal overlaps. */ if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) && (srl[si].lcn >= 0)) { - ntfs_log_debug("Run lists overlap. Cannot merge!\n"); errno = ERANGE; + ntfs_log_perror("Run lists overlap. Cannot merge"); return NULL; } @@ -1642,16 +1641,16 @@ runlist *rlc; if (!rl) { - ntfs_log_trace("Invalid argument passed.\n"); errno = EINVAL; + ntfs_log_perror("%s: ", __FUNCTION__); return -1; } for (rlc = rl; rlc->length; rlc++) if (rlc->lcn < 0) { if (rlc->lcn != LCN_HOLE) { - ntfs_log_trace("Received unmapped runlist.\n"); errno = EINVAL; + ntfs_log_perror("%s: bad runlist", __FUNCTION__); return -1; } return 1; @@ -1672,16 +1671,16 @@ s64 ret = 0; if (!rl) { - ntfs_log_trace("Invalid argument passed.\n"); errno = EINVAL; + ntfs_log_perror("%s: ", __FUNCTION__); return -1; } for (rlc = rl; rlc->length; rlc++) { if (rlc->lcn < 0) { if (rlc->lcn != LCN_HOLE) { - ntfs_log_trace("Received unmapped runlist.\n"); errno = EINVAL; + ntfs_log_perror("%s: bad runlist", __FUNCTION__); return -1; } } else diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/security.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/security.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/security.c 2006-10-31 00:32:47.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/security.c 2007-09-02 15:38:29.000000000 +0300 @@ -43,6 +43,7 @@ #include "attrib.h" #include "security.h" #include "misc.h" +#include "bitmap.h" /* * The zero GUID. @@ -338,3 +339,30 @@ return ret; } +/** + * ntfs_security_hash - calculate the hash of a security descriptor + * @sd: self-relative security descriptor whose hash to calculate + * @length: size in bytes of the security descritor @sd + * + * Calculate the hash of the self-relative security descriptor @sd of length + * @length bytes. + * + * This hash is used in the $Secure system file as the primary key for the $SDH + * index and is also stored in the header of each security descriptor in the + * $SDS data stream as well as in the index data of both the $SII and $SDH + * indexes. In all three cases it forms part of the SDS_ENTRY_HEADER + * structure. + * + * Return the calculated security hash in little endian. + */ +le32 ntfs_security_hash(const SECURITY_DESCRIPTOR_RELATIVE *sd, const u32 len) +{ + const le32 *pos = (le32 *)sd; + const le32 *end = pos + (len >> 2); + u32 hash = 0; + + while (pos < end) + hash = le32_to_cpup(pos++) + ntfs_rol32(hash, 3); + return cpu_to_le32(hash); +} + diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/volume.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/volume.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/libntfs-3g/volume.c 2007-07-10 01:18:07.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/libntfs-3g/volume.c 2007-09-13 00:11:12.000000000 +0300 @@ -76,7 +76,7 @@ */ ntfs_volume *ntfs_volume_alloc(void) { - return calloc(1, sizeof(ntfs_volume)); + return ntfs_calloc(sizeof(ntfs_volume)); } @@ -219,10 +219,9 @@ goto io_error_exit; } ctx = ntfs_attr_get_search_ctx(vol->mft_ni, NULL); - if (!ctx) { - ntfs_log_perror("Failed to allocate attribute search context"); + if (!ctx) goto error_exit; - } + if (p2n(ctx->attr) < p2n(mb) || (char*)ctx->attr > (char*)mb + vol->mft_record_size) { ntfs_log_error("$MFT is corrupt.\n"); @@ -434,6 +433,7 @@ if (!dev || !dev->d_ops || !dev->d_name) { errno = EINVAL; + ntfs_log_perror("%s: dev = %p", __FUNCTION__, dev); return NULL; } @@ -445,6 +445,7 @@ vol = ntfs_volume_alloc(); if (!vol) goto error_exit; + /* Create the default upcase table. */ vol->upcase_len = 65536; vol->upcase = ntfs_malloc(vol->upcase_len * sizeof(ntfschar)); @@ -453,18 +454,20 @@ ntfs_upcase_table_build(vol->upcase, vol->upcase_len * sizeof(ntfschar)); + if (flags & MS_RDONLY) NVolSetReadOnly(vol); if (flags & MS_NOATIME) NVolSetNoATime(vol); - ntfs_log_debug("Reading bootsector... "); - if (dev->d_ops->open(dev, NVolReadOnly(vol) ? O_RDONLY: O_RDWR)) { - ntfs_log_debug(FAILED); + + /* ...->open needs bracketing to compile with glibc 2.7 */ + if ((dev->d_ops->open)(dev, NVolReadOnly(vol) ? O_RDONLY: O_RDWR)) { ntfs_log_perror("Error opening partition device"); goto error_exit; } /* Attach the device to the volume. */ vol->dev = dev; + /* Now read the bootsector. */ br = ntfs_pread(dev, 0, sizeof(NTFS_BOOT_SECTOR), bs); if (br != sizeof(NTFS_BOOT_SECTOR)) { @@ -472,13 +475,11 @@ if (br != -1) errno = EINVAL; if (!br) - ntfs_log_error("Partition is smaller than bootsector " - "size.\n"); + ntfs_log_error("Failed to read bootsector (size=0)\n"); else ntfs_log_perror("Error reading bootsector"); goto error_exit; } - ntfs_log_debug(OK); if (!ntfs_boot_sector_is_ntfs(bs)) { errno = EINVAL; goto error_exit; @@ -550,22 +551,16 @@ */ /* Need to setup $MFT so we can use the library read functions. */ - ntfs_log_debug("Loading $MFT... "); if (ntfs_mft_load(vol) < 0) { - ntfs_log_debug(FAILED); ntfs_log_perror("Failed to load $MFT"); goto error_exit; } - ntfs_log_debug(OK); /* Need to setup $MFTMirr so we can use the write functions, too. */ - ntfs_log_debug("Loading $MFTMirr... "); if (ntfs_mftmirr_load(vol) < 0) { - ntfs_log_debug(FAILED); ntfs_log_perror("Failed to load $MFTMirr"); goto error_exit; } - ntfs_log_debug(OK); return vol; error_exit: eo = errno; @@ -722,13 +717,6 @@ errno = EPERM; goto out; } - for (i = 0; i < NTFS_HIBERFILE_HEADER_SIZE; i++) { - if (buf[i]) { - ntfs_log_error("Windows is hibernated, won't mount.\n"); - errno = EPERM; - goto out; - } - } /* All right, all header bytes are zero */ errno = 0; out: @@ -784,10 +772,8 @@ u32 u; vol = ntfs_volume_startup(dev, flags); - if (!vol) { - ntfs_log_perror("Failed to startup volume"); + if (!vol) return NULL; - } /* Load data from $MFT and $MFTMirr and compare the contents. */ m = ntfs_malloc(vol->mftmirr_size << vol->mft_record_size_bits); @@ -964,11 +950,9 @@ } /* Get a search context for the $Volume/$VOLUME_INFORMATION lookup. */ ctx = ntfs_attr_get_search_ctx(vol->vol_ni, NULL); - if (!ctx) { - ntfs_log_debug(FAILED); - ntfs_log_perror("Failed to allocate attribute search context"); + if (!ctx) goto error_exit; - } + /* Find the $VOLUME_INFORMATION attribute. */ if (ntfs_attr_lookup(AT_VOLUME_INFORMATION, AT_UNNAMED, 0, 0, 0, NULL, 0, ctx)) { @@ -1461,10 +1445,9 @@ } /* Get a pointer to the volume information attribute. */ ctx = ntfs_attr_get_search_ctx(vol->vol_ni, NULL); - if (!ctx) { - ntfs_log_perror("Failed to allocate attribute search context"); + if (!ctx) return -1; - } + if (ntfs_attr_lookup(AT_VOLUME_INFORMATION, AT_UNNAMED, 0, 0, 0, NULL, 0, ctx)) { ntfs_log_error("Attribute $VOLUME_INFORMATION was not found " diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/Makefile.in /tmp/P0FDp6eeZz/ntfs-3g-1.913/Makefile.in --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/Makefile.in 2007-07-10 01:40:43.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/Makefile.in 2007-09-13 00:18:18.000000000 +0300 @@ -107,6 +107,8 @@ FUSE_MODULE_LIBS = @FUSE_MODULE_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LIBRARY_FALSE = @INSTALL_LIBRARY_FALSE@ +INSTALL_LIBRARY_TRUE = @INSTALL_LIBRARY_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/README /tmp/P0FDp6eeZz/ntfs-3g-1.913/README --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/README 2007-02-20 22:14:19.000000000 +0200 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/README 2007-08-17 20:13:48.000000000 +0300 @@ -50,10 +50,13 @@ or ntfs-3g /dev/hda1 /mnt/windows -You may also need to set the 'locale' option to make file names with national -characters visible. Replace the below hu_HU.utf8 with the appropriate setting. +If your Operating System vendor didn't setup your language specific settings +then you may also need to set the 'locale' mount option to make all filenames +with national characters visible. Replace the below en_US.UTF-8 with the +appropriate setting. You can find more information about his topic at +http://ntfs-3g.org/support.html#locale - mount -t ntfs-3g /dev/hda1 /mnt/windows -o locale=hu_HU.utf8 + mount -t ntfs-3g /dev/hda1 /mnt/windows -o locale=en_US.UTF-8 Please see the ntfs-3g manual page for more options and examples. diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/src/Makefile.in /tmp/P0FDp6eeZz/ntfs-3g-1.913/src/Makefile.in --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/src/Makefile.in 2007-07-10 01:40:43.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/src/Makefile.in 2007-09-13 00:18:18.000000000 +0300 @@ -110,6 +110,8 @@ FUSE_MODULE_LIBS = @FUSE_MODULE_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LIBRARY_FALSE = @INSTALL_LIBRARY_FALSE@ +INSTALL_LIBRARY_TRUE = @INSTALL_LIBRARY_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/src/ntfs-3g.8.in /tmp/P0FDp6eeZz/ntfs-3g-1.913/src/ntfs-3g.8.in --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/src/ntfs-3g.8.in 2007-06-17 00:31:46.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/src/ntfs-3g.8.in 2007-08-22 22:59:45.000000000 +0300 @@ -3,7 +3,7 @@ .\" Copyright (c) 2006-2007 Szabolcs Szakacsits. .\" This file may be copied under the terms of the GNU Public License. .\" -.TH NTFS-3G 8 "June 2007" "ntfs-3g @VERSION@" +.TH NTFS-3G 8 "August 2007" "ntfs-3g @VERSION@" .SH NAME ntfs-3g \- Third Generation Read/Write NTFS Driver .SH SYNOPSIS @@ -21,7 +21,7 @@ streams and sparse files; it can handle special files like symbolic links, devices, and FIFOs; moreover it can also read transparently compressed files. -.SS Access handling, security +.SS Access Handling and Security By default, files and directories are owned by the effective user and group of the mounting process and everybody has full read, write, execution and directory browsing permissions. @@ -51,8 +51,16 @@ process drops the root privilege after successful mount and runs unprivileged afterwards. +.SS Windows Filename Compatibility +NTFS supports several filename namespaces: DOS, Win32 and POSIX. While the +\fBntfs-3g\fR driver handles all of them, it always creates new files in the +POSIX namespace for maximum portability and interoperability reasons. +This means that filenames are case sensitive and all characters are +allowed except '/' and '\\0'. This is perfectly legal on Windows, though +some application may get confused. If you find so then please report it +to the developer of the relevant Windows software. .SS Alternate Data Streams (ADS) -All data on NTFS is stored in streams. Every file has exactly one unnamed +NTFS stores all data in streams. Every file has exactly one unnamed data stream and can have many named data streams. The size of a file is the size of its unnamed data stream. By default, \fBntfs-3g\fR will only read the unnamed data stream. @@ -94,16 +102,16 @@ Mount filesystem read\-only. .TP .BI locale= value -You can set locale with this option which is often required to make -visible files with national charaters. It's useful if the locale -environment variables are not set before partitions had been mounted -from /etc/fstab. +This option can be useful if your language specific locale environment +variables are not set correctly or at all in your operating system. +In such cases, the national characters can be made visible by using this +option. Please see more information about this topic at +http://ntfs-3g.org/support.html#locale .TP .B force -Force mount even if the volume is scheduled for consistency check or -the logfile is unclean. The logfile will be unconditionally cleared -in the latter case. Use this option with caution and for your own -responsibility. +Force the mounting even if the NTFS logfile is unclean. The logfile +will be unconditionally cleared. Use this option with caution and for +your own responsibility. .TP .B show_sys_files Show the system files in directory listings. diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/src/ntfs-3g.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/src/ntfs-3g.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/src/ntfs-3g.c 2007-07-10 01:25:15.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/src/ntfs-3g.c 2007-09-12 23:51:06.000000000 +0300 @@ -63,6 +63,7 @@ #include #include #include +#include #ifdef HAVE_SETXATTR #include @@ -105,7 +106,6 @@ typedef struct { ntfs_volume *vol; int state; - long free_clusters; long free_mft; unsigned int uid; unsigned int gid; @@ -122,8 +122,6 @@ } ntfs_fuse_context_t; typedef enum { - NF_FreeClustersOutdate = (1 << 0), /* Information about amount of - free clusters is outdated. */ NF_FreeMFTOutdate = (1 << 1), /* Information about amount of free MFT records is outdated. */ } ntfs_fuse_state_bits; @@ -166,8 +164,8 @@ static __inline__ void ntfs_fuse_mark_free_space_outdated(void) { - /* Mark information about free MFT record and clusters outdated. */ - ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate); + /* Mark information about free MFT records outdated. */ + ctx->state |= NF_FreeMFTOutdate; } /** @@ -220,14 +218,12 @@ return nr_free; } -static long ntfs_fuse_get_nr_free_clusters(ntfs_volume *vol) +static long ntfs_get_nr_free_clusters(ntfs_volume *vol) { u8 *buf; long nr_free = 0; s64 br, total = 0; - if (!(ctx->state & NF_FreeClustersOutdate)) - return ctx->free_clusters; buf = ntfs_malloc(vol->cluster_size); if (!buf) return -errno; @@ -247,8 +243,6 @@ free(buf); if (!total || br < 0) return -errno; - ctx->free_clusters = nr_free; - ctx->state &= ~(NF_FreeClustersOutdate); return nr_free; } @@ -291,7 +285,7 @@ sfs->f_blocks = vol->nr_clusters; /* Free data blocks in file system in units of f_bsize. */ - size = ntfs_fuse_get_nr_free_clusters(vol); + size = vol->free_clusters; if (size < 0) size = 0; @@ -573,14 +567,17 @@ const unsigned dt_type __attribute__((unused))) { char *filename = NULL; + int ret = 0; if (name_type == FILE_NAME_DOS) return 0; + if (ntfs_ucstombs(name, name_len, &filename, 0) < 0) { ntfs_log_perror("Skipping unrepresentable filename (inode %llu)", (unsigned long long)MREF(mref)); return 0; } + if (ntfs_fuse_is_named_data_stream(filename)) { ntfs_log_error("Unable to access '%s' (inode %llu) with " "current named streams access interface.\n", @@ -588,14 +585,16 @@ free(filename); return 0; } + if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || ctx->show_sys_files) { struct stat st = { .st_ino = MREF(mref) }; - fill_ctx->filler(fill_ctx->buf, filename, &st, 0); + ret = fill_ctx->filler(fill_ctx->buf, filename, &st, 0); } + free(filename); - return 0; + return ret; } static int ntfs_fuse_readdir(const char *path, void *buf, @@ -946,7 +945,13 @@ return ntfs_fuse_create(from, S_IFLNK, 0, to); } -static int ntfs_fuse_link(const char *old_path, const char *new_path) +/** + * NOTE: About the role of mtime: during rename(3), which is currently + * implemented by the help of link() operations, modification time mustn't + * be updated, so we NInoSetNoMtimeUpdate() such inodes after they are opened. + * This is not very nice itself but it may be eliminated, in time. + */ +static int ntfs_fuse_ln(const char *old_path, const char *new_path, int mtime) { char *name; ntfschar *uname = NULL; @@ -967,6 +972,10 @@ res = -errno; goto exit; } + + if (!mtime) + NInoSetNoMtimeUpdate(ni); + /* Generate unicode filename. */ name = strrchr(path, '/'); name++; @@ -1000,6 +1009,11 @@ return res; } +static int ntfs_fuse_link(const char *old_path, const char *new_path) +{ + return ntfs_fuse_ln(old_path, new_path, 1); +} + static int ntfs_fuse_rm(const char *org_path) { char *name; @@ -1093,14 +1107,14 @@ ntfs_log_trace("Entering\n"); - ret = ntfs_fuse_link(new_path, tmp); + ret = ntfs_fuse_ln(new_path, tmp, 0); if (ret) return ret; ret = ntfs_fuse_unlink(new_path); if (!ret) { - ret = ntfs_fuse_link(old_path, new_path); + ret = ntfs_fuse_ln(old_path, new_path, 0); if (ret) goto restore; @@ -1114,7 +1128,7 @@ goto cleanup; restore: - if (ntfs_fuse_link(tmp, new_path)) { + if (ntfs_fuse_ln(tmp, new_path, 0)) { err: ntfs_log_perror("Rename failed. Existing file '%s' was renamed " "to '%s'", new_path, tmp); @@ -1183,7 +1197,7 @@ goto out; } - ret = ntfs_fuse_link(old_path, new_path); + ret = ntfs_fuse_ln(old_path, new_path, 0); if (ret) goto out; @@ -1224,6 +1238,9 @@ ni = ntfs_pathname_to_inode(ctx->vol, NULL, path); if (!ni) return -errno; + + NInoSetNoParentMtimeUpdate(ni); + if (buf) { ni->last_access_time = buf->actime; ni->last_data_change_time = buf->modtime; @@ -1631,7 +1648,7 @@ return -1; *ctx = (ntfs_fuse_context_t) { - .state = NF_FreeClustersOutdate | NF_FreeMFTOutdate, + .state = NF_FreeMFTOutdate, .uid = getuid(), .gid = getgid(), .fmask = 0, @@ -1670,14 +1687,16 @@ int default_permissions = 0; /* + * FIXME: This is not pretty ... * +7 fsname= * +1 comma * +1 null-terminator * +21 ,blkdev,blksize=65536 * +20 ,default_permissions + * +70 ,user= * +PATH_MAX resolved realpath() device name */ - ret = ntfs_malloc(strlen(def_opts) + strlen(orig_opts) + 64 + PATH_MAX); + ret = ntfs_malloc(strlen(def_opts) + strlen(orig_opts) + 256 + PATH_MAX); if (!ret) return NULL; @@ -1745,7 +1764,8 @@ } sscanf(val, "%o", &ctx->fmask); ctx->dmask = ctx->fmask; - default_permissions = 1; + if (ctx->fmask) + default_permissions = 1; } else if (!strcmp(opt, "fmask")) { if (!val) { ntfs_log_error("'fmask' option should have " @@ -1753,7 +1773,8 @@ goto err_exit; } sscanf(val, "%o", &ctx->fmask); - default_permissions = 1; + if (ctx->fmask) + default_permissions = 1; } else if (!strcmp(opt, "dmask")) { if (!val) { ntfs_log_error("'dmask' option should have " @@ -1761,7 +1782,8 @@ goto err_exit; } sscanf(val, "%o", &ctx->dmask); - default_permissions = 1; + if (ctx->dmask) + default_permissions = 1; } else if (!strcmp(opt, "uid")) { if (!val) { ntfs_log_error("'uid' option should have " @@ -2127,6 +2149,27 @@ strcat(parsed_options, options); } +static void set_user_mount_option(char *parsed_options, uid_t uid) +{ + struct passwd *pw; + char option[64]; + + if (!uid) + return; + + errno = 0; + pw = getpwuid(uid); + if (!pw || !pw->pw_name) { + ntfs_log_perror("WARNING: could not get username for uid %lld, " + "unprivileged unmount may fail", (long long)uid); + return; + } + + /* parsed_options already allocated enough space. */ + snprintf(option, sizeof(option), ",user=%s", pw->pw_name); + strcat(parsed_options, option); +} + int main(int argc, char *argv[]) { char *parsed_options = NULL; @@ -2183,8 +2226,16 @@ if (!ntfs_open(opts.device, opts.mnt_point, use_blkdev)) goto err_out; - if (use_blkdev) + ctx->vol->free_clusters = ntfs_get_nr_free_clusters(ctx->vol); + if (ctx->vol->free_clusters < 0) { + ntfs_log_perror("Failed to read NTFS $Bitmap"); + goto err_out; + } + + if (use_blkdev) { set_fuseblk_options(parsed_options); + set_user_mount_option(parsed_options, uid); + } /* Libfuse can't always find fusermount, so let's help it. */ if (setenv("PATH", ":/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin", 0)) diff -Nru /tmp/TGDZSOkbhC/ntfs-3g-1.710/src/utils.c /tmp/P0FDp6eeZz/ntfs-3g-1.913/src/utils.c --- /tmp/TGDZSOkbhC/ntfs-3g-1.710/src/utils.c 2007-07-10 00:49:52.000000000 +0300 +++ /tmp/P0FDp6eeZz/ntfs-3g-1.913/src/utils.c 2007-08-22 22:59:45.000000000 +0300 @@ -84,10 +84,6 @@ "different device under /dev/mapper/, (e.g. /dev/mapper/nvidia_eahaabcc1)\n" "to mount NTFS. Please see the 'dmraid' documentation for help.\n"; -static const char *dirty_volume_msg = -"Volume is scheduled for check. Please boot into Windows TWICE, or\n" -"use the 'force' mount option. For example type on the command line:\n"; - static const char *forced_mount_msg = "\n" " mount -t ntfs-3g %s %s -o force\n" @@ -141,19 +137,6 @@ return NULL; } - if (vol->flags & VOLUME_IS_DIRTY) { - if (!force) { - ntfs_log_error("%s", dirty_volume_msg); - ntfs_log_error(forced_mount_msg, volume, mntpoint, - volume, mntpoint); - ntfs_umount(vol, FALSE); - - return NULL; - } else - ntfs_log_error("WARNING: Forced mount, unclean volume " - "information is ignored.\n"); - } - return vol; }