Compare commits

...

4618 Commits
master ... edge

Author SHA1 Message Date
Erik Larsson 75dcdc2cf3 unistr.c: Fix use-after-free in 'ntfs_uppercase_mbs'.
If 'utf8_to_unicode' throws an error due to an invalid UTF-8 sequence,
then 'n' will be less than 0 and the loop will terminate without storing
anything in '*t'. After the loop the uppercase string's allocation is
freed, however after it is freed it is unconditionally accessed through
'*t', which points into the freed allocation, for the purpose of NULL-
terminating the string. This leads to a use-after-free.
Fixed by only NULL-terminating the string when no error has been thrown.

Thanks for Jeffrey Bencteux for reporting this issue:
https://github.com/tuxera/ntfs-3g/issues/84
2023-06-13 17:47:15 +03:00
Erik Larsson 6b3f096069 ntfsprogs/Makefile.am: Only install manpages for 'extras' when enabled.
We used to always install all the manpages, but some are specific to the
'extras' enabled with the configure option '--enable-extras'.
Fixed by only installing the 'extras' manpages when '--enable-extras' is
active.

Also since this commit touches the list of manpages a bit of cleanup was
done to make sure there's only one manpage per line (helps to minimize
diffs) and also that the manpages are sorted in alphabetical order in
ntfsprogs/Makefile.am to avoid future confusion.

Thanks to user 'opty77' for reporting this issue:
https://github.com/tuxera/ntfs-3g/issues/82
2023-05-28 08:21:34 +03:00
Erik Larsson 233658e5a1 attrib.c: Fix another instance of errno not being set on error. 2023-05-19 12:20:54 +03:00
Erik Larsson 1565b01e21 mft.c: Fix broken free MFT records accounting during bitmap extension.
When the bitmap needs extending, 'vol->free_mft_records' is incremented
by 8*8=64 records. This is due to the bitmap's initialized area being
extended 8 bytes at a time.
However the way 'vol->free_mft_records' is being initialized is that all
the bits that are currently allocated to the MFT bitmap are already
taken into account at initialization time. This leads to a value for
'vol->free_mft_records' that is larger than the actual available number
of MFT records.

For example if there are 20 used MFT records and the bitmap has a 4096
byte allocation where 16 bytes are initialized, the number of free MFT
records are ((8 * 16) - 20) + (8 * (4096 - 16)) = 32748 records
available.
If we now expand the bitmap by 8 initialized bytes, we'd be adding 64
MFT entries according to the logic in the function
'ntfs_mft_bitmap_extend_initialized'.
However we are expanding it within the bounds of the existing allocation
where there is (4096 - 16) bytes free, so they shouldn't be added at all
at this stage.

The result is that our internal accounting is that we have 32748 + 64 =
32812 available MFT records, but in reality we will have 32748 records
available all the time until we expand the allocation beyond 4096 bytes.

Fixed by incrementing 'vol->free_mft_records' when the allocation is
expanded, not when the initialized size is.
2023-05-09 11:25:10 +03:00
Erik Larsson 241ddb3860 index.c: Fix crash when a reparse tag cannot be found in the index.
When 'remove_reparse_index', called by 'ntfs_delete_reparse_index',
fails to look up a reparse key in the index, it leaves the
'ntfs_index_context' without a populated 'INDEX_BLOCK *ib' field.

This causes 'remove_reparse_index' to fail but the index entry is then
marked dirty unconditionally in 'ntfs_index_entry_mark_dirty', called by
'ntfs_delete_reparse_index', even though 'ib' may be NULL.

The following 'ntfs_index_ctx_put' call then starts to write out the
dirty 'INDEX_BLOCK', which causes a crash.

Fixed by only marking the index block dirty in if it's non-NULL.

Thanks to Stephen Greenham <sg@solarisfire.com> for reporting this issue
and providing debug information.
2023-05-03 10:44:57 +02:00
Erik Larsson 01b9bddc0c attrib.c: Fix errno not being set on NULL character in attribute name.
This is an error condition as we jump to err_out, but there's no errno
value set to accompany it. Fixed by setting EIO.
2023-05-03 09:57:34 +02:00
Erik Larsson e73d481a76 mkntfs.c: Enable microsecond-precision volume creation time.
Previously the creation time was filled in with seconds (obtained using
time(NULL)) but the microsecond part was left zeroed. Fixed by using
gettimeofday when available.
2022-12-12 18:51:12 +02:00
Sam James 71ecccf279 configure.ac: fix bashism in fuse check
configure scripts need to be runnable with a POSIX-compliant /bin/sh.

On many (but not all!) systems, /bin/sh is provided by Bash, so errors
like this aren't spotted. Notably Debian defaults to /bin/sh provided
by dash which doesn't tolerate such bashisms as '=='.

This retains compatibility with bash.

Fixes configure warnings/errors like:
```
checking Windows OS... no
./configure: 13360: test: xinternal: unexpected operator
checking for pthread_create in -lpthread... yes
checking Solaris OS... no
```

Signed-off-by: Sam James <sam@gentoo.org>
2022-11-08 13:54:36 +02:00
Jean-Pierre André 78414d9361 Configured for version 2022.10.3 2022-10-03 11:10:36 +02:00
Jean-Pierre André 76c3a799a9 Avoided merging runlists with no runs
Runlists with no runs are tolerated though not expected. However merging
such runlists is problematic as there is no significant vcn to examine.
So avoid merging them, and just return the other runlist.
2022-09-14 08:31:31 +02:00
Jean-Pierre André 18bfc67611 Rejected zero-sized runs
A zero-size run is the universal way to indentify the end of a runlist,
so we must reject zero-sized runs when decompressing a runlist. A
zero-size data run is an error, and a zero-size hole is simply ignored.
2022-09-14 08:29:58 +02:00
Jean-Pierre André 875a1d4e90 Configured for version 2022.5.17
This is a security release. The soname is unchanged as no API has changed.
2022-05-17 08:34:26 +02:00
Jean-Pierre André fb28eef6f1 Hardened the checking of directory offset requested by a readdir
When asked for the next directory entries, make sure the chunk offset
is within valid values, otherwise return no more entries in chunk.
2022-05-10 10:48:18 +02:00
Jean-Pierre André 7f81935f32 Returned an error code when the --help or --version options are used
Accepting --help or --version options may leave the ntfs-3g process in an
unclean state, so reject them while processing options. Also reject
them in libfuse-lite.
2022-05-10 10:44:34 +02:00
Jean-Pierre André bce5734a75 Fixed operation on little endian data
Forcing an even usa_of, in a recent security patch, must be made on cpu
endian data.
2022-05-10 10:40:17 +02:00
Jean-Pierre André 96412e28e5 Fixed possible out-of-buffer condition in ntfsck
A bad usa_count could lead to an out-of-buffer condition. Just avoid
the issue and report the error, still not fix it.
2022-05-10 10:30:24 +02:00
Jean-Pierre André 5ce8941bf4 Made sure there is no null character in an attribute name (bis)
When copying an attribute name which contains a null, it is truncated
and this may lead to accessing non-allocated bytes when relying on the
expected name length. Such (illegal) names must therefore be rejected.
2021-11-05 08:41:20 +01:00
Jean-Pierre André 6efc1305c1 Made sure the client log data does not overflow from restart page
Strengthen the consistency check of the length of restart pages, and
check that log client records are within such a restart page.
2021-10-20 09:53:28 +02:00
Jean-Pierre André 60717a846d Avoided allocating and reading an attribute beyond its full size
Before reading a full attribute value for internal use, its expected
length has been checked to be < 0x40000. However the allocated size
in the runlist may be much bigger as a consequence of a bug or malice.
To prevent malloc'ing excessive size, restrict the size of the last
run to read to the needed length.
2021-09-21 10:56:06 +02:00
Jean-Pierre André 838b6e35b4 Made sure there is no null character in an attribute name
When copying an attribute name which contains a null, it is truncated
and this may lead to accessing non-allocated bytes when relying on the
expected name length. Such names must therefore be rejected.
2021-09-21 10:54:50 +02:00
Jean-Pierre André a8818cf779 Used a default usn when the former one cannot be retrieved
When creating a new MFT record, the former seq_no and usn are retrieved
to avoid the new one to be mistaken for the former one.
This may not be possible when the record is used for the first time
or after some bad error. In such situation use default values.
2021-09-21 10:53:16 +02:00
Jean-Pierre André 92b9fbc6fe Updated the urls present in the ntfsprogs manuals
The urls now point at Github
2021-08-30 10:42:14 +02:00
Jean-Pierre André 399ba862c9 Updated the urls present in ntfs-3g code
The urls now point at Github
2021-08-30 09:27:33 +02:00
Jean-Pierre André 84739d9e4d Updated the ntfs-3g manual
Reordered the options alphabetically and updated the urls.
2021-08-30 09:20:48 +02:00
Jean-Pierre André 88c4a19c5a Updated the README
Added a recommendation to use ntfs-3g packaged by a distribution, and
inserted a link to the Wiki.
2021-08-25 08:50:03 +02:00
Jean-Pierre André 31ac7e4f0f Configured for version 2021.8.22 2021-08-22 17:05:00 +02:00
Jean-Pierre André a213e6352b Defined Github as the host for documentation
Documentation and support is now on github.com/tuxera
2021-08-22 17:01:39 +02:00
Jean-Pierre André 21b49600ea Configured for version 2021.8.14 2021-08-14 08:44:08 +02:00
Jean-Pierre André 1261e6b60a Fixed the detection of the end of attribute list
The recent detection of a truncated attribute list entry overlooked the
normal detection of the end of list. Moreover the check for name
overflow is to be done later and not needed at this stage.
2021-07-26 08:49:45 +02:00
Jean-Pierre André a337c4c1eb Renamed ntfs_index_entry_consistent() as ntfs_index_entry_inconsistent()
The original name was error prone when checking the condition.
2021-07-19 09:23:23 +02:00
Jean-Pierre André 45141516d7 Renamed ntfs_attr_consistent() as ntfs_attr_inconsistent()
The original name was error prone while checking the condition.
2021-07-19 09:23:23 +02:00
Jean-Pierre André bb4456d339 Redesigned the INDEX_ROOT consistency checks
By ordering the values from smallest to biggest, there is less chance
to be caught by an arithmetic overflow.
2021-07-19 09:23:23 +02:00
Jean-Pierre André 81725f6a54 Made sure the requested compression block size is supported
Compressed files can only be opened if NTFS version < 3.0, and
the only supported compression block size is 16 clusters long.
2021-07-19 09:23:23 +02:00
Jean-Pierre André 4462f82580 Reset the resident attribute offset when appending from none
When there is no resident attribute value, its offset is unsafe, so better
to recompute it when appending data.
2021-07-19 09:23:23 +02:00
Jean-Pierre André 0911ef206d Rejected negative data length in an attribute list
The negative data length of an attribute list is an indication of a
probable corruption and must be rejected.
2021-07-19 09:23:23 +02:00
Jean-Pierre André b95b4ba1a5 Rejected negative data length in readall()
The negative data length of an attribute is an indication of a probable
corruption and must be rejected.
2021-07-19 09:23:23 +02:00
Jean-Pierre André e70d10d848 Added a check of the minimal length of some attributes
The minimal lengths of STANDARD_ATTRIBUTE and OBJECT_ID were not
checked and could lead to out-of-buffer access.
2021-07-19 09:23:23 +02:00
Jean-Pierre André 2bf5077804 Checked consistency of index blocks
Improved existing consistency checks of index blocks and grouped them
into a specific function.
2021-07-19 09:23:23 +02:00
Jean-Pierre André 55e7326350 Avoided endless recursions when allocating the main bitmap
Allocating clusters to the main bitmap may imply updating the bitmap
itself within a cluster not yet allocated. This can turn into endless
recursions and has to be rejected. Currently the bitmap is assumed
to be fully allocated.
2021-07-19 09:23:23 +02:00
Jean-Pierre André 61134117c1 Fixed checking the end of attrdef data
Incomplete attribute definitions have to be rejected.
2021-07-19 09:23:23 +02:00
Jean-Pierre André f85ce6ff2e Skipped errors for bad free clusters before they are computed
The count of free clusters may be updated while mounting before it
has been initialized, which may lead to irrelevant error messages.
Moreover the count is not computed at all in some ntfsprogs utilities.
So set up a flags to avoid outputting irrelevant errors.
2021-07-19 09:23:23 +02:00
Jean-Pierre André 67f959df96 Fixed the computation of the end of index entry
The end of an index entry is related to its full length, not to the
length of the key. Added an error message in an overflow case.
2021-07-12 08:31:18 +02:00
Jean-Pierre André 5c002438f2 Checked that indexes do not exceed the index block size
Make sure the used part of an index block fits into the allocated buffer.
Note : a negative size may cause overflow on 32-bit cpus.
(contributed by Rakesh Pandit)
2021-07-12 08:31:18 +02:00
Jean-Pierre André 20d700841b Shown in log the inode of directory read error
The unreadable directory record was poorly identified
2021-07-12 08:31:18 +02:00
Jean-Pierre André f30b52490f Restricted the attribute definition table size to 24 bits
The standard size is 2560 bytes. It can be extended for specific purposes,
but its former limit to 32 bits was unreasonable. Anyway ntfs-3g is
not committed to support non-standard situations.
2021-07-12 08:31:18 +02:00
Jean-Pierre André af1bc0f5ec Hardened the check of locations of MFT and MFTMirr
The MFT and MFTMirr may not be negative or overlap the boot sector.
2021-07-12 08:31:18 +02:00
Jean-Pierre André 7f45544ed7 Added and grouped generic attribute checks
Checked that attributes are [non-]resident when they have to be, and
grouped consistency checks on each of them in a dedicated function.
Consequenly request the checks where needed and remove existing index
checks.
2021-07-12 08:31:18 +02:00
Jean-Pierre André 436fe09f87 Checked consistency of index entries
Make sure the data and key in indexes do not overflow from index entries
2021-07-12 08:31:18 +02:00
Jean-Pierre André 32e858a87a Aborted mounting when cannot access standard information of MFT
The standard information of the MFT must be its first attribute in the
base record. If it is not accessible initially, we end up searching it
in an extent before the MFT struct is ready for that.
2021-07-12 08:31:18 +02:00
Jean-Pierre André 68ead9b8fc Checked expanded attribute does not overflow the space in use
When resizing an attribute, make sure the trailing data is moved in
the correct direction.
2021-07-12 08:31:18 +02:00
Jean-Pierre André 84478c4012 Checked attributes layout against length actually used
The end of the attributes must be checked against the space in use
rather than the allocated space. This contributes to the safety of
subsequent attribute resizing.
2021-07-12 08:31:18 +02:00
Jean-Pierre André ec7bf54377 Checked the MFTMirr lcn to be consistent with the boot sector
The lcn of the initial run of the MFTMirr data must be the same as
described in the boot sector. As a consequence this cannot be a hole.
2021-07-12 08:31:18 +02:00
Jean-Pierre André 4e094563d4 Checked $MFT data to be ready before fetching an extent 2021-07-12 08:31:18 +02:00
Jean-Pierre André e2e625065d Checked the layout of attribute list entries
Make sure the attribute list has at least one element, and that each of
them has the minimal size and does not overflow out of the end of list.
2021-07-12 08:31:17 +02:00
Jean-Pierre André 4e09b252af Checked name limits while looking up for an external attribute
Make sure the name of an attribute does not overflow beyond the
attribute length.
2021-07-12 08:31:17 +02:00
Jean-Pierre André f3999a74c6 Fixed consistency check of MFT attributes in ntfsfix
The consistency check could be defeated as a consequence of integer overflow.
Reorganize it to avoid such situations.
2021-07-12 08:31:17 +02:00
Jean-Pierre André fc295da55e Configured for version 2021.5.19 2021-05-19 15:18:56 +02:00
Jean-Pierre André a4177d625c Made sure an error code is issued for failed mounts
In case of failure to mount a file system, an error code is expected to
indicate the failure reason. In an unclear case the error code was not
set, so force an EIO when this happens.
2021-05-17 15:42:31 +03:00
Jean-Pierre André d86c34390d Added a consistency check of attribute size in readall()
Make sure the attribute designated to readall() has a reasonable size.
Apart from a bitmap, in a valid call, the attribute size is limited to
65536, and bitmaps are limited by the number of cluster.
2021-05-17 15:39:52 +03:00
Jean-Pierre André 37a330ea8c Improved the consistency checks of standard information
Make sure the standard information attribute has a valid size.
2021-05-17 15:39:13 +03:00
Jean-Pierre André 218d93b37b Cleaned the tail of compressed buffer before writing a full cluster
When appending to an existing compressed file, the last block must first
be decompressed. When doing so, clear the tail of buffer in order to not
leak unrelated data.
2021-05-17 15:38:20 +03:00
Jean-Pierre André 02e199978b Fixed initialization of a Posix ACL
A posix ACL record was not fully initialized.
2021-05-17 15:37:45 +03:00
Jean-Pierre André d60175230a Added consistency check of MFT attributes in ntfsfix
Make sure the searched attribute is fully within the MFT record and is
correctly aligned.
2021-05-17 15:36:58 +03:00
Jean-Pierre André 5bdfac9704 Added generic checks of MFT records in ntfsfix
Before acting on MFT, make sure it passes the consistency check.
2021-05-17 15:35:51 +03:00
Jean-Pierre André 8adc9c6184 Hardened consistency checks of MFT records
Check the record is properly aligned and does not flow beyond the
expected end of the record.
2021-05-17 15:35:02 +03:00
Jean-Pierre André bb0168e56b Rejected updates of uninitialized MFTMirr
Reject updating uninitialized MFTMirr because it leads to endless
recursions as updating the MFTMirr entry of MFT implies further updating
MFTMirr.
This is probably specific to ntfsfix, as mounts are normally rejected
when MFTMirr does not match MFT.
2021-05-17 15:33:41 +03:00
Jean-Pierre André 3f3b771cb0 Added consistency checks of index root
The index root must lie within the space allocated for it.
2021-05-17 15:33:04 +03:00
Jean-Pierre André 00a5478625 Added check of layout of attributes
Make sure the attributes fully lie within the MFT record, and make sure
their variable components (name, runlist, value) fully lie within the
attribute.
2021-05-17 15:31:52 +03:00
Jean-Pierre André 1258474e07 Improved check of upcase table length
The consistency check on the upcase size was laxist.
The unicode points are limited to 1048575 (20 bits), but there is no
provision to support code points beyond 65535.
In the current implementation the upcase size must be even and <= 131072.
2021-05-17 15:30:17 +03:00
Erik Larsson a4a837025b Add the official git repository location to the README file. 2021-03-05 14:56:40 +02:00
Erik Larsson 442e12fc32 Update outdated copyright notice. 2021-03-05 14:56:38 +02:00
Erik Larsson e464ca7574 Update last two entries in README to match style of previous entries. 2021-03-05 14:56:36 +02:00
Erik Larsson 83b66b3f39 Change http links in README to https for security. 2021-03-05 14:56:34 +02:00
Erik Larsson 3a53515016 Update README to mention support for Windows 8 and 10 NTFS formats. 2021-03-05 14:56:32 +02:00
Erik Larsson 477a4dfe5e ntfscp.c: Fix improper unsigned const endianness macro for signed type. 2021-03-05 14:56:31 +02:00
Jean-Pierre André 2ede3b67ee Improved checking of the location of MFT
Terminate cleanly when the MFT is improperly located, by making sure it
is located within the volume and that it contains its own data.
2021-03-05 10:21:36 +01:00
Jean-Pierre André e5ee8b325c Signalled support of UTIME_OMIT to external libfuse2
The external libfuse2 optionally uses UTIME_OMIT to tell whether mtime
or ctime should not be changed in a utimensat(2) call. Set the flag
flag_utime_omit_ok so that it knows that ntfs-3g supports this feature.
Note : this is the default with internal libfuse and with libfuse3.
2021-03-05 10:05:24 +01:00
Erik Larsson dd75ea7420 configure.ac: Fix obsolete 2-argument AM_INIT_AUTOMAKE invocation.
The 2-argument form has been replaced with fetching the package/version
information from autoconf (AC_INIT). Instead the 1-argument form takes a
list of automake options but we currently do not need to specify any.
2021-03-03 16:39:45 +02:00
Erik Larsson bcd42e5ef3 configure.ac: Respect 'with_fuse' user setting on non-Linux/Solaris.
Previously the configure script simply disregarded the value of the
'with_fuse' flag on non-Linux/Solaris systems. This is not unreasonable
since the 'internal' option doesn't work on those systems, however in
some situations we want to specify the libfuse CFLAGS/LDFLAGS manually
and bypass the pkg-config check with '--with-fuse=none' and this was not
possible with this logic. So add a special test to bypass the automatic
determination when the user has specified a 'with_fuse' value.
2021-02-26 08:09:18 +02:00
Erik Larsson da1b61ec22 lowntfs-3g.c: Fix compile error when building with libfuse < 2.8.0.
The libfuse function 'fuse_lowlevel_notify_inval_inode' is only
available starting with libfuse 2.8.0 while we advertise compatibility
with FUSE 2.6.0 as the baseline. So add a preprocessor check to exclude
this code from libfuse < 2.8.0.
2021-02-25 17:13:24 +02:00
Jean-Pierre André 56b8e713d5 Fixed a constant string concatenation
Adjust for recent compilers requiring a space between concatenated strings.
2021-01-26 10:06:18 +01:00
Jean-Pierre André 094f9b3f2d Fixed a minor endianness ajustment bug
The endianness ajustment was the wrong one though it did the correct thing.
2021-01-26 10:06:18 +01:00
Jean-Pierre André 894b7dd36e Checked the locations of MFT and MFTMirr at startup
On startup make sure the lcns of the MFT and the MFTMirr are not null and
they are different, so that the mounting is denied gracefully if they are.
2021-01-26 10:06:18 +01:00
Jean-Pierre André 5d46b32b91 Enabled Recording the special files the same way as WSL
Optionally record the special files (symlinks, fifos, sockets, character
and block devices) using reparse points instead of using Interix representation.
Doing so, the special files are interoperable with Windows Subsystem for
linux (WSL).
2021-01-26 10:06:18 +01:00
Jean-Pierre André 172da09947 Dropped rejecting having both EA and reparse data
Windows traditionally rejected having both EA and reparse data assigned
to a file, but Windows 10 has dropped the constraint and it uses this
condition massively, so do the same. Note that pre-Windows 10 chkdsk.exe
removes the EA' on reparse points, potentially damaging more recent
volumes.
2021-01-26 10:06:17 +01:00
Jean-Pierre André 8073ab6764 Supported use of WSL special file
The Windows Subsystem for Linux (WSL) of Windows 10 uses reparse points
to record special files (symlinks, fifos, sockets, char or block devices).
Honor such reparse points with the same meaning as WSL.
2021-01-26 10:06:17 +01:00
Jean-Pierre André a67746c8a8 Relocated the mount point field in volume
The location of the mount point field in the volume attributes was
dependent on compiling options, thus creating an uneasy dependency
for plugins. So relocate the field to be independent on options.
2021-01-26 10:06:17 +01:00
Jean-Pierre André 8fa3dd3f22 Defined ntfs_realloc() and ntfs_free()
Currently memory allocations are done through ntfs_malloc() and
ntfs_calloc(), but releases are done through free(3). Defining an
ntfs_free() relay facilitates the debugging of memory leaks in
plugins.
2021-01-26 10:06:17 +01:00
Jean-Pierre André 76fe04d03d Built reparse symlinks from mount point recorded in volume
When building a symlink to emulate a Windows junction or absolute
symlink, use the mount point recorded in the volume attributes.
This enables the plugins to emulate object as symlinks.
2021-01-26 10:06:17 +01:00
Jean-Pierre André c3c5c77be3 Checked file type on OpenIndiana when deleting a file with a reparse point
On OpenIndiana a check is needed to ensure directories are not removed
by rm(1) and files not removed by rmdir(1)
2021-01-26 10:06:17 +01:00
Jean-Pierre André b086c9ef73 Inserted the reparse tag in the bad reparse symlink
The reparse tag is not quoted in the "unsupported reparse point"
fake symlink shown when a reparse point cannot be processed. The tag
is useful to determine which plugin, if any, is missing.
2021-01-26 10:06:17 +01:00
Jean-Pierre André 02673bd04a Enabled actions on directories in reparse plugins
The plugins triggered by reparse points can now act on a directory
through link(2) unlink(2) and creat(2).
2021-01-26 10:06:17 +01:00
Jean-Pierre André 4b8a660006 Fixed maintining the allocated size when updating sparse files
When filling a hole in a sparse file, the beginning of the runlist
does not need to be updated. However the allocated size is within
the extent holding its beginning and it needs to be updated.
2020-11-18 11:33:49 +01:00
Jean-Pierre André 7bcae8743f Allowed customization of sbin for tool directory
Enabled the configure option --sbindir to define where a few ntfsprogs
tools should be installed
2020-11-18 11:29:05 +01:00
Erik Larsson 903db231ec Change default xattr access method to 'openxattr' for macOS builds.
The namespaced way of accessing extended attributes doesn't make sense
in macOS which doesn't use namespaces.
2020-08-25 11:29:42 +03:00
Erik Larsson 1511a5ca51 Add support for 'position' argument in macOS xattr functions.
The 'position' argument is only used for the legacy resource fork and is
disallowed for other extended attributes. The name check is placed first
in the functions as this is how macOS behaves (EINVAL is returned if the
attribute is not the resource fork attribute and the position is non-0
even when the attribute does not exist).
2020-08-25 11:26:29 +03:00
Erik Larsson 4ecc13c0ac Replace ENODATA with ENOATTR in xattrs functions for macOS builds.
The contract in macOS xattr functions is to return ENOATTR when an
extended attribute cannot be found.
2020-08-24 16:50:18 +03:00
Jean-Pierre André 39579a045d Fixed possible null dereferencings
A null directory pointer could appear as being dereferenced. Fix that,
though it probably never occurs in real conditions.
2020-08-14 12:03:09 +02:00
Jean-Pierre André cd68a084fc Recovered space when an index root is shortened
In rare situations, removing an entry from an index root while
rebalancing the index tree, its space was not recovered from the index
root, causing chkdsk to complain. Truncate the index root when this
happens.
2020-08-14 11:57:02 +02:00
Jean-Pierre André d6558f1dea Defined option "posix_nlink" to compute a Posix compliant st_nlink
When the mount option "posix_nlink" is used, the number of links
returned by stat complies with Posix : the legacy 8.3 names are not
taken into account, and the subdirectories are taken into account
for directories. This causes some overhead for recomputing the
number of links.
2020-08-14 11:50:35 +02:00
Jean-Pierre André 1bc996f52f Avoided information leak when processing garbled compressed data
When a compressed file has been deteriorated through hardware error
or accidental overwriting, some unrelated data could be leaked.
Make sure to zero fill the buffer when this happens.
2020-08-14 11:36:57 +02:00
Jean-Pierre André 6bdd1e85ac Displayed the plugin path in the basic help message
The ntfs-3g plugin directory depends on the distribution and may be
difficult to determine. This displays the directory in the basic help.
2020-08-14 11:32:50 +02:00
Jean-Pierre André 5d6fd5c2d2 Used kernel cacheing on read-only mounts or with lowntfs-3g
Kernel cacheing is now safe when using lowntfs-3g on Linux. It is also
safe on read-only mounts with both ntfs-3g and lowntfs-3g.
2020-08-14 11:27:24 +02:00
Jean-Pierre André 4163390f2b Fixed defining the request argument of ioctl()
An occurrence of changing the request from int to unsigned long was
missing.
2020-03-08 10:34:17 +01:00
Jean-Pierre André 3f65ccd949 Exported the translations of Windows paths
The translations of Windows paths designed for translating Windows symlinks
and mount points may also be used in plugins for translation execlinks,
so make them available.
2020-03-08 10:17:21 +01:00
Jean-Pierre André 7cd46f95df Fixed object types returned in readdir() for reparse points
The types of reparse point objects cannot be decided upon the data
available in a directory, so we must delegate their determination to a
specific plugin when available, and be consistent if there is none.
2020-03-08 10:03:23 +01:00
Jean-Pierre André aecd9f011e Decoded execlink reparse data
Add execlink to the list of recognized reparse tags.
2020-03-08 09:57:27 +01:00
Jean-Pierre André 4c8d97cbd2 Fixed ntfsfallocate on a void file
The situation when there were no runlist when ntfsfallocate is applied
was not taken into account.
2020-03-08 09:51:48 +01:00
Jean-Pierre André eddd96f9e6 Fixed a poorly sized string in ntfsinfo
A string overflow was possible, extend its size to worst case.
2020-03-08 09:44:52 +01:00
Jean-Pierre André 8e01e1ed65 Fixed a wrong fallthrough situation in ntfscat
A fallthrough situation was not intentional.
2020-03-08 09:42:15 +01:00
Jean-Pierre André 004709fcc1 Silenced warnings about fallthrough situations in switch cases of ntfsprogs
Insert comments to silence compiler about fallthrough situations when
they are wanted.
2020-03-08 09:38:00 +01:00
Jean-Pierre André b68c27ea74 Silenced warnings about string lengths in snprintf()
Adjust string lengths to the worst case estimated by the compiler, even
though they cannot be reached.
2020-03-08 09:29:04 +01:00
Jean-Pierre André c5530af508 Silenced warnings about fallthrough situations in libntfs-3g
Insert a comment when fallthrough situations are desired in switch cases.
2020-03-07 12:00:11 +01:00
Jean-Pierre André ef61c82529 Avoided using a truncate strncpy() in the fuse library
Replace strncpy() by memcpy() when the exact size if known, thus
silencing the compiler warnings.
2020-03-07 11:56:46 +01:00
Jean-Pierre André 688578c1a6 Removed <linux/fs.h> from lowntfs-3g.c
The headers from <linux.fs.h> now conflicts with <sys/uio.h> and are
not needed any more, so remove them.
2020-03-07 11:50:26 +01:00
Jean-Pierre André 39384c8a1b Disabled the use of cache in lowntfs-3g
Following some change in the Linux kernel, the kernel cacheing of
attributes is not satisfactory (at least the number of hard links is
not refreshed), and has to be disabled.
2020-03-07 11:43:49 +01:00
Jean-Pierre André aa7af7d53b Fixed returning EPERM when not allowed as owner
For actions which may be allowed depending on the ownership rather than
permissions (such as utime()), return EPERM if the owner cannot be
determined.
2020-03-07 11:35:48 +01:00
Jean-Pierre André 314b5396bd Fixed returning errno in setxattr
In case of error in setxattr, it must be returned in errno instead
of the return value.
2020-03-07 10:51:53 +01:00
Jean-Pierre André 2c6472ee5a Accepted alternative recording of cluster size
Since Windows 10, the cluster size may be greater than 128 sectors, and
it has to be recorded as a power of 2 in the boot sector. Hence there
are two possible ways of cluster size. Accept both ways leading to
valid values.
2020-03-07 10:43:00 +01:00
Jean-Pierre André 32c27a8a4f Defined the request argument of ioctl() as unsigned long
On linux the request argument of ioctl() is defined as an unsigned long,
but the fuse protocol squashes it into a signed int. As a consequence
the value received by ntfs-3g may appear as negative and different from
the value defined by the corresponding macro.
So define the request argument as unsigned long in ntfs-3g. It has
however to be fed as unsigned from fuse until the fuse protocol is
updated.
2020-03-07 10:31:12 +01:00
Jean-Pierre André 3433dd0b3c Updated the copyright notice
Updated the copyright notice to 2019
2020-03-07 10:18:01 +01:00
Jean-Pierre André b9ad82ced7 Truncated SSD trimming zones to granularity supported by the device
When the trimming granularity is greater than the cluster size, the
free zones have to be truncated to match the granularity.
2019-01-23 17:43:47 +01:00
Jean-Pierre André 1ae6d818f0 Returned a low level error when an ioctl fails
When an ioctl fails, the errno is not correctly propagated, and the
log was wrong.
2019-01-23 17:40:23 +01:00
Jean-Pierre André 006799ab80 Fixed an endianness error in ntfscp
The file timestamp was not set according to CPU endianness.
2019-01-23 17:38:10 +01:00
Jean-Pierre André facb697303 Fixed reacting to missing plugin
When a plugin is missing, dlopen() does not set errno, which leads
to erratic behavior. Set errno as ELIBACC when this occurs.
2019-01-23 17:33:15 +01:00
Jean-Pierre André 96825f3c2b Cleaned object ids beyond the updated part
An earlier patch enabled updating a file proper id without changing
the other id (birth, volume, domain). However the first time the id
is set, these other ids have to be zeroed.
2019-01-23 17:27:25 +01:00
Jean-Pierre André 7a3ed93463 Reverted accessing reparse directories through internal plugins
As similar reparse tags are being used for accessing OneDrive files
and directories, a similar policy has to be used for accessing them.
Until giving full access to OneDrive files with a local copy is
mature enough to have it processed internally, it is safer to have
it delegated to an external plugin. This reverts [4f450a]
2019-01-23 17:13:12 +01:00
Jean-Pierre André da39fbf24a Fixed reporting an error when setxattr is rejected
When permissions are enabled and setxattr() is rejected, an error
must be returned even though the option silent is set. This is needed
for "cp -p" to know it has to try setting the permissions again and use
chmod().
2018-12-19 16:01:53 +01:00
Jean-Pierre André 85c1634a26 Fixed reporting an error when failed to build the mountpoint
The size check was inefficient because getcwd() uses an unsigned int
argument.
2018-12-19 15:57:50 +01:00
Jean-Pierre André f424cea20a Fixed a typo in the ntfscluster manual
An essential word was missing.
2018-12-19 15:53:08 +01:00
Jean-Pierre André 1ea2003e96 Realigned times set from extended attribute
The alignment of times set in an extended attribute value cannot be
asserted, and this cause alignment errors on some CPUs (met on ARM).
Be safe by copying them in a properly aligned array.
2018-12-19 15:48:03 +01:00
Jean-Pierre André e87c853551 Fixed collecting the label argument in mkntfs
The label argument could be wrongly interpreted, depending on the syntax
use to state the options.
2018-08-22 09:46:30 +02:00
Jean-Pierre André 2514ce6a42 Attempted mounting read-only after failed permission to read-write
If a partition image could not be opened read-write, retry as read-only
2018-08-22 09:43:19 +02:00
Jean-Pierre André d52b1ca929 Removed an unused field (cleanup)
Cleanup imported from the fuse library project.
2018-08-02 16:51:57 +02:00
Jean-Pierre André 9a8aeeea13 Prevented locally defined headers from interfering with ntfs-3g ones
Order the include directories so that those defined for ntfs-3g have
priority over locally defined ones.
2018-08-02 16:47:16 +02:00
Jean-Pierre André 90c361e7f8 Allocated full clusters for reading and rescuing in ntfsclone
Even though mft or index records may be smaller than a cluster,
reading and rescuing them is done on a full cluster base, so
full clusters must be allocated for processing them.
2018-08-02 16:41:19 +02:00
Jean-Pierre André f862fcee00 Extended the allowed cluster size to 2MB
From Windows 10 Creators edition, the cluster size limit has been
extended to 2MB. This has implied redefining the boot sector field
"sectors_per_cluster" so that values greater than 128 can be recorded.
2018-06-01 16:29:01 +02:00
Jean-Pierre André e758709a2c Appended a number to undeleted file name to avoid overwriting an existing one
When an undeleted file name conflicts with an existing one, it is
renamed in order to preserve the existing one.
2018-06-01 16:21:33 +02:00
Jean-Pierre André a951ed7f61 Added an option to ntfscp to copy the modification time
When using option -t the modification timestamp is copied by ntfscp
2018-06-01 16:18:51 +02:00
Jean-Pierre André 4f450a35f5 Made accessing reparse directories through internal plugins
When the bit 28 of a reparse tag is set on a directory, the reparse
information should be ignored and the directory should be accessed
the usual way (this setting is new to Windows 10). In such a situation
access to the directory through an internal plugin rather than through
an external one.
The same policy applies to REPARSE_TAG_WCI which had been defined
earlier without the bit 28 being set.
2018-06-01 16:08:33 +02:00
Jean-Pierre André ad79372024 Checked whether the device to mount was forced read-only
Force the read-only mount mode when the device was set so through a
command "blockdev --setro".
2018-06-01 15:59:09 +02:00
Jean-Pierre André 1f8b751341 Double-checked whether record 15 is an extent of MFT
When extents are needed to store the runlist of the MFT, the first one
must be located in record 15 so that its location can be determined from
the part in the base extent. As this record is always marked in use,
determining whether it is not really in use requires a specific logic.
2018-02-13 09:06:49 +01:00
Jean-Pierre André f334c1fdc3 Delayed updating the MFT runlist when resizing in read-only mode
When trying a resize in "no action" (read-only) mode, and the MFT runlist
has to be reorganized to take its new fragmentation into account, the updated
runlist cannot be read from the device while updating the runlist of
normal files. To avoid having to read the updated runlist, the update
is delayed so that the original runlist is used. As a consequence the test
of reorganizing the runlists is only an approximation of what would happen
in a real resize.
2018-02-13 08:54:12 +01:00
Jean-Pierre André 163635f08f Fixed displaying an inode number in an error message
In an error message, the inode number was displayed in decimal without
taking off its generation number, making it difficult to interpret.
2018-02-13 08:47:00 +01:00
Jean-Pierre André b30460fede Removed an obsolete reference for getting support
Remove from the ntfsresize man page an archaic url for getting support.
2018-02-13 08:43:53 +01:00
Jean-Pierre André 3243e62396 Supported reparse tags for OneDrive cloud storage
Newer versions of Windows 10 use several reparse tags for files which
are synchronized to OneDrive cloud storage (0x9000301a, 0x9000601a,
0x9000701a, ...). identify them as IO_REPARSE_TAG_CLOUD and use a
single plugin to process them.
2018-01-15 11:04:29 +01:00
Jean-Pierre André 5239986093 Silenced compiler warnings in ntfsrecover
Silence the compiler warnings which were introduced in a recent update.
2017-12-22 11:37:58 +01:00
Jean-Pierre André 85e208176f Stopped checking matches of MFTMirr against MFT at record 16
Since its 2017 edition, Windows 10 has stopped mirroring $MFT to the
full size of $MFTMirr leading to mounts of partitions with big clusters
to be rejected because of mismatches. With this patch, only 16 records
are checked, though mirroring is still done for all records in $MFTMirr.
2017-12-22 11:29:00 +01:00
Jean-Pierre André d99a376a90 Documented read-only mount when Windows is hibernated
Document an earlier update which forced read-only mode when mounting
a partition which has been left by Windows in an inconsistent state
through hibernation or fast restarting.
2017-12-22 11:26:08 +01:00
Jean-Pierre André 9e92184b7c Allowed setting a file object id without defining its birth ids
Object ids can be used to locate files which have been move to another
volume. This is only possible when the birth ids are recorded, but in most
cases files reside on their birth volume and their birth ids are not set.
The patch enables setting a file id without changing its birth id, by
setting an extended attribute "system.ntfs_object_id" limited to 16
bytes.
2017-12-22 11:24:58 +01:00
Jean-Pierre André 1f863fef7d Processed redo log actions associated to undoing a CompensationlogRecord
At least when there is a shortage of space on the target device, several
redo actions are associated to undoing a CompensationlogRecord, and they
should be redone upon recovery.
2017-10-26 10:44:36 +02:00
Jean-Pierre André f06672a02c Checked log file blocks more recent than temporary ones
Under some circumstances, the temporary log file blocks are not the
latest ones, so check whether there are more recent ones.
Only done for log version 1.x, as log version 2.x follow a different
logic.
2017-10-26 10:40:17 +02:00
Jean-Pierre André 02747ea647 Aligned internal log buffers on CPUs which require them
The generic buffer structure should respect the alignment of included
log structures. This is required by some CPUs (such as Sparc).
2017-10-26 10:33:29 +02:00
Erik Larsson a0bc659c7f lowntfs-3g.c: Fix compile error when struct stat doesn't have st_*tim.
The struct members for the time fields in struct stat vary depending on
platform, so introduce #ifdefs using the config.h-supplied definitions
for determining which stat time definition is appropriate.
2017-09-20 04:56:06 +02:00
Jean-Pierre André 4128e9da58 Logged falling back to mounting read-only
When the ntfs image is unclean, usually because it was not unmounted
properly from Windows, mounting read-write is denied and falls back
to read-only. Log this situation in the syslog, so that users mounting
through /etc/fstab can more easily know what is going on. Also remove
the "rw" option if it was stated.
2017-08-11 09:56:44 +02:00
Jean-Pierre André 45ba639781 Decoded more reparse tags in ntfsinfo
Displayed some information in ntfsinfo output about a few new types of
reparse point brought by Windows 10.
2017-08-11 09:52:54 +02:00
Jean-Pierre André 1611b21908 Enabled directory operations in plugins
Windows 10 brought a new type of reparse point for directories (0x80000018),
so add opendir() and readdir() to the plugin interface to take directories
into account. The interface for releasedir() is merged with release() as
the plugins can discriminate them if needed.
2017-08-11 09:42:37 +02:00
Jean-Pierre André 67feb2c286 Relaxed limitations on security descriptors
Windows 10 brought security descriptors which contain ACE's related to
new ways of accessing files or directories. These ACE are now accepted
with minimal consistency checks. They are still ignored for translating
permissions and for Windows-type inheritance.
2017-08-11 09:34:31 +02:00
Jean-Pierre André d108009c7c Fixed a typo
A typo made a directive for plugin developers difficult to understand
2017-08-11 09:29:52 +02:00
Jean-Pierre André cdd58aaee3 Fixed updating the vcn of subtree in ntfsrecover
The logic for determining where the actions SetIndexEntryVcnRoot and
SetIndexEntryVcnAllocation had to insert a new vcn was unclear and was
wrong in some situations. This is to fix the logic as determined by new
evidence.
2017-06-20 08:56:00 +02:00
Jean-Pierre André 866f5cf9e6 Mentioned ntfsfallocate and ntfsrecover in the general ntfsprogs manual
The most recent ntfsprogs utilities should be referenced in the table of
contents.
2017-06-20 08:51:09 +02:00
Jean-Pierre André 5be0b9f62a Fixed the computation of highest_vcn when applying a runlist fixup
When a file is partially truncated, the highest_vcn has to be recomputed
before the file size is adjusted. As a consequence the unmapped run
inserted at the end of runlist to match the file size should not be taken
into account when determining the higest_vcn.
2017-05-25 10:52:54 +02:00
Jean-Pierre André 1797ab5ecd Upgraded ntfsrecover to support log files 2.0
When the fast restart mode of Windows 8 (or later) is activated, the
log file format is different (version 2.0 instead of 1.1), having 32
temporaty blocks instead of 2. This patch upgrades ntfsrecover to take
the new format into account.
2017-05-25 10:44:18 +02:00
Jean-Pierre André ba810877ca Bypassed cluster allocation errors using --ignore-fs-check in ntfsclone
When using option --ignore-fs-check in ntfsclone, doubly allocated cluster
still lead to aborting the process. Bypassing the error is useful for
creating a metadata image intended for debugging, for example when the
partition was not closed properly and the logfile has to be applied to
restore the integrity of metadata.
2017-05-25 10:28:05 +02:00
Jean-Pierre André adb2cd24a8 Version 2017.3.23 2017-03-23 10:39:59 +01:00
Jean-Pierre André 79ea3b49b1 Fixed computing the replacement bytes in ntfswipe
The computing of replacement bytes for overwriting undeletable files
uses random values and standard ones instead of the values provided in
option --bytes. Fix the mixup between both logics, mention the difference
in the documentation and reject defining both options --bytes and --undel.
2017-03-22 17:49:40 +01:00
Erik Larsson b11a5ea91b ntfsusermap.c: Fix warning about implicit conversion between enums. 2017-03-21 12:06:04 +01:00
Erik Larsson f0d3751c98 Fix bad native->little endian byteswap of little endian value. 2017-03-21 11:58:30 +01:00
Erik Larsson 65f63fe2b3 Use signed endian conversion macros for signed little-endian members. 2017-03-21 11:55:41 +01:00
Jean-Pierre André 275edd5353 Removed the loader from boot image
The license for using the boot loader which used to be inserted by mkntfs
is unclear, so remove it, and only keep the boot sector restricted to
what is needed for having it recognized as such. The space for a loader
is still reserved so that an operating system being installed can insert
its own loader.
2017-03-18 15:42:00 +01:00
Jean-Pierre André 0595f888ae Version 2017.2.15 2017-02-15 17:04:57 +01:00
Jean-Pierre André a07b7edebd Loaded the fuse kernel module with no environment
Avoided leaking the current environment when loading the fuse kernel
module
2017-02-11 11:03:02 +01:00
Jean-Pierre André 7a0cf11e1c Fixed expanding $STANDARD_INFORMATION with almost-full MFT record
When setting a security descriptor on an NTFS v1.2 format file in an
NTFS v3.0+ volume, NTFS-3G would migrate $STANDARD_INFORMATION to the
new format, which requires extending its size from 48 to 72 bytes.  If
this happened while the file's MFT record was almost full, and none of
the file's attributes could be made non-resident, and the file did not
have an attribute list attribute, then the operation would unexpectedly
fail with ENOENT.  Fix this by adding an attribute list to the file in
this situation.

(contributed by Eric Biggers)
2017-02-11 10:58:46 +01:00
Jean-Pierre André 17b56ccfa2 Allowed names with trailing dot or space on conditions
Windows places filenames with a trailing dot or space in the Win32
namespace and allows setting DOS names on such files.  This is true even
though on Windows such filenames can only be created and accessed using
WinNT-style paths and will confuse most Windows software.  Regardless,
because libntfs-3g did not allow setting DOS names on such files, in
some cases it was impossible to correctly restore, using libntfs-3g, a
directory structure that was created under Windows.

Update ntfs_set_ntfs_dos_name() to permit operating on a file that has a
long name with a trailing dot or space.  But continue to forbid creating
such names on a filesystem FUSE-mounted with the windows_name option.
Additionally, continue to forbid a trailing a dot or space in DOS names;
this matches the Windows behavior.

(contributed by Eric Biggers)
2017-02-11 10:54:51 +01:00
Jean-Pierre André 1178a7a801 Fixed setting opening contexts for plugins
The opening context was incorrectly passed to plugins by lowntfs-3g

(contributed by Eric Biggers)
2017-02-11 10:44:02 +01:00
Jean-Pierre André 94677ae961 Accepted displaying bad security descriptors on conditions
Display security descriptors in ntfssecaudit when they appear as
correctly formed, even when they contain unsupported items.
2017-02-11 10:37:47 +01:00
Jean-Pierre André ea9b8a487c Fixed memory leak when failing to lookup an index
When an index could not be used, the search context was not freed
2017-02-11 10:29:39 +01:00
Jean-Pierre André d69d2d9a1f Got ready for Posix ACL support in fuse kernel
Following a recent patch to the fuse kernel, the Posix ACL checks can
be done within the kernel instead of having to be done in the file
system, provided lowntfs-3g is used.

This mode is still not used by default until the fuse patch is
released by distributions.
2017-02-11 10:21:07 +01:00
Jean-Pierre André 35cb222233 Removed unused argument from ntfs_make_symlink()
Now that the size of the reparse point attribute is no longer used by
the FUSE drivers to populate st_size for symlinks and junctions, it no
longer needs to be returned by ntfs_make_symlink().

(contributed by Eric Biggers)
2017-02-11 10:11:01 +01:00
Jean-Pierre André 051a4b556b Returned the size of locale encoded target as the size of symlinks
Made ntfs-3f conform to the standard POSIX convention of setting st_size
to the length of the symlink target without a terminating null.

(contributed by Eric Biggers)
2017-02-11 10:04:15 +01:00
Jean-Pierre André 376f4cbca7 Validated minimum size of mountpoint/symlink reparse points
valid_reparse_data() would read past the end of the reparse point buffer
if it was passed a malformed reparse point that had the tag for a
mountpoint or a symlink but had a data buffer smaller than expected.
Fix this by validating the buffer size.

(contributed by Eric Biggers)
2017-02-11 10:00:34 +01:00
Jean-Pierre André 3c5fb9b352 Eliminated unnecessary strlen() in ntfs_get_ntfs_dos_name()
Since ntfs_ucstombs() returns the output string length, there is no need
to call strlen().

(contributed by Eric Biggers)
2017-02-11 09:58:30 +01:00
Jean-Pierre André 2052b46639 Fixed a possible buffer overrun in ntfs_utf16_to_utf8()
If an output buffer was provided, ntfs_utf16_to_utf8() limited the
output string length without the terminating null to 'outs_len'.  This
was incorrect because a terminating null was always added to the string,
causing a buffer overrun if the output string happened to have exactly
the maximum length.  This was a longstanding bug.  Fix it by leaving
space for a terminating null.

(contributed by Eric Biggers)
2017-02-11 09:51:17 +01:00
Jean-Pierre André b9624542e0 Made utf16_to_utf8_size() always honor @outs_len
utf16_to_utf8_size() was not guaranteed to fail with ENAMETOOLONG if the
computed length was greater than @outs_len.  This could cause a buffer
overrun in ntfs_utf16_to_utf8().

(contributed by Eric Biggers)
2017-02-11 09:49:03 +01:00
Jean-Pierre André e60056d377 Preventing --enable-plugins from disabling the plugins
The plugins are enabled by default, and the can be disabled by the
configure option --disable-plugins, but the option --enable-plugins
also led to disabling them.
2017-02-11 09:36:30 +01:00
Jean-Pierre André b337582d36 Fixed DISABLE_PLUGINS as the condition for not using plugins
The condition for using plugins did not match the definition by
./configure
2017-02-11 09:33:27 +01:00
Jean-Pierre André c314a8115b Fixed nesting when not using plugins
The logical nesting (defined by {...}) did not match the physical nesting
(defined by #ifdef...#endif)
2017-02-11 09:26:58 +01:00
Jean-Pierre André 8f0fbd286d Fixed updating the backup boot sector in ntfslabel
The location of the backup boot sector was one-off
2017-02-11 09:22:50 +01:00
Jean-Pierre André fa0a7a5686 Logged more information when a plugin could not be loaded
Put the explanation from dlerr() into the syslog when a plugin could
not be loaded.
2017-02-11 09:15:33 +01:00
Jean-Pierre André 2eb5052480 Decoded the reparse tag for deduplication in ntfsinfo
Take into account the reparse tag for deduplication and display its meaning
2017-02-11 09:11:51 +01:00
Jean-Pierre André 30ae872b89 Included <paths.h> where useful in fuse-lite
Both fusermount.c and mount_util.c use _PATH_MOUNTED, so they should
include <paths.h>, which provides this definition.
This is required for building with the musl C library.

Contributed by Thomas Petazzoni
2017-02-11 09:08:22 +01:00
Jean-Pierre André 28c479af6a Denied creating/removing files or directories from $Extend
$Extend is a directory reserved for metadata specific to Windows.
Inserting other files or directories there leads to problems with
some Windows versions.
2017-02-11 09:00:49 +01:00
Jean-Pierre André b66f5f8241 Replaced secaudit by ntfssecaudit in its own usage output
The usage output did not match the command name change
2017-02-11 08:57:37 +01:00
Jean-Pierre André fdefd8feba Fixed bad indentations (cosmetic) 2017-02-11 08:53:20 +01:00
Jean-Pierre André 32587b485c Improved opening/closing $Secure when un/mounting NTFS volume
Call ntfs_close_secure() earlier, check for error, and other cleanups

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-09-02 08:30:07 +02:00
Jean-Pierre André d4dfa18f7d Corrected code with misleading indentation
GCC 6 reports a warning in ntfs_allowed_dir_access() because the code has
misleading indentation.  Fix by adding braces.  There is no actual change
in behavior because of the '(allowed == 2)' condition.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-28 16:30:05 +02:00
Jean-Pierre André f86c4403ed Corrected validation of multi sector transfer protected records
The validation contained an off-by-one error.  The
expression '(u32)(usa_ofs + (usa_count * 2)) > size' used 'usa_count'
after it had been decremented to skip the update sequence number entry.
Consequently, the code could read out of bounds, up to two bytes past the
end of the MST-protected record.

Furthermore, as documented in the comment in layout.h for "NTFS_RECORD"
and also on MSDN for "MULTI_SECTOR_HEADER", the update sequence array
must end before the last le16 in the first logical sector --- not merely
before the end of the record.

Fix the validation and move it into a helper function, as it was done
identically in the read and write paths.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-28 16:26:21 +02:00
Jean-Pierre André 2840e84a97 Always opened $Secure when mounting NTFS volume
Currently, applications that wish to access security descriptors have to
explicitly open the volume's security descriptor index ("$Secure") using
ntfs_open_secure().  Applications are also responsible for closing the
index when done with it.  However, the cleanup function for doing,
ntfs_close_secure(), cannot be called easily by all applications because
it requires a SECURITY_CONTEXT argument, not simply the ntfs_volume.
Some applications therefore have to close the inode and index contexts
manually in order to clean up properly.

This proposal updates libntfs-3g to open $Secure unconditonally as part
of ntfs_mount(), so that applications do not have to worry about it.

This proposal updates libntfs-3g to open $Secure unconditonally as part
of ntfs_mount(), so that applications do not have to worry about it.

ntfs_close_secure() is updated to take in a ntfs_volume for internal use,
and ntfs_destroy_security_context() is now the function to call to free
memory associated with a SECURITY_CONTEXT rather than a ntfs_volume.

Some memory leaks in error paths of ntfs_open_secure() are also fixed.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-28 16:22:16 +02:00
Jean-Pierre André ab4c6a6141 Fixed tautological comparison
Wrong comparison in ntfscmp.c
2016-07-28 16:19:29 +02:00
Jean-Pierre André e6cbd4d221 Removed unused variables
A few variables in xattrs.c are not used any more
2016-07-28 16:16:42 +02:00
Jean-Pierre André 043b0e6e73 Allowed using full library API on systems without extended attributes support
A number of functions in libntfs-3g are generally useful, but are tied to
extended attributes support and are not included when the library is
built on platforms without extended attributes support.

This proposal updates libntfs-3g to always include these functions.

The only tricky part is dealing with the XATTR_CREATE and XATTR_REPLACE
flags.  These flags are defined in <sys/xattr.h>, so they must be
redefined on platforms without extended attributes support.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-28 16:13:59 +02:00
Jean-Pierre André 4264f19acb Cleaned up file name collation code
- Update documentation for COLLATION_RULES
- Document how ntfs_names_full_collate() compares names
- Update comments and DEBUG code to reflect that ntfs_names_full_collate()
  always access 'upcase', even in CASE_SENSITIVE mode
- Remove unneeded assignments to 'c1' and 'c2' in IGNORE_CASE mode

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-28 16:10:14 +02:00
Jean-Pierre André 54b78660d7 Allowed dlopen API to be either in libc or libdl
On Linux, the functions in the dlopen API are in libdl.  However, on
FreeBSD, libdl doesn't exist and the functions are instead in libc.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-19 11:53:28 +02:00
Jean-Pierre André 0babe3c0db Made plugin.h include all prerequisite declarations
Only <plugin.h> to be included in plugins code.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-19 11:50:32 +02:00
Jean-Pierre André 68dec8ddbc Renamed include guard for plugin.h to _NTFS_PLUGIN_H
Be consistent with other NTFS-3G headers and use the "_NTFS_" prefix.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-19 11:49:04 +02:00
Jean-Pierre André 38ff4602a7 Cleared the sparse flags when clearing the bad cluster list
The bad cluster list may be updated in ntfsresize and ntfsfix. Though
technically it is organized as a sparse file, Windows does not set
the sparse flags. Do the same to avoid problems with third-party
packages.
2016-07-19 11:44:59 +02:00
Jean-Pierre André 191e47ff9d Tolerated garbage put by Windows 10 into the last ACE
For some reason, Windows 10 sometimes inserts garbage after the
last ACE of an ACL. The ACL consistency check has to tolerate this.
2016-07-19 11:40:20 +02:00
Jean-Pierre André b973c0bd3c Compiled out conditionally debug-oriented code
Although ntfs_log_trace() is defined to a no-op in non-DEBUG builds,
ntfs_attr_name_get() is not.  This function performs a string conversion
and a memory allocation, so it is nice to have the call to it compiled
out when not needed.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-06-22 12:01:25 +02:00
Jean-Pierre André 5693341f0d Fixed ntfs_delete() failure caused by string conversion error
It was possible for ntfs_attr_name_get() to set errno due to a wide
character string that could not be converted to a multibyte string.  This
caused ntfs_delete() to fail.

Fix by checking for a nonzero return value specifically from
ntfs_attr_lookup(), rather than assuming that nothing else sets errno.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-06-22 11:58:20 +02:00
Jean-Pierre André cf6f265069 Switch to using the standard autoconf AC_HEADER_MAJOR macro
Switch to the standard autoconf AC_HEADER_MAJOR macro which takes care
of the ugly details like when to use mkdev.h and when to use sysmacros.h.
(requires <sys/types.h> to be included)
Also include these in all files that use major/minor/makedev funcs.

(Contributed by Mike Frysinger)
2016-05-31 08:33:10 +02:00
Jean-Pierre André e7c5950117 Silenced a truncation warning in upper case table
The upper case value for 0x1d79 is 0xa77d, so the difference is 0x8a04,
which overflows in the table which defines the computation of upper case
values. Rewriting this difference as -0x75fc leads to the same result
in an upper case table truncated to two bytes, and this avoid the
compiler warning.
2016-05-31 08:24:23 +02:00
Jean-Pierre André 08d3bcb2bf Ported patches to libfuse from the OpenIndiana variant
A few patches had been found useful to the OpenIndiana variant of libfuse
(2.7.6). Port them to libfuse-lite and restrict them to Solaris/OpenIndiana.
2016-05-04 10:15:35 +02:00
Jean-Pierre André a7ce195489 383 Fixed masks for major and minor in fuse-lite for OpenIndiana
On Solaris/OpenIndiana, the major and minor fields in st_rdev have to
be represented on 14 bits and 18 bits respectively. They must have
the same representation on 32-bit and 64-bit builds as the kernel
and the library do not know the word size of each other.
2016-05-04 10:08:06 +02:00
Jean-Pierre André 34f7bd7ff0 Used <sys/mkdev.h> instead of <sys/sysmacros.h> on OpenIndiana
On Solaris/OpenIndiana, use the macroes makedev(), major() and minor()
from <sys/mkdev.h>. Those from <sys/sysmacros.h> are inappropriate for
current builds.
2016-05-04 10:03:39 +02:00
Jean-Pierre André 040153adcb Redefined ELIBBAD as ENOEXEC when missing
When a plugin cannot be initialized a ELIBBAD error is returned on Linux
and OpenIndiana. As this is not a Posix error code, use ENOEXEC on
systems which do not define ELIBBAD.
2016-05-04 09:59:18 +02:00
Jean-Pierre André 0ad352b40f Updated information about ntfsprogs to the README file
Added mentions of ntfssecaudit, ntfsusermap and ntfsrecover to the
README file.
2016-05-04 09:55:16 +02:00
Jean-Pierre André 4278fbb7f6 Defined an option to kill the Windows cache and play the log file
The new ntfsrecover option --kill-fast-restart can be used to delete
the Windows fast-restart indication before playing the log. This can
lead to data loss, but is needed before mounting a partition improperly
unmounted from Windows when remounting on Windows is inconvenient.
2016-05-04 09:47:51 +02:00
Jean-Pierre André ab4bdea00f Rejected implicit mounting read-only when hiberfile option is present
If the remove_hiberfile mount option is present, explicitly disallow
the library from switching to a read-only mount. This is only to avoid
confusion, as the remove_hiberfile is processed before taking the
decision to fall back to read-only.
2016-05-04 09:39:48 +02:00
Jean-Pierre André 0c855fe36b Used Microsoft terminology for SID names
A few SIDs descriptions might be confusing because of a wording different
from Microsoft usage.
2016-05-04 09:33:42 +02:00
Jean-Pierre André df01bf1b4d Displayed the SID revision as an unsigned number (cosmetic)
Properly display a SID revision if it should ever reach 128.
(suggested by Ulf Zibis)
2016-05-04 09:30:48 +02:00
Jean-Pierre André 1b8b599408 Checked the number of subauthorities before accessing them
Be more crash resistent when analyzing a badly formed SID.
(contributed by Ulf Zibis)
2016-05-04 09:27:32 +02:00
Jean-Pierre André d587ff54f9 Fixed segmentation fault on empty $LogFile in ntfsrecover
ntfsrecover -f -v <log file> receives a SIGSEGV because of trying to
read memory outside allocated buffer because of no sanity checks on
restart page header values. This happens on an empty $LogFile because
of no basic checks present. Attached patch adds basic checks similar
to those inside logfile library and allows tool to exit with more
suitable message.
(contributed by Rakesh Pandit)
2016-05-04 09:24:51 +02:00
Jean-Pierre André 1840b52d12 Fixed a missing "break" in ntfssecaudit.c
A missing "break" in a case construct could be troublesome.
(suggested by Ulf Zibis)
2016-05-04 09:19:39 +02:00
Jean-Pierre André df7f3b9151 Fixed indentation in ntfssecaudit.c (cosmetic)
There was an abusive indentation.
2016-05-04 09:15:43 +02:00
Erik Larsson f0370bfa9c unistr.c: Unify the two defines NOREVBOM and ALLOW_BROKEN_SURROGATES.
In the mailing list discussion we came to the conclusion that there
doesn't seem to be any reason to keep these declarations separate since
they address the same issue, namely libntfs-3g's tolerance for bad
Unicode data in filenames and other UTF-16 strings in the file system,
so merge the two defines into the new define ALLOW_BROKEN_UNICODE.
2016-04-12 17:02:40 +02:00
Erik Larsson d9c61dd60e unistr.c: Enable encoding broken UTF-16 into broken UTF-8, A.K.A. WTF-8.
Windows filenames may contain invalid UTF-16 sequences (specifically
broken surrogate pairs), which cannot be converted to UTF-8 if we do
strict conversion.

This patch enables encoding broken UTF-16 into similarly broken UTF-8 by
encoding any surrogate character that don't have a match into a separate
3-byte UTF-8 sequence.

This is "sort of" valid UTF-8, but not valid Unicode since the code
points used for surrogate pair encoding are not supposed to occur in a
valid Unicode string... but on the other hand the source UTF-16 data is
also broken, so we aren't really making things any worse.

This format is sometimes referred to as WTF-8 (Wobbly Translation
Format, 8-bit encoding) and is a common solution to represent broken
UTF-16 as UTF-8.

It is a lossless round-trip conversion, i.e converting from broken
UTF-16 to "WTF-8" and back to UTF-16 yields the same broken UTF-16
sequence. Because of this property it enables accessing these files
by filename through ntfs-3g and the ntfsprogs (e.g. ls -la works as
expected).

To disable this behaviour you can pass the preprocessor/compiler flag
'-DALLOW_BROKEN_SURROGATES=0' when building ntfs-3g.
2016-04-08 05:39:48 +02:00
Jean-Pierre André ebdff7d4ee Deleted file secaudit.h
The declarations for compiling secaudit on Windows are not used any more
and can be dropped.
2016-04-07 09:36:01 +02:00
Jean-Pierre André 48e1c132c7 Removed declarations for using acls.c outside ntfs-3g
The declarations for using acls.c within secaudit on Windows are not used
any more and can be dropped.
2016-04-07 09:32:26 +02:00
Jean-Pierre André 3d7a28bfa5 Adapted secaudit and usermap (now ntfssecaudit and ntfsusermap) to ntfsprogs
These tools were originally developed for running on Windows and later
ported to libntfs-3g. This patch makes them similar to other ntfsprogs
tools, dropping the native Windows interfaces and using libntfs-3g on
all platforms.

There is no change in usage or supported features, only the command
names have changed.
2016-04-07 09:20:23 +02:00
Jean-Pierre André 0ded128808 Moved secaudit and usermap to directory ntfsprogs
These tools were developped before the ntfsprogs were merged into ntfs-3g,
redesigning them like the ntfsprogs make the code simpler.

Note : at this stage secaudit and usermap cannot be built any more.
2016-04-07 09:07:13 +02:00
Jean-Pierre André 7917a0a6cc Fixed indentation in ntfsclone help text (cosmetic)
The tabs in source code appear differently in actual output.
2016-04-06 11:09:35 +02:00
Jean-Pierre André 18a66b7a9a Fixed a spelling error in ntfsresize manual (cosmetic)
an other -> another
2016-04-06 11:07:30 +02:00
Jean-Pierre André 3cc22ba329 Moved general declarations from ntfsrecover.h to logfile.h
The declarations related to the log file structure are now grouped
in logfile.h, those specific to the recovery process are kept in
ntfsrecover.h
2016-04-06 11:03:31 +02:00
Jean-Pierre André 9693dd2fc1 Added a usn field to RESTART_PAGE_HEADER
Prepare merging ntfsrecover.h into logfile.h by adding a usn field to
RESTART_PAGE_HEADER. As this changes the record size, ignore the new
field in existing code.
2016-04-06 10:58:25 +02:00
Jean-Pierre André 60ba821ece Renamed reserved fields in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by naming reserved fields
the same way.
2016-04-06 10:54:51 +02:00
Jean-Pierre André 234cae2a1b Renamed record_length as log_record_header_length in ntfsrecover.h
Prepare merging ntfsrecover.h into logfile.h by naming the record
header length the same way.
2016-04-06 10:52:18 +02:00
Jean-Pierre André b977f18c6e Renamed restart_offset as restart_area_offset in ntfsrecover.h
Prepare merging ntfsrecover.h into logfile.h by renaming the restart
offset the same way.
2016-04-06 10:50:31 +02:00
Jean-Pierre André ad59ecec3f Redefined target_vcn on 64 bits in ntfsrecover.h
In a log record, the target vcn has to be stored on 64 bits
2016-04-06 10:45:30 +02:00
Jean-Pierre André 044f2104f9 Redefined file_offset on 64 bits in ntfsrecover.h
The log file offsets are apparently stored on 64 bits, though the file
size is unlikely to reach 2MB.
2016-04-06 10:40:28 +02:00
Jean-Pierre André d947ffa834 Unfolded record headers in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by unfolding the record
headers the same way.
2016-04-06 10:38:06 +02:00
Jean-Pierre André a6f4bae6d5 Typedef'ed new structs in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by declaring new structs
the same was as in logfile.h
2016-04-06 10:34:46 +02:00
Jean-Pierre André 2ab8bb509a Typedef'ed old structs in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by declaring duplicated
structs the same way
2016-04-06 10:32:39 +02:00
Jean-Pierre André 71b03fbd16 Redefined ntfsrecover enums as little-endian values
Rather than cpu-endian values, use little-endian ones in ntfsrecover
for similarity with layout.h
2016-04-06 10:26:46 +02:00
Jean-Pierre André 88451c8069 Made a full check for whether a user extended attribute is allowed
User extended attributes should only be set on files and directories,
not on symlinks, sockets, devices, etc. For safety they are also
forbidden on metadata files, but should be allowed on the root
directory. For files based on reparse points, requests are made
to the plugin to determine the type.
2016-04-06 10:17:27 +02:00
Jean-Pierre André 6cb8913967 Translated directory separators when running ntfscluster on Windows
Use \ as a directory separator when running on Windows.
2016-04-06 10:11:08 +02:00
Jean-Pierre André 31430ae01a Returned an error code for an exclusive access violation on Windows
Translate to Windows error code STATUS_SHARING_VIOLATION to Unix error
code EBUSY.
2016-04-06 10:08:01 +02:00
Jean-Pierre André e8170f588f Fixed the maximum size of an ACL
Define the maximum size of an ACL as results from the maximum number of
sub-authorities defined in layout.h
2016-04-06 10:02:23 +02:00
Jean-Pierre André 6c768f215d Used a more portable way to force alignment in security.h
Defining an array of zero elements does not force alignment on some CPUs,
insert a filler.
2016-04-06 09:57:59 +02:00
Jean-Pierre André 8a1358fff4 Enabled fallback to read-only mount when volume is hibernated
When a volume is found hibernated (or prepared for fast restarting),
it is force-mounted as read-only.
2016-04-06 09:51:47 +02:00
Jean-Pierre André 887d8f8294 Allowed kernel cacheing by lowntfs-3g when not using Posix ACLs
Kernel cacheing of file attributes is usually not used by ntfs-3g,
because it has defects when dealing with hard linked files and directory
permission checks. Kernel cacheing is however possible when using
lowntfs-3g and not using Posix ACLs.
2016-04-06 09:44:59 +02:00
Jean-Pierre André fc666cb0b9 Fixed bad test in fuse mount
Apply a fix from the full fuse library
2016-04-06 09:42:16 +02:00
Jean-Pierre André 366c20e8a2 Silenced fixup warnings when allocating a new MFT record
When creating a new MFT record, do not issue a warning if the current
record has bad fixups. These warnings are meaningless, difficult to
interpret and cause unneeded worries.
2016-04-06 09:32:18 +02:00
Jean-Pierre André b6b100b588 Added clarification about creating a partition to the ntfsclone manual
Try to make clear the option --output feeds data into a partition, but
does not create the partition.
2016-04-06 09:27:07 +02:00
Jean-Pierre André da33b0328f Used plugins to process reparse points
The new "system compression" files used by Windows 10 make use of reparse
points to record the compression parameters, and a specific named data
stream is used to store the compressed data. With this patch, processing
of reparse points can be done by an external plugin only loaded as needed.
Junctions and symlinks, which are also based on reparse points, are now
processed by "internal plugins".
2016-04-06 09:10:35 +02:00
Jean-Pierre André 8e550e712d Added an option for preserving the full log file in ntfsclone
Usually, only a few pages of the Windows log file are saved in an
ntfsclone image. This is inappropriate for building reference images
for recovering the log, and the --full-logfile option serves that
purpose.
2016-04-06 08:51:36 +02:00
Jean-Pierre André 8fc9c96305 Reworked decisions to undo related to unreadable records
When an INDX or MFT record could not be read while undoing the creation
of this record, there is nothing to do. However if this was undoing the
deletion of the last entry in an index, a new void index block has to be
created.
2016-04-06 08:44:38 +02:00
Jean-Pierre André 6b5e47f094 Version 2016.2.22 2016-02-22 08:28:50 +01:00
Erik Larsson 038a45a8a1 Fix compilation errors on OpenIndiana caused by missing limit macros. 2016-02-16 20:43:00 +01:00
Erik Larsson 9d1360b282 endians.h: Fix bad assumption of valid __BYTE_ORDER__ values.
On the OpenIndiana Hipster distribution, compiling with GCC 4.9 would
fail because __BYTE_ORDER__ was defined but not to any of the values
assumed to be associated with this define (__LITTLE_ENDIAN__ or
__BIG_ENDIAN__). Instead it was defined to either
__ORDER_LITTLE_ENDIAN__ or __ORDER_BIG_ENDIAN__. This caused
compilation to fail.

Fixed by checking that all referenced defines are in fact defined
before using them and adding an additional #elif clause for this newly
discovered condition.
2016-02-16 20:29:56 +01:00
Erik Larsson 9dee659190 ntfsrecover.c: Fix compiler warning about uninitialized 'savebuf' usage.
The previous fix for the warning referred to 'prevbuf' being used
uninitialized and this is also what the compiler says. However
initializing 'prevbuf' doesn't make the warning go away and further
testing revealed that it is really 'savebuf' being possibly used prior
to initialization that is the source of the warning (the incorrect
warning message is probably an optimization-related gcc bug). So replace
previous ineffective fix with explicit initialization of 'savebuf'.
2016-02-16 09:38:12 +01:00
Erik Larsson 62b5c91420 Fix compiler warnings about mismatching printf format / argument type.
For 64-bit (e.g. x86_64) Linux the 64-bit wide types resolve to long,
not long long as is the case in 32-bit (e.g. i386) Linux. So we need an
explicit cast to long long for 64-bit types since the format string must
specify the 'll' modifier in order to print 64-bit values.
2016-02-16 09:30:49 +01:00
Jean-Pierre André 1ae297378c Version 2016.2.15 2016-02-15 16:32:03 +01:00
Jean-Pierre André 4f6fb651c2 Silenced a compiler warning for possibly uninitialized pointer
Some compilers issue a warning when a pointer is initialized in
both alternatives of a condition. Force an extra initialization
to avoid such warnings.
2016-02-15 12:07:28 +01:00
Jean-Pierre André 941ec4762f Silenced a compiler warning for different types
Some compilers issue a warning when the alternatives in a "? :"
expression have different signedness.
2016-02-15 12:02:10 +01:00
Jean-Pierre André d2197785f4 Avoided pointer cast when checking record types
Some compilers issue warning when casting a pointer to a pointer to
a different type.
When checking a record magic, there is no need to cast pointers.
2016-02-15 11:54:33 +01:00
Jean-Pierre André f655192f26 Updated the drivers copyrights
Extend the copyright to 2016
2016-02-12 17:24:27 +01:00
Jean-Pierre André 6548d91f73 Closed the volume when a resizing is done
Closing the volume is the way to sync the MFT to disk. When not doing
so, the MFT runlists in $DATA and $Bitmap are not synced if they have
been updated in the second resizing stage relative to runlists which
have grown outside their original MFT record.
2016-02-12 17:13:21 +01:00
Jean-Pierre André 5edb3ec920 Closed the bad sector inode after updating the list
Unlike in most cases, the bad sector inode has to be closed if it
was updated and required MFT extents (when there are a lot of bad
sectors and some of them were outside the truncated partition).
Not doing so causes the inode to not be fully synced to device.
2016-02-12 17:03:53 +01:00
Erik Larsson a207d4e86a endians.h: Cast the result of const endianness macros to the right type.
This fixes compiler warnings emitted when you compare an le32 value with
e.g. 'const_cpu_to_le32(-1)' on a little-endian system, because
previously the expansion of the macro expression 'const_cpu_to_le32(-1)'
would be '(-1)' on a little-endian system but '(u32)((((u32)(-1) &
0xff000000u) >> 24) | (((u32)(-1) & 0x00ff0000u) >>  8) | (((u32)(-1) &
0x0000ff00u) <<  8) | (((u32)(-1) & 0x000000ffu) << 24))' on a
big-endian system, i.e. the type of the expanded expression would be
'int' (signed) in the little-endian case but 'u32' (unsigned) in the
big-endian case.

With this commit the type of the expanded expression will be 'le32' in
both the little-endian and the big-endian case.
2016-02-11 14:19:41 +01:00
Erik Larsson f463919310 ntfs-3g_common.h: Fix improper type for 'dmtime' in ntfs_fuse_context_t.
This field is always assigned a signed value, and compared to other
signed values (ntfs_time values are signed little-endian 32-bit
integers).

This fixes two compiler warnings about signed/unsigned comparison.
2016-02-11 14:06:53 +01:00
Erik Larsson abb2266147 mft.c: Fix compiler warning about mismatching format/argument type.
The expression is promoted to 'int' implicitly so we explicitly cast it
to 'u8'.
2016-02-11 13:52:59 +01:00
Erik Larsson 33cb3087b5 efs.c: Fix incorrect type of local variables 'newsize' and 'oldsize'.
These variable are only ever assigned to/from s64 values, so their type
should be s64, not u64. This fixes a compiler warning about
signed/unsigned comparison.
2016-02-08 18:42:53 +01:00
Erik Larsson 0b378fd177 ntfslabel.c: Fix incorrect label buffer being NULL-terminated.
The UTF-16LE label buffer containing the result of mbs2ucs is the one
that should be NULL-terminated when the label is longer than permitted.
Not the input buffer, which is a function parameter assumed to be
NULL-terminated anyway.
2016-02-08 18:32:24 +01:00
Erik Larsson a2efc3ec9f Change type of all LSN struct members in ntfsrecover.h to leLSN.
This is done to match the type of the LSN struct members in layout.h.
The effect of this change is that while these members were declared with
the le64 type previously, leLSN resolves to sle64. I.e. what was
previously unsigned fields are now signed.

Following this change we also need to switch over a few macros from
unsigned to signed versions in the code that uses these struct
definitions.
2016-01-29 12:36:06 +01:00
Erik Larsson ee4c48f4b1 playlog.c: Use const macro for byteswapping const expression. 2016-01-29 10:49:52 +01:00
Erik Larsson 81fce3b70e playlog.c: Fix improper byteswapping macros used for sle64 members. 2016-01-29 10:49:25 +01:00
Erik Larsson 9893ea9ee6 Merge endianness fixes.
Conflicts:
	libntfs-3g/attrib.c
2016-01-28 09:22:42 +01:00
Erik Larsson e37258bf01 ntfscmp.c: Fix missing byteswap of little-endian attribute type value. 2016-01-28 09:11:55 +01:00
Erik Larsson 8aca3d4800 ntfsmove.c: Fix multiple cases of raw usage of little-endian fields.
There were multiple cases of little-endian fields being used as
CPU-endian without byte swapping. This would result in incorrect
behaviour on big-endian systems.
2016-01-27 15:28:55 +01:00
Erik Larsson 8daa92717e ntfsdump_logfile.c: Fix use of wrong byteswapping macro for le16 field. 2016-01-27 15:26:51 +01:00
Erik Larsson 0741f54b2e ntfsdump_logfile.c: Fix incorrectly parenthesized expression.
On big-endian systems the result of the '!=' operation would be
endian-swapped rather than the first argument (which must have been the
intended action).
2016-01-27 15:24:52 +01:00
Erik Larsson 55dafda732 ntfsck.c: Fix comparing le32 values as u32.
This is harmless except when we do strict endianness checking, in which
case this results in a compile error. Fixed by converting values to
CPU endianness before comparing them.
2016-01-27 15:23:13 +01:00
Erik Larsson ec18534f31 ntfsck.c: Fix comparison between little-endian and native-endian data.
This comparison would yield the wrong result on big-endian systems.
2016-01-27 15:21:05 +01:00
Erik Larsson ef09702b0c ntfstruncate.c: Fix mixed endianness usage of variable 'i'.
In 'dump_resident_attr_val', 'i' was sometimes used as a native-endian
'int'-precision string length value and sometimes used as a little-
endian 16-bit flags value. This type of mixed usage is bad practice and
results in a hard error when strict endianness checking is used.

Fixed by introducing new variable 'flags' to hold the little-endian 16-
bit flags value.
2016-01-26 10:28:38 +01:00
Erik Larsson 7e9003b147 ntfstruncate.c: Fix incorrect type for CPU-endian value in 'ucstos'. 2016-01-26 10:19:44 +01:00
Erik Larsson 1b67b943df ntfstruncate.c: Fix conflicting endianness for variable 'attr_type'.
If the attribute type is specified by the user, 'attr_type' was assigned
a CPU-endian value, however if the attribute type was not specified it
would be assigned the attribute type AT_DATA, which is a little-endian
value. The rest of the code seems to assume that 'attr_type' is
CPU-endian, so this is clearly a bug.

Resolved by fixing the endianness of the variable at little-endian,
converting the input value to little-endian when specified.
2016-01-26 10:18:51 +01:00
Erik Larsson efa876d31b ntfstruncate.c: Fix mixed endianness usage of variable 'u'.
In 'dump_attr_record' the variable 'u' was first used to store a
CPU-endian 32-bit value, and then to store a 16-bit little-endian value.
This is bad practice and results in a hard error when strict endian type
checking is used.

Fixed by storing the 16-bit little-endian flags value in a new variable
'flags'.
2016-01-26 10:03:36 +01:00
Erik Larsson 02ce4947df ntfs-3g.c: Fix raw usage of inode time fields without byteswapping. 2016-01-26 07:55:45 +01:00
Erik Larsson 701cd61cca volume.c: Fix passing bad pointer type to ntfs_is_[baad|mft]_recordp. 2016-01-25 11:31:12 +01:00
Erik Larsson 8aa2769d70 mst.c: Fix mixed native/little-endian usage of variable 'usn'. 2016-01-25 11:30:13 +01:00
Erik Larsson 84f042e739 reparse.c: Fix big-endian bug when converting file name to lowercase.
When looking up the lowercase equivalent of a Unicode character in
ntfs_fix_file_name, no byte swapping was performed on the ntfschar used
as index into the 'locase' array. This would lead to very strange
results on big-endian systems.
2016-01-04 10:19:05 +01:00
Erik Larsson 75da0ce302 Fix inverted usage of endian conversion macros.
This is mostly a semantic issue since the end result would be the same.
2016-01-04 10:08:15 +01:00
Erik Larsson 9cf04fd2cd Fix incorrect usage of native/little-endian types, signed types, etc.
This is harmless with regard to code generation but if we turn on strict
type checking these type mismatches will result in errors.
2015-12-21 23:55:31 +01:00
Erik Larsson f076fae75a Fix endianness issues in log and terminal output.
This commit addresses issues where little-endian variables are emitted
raw to a log or output stream which is to be interpreted by the user.

Outputting data in non-native endianness can cause confusion for anybody
attempting to debug issues with a file system.
2015-12-21 23:31:09 +01:00
Erik Larsson dfa4a6647f Fix code to use const_cpu_to_X/const_X_to_cpu macros for constants.
This enables the compiler to optimize this code in cases where compiler
support for endianness swapping is not present.
2015-12-21 23:21:00 +01:00
Erik Larsson 58bb59487c endians.h: Add const endian conversion macros for s{l,b}e{16,32,64}. 2015-12-21 23:05:36 +01:00
Jean-Pierre André 5efc87cce8 Fixed accessing next log buffer only when it exists
Do not locate the next log buffer until it is known to exist.
2015-12-01 11:12:53 +01:00
Jean-Pierre André ca70766dc4 Fixed reporting action states when restart page appears outdated
If start buffer is more recent than restart, we update committed LSN
with last record LSN of block (last_end_lsn) while applying action but
forget about it while printing records with -f for investigation
purpose.

Note that while applying actions we use start_buffer to calculate
latest page out of block 2 and block 3 and then from latest take
committed LSN. For -f we don't need buffers so we just compare
directly with committed LSN from restart.

(contributed by Rakesh Pandit)
2015-12-01 11:10:48 +01:00
Jean-Pierre André f7cbf30d54 Rejected invalid null reparse tag
The null reparse tag is considered invalid by Windows, so do the same.
2015-12-01 11:06:11 +01:00
Jean-Pierre André 4d5ce43ab9 Fixed returning the trimming count to fstrim(8)
When used with the option -v, fstrim(8) reported the maximum trimming count
because the correct value was not returned to the ioctl call.
2015-12-01 11:00:24 +01:00
Jean-Pierre André 730776b0e5 Defined reparse tag for system compression
The new compression formats used by Windows 10 uses reparse data, and
a new reparse tag which it is useful to define even though these formats
is not yet supported by ntfs-3g.
2015-12-01 10:56:01 +01:00
Jean-Pierre André aeb1d7fb74 Fixed special case of decompressing a runlist
When the unreadable directory has an ATTRIBUTE_LIST attribute and an
INDEX_ALLOCATION attribute occupying split over several extents, the first
of which defines a single cluster, the first INDEX_ALLOCATION extent has
lowest_vcn=0 and highest_vcn=0, and the second one has lowest_vcn=1.

This unusual case, which can be created by the combination of a small
volume and near-full MFT records, triggers some special-case behavior in
ntfs_mapping_pairs_decompress_i(). That behavior is incorrect if the
attribute's first extent only contains a single cluster, since in that case
highest_vcn=0 as well.

This configuration has been tested on Windows and it *is* able to
successfully read the directory.  This supports the hypothesis that the
volume is valid and NTFS-3g has a bug on the read side.

This bug could, in theory, occur with any non-resident attribute, not just
INDEX_ALLOCATION attributes.

(Contributed by Eric Biggers)
2015-11-20 16:17:48 +01:00
Jean-Pierre André f85b82c8e1 Fixed headers of log play functions in playlog
The functions were made static with a textual description.
2015-11-20 16:14:16 +01:00
Jean-Pierre André aade4c46b6 Fixed missing error return in playlog
No error was returned from reading a protected record which is part of
an unreadable raw cluster.
2015-11-20 16:11:15 +01:00
Jean-Pierre André 3c964b6af3 Fixed truncating an extended bad cluster list in ntfsresize
This fixes the case where the original bad cluster list requires extents.
The list is processed globally, no relocation is done, and the list is
truncated, possibly fitting into fewer extents.
2015-11-20 16:04:47 +01:00
Jean-Pierre André ede1808ba6 Removed obsolete code from playlog
The code for dealing with new MFT records had been made more general
2015-11-12 15:46:33 +01:00
Jean-Pierre André 22b59548d9 Subdivided the replay functions in playlog
Partially unnested play_redos() and play_undos()
2015-11-12 15:44:47 +01:00
Jean-Pierre André fe3e16243a Fixed a memory leak in ntfsrecover
A buffer was left leaking memory in reset_logfile()
2015-11-12 15:41:44 +01:00
Jean-Pierre André 1aa9882810 Silenced a compiler warning (cosmetic)
An argument to ntfs_index_remove() is now unused
2015-11-12 15:39:20 +01:00
Jean-Pierre André 59c90f039d Defined the last logfile block as preceding block 4 in ntfsrecover
When block 2 or block 3 points backward to block 4, it is not clear
whether the log file only consists of block 2 or block 3 or the log
file has just wrapped around. The latter is now assumed.
2015-11-12 15:31:24 +01:00
Jean-Pierre André f7bc5249bc Alleviated constraints relative to reparse points
Some constraints put on reparse points of unknown type (e.g. they cannot
be deleted) are not acceptable to archivers. This patch removes some
constraints.
2015-11-09 16:22:16 +01:00
Jean-Pierre André fb0afd41c8 Decoded the full list of bad clusters in ntfsclone and ntfsresize
When the bad cluster list required extent, ntfsclone and ntfsresize
did not process the extents, leading to unexpected read errors and
unmatching bitmaps. This fix enables the full list to be taken into
account.
2015-11-09 16:16:39 +01:00
Jean-Pierre André 34d29fe0b0 Fixed reparse data check for non-Microsoft tags
Windows requires non-Microsoft reparse points (identified by having bit
31 of the reparse tag clear) to have a 16-byte GUID following the regular
reparse point header.  This GUID is not, and cannot, be included in the
"reparse data length" field.

(Contributed by Eric Biggers)
2015-11-09 16:14:31 +01:00
Jean-Pierre André 37bd6661d4 Fixed getting space for making an index non resident
Under some rare condition there is no space in an MFT entry to make
an index non-resident, and the index root has to be moved to an extent.
This fix cares for the situation when the attribute list was inserted
beforehand.
2015-11-09 16:09:52 +01:00
Jean-Pierre André 1aaaa8fac1 Wrote as much data as possible in compressed attribute pwrite
When writing to compressed data, the function ntfs_attr_pwrite()
cannot cross a compression block border. This is a problem for archivers
which rely on libntfs-3g, so the function is now wrapped in another one
which restarts the writing as needed.
2015-11-09 16:00:31 +01:00
Jean-Pierre André cba621e822 Silenced a compiler warning in ntfswipe (cosmetic)
Avoid a signed-to-unsigned compare warning
2015-11-09 15:58:00 +01:00
Jean-Pierre André e736fea196 Fixed relocating the MFT runlists in ntfsresize
The MFT has two runlists which may be partially stored in extents.
When these runlists have to be relocated, the relocations must be done
after the old runlists are not needed any more to read the data of
standard files, but before the MFT may be needed to extend the runlists
of standard files. Before doing so the MFT runlists have to be refreshed
from device in order to collect the updates which cannot be done in
memory during the first stage.
2015-11-09 15:44:33 +01:00
Jean-Pierre André 0cb0173bbc Implemented recovery of updates committed by Windows
ntfsrecover applies to the metadata the updates which were requested on
Windows but could not be completed because they were interrupted by
some event such as a power failure, a hardware crash, a software crash
or the device being unplugged. Doing so, the file system is restored
to the latest consistent state.

No update to libntfs-3g is required by this implementation.
2015-11-09 13:18:58 +01:00
Erik Larsson 9191d85e28 Use appropriate little-endian/big-endian types in struct definitions.
On-disk struct definitions used native types (u16/u32/u64/s16/s32/s64),
which doesn't say anything about the intended interpretation of the
data. The intention of having little-endian-specific types and
big-endian-specific types must have been to clarify interpretation of
data and intentions in the code. Therefore it seems reasonable to use
these types in struct definitions to clarify what data represention is
used to encode field data.

Because some struct members in layout.h are big-endian, this change also
means moving the duplicated definitions for big-endian byteswapping
macros and big-endian types found in acls.h and security.h to the
appropriate locations in endians.h and types.h respectively in order to
make them available for the struct definitions in layout.h.
2015-10-03 12:58:08 +02:00
Jean-Pierre André 80e500c6ef Protected against opendir reinitialization in lownfs-3g
Under some condition (probably interference with another process), the
directory list gets reinitialized by releasedir() and opendir() at the
beginning of a partial buffer. So in readdir() skip to the requested
offset. This is a step towards implementing seekdir().
2015-09-30 09:35:17 +02:00
Jean-Pierre André 2f373dee56 ntfsprogs Builds on Windows use macroes to translate printing formats,
and these macroes redefined "buf" in a way which causes trouble when
"buf" has another meaning. Use "_b" instead.
2015-09-30 09:08:35 +02:00
Jean-Pierre André 800660f728 Displayed reparse point information in ntfsinfo
Added displaying of reparse point data and decode known formats.
2015-09-30 09:05:47 +02:00
Jean-Pierre André 9f22e17a16 Improved the check for a valid $MFTMirr
The test for a valid $MFTMirr could segfault on a badly damaged partition.
Add safety checks.
2015-09-30 09:02:15 +02:00
Jean-Pierre André 94f8d2128e Fixed a wrong test report in ntfsfix
When used with the "no-action" option, the test for self-located MFT
still reported the partition to have been repaired. Adapt the report to
only tell repairing is possible.
2015-09-30 08:54:27 +02:00
Jean-Pierre André 4a4ec8c1c6 Fixed a bad sanity check in ntfsfix
Fix misordered checks to avoid potential segfaults on badly damaged partitions.
2015-09-30 08:51:20 +02:00
Jean-Pierre André 267357899f Made secaudit to load the library based on its generic name
When compiled autonomously without the automatically generated dynamic
link stubs, use a generic library name instead of a version dependent one.
(obsolete compile mode rarely used).
2015-09-30 08:44:56 +02:00
Jean-Pierre André 9c2657b4ae Made use of fuse module cache on OpenIndiana
The fuse cache does not handle properly hard-linked files, so ntfs-3g
traditionally disables it by using a null time-out. With an upgrade of
the fuse kernel module on OpenIndiana, cacheing of non hard-linked files
is now possible, so use it.
2015-09-30 08:36:37 +02:00
Jean-Pierre André 5ebe36f10a Mentioned the starting sector when it overflows in mkntfs
In an NTFS boot sector, the first sector of the partition is limited to
32 bits and it may overflow on large disks. This field is only used for
booting on the partition and it is ignored by ntfs-3g, but the warning
in mkntfs mislead users, so improve it.
2015-09-30 08:25:25 +02:00
Jean-Pierre André 8a3c3c477c Used incremental offsets when reading a directory in lowntfs-3g
Using incremental offsets avoids misinterpreting readdir() as rewinddir().
It also makes possible to implement seekdir() [not done yet]
2015-09-30 08:18:13 +02:00
Jean-Pierre André 2c11aaa2aa Fixed the range of valid subauthority counts in a SID
ntfs_valid_sid() required that the subauthority count be between 1 and 8
inclusively.  However, Windows permits more than 8 subauthorities as well
as 0 subauthorities:

  - The install.wim file for the latest Windows 10 build contains a file
    whose DACL contains a SID with 10 subauthorities.
    ntfs_set_ntfs_acl() was failing on this file.

  - The IsValidSid() function on Windows returns true for subauthority
    less than or equal to 15, including 0.

There was actually already a another SID validation function that had the
Windows-compatible behavior, so I merged the two together.

Contributed by Eric Biggers
2015-07-14 08:37:01 +02:00
Erik Larsson c9771d0509 unistr.c: Cleanup of OS X Unicode normalization code.
Normalize coding conventions to fit in with the rest of NTFS-3G,
including line breaks at column 80.
2015-06-23 06:43:17 +02:00
Erik Larsson 9a7bd25181 Skip installing manpages for mount helpers when they aren't available. 2015-06-23 06:27:33 +02:00
Erik Larsson 78ad037c66 Make installing mkntfs /sbin symlinks dependent on ENABLE_MOUNT_HELPER.
We shouldn't install anything into /sbin unless ENABLE_MOUNT_HELPER is
on, which is only true for Linux (these are Linux-specific symlinks).
2015-06-23 06:26:52 +02:00
Jean-Pierre André 99cb156ae5 Ported clearing the environment when starting mount or umount
When starting mount or umount, the environment was not cleared and
could be used for privilege escalation (CVE-2015-3202).
This is a port of the fix to full fuse by using execle(3) instead
of execl(3)
2015-06-01 12:48:43 +02:00
Jean-Pierre André 0d01fcabfc Implemented rewindind a directory in lowntfs-3g
Rewinding a directory is done by freeing the current list of files and
rebuilding it. Only seeking to the beginning of the list is implemented.
2015-04-17 11:38:33 +02:00
Jean-Pierre André 5741f54529 Zeroed uninitialized bytes before writing compressed data
Compressed records may be written as full clusters even though cluster
tails are meaningless. This is to avoid the lower levels doing a read-
modify-write cycle. Be sure to zero the meaningless bytes to avoid
leaking information.

Contributed by Eric Biggers
2015-04-17 11:31:47 +02:00
Jean-Pierre André bd2c91d4a3 Packed/unpacked st_rdev transported as 32-bits on OpenIndiana 64-bits
On OpenIndiana 64-bits, st_rdev has major and minor as 32-bits wide each,
but the fuse protocol (common to 32-bit and 64-bit) has an st_rdev field
limited to 32-bit. For now, pack major and minor the same way as in the
32-bit variant (14 and 18 bits).
2015-04-17 11:22:49 +02:00
Jean-Pierre André 46716df541 Simplified NTFS ACLs when group same as owner and same permission as all
When the owner and the group of a file have the same SID, and permissions
for the group is the same as permissions for other, no ACE is needed for
the group.
2015-04-17 11:17:51 +02:00
Jean-Pierre André 3d1c87d0d9 Fixed setting SIG_DFL on fuse session exit
This is a backport of a fix applied to the (external) fuse library
2015-04-17 11:14:36 +02:00
Jean-Pierre André e40b86a86c Upgraded the upper-case table as defined by Windows 7
Newer versions of Windows use more recent definitions of upper-case
table defined by the Unicode consortium. Now using the same table as
Windows 7, windows 8 and Windows 10. This only has an effect on file
systems newly created by mkntfs.
2015-04-17 11:03:58 +02:00
Jean-Pierre André 6a1c32e538 Fixed the DESX encryption/decryption in ntfsdecrypt
The DESX encryption/decryption algorithm was different from the Windows one.
2015-04-17 11:00:00 +02:00
Jean-Pierre André e24ea68632 Removed a temporary debug comment (cosmetic)
The comment was a left over from some debugging action.
2015-04-17 10:56:34 +02:00
Jean-Pierre André baab4c287e Added a sanity check to ntfswipe
Unused entries in the MFT may have a bad length leading to fetch fixups
from unallocated memory. Check the condition, but do not wipe, leave it
to chkdsk to decide what should be fixed.
2015-04-17 10:49:23 +02:00
Jean-Pierre André b249246e9f Defended against reusing data from an invalid MFT record
An unused MFT record may show a bad length, leading to fetch fixups from
unallocated memory when allocating the record to a new file. So check
the length before applying the fixups. Such records have been found after
the MFT has been reallocated by a defragmenter, and they are not cleaned
by chkdsk.
2015-04-17 10:41:04 +02:00
Jean-Pierre André 8fb58de762 Updated the read-only flag even when the security attribute was cached
When chmod'ing a file, no new ACL has to be created if the one needed
is already present in the cache. However the read-only flag may have
to be updated, so that it is kept as the opposite of S_IWUSR.
2015-04-17 10:35:26 +02:00
Jean-Pierre André d96ae8d7da Removed the double try to unmount partition in ntfsfix
When the unmounting of the partition fails after running ntfsfix, a
second try was attempted. This cannot be done and leads to more errors
because some essential records have been freed, so better quit without
making a second try.
2015-04-17 10:27:24 +02:00
Jean-Pierre André 9fc3730a9b Fixed displaying "UserMapping" as a file name
Fix the capitalization of the user mapping file name to be filled with
the output of secaudit with option -u.
2015-04-17 10:21:02 +02:00
Jean-Pierre André 1e8ae121fc Rephrased a misleading report message in ntfswipe
When using the "--no-action" option, ntfswipe should display a count
of would-be wiped bytes without suggesting any has been wiped.
2015-04-17 09:42:19 +02:00
Jean-Pierre André e43f58e0e4 Avoided logging meaningless fixup errors in ntfswipe
As ntfswipe examines all MFT entries, it may find uninitialized ones.
They should not be considered as erroneous ones even if the fixups
are wrong.
2015-04-17 09:37:11 +02:00
Jean-Pierre André e7b71bb78d Avoided mentioning deleted inodes in non-verbose output of ntfswipe
In non-verbose ntfswipe, avoid displaying deleted inodes as erroneous
ones.
2015-04-17 09:33:04 +02:00
Jean-Pierre André 25eb7a710b Added clarifications about several options to the ntfswipe manual
Clarified the usage of fast wiping, info and verbose options.
2015-04-17 09:26:59 +02:00
Jean-Pierre André 3fb1deb13b Fixed getting sector size from a partition image (Windows variant)
On Windows, when processing a partition image, get the sector size
from the boot sector instead of the containing partition.
2015-04-17 09:21:58 +02:00
Jean-Pierre André 4340df770e Supported the directory separator on Windows in ntfsprogs (cosmetic)
On Windows, when an ntfsprogs utility requests a path translation,
translate the '\'s to '/'s so that only '/' have to be interpreted
in libntfs.
2015-04-17 09:15:25 +02:00
Jean-Pierre André bbeebd5a15 Rephrased the warning for trimming not supported (cosmetic)
The initial text looked like an error message
2015-04-17 09:06:22 +02:00
Jean-Pierre André 274b89cec9 Avoided truncation in a debug message in secaudit
When compiled for Windows 64-bit, pointers have to be displayed as
"long long" instead of "long" which is 32-bit
2015-04-17 09:03:08 +02:00
Erik Larsson deeb0ad584 Version 2015.3.14. 2015-03-14 12:49:43 +01:00
Erik Larsson 807ee0f26c Enable ioctl in ntfs-3g unconditionally when building with fuse-lite.
fuse-lite announces a FUSE_VERSION which may not always match the exact
capabilities of the library. Hence we add a special case for 'ioctl',
which we know exists in fuse-lite regardless of the version number
published.
2015-03-14 11:11:43 +01:00
Erik Larsson 1ebf77f769 Fix improper #ifdef conditions around FUSE_CAP_IOCTL_DIR.
The capability actually appeared in FUSE 2.9, not 2.8. However in order
to maintain similarity to earlier #ifdef:s, we simpy check if
FUSE_CAP_IOCTL_DIR is defined rather than checking the FUSE version.
2015-03-14 06:53:31 +01:00
Erik Larsson d0cb2ea735 Version 2015.3.13. 2015-03-13 15:04:43 +01:00
Erik Larsson b970c69c02 usermap.c: Fix uninitialized variable warning in main.
If platform was non-Win32 and open_security_api() failed, the variable
'ok' would end up being uninitialized.
2015-03-13 09:06:17 +01:00
Erik Larsson 36f4957587 lowntfs-3g.c: Fix uninitialized variable warning in ntfs_fuse_getxattr.
The variable 'res' was never initialized if the #ifdef condition
'!KERNELPERMS | (POSIXACLS & !KERNELACLS)' evaluated to true and there
was an error allocating memory for 'value'.
2015-03-13 09:02:38 +01:00
Erik Larsson 82bb43eed3 ntfsclone.c: Compile fix for OS X.
OS X keeps the statfs declarations in sys/mount.h.
2015-03-13 08:59:20 +01:00
Erik Larsson 3f5d881a70 Compile fix for FUSE versions earlier than 2.8.0. 2015-03-13 08:57:38 +01:00
Jean-Pierre André b275f41cd8 Set release version 2015.3.5 2015-03-05 18:47:06 +01:00
Jean-Pierre André b2709f60ac Updated the copyright on the drivers to 2015 2015-03-05 18:25:17 +01:00
Jean-Pierre André 0101407feb Made to ignore the -s ("sloppy") mount option
autofs passes the sloppy option to mount(8) for all file systems to mean
that mount should not choke on invalid options such as those meant for
remote mounting on another operating system through nfs or cifs.
Following a recent change, mount(8) passes the -s option on to any file
system, even to local ones (which are not expected to get foreign options),
so ntfs-3g now has to ignore -s.
2015-01-22 08:42:43 +01:00
Jean-Pierre André 39c7d8538d Set the fuse protocol fall back to 7.12 when available
The support for ioctls has been added to fuse when using protocol 7.18,
and an equivalent upgrade has been done in fuse lite with commit [ae9aee].
For old kernels, a fall back to protocol 7.8 was implemented, but this
appears not to be supported in not-so-old kernels (e.g. 2.6.35).
With this patch, the fall back protocol is set to 7.12 or to the highest
level supported by the kernel.
2014-11-10 08:52:23 +01:00
Jean-Pierre André 3a8d923c13 Fixed accessing security attributes the old way on ntfs 3.x
When the security attribute is present, chkdsk may set a null security id
in the standard attributes, and this should not be considered as an error.
(this partially reverts commit [70e5b1])
2014-11-10 08:43:32 +01:00
Jean-Pierre André 3bfff8ea3f Fixed reading the MFT bitmap when expanding downward
When expanding downward the MFT bitmap was wrongly read when fragmented,
leading to inconsistencies and cancellation of the process.
2014-10-20 08:58:04 +02:00
Jean-Pierre André e1d2b7faa7 Silenced a const qualifier dropping (cosmetic) 2014-09-02 10:03:23 +02:00
Jean-Pierre André a7aa91d73d Developped an option --unused-fast for faster ntfswipe
When the new option --unused-fast is used, clusters which appear as wiped
are not written again. This is useful for avoiding virtual partitions to
be extended to their full size.

Contributed by michael
2014-09-02 09:55:53 +02:00
Jean-Pierre André c358191f91 Disabled option remove_hiberfile on read-only mounts
The mount options remove_hiberfile and read-only are contradictory.
When both are mentioned, ignore remove_hiberfile.
2014-09-02 09:50:27 +02:00
Jean-Pierre André b6152757c5 Reengineered the compression algorithm
This patch changes the algorithm to use hash chains instead of binary
trees, with much stronger hashing.  It also introduces useful (for
performance) parameters, such as the "nice match length" and "maximum
search depth", that are similar to those used in other commonly used
compression algorithms such as zlib's DEFLATE implementation.

The speed improvement is very significant, with some loss of compression
rate. The compression rate is still better than then Windows one.

Contributed by Eric Biggers
2014-09-02 09:45:16 +02:00
Jean-Pierre André 54833dffc0 Inserted missing ea.h and ioctl.h in devel file list
ea.h and ioctl.h were not mentioned in include/ntfs-3g/Makefile.am
so they were not released as public headers in devel files.
2014-09-02 09:39:12 +02:00
Jean-Pierre André c26a519da1 Fixed fstrim(8) applied to partitions
The new way goes via /sys/dev/block/MAJOR:MINOR to map partitions to
devices and get discard parameters of the parent device. It also ensures
that the partition is aligned to the discard block size.

Contributed by Richard W.M. Jones
2014-08-04 17:39:50 +02:00
Jean-Pierre André f4e3f126df Implemented fstrim(8)
fstrim(8) discards unused blocks on a mounted filesystem. It is useful for
solid-state drives (SSDs) and thinly-provisioned storage.
Only trimming the full device (with no option) is supported.

Contributed by Richard W.M. Jones
2014-07-31 14:03:11 +02:00
Jean-Pierre André ae9aeebbbf Upgraded fuse-lite to support ioctls
This is backporting code from the full FUSE library in order to support
ioctls. The fuse protocol level negociated is now 7.18 instead of 7.8.
A fallback protocol to 7.8 is provided for compatibility with older kernels.

32-bit ioctls are not supported by a 64-bit library
2014-07-30 16:44:18 +02:00
Jean-Pierre André 9325fa3ca6 Enabled new manual entries for ntfsprogs utilities
There were no manual entries so far for ntfswipe, ntfsdecrypt, ntfstruncate
and ntfsfallocate.
2014-06-25 12:50:45 +02:00
Jean-Pierre André 5d5d9f5b98 Added a manual entry for ntfsfallocate 2014-06-25 12:48:35 +02:00
Jean-Pierre André fbf18a2953 Added a manual entry for ntfstruncate 2014-06-25 12:47:33 +02:00
Jean-Pierre André 781c97cb76 Added a manual entry for ntfsdecrypt 2014-06-25 12:46:36 +02:00
Jean-Pierre André a42b52ea61 Added a manual entry for ntfswipe 2014-06-25 12:45:15 +02:00
Jean-Pierre André 935ce8d08b Fixed inappropriate description of ntfs_build_basic_posix() (cosmetic)
Fixed a missing description and wrongly copied+pasted comment
2014-06-23 11:46:58 +02:00
Jean-Pierre André ab8f021861 Fixed checking permissions when Posix ACLs are compiled in but not enabled
When the Posix ACLs are not enabled in the mount options, the permission
checks should not take into account the extra owners and groups of the
file.
2014-06-23 11:26:00 +02:00
Jean-Pierre André bfc5f3dd3d Fixed processing umask when Posix ACLs are compiled in but not enabled
When Posix ACLs are used, the umask is ignored and the initial permissions
of created files are taken for the parent directory. However the umask
should still be used when the Posix ACLs are not enabled in the mount
options.
2014-06-23 11:20:21 +02:00
Jean-Pierre André 22ecedb996 Fixed a wrong function header in usermap
A wrong header was defined for ntfs_initialize_file_security()
2014-06-23 11:16:02 +02:00
Jean-Pierre André 973949964c Fixed ownership of files created by root with no user mapping
Ownership of files should always represent the creator of files.
This fixes a situation, currently disabled, where there is no user
mapping and the owner of the parent directory is used as the owner
of the created file.
2014-06-23 11:11:07 +02:00
Jean-Pierre André ae4a797473 Disabled the default user mapping when Windows inheritance is used
Windows-type inheritance is meaningful only when used with user
identifications known to Windows, so avoid using default ones.
2014-06-23 10:59:38 +02:00
Jean-Pierre André 19d71c6c9e Fixed apparent const violation in secaudit.c for Windows (cosmetic)
The prototype for SetFileSecurityW() does not exhibit a const attribute
for the second attribute, thus triggering a compiler warning.
This warning can be silenced by copying the argument.
2014-06-23 10:53:23 +02:00
Jean-Pierre André 952917bccf Fixed const violation in win32_io.c (cosmetic)
Fixed the read-modify-write procedure to be compatible with the
write-only one to avoid violating the "const" attibute of the latter.
2014-06-23 10:46:31 +02:00
Jean-Pierre André 276c6ec661 Showed Windows ownership in secaudit with verbose option
The Windows ownership can now be displayed without using the "very
verbose" option, and when used on Windows the login name is displayed.
2014-06-23 10:41:39 +02:00
Jean-Pierre André 21f6d9d0a3 Included ntfsfallocate in the quarantined ntfsprogs
ntfsfallocate is the equivalent of fallocate(1) :
Usage : ntfsfallocate [-n] [-p] [-o offset] -l length filename
For now, it is only released as a quarantined ntfsprogs because it can
produce configurations which cause subsequent updates of the file by
Windows to hang.
2014-06-23 10:33:22 +02:00
Jean-Pierre André 6abf81721c Defined the configure option --enable-quarantined for non functional utilities
Distributions have complained about releasing a non-functional ntfsck.
Actually, ntfsck and a few other developer-oriented utilities were not
meant to be released by distributions and are only compiled in if the
configure option --enable-extra is set, and, for some reason, this
option is set by most distributions.

In order to get distributions to not complain, though making the source
code available for candidate developers to improve it, the non functional
or developer-oriented utilities (ntfsck, ntfsdump_logfile, ntfsmftalloc
and ntfsmove) are now only compiled in if the configure option
--enable-quarantined is set.
2014-06-23 10:15:24 +02:00
Jean-Pierre André 37862daf83 Fixed getting inherited security ids from cache
When using Windows inheritance, the cacheing of ACLs for files created
within a directory only depended on the directory. Actually it also
depends on the user who creates the file. With the patch, only the ACLs
created by the owner of the directory are cached.
2014-05-22 09:52:42 +02:00
Jean-Pierre André 0ccd90f2fb Fixed ignoring the umask mount option when permissions are used
When permissions are used, umask(2) is supposed to be active and the
umask mount option is supposed to be ignored, but it was still wrongly
applied. This caused permission restrictions when an external disk was
automatically mounted with standard options.
2014-05-22 09:45:46 +02:00
Jean-Pierre André e8c43f434b Fixed checking static groups against process owner
When grouping of users are determined from /etc/group (a compile-time
option not currently used), the groups examined for checking access rights
to a file were wrongly derived from the uid of the file instead of the
uid of the current process.
2014-05-22 09:38:47 +02:00
Jean-Pierre André 8390ac4dee Recognized interactive users as any user
Since Vista, the standard directory /Users/Public which should be accessed
by any user is actually restricted to a few group of users, among them
the interactive ones. To make this directory accessible without using
the Posix ACLs, all Linux users are considered as interactive.
However, when Posix ACLs are used, users supposed to be interactive have
to be put into a secondary group mapped to the equivalent Windows group.
2014-05-22 09:30:07 +02:00
Jean-Pierre André 7154606369 Decoded more "well-known" and generic SIDs in secaudit
More SIDs found in common situations are displayed with their meaning.
2014-05-22 09:25:11 +02:00
Jean-Pierre André 38dcb707ef Improved the ownership definition when inheriting and user mapping fails
When using the Windows permission inheritance mode and the current user
has not been mapped, try to derive a reasonable user from the parent
directory.
2014-05-22 09:19:52 +02:00
Jean-Pierre André c2af343c03 Improved the conditions for double inheritance of an ACE
The Windows-type inheritance of an ACE may imply creating two ACE's : one
for access and one for further inheritance. The conditions for doing so,
and the flags set on created ACE were sometimes wrong.
Note : the rules have been derived from testing multiple situations, but
there still are some gray cases.
2014-05-22 09:07:43 +02:00
Jean-Pierre André c9b0c415fd Decoded the GENERIC_ALL flag in secaudit
The GENERIC_ALL flags was not decoded and could lead to displaying no
access to some directories.
2014-05-22 09:01:37 +02:00
Jean-Pierre André 5554f2e677 Displayed the parent directory of selected files in usermap
Displaying the parent directory facilitates the identification of files
selected by usermap as a base for defining the mapping of Windows users
to Linux ones.
2014-05-22 08:58:03 +02:00
Jean-Pierre André 3e212bb901 Ignored chmod/chown/setfacl when Windows inheritance is applied
chmod/chown/setfacl can only define permissions according to Linux rules
with references to owner and group. Windows rules are more general and
propagated through inheritance, and chmod/chown/setfacl may create unwanted
deviations from these rules. Ignoring them prevents text editors from
creating such deviations when updating a file and creating a backup one.
2014-05-22 08:46:08 +02:00
Jean-Pierre André eefa41c385 Allowed group mapping of a few well-known SIDs
Since Vista, Windows defines a /Users/Public directory supposed to be
public, but actually only allowed to a few user categories (interactive,
batch, etc.) This patch makes possible to create equivalent Unix groups
and group users the same way as in Windows. Posix ACLs have to be enabled
for access to /Users/Public to be allowed to several groups.
2014-05-22 08:36:41 +02:00
Jean-Pierre André c0287870e1 Returned success from ntfsprogs utilities with options --version and --help
The ntfsprogs used to return failure when option --version or --help
was used, and this has triggered complains from distribution packagers
who use these options in packaging scripts.
With this patch, success is returned (same behavior as gcc).
2014-04-23 10:13:27 +02:00
Jean-Pierre André 70e5b1b250 Fixed inserting a new ACL after they have been wiped out by chkdsk
chkdsk deletes the ACLs when they are bad or when they are not used any
more. This fixes inserting a new ACL after the previously last ACL (or
even all of them) was deleted.
2014-04-23 09:53:13 +02:00
Jean-Pierre André 89de050c94 Fixed $Bitmap size in the root index in ntfsresize
When the partition is resized, the global bitmap size is adjusted accordingly,
however so far the new size was not set into the parent index (only minor
consequences).
2014-04-23 09:47:21 +02:00
Jean-Pierre André 556bb9fada Fixed inclusion of <sys/param.h> for Solaris/OpenIndiana
The truncation of oversized file names on Solaris/OpenIndiana requires
the definition of the maximum size from <sys/param.h> instead of
<param.h>
2014-04-23 09:43:43 +02:00
Erik Larsson 9e7184e2a6 Fix readdir I/O error on file names larger than 255 bytes in Solaris.
If a readdir operation returned a file name larger than 255 bytes,
Solaris/Illumos would return I/O error from the readdir operation.
Fixed by truncating the file name returned in the readdir operation.
2014-04-18 11:54:54 +02:00
Chih-Wei Huang a0914beb98 Fix a possible memory leak
In ntfs_fuse_parse_path(), it's possible that strdup() succeeds but
ntfs_mbstoucs() returns a negative value. In such a case the callers
just treat it as an error and ignores the allocated path buffer
that results in a memory leak.
2014-04-16 11:30:50 +02:00
Chih-Wei Huang 419d3399dc Initialize 'path' correctly
It fixes the warnings
src/ntfs-3g.c: In function 'ntfs_fuse_readlink':
src/ntfs-3g.c:987:6: warning: 'path' may be used uninitialized in this function [-Wmaybe-uninitialized]
src/ntfs-3g.c: In function 'ntfs_fuse_create':
src/ntfs-3g.c:1765:6: warning: 'path' may be used uninitialized in this function [-Wmaybe-uninitialized]
2014-04-16 11:30:48 +02:00
Jean-Pierre André 25d0f163ee Mapped the runlist when filling an initial hole
A bug was introduced by commit d2c7d40a2b :
when the beginning of a file was a hole and the runlist span over several
MFT extents, the runlist was not mapped on filling the initial hole.
This lead to a crash when using torrent to download big files.
2014-04-12 09:32:59 +02:00
Jean-Pierre André 8f20ca0d94 Added a license section to the README file
Explained the licensing differences between fuse-lite and ntfs-3g proper.
2014-04-12 09:27:27 +02:00
Jean-Pierre André ae459dd7b3 Implemented an extended attribute to get/set EAs
The new extended attribute "system.ntfs_ea" can now be used to get or
set the set of EAs of a file or directory.
2014-04-12 09:22:17 +02:00
Jean-Pierre André f3c4c6c604 Fixed ioctl() error return for ntfsclone on Windows
The ioctl() function is not implemented in the Windows variant. By forcing
a negative apparent return, an alternative is triggered to get the
partition size which is normally obtained from an ioctl().
2014-04-12 09:14:08 +02:00
Jean-Pierre André fd93d8e840 Switched to the relocated bitmap for delayed relocations in ntfsresize
In some rare situations relocated runlists are longer than the original
ones and do not fit into the same extent. When this happens the runlist
updating is delayed and done globally. Be sure to use the updated global
bitmap for making the needed allocations.
2014-03-11 11:15:59 +01:00
Jean-Pierre André fb88692394 Implemented updating an encrypted file in ntfsdecrypt
Existing encrypted files can be updated provided the encryption method
and key can be extracted from the LOGGED_UTILITY_STREAM attribute.
2014-03-11 11:10:33 +01:00
Jean-Pierre André 700015c289 Accepted encryption keys whose EFS purpose is not the first one
X509 certificates have a purpose field restricting what the certificate
can be used for, and EFS encryption is such a purpose. Allow EFS encryption
to be at any position in the list.
2014-03-11 11:06:21 +01:00
Jean-Pierre André cfab9d64c6 Fixed checking whether utimensat() applies to current atime
The check was applied to mtime instead of atime
2014-03-11 11:03:06 +01:00
Jean-Pierre André 543b17b7ef Rejected reserved files names when option windows_names is set
Windows applies legacy restrictions to file names, so when the option
windows_names is applied, reject the same reserved names, which are
CON, PRN, AUX, NUL, COM1..COM9, and LPT1..LPT9
2014-03-11 10:56:31 +01:00
Jean-Pierre André e5ea399ee6 Added a summary of inodes found by ntfscluster
Output the number of inodes found.
2014-03-11 10:51:47 +01:00
Jean-Pierre André 9636ac058f Improved the warning for analyzing an extent in ntfscluster
When analyzing an extent in ntfscluster, mention its base record
2014-03-11 10:47:48 +01:00
Jean-Pierre André 977abdefa2 Fixed endianness bugs in ntfscluster
ntfscluster was not suitable for big-endian CPUs
2014-03-11 10:43:31 +01:00
Jean-Pierre André 15f300412a Fixed displaying the correct sector number in error message
When opening a volume, the availability of the last sector is checked,
but the error message mentioned a wrong sector.
2014-03-11 10:37:27 +01:00
Jean-Pierre André b80d33785a Fixed marking device as closed (Windows variant)
When closing a device, the flag keeping track of open state was not reset,
and this prevented opening again (native Windows variant only).
2014-03-11 10:32:39 +01:00
Jean-Pierre André b70df75369 Updated ctime after setting an ACL
When setting a Posix ACL, the ctime was not updated to match ext2/ext3
behavior. This ext2/ext3 behavior has been changed, so do the same.
2014-03-11 10:28:02 +01:00
Jean-Pierre André e6c46d4fa0 Used MFT record 15 for the first extent to MFT:DATA
When the runlist of the data attribute of MFT has to be split across
several extents, the location of each extent has to be known from the
runlist present in previous extents. So, force the first extent into
record 15 to avoid a bad layout.
2014-03-11 10:16:26 +01:00
Jean-Pierre André ea8e192613 Traced dirtying runlists and updated them accordingly
Use a new flag to trace changes to a runlist and avoid recomputing the
runlist when no actual change occurred.
2014-03-11 10:11:00 +01:00
Jean-Pierre André d2c7d40a2b Avoided full runlist updating in more situations
When a hole in a sparse file was filled, the runlist was fully recomputed.
When a sparse file spans over several MFT extents, this patch leads to
only recompute the runlist from the modified extent to the end.
2014-03-11 10:04:54 +01:00
Jean-Pierre André ddd3a8a329 Reset the output file to favour appending to image in ntfsclone
When ntfsclone'ing to a file, the target file was truncated to the volume
size. This is not useful on file systems which support sparse files. In
the case of ntfs-3g this leads to prevent optimizations specific to
appending data. So when a sparse output file is detected, it is emptied
to benefit from subsequent appending of data.
2014-03-11 09:54:53 +01:00
Jean-Pierre André 7e38a29656 Avoided double opening of parent directory name in ntfscp
Double openings of a file or directory lead to double memory copies and
may lead to inconsistencies. On such situation could occur in ntfscp.
2014-03-11 09:50:02 +01:00
Jean-Pierre André 1d2fc42593 Avoided unnormalized parent directory name in ntfscp
Avoid leading '/' in directory names and use in ntfscp the same rule as fuse.
2014-03-11 09:44:50 +01:00
Jean-Pierre André 04ad1b9c09 Fixed default option for compression in the manual
Mention in the manual that compression is now enabledd by default.
2014-03-11 09:40:18 +01:00
Jean-Pierre André 2ab2994536 Fixed an erroneous reference to compression in the manual
compression was erroneously mentioned in the manual instead of permission.
2014-03-11 09:35:50 +01:00
Jean-Pierre André 1c09012dbc Improved the description of the silent option in the manual
The silent option acts on chown and chown, but also on permission checking,
and when the option is disabled, permission checking errors may emerge.
2014-03-11 09:30:18 +01:00
Jean-Pierre André 0f892b92d6 Added option --min-fragments to reduce fragmentation in ntfscp
When copying a file through ntfscp, the file size is known, hence the
space allocation can be optimized to get minimal fragmentation.
2014-03-11 09:24:34 +01:00
Jean-Pierre André 8520af7f7d Avoided displaying sync errors in ntfscp with --no-action
Do not loop on displaying errors when nothing is to be done
2014-03-11 09:19:06 +01:00
Jean-Pierre André fb4a2a6292 Fixed an endianness error in ntfsundelete
Name matching was wrong on big endian CPUs when not using regex
2014-03-11 09:12:41 +01:00
Jean-Pierre André 44d74a5b22 Allowed setting the serial number to 0x8000000000000000 or greater
The serial number of an ntfs volume should be processed as an unsigned
number (fix by E. Talsma)
2014-03-11 09:07:59 +01:00
Jean-Pierre André f53c5a34ee Updated the references to changelog and source repository
References now set to Tuxera and git repository
2014-02-16 21:16:09 +01:00
Jean-Pierre André d2daead832 Updated copyright claims 2014-02-16 18:25:09 +01:00
Szabolcs Szakacsits 316abf080f Version 2014.2.15 2014-02-15 16:01:40 +02:00
Jean-Pierre André b921b09fb8 Made ntfsdecrypt compatible with libgrypt-1.6
The upcoming libgrypt-1.6 drops the "module" interface which was used
by ntfsdecrypt for decrypting files which were encrypted with the "DESX"
algorithm. This algorithm is a Microsoft variant of DES with a key size
of 128 bits, and is not natively supported by libgrypt. The module interface
made possible to declare an external algorithm so that all the encryption
modes could be processed the same way whether the algorithm was internal
or external.
This patch makes DESX a specific case, so that the module interface is
not needed any more. It is compatible with current libgrypt and upcoming
libgrypt-1.6
2014-01-13 15:21:51 +01:00
Jean-Pierre André f0c5c2a54f Ignored unmapped regions when checking whether sparse
Updating an attribute may imply decompressing runlists which are not
contiguous, leaving an unmapped region between them. When checking whether
the attribute has been made sparse, such unmapped regions should be ignored
This mostly happens after updating an index. (fix by Forrest Liu)
2013-12-17 10:39:55 +01:00
Jean-Pierre André 5b38218f0b Logged more details when an attribute is not found
Log the inode number and attribute type when an attribute is not found.
This simplifies identifying relevant ones among such log messages.
2013-09-20 16:20:02 +02:00
Jean-Pierre André 91a44b438c Allowed DACLs to to not have any ACE
Windows server 2012 apparently uses files with no ACEs in their DACL,
thus denying any access to any process except system backup.
Such DACLs should however be considered valid.
2013-09-20 16:14:55 +02:00
Jean-Pierre André e9a2d29b33 Fixed memory leak while comparing attributes with bad sectors
When bad sectors were found when comparing attributes, the attribute
descriptors were not closed and freed (fixed by Rakesh Pandit)
2013-09-09 19:46:00 +02:00
Jean-Pierre André 2cbdba0c5c Silenced warnings by gcc >= 4.8 about non-checked return values
Added tests on the value returned by setuid() to avoid warnings by
gcc >= 4.8
2013-09-09 15:39:45 +02:00
Jean-Pierre André 5e18e97d0b Silenced warnings by gcc >= 4.8 about aliasing
Added intermediate variables to avoid warnings by gcc >= 4.8
2013-09-09 15:34:14 +02:00
Jean-Pierre André 89af38f687 Fixed expanding a resident attribute without inserting holes
When calling ntfstruncate() to expand a resident attribute, the function
is called again recursively, losing the requirement for not inserting
holes. This is for forwarding the requirement (used by ntfscp).
2013-09-09 15:27:38 +02:00
Jean-Pierre André 1f7fd0160f Fixed testing whether a stream has been wiped out
When testing whether a stream has been wiped out for possibly changing
its compression status, only the non-resident case was considered.
This fixes the test for streams which were never made non-resident.
2013-09-09 15:19:50 +02:00
Jean-Pierre André 33bbb9d009 Fixed creating a new image file on Windows
Creating a new image file (clone or metadata) by ntfsclone failed on
Windows, because the file was not opened with the needed flags.
2013-08-06 11:44:40 +02:00
Jean-Pierre André a28e2a8606 Fixed dealing with errors getting the file size from Windows
Using SetFilePointer() for compatibility with old Windows implies
a specific management of errors....
2013-08-06 11:39:13 +02:00
Jean-Pierre André ebf35000c9 Fixed computing a file size on Windows
The lower part should not have been sign-extended.
2013-07-30 11:42:59 +02:00
Jean-Pierre André 2c10bd6a98 Fixed struct formats for running on 64-bit Windows
Added a few paddings for field alignment in structs whose layout has to
match 64-bit Windows internals.
2013-07-30 11:31:56 +02:00
Jean-Pierre André 50db448f02 Fixed format translations for Windows
Translating "%ll" print formats to "%I64" for Windows was wrong.
2013-07-30 11:27:16 +02:00
Jean-Pierre André 1120b9c0b0 Removed duplicated code in mkntfs
Removed a meaningless duplicated test.
2013-07-30 11:22:34 +02:00
Jean-Pierre André e221ad783c Improved emulation of stat(2) on Windows
Made a distinction between a file and a partition when emulating stat(2)
on Windows (useful for ntfsclone).
2013-07-30 11:17:29 +02:00
Jean-Pierre André 0c8e776c12 Silenced a compiler warning in ntfs-3g.probe
Avoid some compilers to complain about a missing return value...
2013-07-30 11:13:51 +02:00
Jean-Pierre André ad40849149 Forced 64-bit computation of inode number in ntfsundelete
An inode number computation was done with 32 bits, and could (theoretically)
lead to truncation.
2013-07-30 11:07:12 +02:00
Jean-Pierre André bcbd157cfc Output the modification time when scanning files by ntfsundelete
When trying to undelete a file which was modified several times the
same day, it is difficult to tell which one is the latest unless the
modification time is displayed.
2013-07-30 11:00:46 +02:00
Jean-Pierre André b60954ff6a Fixed delayed deletion of files opened multiple times in lowntfs-3g
Reworked the delayed deletion of open files in lowntfs-3g to cope with
situations where a file was opened multiple times. In such circumstances,
multiple ghost names are created, to avoid having to check the full list
when opening and closing, which are much more frequent than deleting.
2013-07-30 10:53:07 +02:00
Jean-Pierre André c8a43e3f9f Improved the manual description of the size option of ntfsresize
Tried to make clear an NTFS file system size is smaller than the
partition size, and the size wanted by ntfsresize is the partition
size.
2013-07-30 10:45:22 +02:00
Jean-Pierre André 397848e21d Reserved a single sector for the backup boot sector
Reserve a single sector, instead of a full cluster, for the backup boot
sector.
2013-07-30 10:35:13 +02:00
Jean-Pierre André 9d730b0da1 Set the backup boot sector in ntfsresize when the size is reliable
Traditionally the backup boot sector is not set by ntfsresize because
the exact partition size is not yet known. A chkdsk is triggered to
subsequently insert it.
However ntfsresize is frequently activated by a partition editor which
has an exact knowledge of the wanted layout, and the backup boot sector
can be inserted by ntfsresize. This is only done if the target partition
size is defined with no unit suffix, and it is a multiple of the sector
size. Anyway the backup boot sector cannot overwrite useful data as it
is inserted between the file system size and the target partition size.
2013-07-30 10:17:28 +02:00
Jean-Pierre André 66cdec13d9 Fixed processing compressed data beyond file size
Windows 8 does not zero any more the end of a compression block beyond
what is needed to reach the end of a file. We must now be careful not
to decompress more data than needed.
2013-05-30 10:23:04 +02:00
Jean-Pierre André db35a16838 Fixed size truncation when checking for Interix types on 32-bit CPU
A cast, intended to avoid comparing signed to unsigned, led to truncate
the size on a 32-bit CPU, hence to wrongly check for Interix types.
2013-05-07 11:42:48 +02:00
Jean-Pierre André abba388447 Fixed the reversing of slashes in relative Windows-type symlinks
When translating Windows-type symlinks to Linux ones, the directory
separator has to be changed from '\' to '/'. The change was wrong
for multiple "..\" and ".\"
2013-04-26 19:07:47 +02:00
Jean-Pierre André be58b3b1f6 Fixed usa checking by ntfsck on 4K sectors
The usa sequence is used to make sure the sectors containing metadata
are fully written. The values are always put at the end of 512-byte
chunks even if the sectors are greater.
2013-04-22 19:14:48 +02:00
Jean-Pierre André c5a11341b0 Removed obsoleted references to utime_omit_ok
When issuing an utimensat as a consequence of utime(2) or utimensat(2),
fuse had temporarily defined a flag utime_omit_ok to identify whether
the file system supports the values UTIME_OMIT and UTIME_NOW to mean
specific timestamp updatings. The flag has been obsoleted and all
file system are now supposed to comply with the convention.
2013-04-22 19:06:49 +02:00
Jean-Pierre André baf13fe555 Fixed updating all the MFT runs in a relocated MFT in ntfsresize
When the MFT is partially located beyond the end of a resized partition,
it has to be relocated after the other files have been processed
because the MFT data is needed to do the relocations. When the MFT runlist
is split over extents, all of them have to be processed.
2013-04-22 18:55:26 +02:00
Jean-Pierre André 28cacf40b0 Fixed trying to update the MFT and Bitmap on a test run of ntfsresize
When the beginning of the MFT is beyond the end of the resized
partition, a specific procedure has to be used to relocate this part
of the MFT and adjust the bitmap accordingly. On a test run, these
updates should not be done.
2013-04-22 18:45:48 +02:00
Jean-Pierre André 20801dc6a0 Used /proc/mounts for checking existing mounts
The file /etc/mtab is traditionally checked to avoid multiple mountings
of the same device, but this is not accurate enough in some conditions.
So use /proc/mounts when available and fall back to /etc/mtab on
systems which do not have /proc/mounts.
2013-04-22 18:37:51 +02:00
Jean-Pierre André b35a204d01 Increased the maximum format size on Windows
The long long printing formats (such as %lld or %llx) have to be
translated to %I64 on older Windows systems, and the buffers to
receive the translated format must be able to hold the tool banners
which can be quite lengthy.
2013-04-22 18:31:16 +02:00
Jean-Pierre André 6aa24b3df3 Fixed a use of uninitialized variable compiler warning
Author: Anton Altaparmakov
Date:   Wed Feb 13 02:29:47 2013 +0000

This is a fix to the use of hd library to get the legacy BIOS geometry.
2013-02-13 08:54:34 +01:00
Jean-Pierre André 0e91e1a9ae Made compilation with --enable-really-static option to ./configure work
Author: Anton Altaparmakov
Date:   Wed Feb 13 02:29:47 2013 +0000

This is a fix to the use of hd library to get the legacy BIOS geometry.
2013-02-13 08:51:47 +01:00
Jean-Pierre André 9442db0d8b Added use of hd library to get the legacy BIOS geometry
Author: Anton Altaparmakov <anton@tuxera.com>
Date:   Tue Feb 12 10:33:55 2013 +0000

    Modify libntfs-3g to make use of hd library to get the legacy BIOS geometry
    from EDD.  We scan all whole disk devices on the system and check if they
    match the open ntfs device and if not we scan all partition devices on the
    system and check if they match the open ntfs device.

    If we find a partition device to match then we find its parent device again
    using the hd library.

    Once we have the parent of the partition device or we matched a whole disk
    device we get the legacy EDD sectors per track and heads again using the hd
    library.

    Use of the hd library is auto detected (based on finding <hd.h> header file,
    being able to link against libhd and finding the hd_list symbol in libhd.

    Use can also be disabled/enabled/libhd prefix specified at ./configure time.
    See ./configure --help for details.

    Note this obviously requires libhd to be installed.  On Ubuntu 12/04 systems
    the relevant packages needed are libhd-dev and libhd16 (on older Ubuntu
    versions it will be libhdN where N is some number <= 16 but an easy way to
    get the right package is to simply install libhd-dev which by dependency
    pulls in the correct libhdN package) whilst on SLES systems the relevant
    packages needed are hwinfo and hwinfo-devel.
2013-02-12 15:45:54 +01:00
Jean-Pierre André 1e625a9563 Made the meaning of the size argument of ntfsresize more clear in the manual
The size argument of ntfsresize is the target partition size. This is
not the file system size as returned by df(1) or statvfs(3) because a
sector is reserved for the backup boot sector, and the remaining sector
count might not be a multiple of clusters per sector.
2013-02-09 15:19:34 +01:00
Jean-Pierre André 2737f9cbd0 Initialize the random generator for the internal guid generator
When uuid/uuid.h is not available, mkntfs uses a home-made guid
generator. Better initialize the random generator to get a random guid.
2013-02-09 15:12:56 +01:00
Jean-Pierre André a6b765c824 Fixed rescuing clusters by physical sectors in ntfsclone
When a sector is unreadable, consider the whole sector as bad, instead
of trying to find which 512-byte parts of it are bad. This was causing
unwanted retries for devices with 4K sectors.
2013-02-09 15:07:06 +01:00
Jean-Pierre André a086683ece Fixed setting a magic header to unreadable sectors in ntfsclone
The magic header of an unreadable sectors should have the size of
"BadSectoR", not the size of a pointer to it.
2013-02-09 15:04:41 +01:00
Jean-Pierre André c73b805062 Rejected reading a volume from stdin in ntfsclone
Reading a volume must be done in a seekable way. Better throw a proper
error.
2013-02-09 15:01:36 +01:00
Jean-Pierre André c72b569da1 Ported ntfsundelete to Windows
Made a few adaptations to what is available on Windows.
2013-02-09 14:56:46 +01:00
Jean-Pierre André c17512cde5 Translated %ll print editing formats to %I64 on Windows
Older msvcrt.dll (on XP and earlier) did not support "%ll" print editing
formats frequently used by ntfsclone. So translate them to "%I64" when
running on Windows. This format appears to be supported by all Windows
versions. Error messages from libntfs-3g are still not translated.
2013-02-09 12:57:22 +01:00
Jean-Pierre André e6eae9fa16 Ported ntfsclone to Windows
This mainly means using the functions in win32_io.c instead of the
standard msvcrt.dll ones in order to be able to truncate files and
create sparse ones.
2013-02-09 12:54:44 +01:00
Jean-Pierre André 88de9987a0 Fixed bad copying of the backup boot sector in ntfsclone
This patch fixes the sector offset to the backup boot sector when creating
a metadata image.
2013-02-09 12:53:38 +01:00
Jean-Pierre André d32c593521 Revert "Ported ntfsclone to Windows", should be "Fixed bad copying of the backup boot sector"
This reverts commit 92cd41b6e5.

The title and description were wrong
2013-02-09 12:50:16 +01:00
Jean-Pierre André 92cd41b6e5 Ported ntfsclone to Windows
This mainly means using the functions in win32_io.c instead of the
standard msvcrt.dll ones in order to be able to truncate files and
create sparse ones.
2013-02-09 12:14:19 +01:00
Jean-Pierre André c4f65e05c4 Cleaned selecting stdout or stderr for messages from ntfsclone
Depending on the options selected, ntfsclone messages are output on
stdout or stderr. This is now done through standard logging procedures.
2013-02-09 12:12:02 +01:00
Jean-Pierre André 2e2550026e Avoided displaying in non-verbose mode information which is not computed
The summary of 'runcount.runs' and 'runcount.fragments' was displayed in
non-verbose mode. However these variables are not updated in non-verbose
mode, so they would always be 0.
We now only display this summary in verbose mode.
2013-02-09 12:08:58 +01:00
Jean-Pierre André aebfcf3d27 Enabled relocating the MFT when shrinking a volume
This patch makes it possible to shrink a volume to a small size such that
the existing $MFT is beyond the new size.
2013-02-09 12:00:02 +01:00
Jean-Pierre André b2e1dbbf38 Made possible to run ntfsundelete on systems with no regex.h
The filtering of files to undelete is usually done through the regex
library. This patch offers an alternate way when such a library is
not readily available (typically on Windows).
2013-02-09 11:56:09 +01:00
Jean-Pierre André c972652876 Avoided meaningless errors logging during ntfsundelete scans
When ntfsundelete scans the $MFT for possible deleted files, it may
examine extries which have never been used, producing error messages
which most users do not understand. This patch silences such messages.
2013-02-09 11:51:40 +01:00
Jean-Pierre André 61eceb2fe5 Cosmetic : use symbolic names for ntfsclone control codes
Defining symbolic names makes it easier to identify where they are used.
2013-02-09 11:48:54 +01:00
Jean-Pierre André 81eb7baf88 Allowed cloning a file system despite allocation errors
Allow the "--ignore-fs-check" option to be used when cloning a file system
which has allocation errors. This is useful when there is a fear that
repairing the file system might create further damage, or when the repair
has to be made on another computer.
2013-02-09 11:41:39 +01:00
Jean-Pierre André c820cb6d76 Added a display of the location of an inconsistency in an image
When an ntfsclone image appears to be corrupted, show at which position
the error happens. This is useful for providing support.
2013-02-09 11:37:31 +01:00
Jean-Pierre André 412f09d87d Fixed the ntfsfix option for testing in the manual
The option for checking the behavior of ntfsfix without writing anything
is "--no-action", not "--do-nothing".
2013-02-09 11:33:17 +01:00
Jean-Pierre André 7c83060553 Added a new option for testing the consistency of an ntfsclone image
This patch adds a new option -n to ntfsclone for simulating a restore
without writing anything. This is useful for checking the consistency
of an image without destroying the original partition.
2013-02-09 11:29:21 +01:00
Jean-Pierre André 44fbf02a97 Upgraded the Win32 interface for use with ntfsprogs
Upgrade the Win32 interface (win32_io.c) which was designed for Cygwin
so that it can be used for using the ntfsprogs utilities on native Windows.
Two new entries are added for truncating a file and creating a sparse
file, both of which not being supported through msvcrt.dll.
2013-02-09 11:22:41 +01:00
Jean-Pierre André 7cb4b99627 Fixed wiping fragmented metadata when creating a metadata image
When creating a metadata image, all user data is supposed to be wiped off,
but this was wrong for $MFT and directory indexes when they were
fragmented. This patch cleans the tails of metadata fragments.
2013-02-09 11:12:45 +01:00
Jean-Pierre André 6caa1b0bda Added directions for getting a user mapping proposal through secaudit
The definition of the user mapping needed to interoperate permissions
with Windows is too complex for most users. Even the "usermap" utility
is too complex. This patch adds explanations for using the "-u" option
of secaudit to get a user mapping proposal
2013-02-09 11:06:39 +01:00
Szabolcs Szakacsits d3dad801b3 Version 2012.1.13 2013-01-13 08:31:50 +02:00
Erik Larsson 7506d8b80b Rename legacy MS_* flags for ntfs_mount with NTFS_MNT_* flags.
The MS_* flags originated from system constants. However the flags
passed to ntfs_mount were really unrelated to the system constants and
many new MS_* flags had to be introduced as different features were
added to the library. Those flags had no counterparts in any system
APIs, so using the same naming scheme is inappropriate.

Instead, let's namespace these flags similarly to what has already been
done in ntfsprogs/libntfs earlier. This avoids any possible conflicts
with system constants.
The values of the flags themselves are kept the same as earlier, so
backward compatibility is retained.
2012-11-07 16:29:48 +01:00
Erik Larsson ebb38c4b1c API cleanup of const arguments.
- Replaced 'ntfschar*' parameters with 'const ntfschar*' where
  appropriate (the function does not need to modify the string).
- Replaced some instances of 'u8*' and 'char*' read-only buffer
  arguments with 'const u8*' and 'const char*'.
2012-11-07 14:15:53 +01:00
Erik Larsson ea55e5e3c8 configure.ac: Restructure uuid library detection.
The 'uuid' library functionality may be located in a separate 'uuid'
library, but it may also be included in the standard C library. This is
the case on Mac OS X.

Instead of relying on the uuid code being located in a 'uuid' library,
we restructure the code so that it checks different libraries, in order
for the 'uuid_generate' function. This code is easy to extend if we
would find a new configuration where uuid_generate is located in a
different library.
2012-11-06 10:30:48 +01:00
Erik Larsson 11a7e8297d ntfsclone.c: Cleanup in error message. 2012-11-06 08:23:04 +01:00
Erik Larsson 2bee30c2f7 acls.c: Fix compiler warning regarding usage of uninitialized variable.
This warning is really a false alarm, but fix it anyway.
2012-11-06 02:12:48 +01:00
Erik Larsson e85f9305c1 ntfsclone.c: Fix missing space in error message. 2012-11-06 02:07:53 +01:00
Erik Larsson 72bea99a8f Fix compilation of libfuse-lite on Solaris/OpenIndiana.
The OpenSolaris port of libfuse, from which our Solaris-port of
libfuse-lite originated, had to be supplied with some additional
compiler flags in order to compile.
The configure script now detects whether it is running on a Solaris
system. If that is the case it passes the proper compiler flags to
libfuse-lite, so it can compile properly.

Tested on:
- OpenIndiana oi_151a3 / gcc 3.4.3
- OpenIndiana oi_151a7 / gcc 4.3.3
- Solaris 11.1 / gcc 4.5.2
2012-10-28 05:23:39 +01:00
Erik Larsson 941a22e7f8 configure.ac: Disable checks for libfuse when not building ntfs-3g.
When we aren't building ntfs-3g but only the tools, then there's no need
for libfuse. Still the configure script checked for libfuse availability
and wouln't proceed unless either libfuse was detected or libfuse-lite
was enabled.

This commit fixes this issue by running the libfuse checks only when
ntfs-3g is built, meaning that we can now build the ntfsprogs even when
libfuse library or headers aren't available.
2012-10-27 13:18:07 +02:00
Jean-Pierre André 761ba29110 Inserted updated definitions of reparse tags into layout.h
Replace the obsolete definition of reparse tags in layout.h by the
current definitions from msdn, and use them in reparse.c instead of
redefining them.
2012-10-05 10:42:19 +02:00
Jean-Pierre André 4d3967840c Fixed a memory leak caused by disabling getting/setting DOS names
After rejecting a DOS name setting on a hardlinked file, the search
context has to be freed.
2012-10-05 10:35:59 +02:00
Jean-Pierre André 67fa6273cf Disabled getting/setting DOS names on hardlinked files
As the path passed to ntfs-3g for getxattr(2)/setxattr(2) are not
guaranteed to be the one mentioned by the caller when there are hard links,
getting/setting DOS names have to be discontinued in that situation.
Getting/setting DOS names is still possible when there is a single
non-DOS name.
2012-10-03 11:23:58 +02:00
Jean-Pierre André 559270a8f6 Prevented partitions with metadata cached in Windows from being mounted
Windows 8 includes a "fast restart" feature for restarting without fully
remounting the internal volumes. When this mode is selected, metadata
stored in the cache (probably hiberfil.sys) is used instead of what
is actually on disk, and this may lead to inconsistencies when changes
have been made by ntfs-3g in the meantime.

This patch tries to prevent ntfs-3g from mounting in read-write mode
when a fast restart of Windows 8 is detected. It relies on the restart
pages in the $LogFile being identified as version 2.0, which is
apparently related to data being cached for hibernation or fast restarting.
2012-09-25 09:46:54 +02:00
Erik Larsson 9337e0a069 bootsect.c: Don't allow negative start clusters for $MFT/$MFTMirr.
Negative values for mft_lcn / mftmirr_lcn don't make any sense and must
be detected as corruptions.
2012-09-24 12:57:22 +02:00
Jean-Pierre André 0b2a85b612 Forced option ro when mounting a read-only device
External devices, such as USB keys, may have a switch to make them
temporarily unwriteable. When such a device is plugged in, mount it
as read-only by default.
2012-09-12 09:47:36 +02:00
Jean-Pierre André 4d0b9163c9 Accepted processing restart pages v 2.0 with no warning (used by Windows 8)
In the $LogFile, Windows 8 defines restart pages with version 2.0.
The checks designed for version 1.1 appear to apply, so accept v 2.0
and apply the usual checks.
2012-09-12 09:42:24 +02:00
Jean-Pierre André c31c7463e8 Allowed SACLs to to not have any ACE
Accept security descriptors in which the SACL is present though it does not
contain any ACE. Such security descriptors have been found in Windows
installation files.
2012-09-12 09:36:21 +02:00
Jean-Pierre André 2223b8796c Added an option to secaudit for getting a user mapping proposal
Get a user mapping proposal by designating a file created on Windows
by the user to be mapped to the current one on Linux.
This is expected to be easier to use than "usermap".
2012-09-12 09:31:35 +02:00
Erik Larsson 7c600754dd ntfsinfo.c: Fix printing all the flags in hex in 'ntfs_dump_flags'.
The variable 'flags' was modified along the way and did not contain the
original flags at the end as assumed by the last printout. Fixed by
storing the original state of the flags in a temporary const variable.
2012-08-27 21:26:57 +02:00
Jean-Pierre André 9403b9e44f Allowed commas within option fsname on OpenIndiana
On OpenIndiana, the device names have commas in them. Do not interpret
commas as option separators within the option fsname. As a consequence
this option has to be the last one.
2012-08-22 11:08:20 +02:00
Jean-Pierre André 97342d05bc Merged libfuse for OpenIndiana into libfuse-lite
The libfuse used by OpenIndiana has the same features as libfuse-lite
though requiring some code variants. Merging them simplifies supporting
both.

Variants for OpenIndiana are selected when defining __SOLARIS__
2012-08-22 11:02:36 +02:00
Jean-Pierre André 3e4c439520 Fixed the returned files types in readdir()
The type of special files (symlinks, fifos, etc.) was not returned in
readdir() and they appeared wrongly in the field d_type of "struct dirent".
This prevented some applications which relied on d_type (which does
not exist in Solaris) from navigating in an NTFS tree.
2012-08-20 14:34:16 +02:00
Jean-Pierre André 3953e929bb Fixed Windows-type inheritance for creator-owner ACE
Inheriting a creator-owner ACE the Windows way led to a buggy ACL
2012-08-20 14:29:51 +02:00
Jean-Pierre André fa158031f2 Restored interpreting UTIME_NOW and UTIME_OMIT from external fuse >= 2.9
Use of UTIME_NOW and UTIME_OMIT had been temporarily removed when using
external fuse, because early versions of external fuse 2.9 did not
support them. They can now be restored as they are supported by released
versions of fuse 2.9
2012-08-20 14:24:49 +02:00
Jean-Pierre André f61aaf012c Made secaudit to be runnable on OpenIndiana
A few differences in dynamic linking.
2012-08-20 14:22:10 +02:00
Jean-Pierre André 3461acd0c2 Changed "blocks" to "sectors" in the mkntfs manual
The last (optional) argument in mkntfs was described as a block count,
which may be confusing because in ext[123] a block means a cluster.
2012-08-20 14:17:09 +02:00
Jean-Pierre André eecc700df1 Inserted in the manual an explanation for the $Info stream in $UpCase 2012-08-20 14:14:15 +02:00
Jean-Pierre André 9d22736044 Inserted an $Info stream in $UpCase to comply with Windows 8
Since Windows 8 a new stream is added to the upper case file to record
a CRC of the upper case data. This way, if the file does not match the
one defined on the current Windows system, chkdsk can tell whether the
file is damaged or just out of date, and an error is only displayed if
the file is damaged.

The $Info data has been checked to be ignored by Windows XP, Windows
Vista and Windows 7. If not present, chkdsk for Windows 8 complains about
a wrong upper case file.
2012-08-20 14:01:53 +02:00
Jean-Pierre André 262a0559ac Fixed the computation of named attributes sizes in mkntfs
The named attributes sizes were wrongly computed in mkntfs. This did not
lead to visible errors so far owing to 8-byte alignments in attribute
records (current names $SDS, $R, $O, etc).
2012-08-20 13:57:00 +02:00
Jean-Pierre André f793ead700 Cosmetic : avoided having a hardcoded knowledge of upcase table size in mkntfs 2012-08-20 13:53:48 +02:00
Jean-Pierre André 35eab4044e Avoided an unnecessary runlist update when appending data to a file
Appending data to a file is done in two steps : first extending the
file to the required size, then inserting data in the created space.
There is no need to recompute the runlist at the end of the first
step, just be sure the original configuration is rolled back if inserting
data leads to an error.
2012-08-20 13:48:49 +02:00
Jean-Pierre André ba3cb2c88b Fixed displaying progress percentage for metadata images
When building (options -ms) or restoring a metadata image, the progress
percentages were wrong (evaluated against a wrong base)
2012-08-20 13:44:33 +02:00
Jean-Pierre André f61b34ee2c Ignored permissions when listing xattrs for special files
Special files (FIFOs, SOCKETs, etc.) are not allowed to have user extended
attributes. When listing their extended attributes, return none without
checking whether the calling process is allowed to access these files.
2012-08-20 12:45:21 +02:00
Jean-Pierre André 3103a6c383 Extended Windows-type ACL inheritance, as needed by Windows 8
Windows 8 uses "Authenticated user" principals which needs to be replaced
by the actual owner when inheriting
2012-08-20 12:36:45 +02:00
Jean-Pierre André 4b651b9340 Processed ACLs with no mentioned rights for owner (used by Windows8)
Windows 8 uses ACL patterns in which the owner has only implicit rights
(pattern not used by previous Windows versions)
2012-08-20 12:28:15 +02:00
Jean-Pierre André 8ae20018df Fixed the fixing of the backup boot sector in ntfsfix
ntfsfix now checks and update the backup boot sector on the last sector of
the partition (instead of the sector next to end of the file system). After
an ntfsresize the file system generally does not use the maximum size because
of different roundings and required alignments in the resizing and the
repartitioning.
2012-07-06 09:56:50 +02:00
Jean-Pierre André db5af00af6 Processed junctions and symlinks whose target references another one
When the target of a junction or a Windows-type symlink references another
junction or symlink, the search for the full path on the current partition
and its translation for case-sensitive access is interrupted. The target can
now be dereferenced, provided the end of the path needed no translation.
2012-07-06 09:48:05 +02:00
Jean-Pierre André ab6f7c027d Extended the wiping of file tails to all data attributes in ntfswipe
This patch adds the wiping of the tails of named data attributes to
ntfswipe.
2012-06-18 13:00:17 +02:00
Jean-Pierre André 7a93d1790a Added processing of SACLs to secaudit on Windows (nickgarvey)
This patch adds the processing of SACLs to secaudit on Windows, but
requested the required privileges.
2012-06-18 12:57:40 +02:00
Jean-Pierre André 0f8ef123ea Added inheritance of the set-group-id flag
So far the set-group-id flag could be set in a chmod. This patch enables
the inheritance of the group to files and subdirectories, and the
inheritance of the set-group-id flag to subdirectories.
2012-06-18 12:53:25 +02:00
Jean-Pierre André 93ac6ce3bf Removed the suggestions to use option remove_hiberfile
The suggestion to use option remove_hiberfile was displayed in the
standard help and when a volume is found dirty. As this option may
lead to loss of data, only mention it in the manual, with a proper
warning.
2012-06-18 12:46:21 +02:00
Jean-Pierre André 24c9f19065 Added optional wiping of file tails and undelete data to ntfswipe (Bogdan)
Added more wiping options to ntfswipe (to avoid leaking of deleted data).
2012-06-18 12:41:51 +02:00
Jean-Pierre André 8f896f112a Added an optional argument (number of seconds) to the option delay_mtime
The option delay_mtime avoid updating the mtime of a file after each
individual updating. With this patch, the frequency of the update can
be adjusted to needs (default 60s). This is mainly useful for big files
which are kept open for a long period (file system images, virtual
computers, etc.)
2012-06-18 12:34:56 +02:00
Jean-Pierre André 9704ff9396 Processed ACL inheritance for authenticated users
Under some conditions, Windows defines an ACL inheritance for an
unidentified authenticated user. With this patch, such an unidentified
user is treated as any user (same as "world").
2012-06-18 12:27:38 +02:00
Jean-Pierre André 464a9156cd Fixed a wrong computation of ACL size (minor issue) 2012-06-18 12:26:36 +02:00
Jean-Pierre André 9ae4165ee8 Added allocation data to output of "ntfsinfo -m"
Volume state and the level of allocation were added to the output
of "ntfsinfo -m", they are useful to identify the state of a volume.
2012-06-18 12:19:27 +02:00
Jean-Pierre André dba29ee6e7 Implemented the fixing of the backup boot sector in ntfsfix
This checks the backup boot sector and fixes it as needed.
2012-03-21 19:35:30 +01:00
Jean-Pierre André 1ad9bdad4d Avoided interpreting UTIME_NOW and UTIME_OMIT from external fuse
UTIME_NOW and UTIME_OMIT are needed for implementing utimensat() and
futimens(2), but they cannot yet be used with external fuse.
This patch is to avoid errors if they cannot be used, even with fuse 4.9
2012-03-21 19:26:00 +01:00
Jean-Pierre André 911ecba5e2 Set the hidden flag according to the latest name when hide_dot_files is set
When the hide_dot_files option is set, a file is marked hidden if the
first character in its name is a dot. This patch updates the hidden flag
when the file is renamed or hard linked (useful for text editors which
create files with a temporary name)
2012-03-21 19:19:39 +01:00
Jean-Pierre André 4e29280cb2 Kept the name of a deleted file in place for easier undeletion
When a file is deleted, there is no need to remove its last name in
the deleted MFT record. The name may be useful for undeleting the file
later (Windows also does not delete the name).
2012-03-21 19:14:03 +01:00
Jean-Pierre André 37ae85a9d5 Cosmetic : moved the basename(3) redefinition to a better location
basename(3) is not available on OpenIndiana and had to be redefined.
Just move the redefinition to a more standard location
2012-03-21 19:09:52 +01:00
Jean-Pierre André 2b779a6510 Implemented the check for already mounted device on OpenIndiana
This adds a variant for checking on OpenIndiana whether a device
is mentioned in /etc/mnttab as being mounted.
2012-03-21 19:01:33 +01:00
Jean-Pierre André 66416041ec Reverted the workaround for ftruncate() and access(W_OK) on OpenIndiana
The special tests for accepting ftruncate(2) and access(W_OK) applied
to a file being created read-only have been implemented in the fuse
kernel module, so there is no need to duplicate them in the file system.
2012-03-21 18:56:05 +01:00
Jean-Pierre André 1c93e2a97d Avoided setuid/setgid removal by chown on OpenIndiana
On OpenIndiana, it is not customary to remove the setuid/setgid flags
when doing a chown, so comply with the local rules.
2012-03-21 18:52:07 +01:00
Jean-Pierre André 319958545e Made sure directories are not hard linked
On OpenIndiana the fuse kernel module does not prevent link(2) from
hard linking directories, so this has to be done in the lowntfs-3g
driver.
2012-03-21 18:48:38 +01:00
Jean-Pierre André e82240f499 Made sure rmdir is only used for directories, and unlink otherwise
On OpenIndiana the fuse kernel module does not prevent unlink(2)
from deleting directories, nor prevent rmdir(2) from deleting files,
so this has to be done in the lowntfs-3g driver.
2012-03-21 18:42:29 +01:00
Jean-Pierre André f78cc45208 Implemented supplementary group checks for OpenIndiana
Checking supplementary groups permissions to access a file relies on
a supplementary group list available in /proc/PID. This patch adds a
variant to implement the checks based on the specific format used
by OpenIndiana.
2012-03-21 18:34:48 +01:00
Jean-Pierre André 66d30c86b3 Implemented an option to set a new serial number in ntfslabel
Defined new options --new-serial and --new-half-serial to set a new
serial number (either the given one or a random one) to a file system.
Useful for mounting the original and the cloned file system at the
same time.
2012-01-23 18:22:59 +01:00
Jean-Pierre André 54f96e4af1 Implemented an option to set a new serial number in ntfsclone
Defined new options --new-serial and --new-half-serial to set a new
random serial number when cloning or restoring a file system.
Useful for mounting the original and the cloned file system at the
same time.
2012-01-23 18:19:17 +01:00
Jean-Pierre André e7bfd31de4 Fixed clearing user data when creating metadata images
Clearing of user data was wrong when extracting the metadata into a
special format image. In this situation the clearing has to be done
without mounting the file system.
2012-01-23 18:13:59 +01:00
Jean-Pierre André 4a0892eb26 Implemented a new option -q to avoid updating the progress information (Matthew Boyle)
The progress bars complexify the integration of ntfsclone into other
tools, the option -q (or --quiet) gets rid of them.
2012-01-23 18:10:26 +01:00
Jean-Pierre André cd0be288b9 Fixed debug check for double opening after deleting an inode
A debug check could be defeated when a deleted inode number was reused.
2012-01-23 18:05:27 +01:00
Jean-Pierre André a5e656751d Worked around basename(3) not present on OpenIndiana 2012-01-23 18:03:59 +01:00
Jean-Pierre André e85d986494 Put the device name as the last option
On OpenIndiana the device names have commas, so put it as the last option
to prevent defeating the options parsing.
2012-01-23 18:00:18 +01:00
Jean-Pierre André 08ad3b4977 Mounted with an absolute mount point on OpenIndiana
OpenIndiana requires that the mount points be defined on a full
absolute patch. Give it what it needs.
2012-01-23 17:56:15 +01:00
Jean-Pierre André 458c5eb191 Worked around write checks for ftruncate() and access(W_OK) on OpenIndiana
When a file is created with no write permissions, ftruncate and
access(W_OK) should be allowed, but this check has to be made by the
file system on OpenIndiana.
This patch is not active on Linux (#ifdef'ed)
2012-01-23 17:49:38 +01:00
Jean-Pierre André b25178fec3 Strengthened sanity checks on readdir/closedir
Be more defensive against readdir() on closed directories.
2012-01-23 17:45:12 +01:00
Jean-Pierre André ac8a980e7a Preferred access control by file system on OpenIndiana
ntfs-3g cannot reliably use the access control made by the kernel on
OpenIndiana, so do it at the file system level until this is solved.
2012-01-23 17:39:47 +01:00
Jean-Pierre André d85675bf6d Returned unmount errors in ntfs-3g.probe (Diego Elio Petteno)
ntfs-3g.probe is used to get information about mounting errors, this
extends the use for unmounting errors.
2012-01-23 17:34:19 +01:00
Jean-Pierre André 528b4303b2 Accepted multiple read-only mounts
Multiple mounts of a partition is now allowed provided they are all
in read-only mode.
2012-01-23 17:31:15 +01:00
Jean-Pierre André c9edd32113 changed error return for user access to trusted xattr
When a user queries an extended attribute in the trusted namespace,
the traditional error return was EPERM. This has been recently changed
to ENODATA. See https://lkml.org/lkml/2011/5/27/199
2012-01-23 17:25:55 +01:00
Jean-Pierre André 0aa68c128d output the numbers of runs and fragments in ntfsinfo
It is difficult to identify whether a file from a user complaining about
bad throughput is over-fragmented, so get the information from ntfsinfo.
2012-01-23 17:20:20 +01:00
Jean-Pierre André 3c6e88cb0f fixed checking whether Windows 7 was hibernated
On Windows XP and Vista, the system hibernation is identified by the
sequence "hibr" at the beginning of hiberfil.sys. This had been changed
to "HIBR" in Windows 7, so both sequences have to be accepted as
hibernation criteria.
2012-01-23 17:16:07 +01:00
Jean-Pierre André 5593ee2711 fixed clearing the end of extents when extracting metadata
When extracting the metadata, unused data at the end of MFT records is
supposed to be cleared. This was done for the base record of each file,
but not for the extent records.
2012-01-23 17:11:46 +01:00
Jean-Pierre André 4ce33daf6c Cosmetic : fixed an indentation in unistr 2012-01-23 17:09:19 +01:00
Jean-Pierre André 162b4f8051 Fixed clearing the bad cluster list in ntfsfix
Clearing the bad cluster list was done by truncating $BadClus:$Bad,
this turned out not to be reliable because chkdsk does not adjust
the size of $BadClus:$Bad when declaring a cluster bad.
2012-01-23 16:59:49 +01:00
Jean-Pierre André 9b5bd2cbbc Allowed building for kfreebsd (Robert Millan)
Extended several #ifdef's to account for "FreeBSD kernel"
2012-01-23 16:55:04 +01:00
Jean-Pierre André d06ee35332 Used ENOENT instead of ENODATA when the latter is not defined (Robert Millan)
ENODATA is not defined by Posix and is lacking on FreeBSD
2012-01-23 16:50:25 +01:00
Szabolcs Szakacsits e38154dde2 Version 2012.1.15 2012-01-15 15:21:52 +02:00
Erik Larsson e08c40170b Prefix all functions and macros in ntfsprogs/list.h with 'ntfs_/NTFS_'.
This avoids name collisions with Mac OS X system headers (specifically
/usr/include/sys/queue.h). It's quite possible that other operating
systems also have similarly named macros in their system headers since
the function/macro names are very generic.
2012-01-13 13:37:33 +01:00
Erik Larsson 9fca9caf5c ntfswipe.c: Deduplicated MFT write code in wipe_mft. 2012-01-13 08:54:46 +01:00
Erik Larsson 50774cd274 ntfswipe.c: Code cleanup.
Changed the code to use the structs in layout.h instead of addressing
byte addresses directly. This makes the code a lot more readable.
2012-01-13 08:54:46 +01:00
Erik Larsson 7e2ee67097 ntfswipe.c: Big endian fix for wipe_mft.
The 'bytes_in_use' member was not byteswapped after being read from the
buffer and used in a calculation.
2012-01-13 08:54:46 +01:00
Erik Larsson 887ccbf868 ntfswipe.c: Write newly manufactured MFT entries to $MFTMirr if needed.
'wipe_mft' didn't write any $MFTMirr entries for newly manufactured
entries (i.e. entries that were unused and therefore competely wiped and
replaced with a newly initialized copy).
2012-01-13 08:54:46 +01:00
Erik Larsson 7213211c96 ntfswipe.c: Fixed writing incorrect $MFTMirr entries in wipe_mft.
The dereferencing of 'offset' and 'usa' from the MFT record wasn't an
le16* dereference but a u8* dereference, leading to only the least
significant byte (little-endian systems) or the most significant byte
(big-endian systems) being part of the value. (So while this bug could
go unnoticed on little-endian systems for volumes with small values of
'usa', it caused even more significant problems on big-endian systems.)

Fixed by properly casting the address to le16* before dereferencing.
2012-01-13 08:54:46 +01:00
Erik Larsson 82ea9c6e07 ntfswipe.c: Fix support for non-1024 byte MFT record sizes in wipe_mft.
'wipe_mft' was hardcoded to use the USA size of a 1024 byte MFT record
when creating new blank MFT entries. It now calculates the USA size
based on vol->mft_record_size.
2012-01-13 08:54:45 +01:00
Erik Larsson 5f7c535b55 utils.c: Fixed apparently incorrect initial value of 'bmpmref'.
This bug led 'utils_mftrec_in_use' to use 'cached' data before it had
been initialized (i.e. its contents was undefined), producing incorrect
results for the first 3584 MFT entries.
2012-01-13 08:54:45 +01:00
Jean-Pierre André debeb762c1 secaudit : minor : fixed a false memory leak detection 2011-11-10 21:34:39 +01:00
Jean-Pierre André 2fb7a43638 secaudit : prefixed owner and group SID in ACL display 2011-11-10 21:33:06 +01:00
Jean-Pierre André 1df34a6056 New : implemented an option -d to clear the dirty flag if ntfsfix is successful 2011-11-04 11:15:01 +01:00
Jean-Pierre André cb3aad8a63 Minor : fixed a test of volume dirty flag in ntfsfix 2011-11-04 11:11:40 +01:00
Jean-Pierre André b76883dc84 major : Fixed computation of index block size (Anton Altaparmakov)
When the cluster size is bigger than the index block size, the index
block size unit is 512 (not the sector size) instead of the cluster size.
The partitions formatted by mkntfs and used by ntfs-3g were not
interoperable with Windows when the cluster size is bigger than 4K
and the sector size is not 512.
2011-11-04 11:01:11 +01:00
Jean-Pierre André 4629a7af14 manual : Added a warning against checks at boot time
The booting process has recently been changed so that partitions
which are requested to be checked at mount time with no checker
available, cause a specific user interaction while booting.
The patch warns users against requesting such a check, as there
is no known open-source ntfs file system checker.
2011-10-20 19:11:38 +02:00
Jean-Pierre André 864cf7232e Fixed huge data writes
When computing the runlist for the first non-resident write to an
attribute, an inconsistency was created between the attribute image
and the ntfs_attr structure, which could cause an MFT record overflow
when the first write is huge and fragmented (reported by Vito Caputo).
2011-10-20 19:05:27 +02:00
Jean-Pierre André 59ecea5c80 new : allow compression in default setup
With the default mount options, compression of new files are now done
if the parent directory is marked for compression. The mount option
"compression" is not needed any more, but the option "nocompression"
can be used to disable compression of new files.

The default option also applies to applications using libntfs-3g with
no mount command.
2011-10-20 18:55:32 +02:00
Jean-Pierre André 69549be496 fix : fed in the available space in ntfscp 2011-10-20 18:51:15 +02:00
Jean-Pierre André 650eaddb89 new : allowed compression in ntfscp 2011-10-20 18:49:58 +02:00
Szabolcs Szakacsits 360e9475f4 Release 2011.10.9-RC 2011-10-09 11:29:41 +03:00
Jean-Pierre André 328f36447e Inserted the inode number when naming unnamed undeleted files
When undeleting a file whose name cannot be recovered, this patch
defines a name to which the inode number is appended to facilitate
a bulk recovery (recovering the unwanted deletion of a subtree).
2011-10-07 11:52:21 +02:00
Jean-Pierre André 6e52a39608 Added to ntfsundelete an attempt to recover the name of a deleted file
When a file is deleted, ntfs-3g deletes the name from the MFT record,
so the name is not available when the file has to be undeleted.
This patch tries to recover the name when it has not been overwritten.
This is mostly possible when data is non-resident and not fragmented.
2011-10-07 11:45:47 +02:00
Jean-Pierre André 42597c830d Developped creating a metadata image in ntfsclone
With this patch a metadata image can be created without creating
an intermediate file. Use both option -m and -s.
2011-10-07 11:42:08 +02:00
Jean-Pierre André c42c502e92 Developped fixing of a self-located MFT data bug in ntfsfix
Under some rare and obscure circumstances probably unrelated to ntfs-3g,
a part of the runlist of MFT describes its own location, therefore
it cannot be loaded. This patch relocates the MFT extent to inode 15
to fix this. Note : chkdsk cannot fix it and destroys all the files.
2011-10-07 11:33:22 +02:00
Jean-Pierre André b41ad439f9 Developped expanding an NTFS volume downwards in ntfsresize
When the lower bound of an ntfs partition is moved down this patch
recreated new metadata in the expanded space without copying the
actual data. The existing code for moving the upper bound of the
partition has been kept unchanged.
2011-10-07 11:26:58 +02:00
Jean-Pierre André a7c61d83a7 Defined option delay_mtime to delay updates of mtime+ctime
This patch avoid updating the time stamps whenever a file is modified,
by delaying the time stamps updating until the file is closed.
This is mostly useful when the ntfs file system hosts another loop-monted
file system to avoid frequent updates of the time stamps in the outer
file system.
2011-10-07 11:16:23 +02:00
Jean-Pierre André 8a762bee41 Cosmetic : fixed an error message (hggdh2) 2011-09-30 09:06:42 +02:00
Jean-Pierre André c0955e5d74 cosmetic : fixed improper wordings (hggdh2) 2011-09-28 16:41:12 +02:00
Jean-Pierre André 35fbb698ba Fixed a bug when undeleting a sparse file
An old typo leading to a badly recovered file and sometimes to a segfault
2011-09-26 15:03:38 +02:00
Jean-Pierre André 08bf2b5bcb Avoided logging meaningless fixup errors in ntfsclone and ntfsresize
Logging of fixup errors for uninitialized inodes cause unnecessary
worries and suspicion of malfunctions in ntfs-3g. This patch silences
these loggings in ntfsclone and ntfsresize which have to analyze all
inodes, including the uninitialized ones.
2011-09-23 11:28:42 +02:00
Jean-Pierre André ad53f4c24a Enabled getting the sector size from an ioctl on FreeBSD and MacOSX (Erik Larsson)
The sector size is needed for formatting a volume unless forced through
an option or using the traditional sector size.
2011-09-14 12:21:59 +02:00
Jean-Pierre André 3c03e056f1 Fixed the size limits for the volume label set by mkntfs 2011-09-14 08:32:28 +02:00
Erik Larsson c3e651047a Replaced some usages of ntfs_mbstoucs_libntfscompat with ntfs_mbstoucs.
Some calls to ntfs_mbstoucs_libntfscompat were unnecessary as they only used
functionality that can be provided by ntfs_mbstoucs.
2011-09-13 09:51:55 +02:00
Erik Larsson 8d06955ea4 Cleaned up and moved label changing functionality into libntfs-3g.
The label changing code in ntfslabel was cleaned up and modified to use the more
advanced functionality of libntfs-3g instead of using older custom code to
resize and create resident attributes.
The core label changing functionality was also moved into the library so it can
be reused by other programs.
2011-09-13 09:43:30 +02:00
Jean-Pierre André 4dd63e0fd1 Fixed the setting of attributes by secaudit
The setting of attributes was done in the "standard information",
it must also be propagated to the indexes in parent directories.
2011-09-12 18:41:25 +02:00
Erik Larsson b8103bbcfe Permit $VOLUME_NAME to be 0-sized, even when $AttrDef says otherwise.
When clearing a volume name in Windows, $VOLUME_NAME is set to size 0, even if
the standard $AttrDef says that the minimum size is 2.

So the definition in $AttrDef doesn't reflect actual Windows behaviour in this
particular case, and to clear volume names ourselves the way Windows does it,
we must must add a special rule to permit us to truncate the $VOLUME_NAME
attribute to 0 even when $AttrDef specifies a higher value as minimum size.
2011-09-12 09:07:00 +02:00
Jean-Pierre André 178ae712c3 Fixed the truncation of dos file names
Truncate dos file names to 12 ntfschars instead of 12 utf-8 bytes
2011-09-08 09:52:51 +02:00
Jean-Pierre André 0b8b7521a4 Fixed the FullyMapped flag when making an attribute resident
When an attribute is truncated and made resident, the NAttrFullyMapped
flags has to be cleared, otherwise the attribute cannot be properly
mapped when the attribute is later made non-resident again.
2011-08-30 16:02:32 +02:00
Jean-Pierre André 0b827cc978 Avoid endless recursion when MFT extents are described in themselves
When getting extents of MFT, we must be sure they are in the MFT part which
has already been mapped, otherwise we fall into an endless recursion.

Situations have been met where extents locations are described in themselves,
as a consequence of a bug, probably unrelated to ntfs-3g.
This is a severe error which chkdsk cannot fix.
2011-08-30 15:56:36 +02:00
Jean-Pierre André a1161d552f cosmetic : Removed a pointless store in ntfs_attr_make_resident() (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André e4a7a56a1a cosmetic : Removed a redundant store in utils_is_metadata() (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André ae020fc4a7 cosmetic : Removed two dead stores in remove_object_id_index() (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André 35ad185ade cosmetic : Removed a pointless variable initialization in upgrade_secur_desc() (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André 246019fcd5 fix : Fixed ntfs_rl_extend() returning garbage in error case (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André 9497aa7974 minor : Fixed ntfs_fuse_read() returning garbage in error case (Fabian Keil) 2011-08-04 15:49:35 +02:00
Jean-Pierre André fa3d7a5728 minor : Fixed ntfs_upcase_build_default() returning garbage in error case (Fabian Keil) 2011-08-04 15:49:35 +02:00
Jean-Pierre André f10f067c7b revert : Reverted to old behavior for errored reply in ntfsresize 2011-08-04 15:49:35 +02:00
Jean-Pierre André a3579a1674 documentation : Improved the description of the -f option in the manual for ntfsresize 2011-08-04 15:49:35 +02:00
Jean-Pierre André 0147a15e1e cosmetic : Removed an unneeded function in fuse_lowlevel.c (and a gcc 4.6 warning) 2011-08-04 15:49:35 +02:00
Jean-Pierre André 12e54df513 cosmetic : Removed more unneeded variables warned by gcc 4.6 2011-08-04 15:49:35 +02:00
Erik Larsson 182c5c2a2f Fix: Forgot to update state bits after last change. 2011-08-03 15:49:40 +02:00
Erik Larsson 7f2d1efa82 Bugfix: ntfs_mft_load didn't fill in the size fields in the $MFT inode. 2011-08-03 11:13:40 +02:00
Erik Larsson 277c8c8cdf ntfsprogs/Makefile.am: Fix for conflicting usage of EXTRA_PROGRAMS.
After the '--enable-extras' patch, EXTRA_PROGRAMS and bin_PROGRAMS were both defined when ENABLE_EXTRAS was enabled.
This created a conflict, where at least automake 1.10 attempted to emit targets for the binaries twice, resulting in failure when running 'autogen.sh'.

Conflict was resolved by defining the names of the binaries in a non-reserved variable EXTRA_PROGRAM_NAMES, which is then included either in EXTRA_PROGRAMS or bin_PROGRAMS but never in both.
2011-07-06 19:11:49 +02:00
Erik Larsson fd71e36096 Added a new configure option '--disable-ntfs-3g'.
The binaries 'ntfs-3g', 'lowntfs-3g', 'ntfs-3g.probe' 'ntfs-3g.usermap' and 'ntfs-3g.secaudit' will not be built when this option is passed to 'configure'.

When specifying both '--disable-ntfsprogs' and '--disable-ntfs-3g', only libntfs-3g will be built (no executable binaries).
2011-07-06 19:11:42 +02:00
Jean-Pierre André 2cc1bcb59d Fixed compiling ntfsfix.c for a Sparc 2011-07-06 17:46:31 +02:00
Jean-Pierre André de151c1add Implemented a new option to clear the list of bad sectors 2011-07-05 12:17:31 +02:00
Jean-Pierre André 919eeb71df Improved compression (faster) 2011-07-05 12:17:30 +02:00
Jean-Pierre André d7926f72d0 Provided support for big writes 2011-07-05 12:17:30 +02:00
Jean-Pierre André 17caba34db Implemented expanding runlists in ntfsresize (Fedora 689275) 2011-07-05 12:17:30 +02:00
Jean-Pierre André bde75a7bce Optionally closed volume and cleaned memory when leaving ntfsresize (kept disabled) 2011-07-05 12:17:30 +02:00
Jean-Pierre André c54db11d96 Fixed dead http links in ntfsprogs manuals (Daniel Baumann) 2011-07-05 12:17:30 +02:00
Jean-Pierre André 1673ce9c91 Accepted the backup bootsector not be to accounted for when cloning 2011-07-05 12:17:29 +02:00
Jean-Pierre André 5a56ad9ff1 Silenced apparent out-of-range subscripts warned by gcc 4.6 2011-07-05 12:17:29 +02:00
Jean-Pierre André 5cd49257b0 Removed unneeded variables as warned by gcc 4.6 2011-07-05 12:17:29 +02:00
Jean-Pierre André 1c1c0540e8 Fixed use of uninitialized variable in ntfsfix 2011-07-05 12:17:29 +02:00
Jean-Pierre André 2be8e64049 Fixed relatime as a default mount option (had become atime) 2011-07-05 12:17:29 +02:00
Jean-Pierre André 47a4b0ba17 Fixed a too restrictive consistency check in attrib.c 2011-07-05 12:17:29 +02:00
Jean-Pierre André f5433e02a2 Fixed the description of inherit option in the manual 2011-07-05 12:17:28 +02:00
Jean-Pierre André 2c248202f5 Fixed accessing an unmounted volume in ntfsck 2011-07-05 12:17:28 +02:00
Jean-Pierre André 0ec31405c6 Fixed casting data to printf format in ntfsck, ntfsmove and ntfswipe 2011-07-05 12:17:28 +02:00
Jean-Pierre André fe1a7b22a2 Fixed checking file system type in ntfsck 2011-07-05 12:17:28 +02:00
Jean-Pierre André 473d03d4b7 Fixed a bug causing SEGV in ntfsck (but nothing done anyway) 2011-07-05 12:17:28 +02:00
Jean-Pierre André 44116675ca Fixed warning for possible use of uninitialized variable in ntfsfix 2011-07-05 12:17:28 +02:00
Jean-Pierre André 262ed5f7df Cleared attribute flags controlling recursive writes 2011-07-05 12:17:28 +02:00
Jean-Pierre André 571dbc5784 Fixed device path canonicalization for use by devmapper (basilinya)
For some reason, when the monted device is "/dev/mapper/*", a record
in the form "/dev/dm-*" ends up in /etc/mtab and the device cannot be
unmounted.

The reason is unclear, the /dev/mapper name is not a symlink, and the
function doing the name change is not known. No detailed feedback from
the users having met the issue.

The patch changes the name back to the /dev/mapper name after realpath()
is called, and, if there is an actual change, both the name passed to
ntfs-3g and the one passed to fuse and mount are logged in the hope
of getting a clue about what is happening.

But ntfs-3g is probably not the right place for a fix.
2011-07-05 12:17:12 +02:00
Jean-Pierre André 82b00364a8 Fixed setting DOS names when defined with lower-case chars 2011-07-05 12:17:11 +02:00
Jean-Pierre André 5aa84db792 Silenced warning for ignoring the result of fgets in ntfsresize 2011-07-05 12:17:11 +02:00
Jean-Pierre André 683d0a0a4f Defined an option --enable-extras for extra ntfsprogs tools (from Fedora) 2011-07-05 12:17:11 +02:00
Jean-Pierre André 259b8ab308 Fixed compilation on OpenIndiana (Apostolos Syropoulos) 2011-07-05 12:17:11 +02:00
Jean-Pierre André 5cd711248b Fixed options parsing on OSes with no extended attributes 2011-07-05 12:17:11 +02:00
Jean-Pierre André 0289d1a6c3 Fixed the included files into ntfsck.c (from Fedora) 2011-07-05 12:17:11 +02:00
Jean-Pierre André f510c5cdf4 Got the target libs to build libntfs-3g and libfuse-lite if selected 2011-07-05 12:17:11 +02:00
Szabolcs Szakacsits 6742b536b0 Release 2011.4.12 2011-04-10 21:02:34 +03:00
Szabolcs Szakacsits 78e5023eaa Merge branch 'edge' of ssh://szaka@ntfs-3g.git.sourceforge.net/gitroot/ntfs-3g/ntfs-3g_ntfsprogs into edge 2011-04-10 20:54:09 +03:00
Szabolcs Szakacsits 9523cf4bfd Release 2011.4.10 2011-04-10 20:52:22 +03:00
Jean-Pierre André e4db980830 Translated the junctions to lower case when ignore_case is set
When ignore_case is set, the file names are returned lower-case in
readdir() in order to make file name completions possible. This patch
does the same for junction points to avoid directory locks when used
with non-matching names.
2011-04-08 18:19:17 +02:00
Jean-Pierre André b492b313f9 Fixed a false detection of bad memory release in secaudit 2011-04-08 18:15:43 +02:00
Jean-Pierre André 5603b7d4c2 Described a few configure options in the README file 2011-04-08 18:13:25 +02:00
Szabolcs Szakacsits 303910b052 Release 2011.3.28-RC 2011-03-28 02:38:41 +03:00
Szaka 62f305970f Release 2011.3.26 2011-03-27 15:31:13 +03:00
Szaka f246d6ce97 Update ntfs-3g.org references 2011-03-27 15:29:48 +03:00
Jean-Pierre André 04f3e94dff Added mention of contributors for porting ntfsprogs to ntfs-3g 2011-03-23 10:09:20 +01:00
Jean-Pierre André 67f07ac3ad Added option --check to ntfsresize (from fedora) 2011-03-23 09:50:12 +01:00
Jean-Pierre André 71488598d7 Added option --info-mb-only to ntfsresize (from fedora) 2011-03-23 09:48:40 +01:00
Jean-Pierre André 86ce44ac58 Made ntfsfix able to use a backup boot sector larger than 512 bytes
When the normal boot sector is not usable, ntfsfix tries to use the last
sector as a boot sector replacement. This implies getting the sector size
and reading both full-sized boot sectors.
2011-03-23 09:46:46 +01:00
Jean-Pierre André c6043ec2c9 Set the same timestamp per file in all attributes in mkntfs
mkntfs did not set the same timestamp in inode and index.
2011-03-23 09:43:13 +01:00
Jean-Pierre André b4d1c6165b Used a stream to produce aligned writes in image creation
When creating a partition image, ntfsclone write an extra byte to
describe each cluster, this causes two unneeded ntfs-3g calls per cluster,
and inefficiency when imaging to ntfs.
2011-03-23 09:35:24 +01:00
Jean-Pierre André 0ce2d5bc57 Freed a search context in ntfslabel
Avoids a memory leak detection
2011-03-23 09:30:51 +01:00
Jean-Pierre André 2a2d94897c Silenced warnings for no-return functions in ntfsresize 2011-03-23 09:29:27 +01:00
Jean-Pierre André 4b408e60ae Strenghtened types in ntfslabel and ntfsfix 2011-03-23 09:27:33 +01:00
Jean-Pierre André 6d68c74f37 Fixed a segfaulting bug in ntfsundelete (from Fedora) 2011-03-23 09:24:55 +01:00
Jean-Pierre André 058f850eb3 Fixed getting space for making an index non resident
In rare situations there is not enough space in the base inode entry
to make an index non resident. The index has to be moved to an extent
first. This happens when not using permissions and inserting a file
whose name has 60 chars into a directory whose name has 184 chars.
(bug reported by Vito Caputo)
2011-03-23 09:22:08 +01:00
Jean-Pierre André f219d2e07e Fixed inconsistent interface to ntfs_initialize_file_security()
The "flags" argument of ntfs_initialize_file_security() is intended to
feed the one to ntfs_mount(). Having the same type for both may avoid
future problems.
2011-03-23 09:20:10 +01:00
Jean-Pierre André 1e7d8809a8 Fixed freeing upcase in ntfsfix (avoiding memory leak detection)
Under some error condition, the upcase table was not freed.
Just cosmetic fix to avoid a memory leak detection.
2011-03-23 09:16:57 +01:00
Jean-Pierre André 2594a6c983 Fixed allocated size for resident unnamed data in mkntfs
The recorded allocated size depends on unnamed data being non resident,
which depends on MFT record size, hence on sector size.
The allocated size was wrong for $AttrDef when sector size is 4K bytes
(chkdsk silently fixes it).
2011-03-23 09:14:55 +01:00
Jean-Pierre André c879697b12 Fixed type of argument (same value)
A boolean argument had been replaced by a tri-state one, but the change
was forgotten in one instance. No visible effect, the value is the same.
2011-03-23 09:10:10 +01:00
Jean-Pierre André 7ac015451c Fixed allocated size to MFT in mkntfs
mkntfs stored a different value for allocated size in inode and index.
2011-03-23 09:06:27 +01:00
Jean-Pierre André 2363a26297 Removed duplicated code
A patch had been applied twice, duplication caused to no visible effects.
2011-03-23 09:02:15 +01:00
Jean-Pierre André c6da530efc Synced the created image before remounting in ntfsclone
Better sync before remounting, but probably not an error
2011-03-23 08:59:49 +01:00
Erik Larsson e8dc824252 Enabled ntfsprogs by default. 2011-03-04 17:33:07 +01:00
Jean-Pierre André 402924cc50 Fixed cluster mapping ahead of mapped runlist
A corner case was wrong and could cause aborted writes with error
"Run lists overlap. Cannot merge" when the clusters required by the
write are described in different MFT extents.
This can only happen in very fragmented files when the cluster size
is smaller than 4096 bytes. It does not cause any metadata corruption.
2011-03-01 12:14:53 +01:00
Jean-Pierre André e20c1df1e5 Fixed copying the backup boot sector on a partial cluster
A recent patch added copying the backup boot sector when cloning,
saving or restoring a partition, but when the total number of sectors is
not a multiple of the number of sectors per cluster, the last cluster
containing the backup boot sector is shorter than usual.
When this happens, the present patch avoids overflowing from partition
when accessing the last cluster.
2011-02-17 16:11:26 +01:00
Jean-Pierre André 30c06f9092 Fixed dealing with holes when expanding an attribute 2011-02-16 12:22:30 +01:00
Jean-Pierre André 8034e9be25 Fixed the location of the backup boot sector 2011-02-16 12:20:46 +01:00
Jean-Pierre André f68259e0c2 Copied the alternate boot sector when cloning 2011-02-16 12:18:56 +01:00
Jean-Pierre André 309ca32e52 Silenced warning for function with no return 2011-02-08 13:52:13 +01:00
Jean-Pierre André 6b570dfe96 Added tries to fix file systems with incorrect size 2011-02-08 13:52:13 +01:00
Jean-Pierre André 3160203c97 Defined option acl to request the use of Posix ACLs 2011-02-08 13:52:12 +01:00
Jean-Pierre André f55f359f4e Moved global options parsing to ntfs-3g_common.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André 461e9f21b8 Moved mount options parsing to ntfs-3g_common.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André a46a395006 Updated copyright notices 2011-02-08 13:52:12 +01:00
Jean-Pierre André 2842936b74 Checked and fixed the upcase table in ntfsfix.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André 4c6cf9d977 Moved the knowledge of default upcase size to unistr.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André b0849af206 Tried alternate boot sector if cannot start up in ntfsfix.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André 9f765effd3 Defined option -n for no action in ntfsfix.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André c60ae578bd Exited with failure code from ntfsfix.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André 82ce1fcdfa Improved appending data to a long hole 2011-02-08 13:52:12 +01:00
Jean-Pierre André addc9be334 Merged sparse testing when appending with ntfsprogs requirement 2011-02-08 13:52:12 +01:00
Jean-Pierre André bbdfcb017d Restricted listxattr() to environments with extended attributes 2011-02-08 13:52:12 +01:00
Jean-Pierre André d58b21ec1d Fixed possible wrong hole size when overwriting compressed data 2011-02-08 13:52:12 +01:00
Jean-Pierre André e47734baa9 Denied modifications to metadata files 2011-02-08 13:52:11 +01:00
Jean-Pierre André 9ddc70f19b Moved listxattr() to a specific source module 2011-01-17 15:50:25 +01:00
Jean-Pierre André 7eccaa3c53 Fixed the type of argument of utils_mount_volume() 2011-01-10 11:19:54 +01:00
Jean-Pierre André b3d62451e8 Silenced compiler warnings on the use of aggregates 2011-01-10 11:18:55 +01:00
Jean-Pierre André 6bf4af7544 Fixed allocated size when an attribute update causes unnamed data to be expelled 2011-01-10 11:18:16 +01:00
Jean-Pierre André 9b2ecca3df Do not record inode open when failed (debug only) 2011-01-10 11:16:39 +01:00
Jean-Pierre André 6f85502c22 Described how to test in the README file 2010-12-21 15:56:27 +01:00
Jean-Pierre André 70490ce10e Silenced warnings for no return 2010-12-21 15:51:08 +01:00
Jean-Pierre André bfb648b99c Silenced warning on redefinition of ntfs_time 2010-12-21 15:51:08 +01:00
Jean-Pierre André 53599b1a98 Switched to the same Upcase table as Vista 2010-12-21 15:51:08 +01:00
Jean-Pierre André 0cb35ac7aa Enabled expanding an attribute without creating a hole 2010-12-21 15:51:07 +01:00
Jean-Pierre André d4e2a501a5 Enabled forensic mounting 2010-12-21 15:51:07 +01:00
Jean-Pierre André 5b03804c73 Set a volume UUID unless option -U 2010-12-21 15:51:07 +01:00
Jean-Pierre André fd22595518 Avoided storing the full logfile in memory 2010-12-21 15:51:07 +01:00
Jean-Pierre André 94cab92a24 Avoided storing the full bitmap in memory 2010-12-21 15:51:07 +01:00
Jean-Pierre André 3a6ea1f2c9 Avoided writing beyond allocated variable 2010-12-21 15:51:07 +01:00
Jean-Pierre André f21110f9a3 Closed volume and cleaned up when exiting from ntfsclone 2010-12-21 15:51:07 +01:00
Jean-Pierre André 936ca1193f Displayed times in UTC in ntfsinfo 2010-12-21 15:51:07 +01:00
Jean-Pierre André 31ce5db142 Added option for not clearing the timestamps in ntfsclone 2010-12-21 15:51:07 +01:00
Jean-Pierre André f3e6a1af01 Fixed reading old big-endian ntfsclone images 2010-12-21 15:51:07 +01:00
Jean-Pierre André 9f40bcfc22 Moved ntfs_mbstoucs_libntfscompat() to utils.c 2010-12-21 15:51:07 +01:00
Jean-Pierre André 1c9ef6293b Moved the definition of leMFT_REF to layout.h 2010-12-21 15:51:07 +01:00
Jean-Pierre André f22dec0442 Silenced warnings for formats in ntfsfix.c 2010-12-21 15:51:07 +01:00
Jean-Pierre André dc7317dbcc Fixed included files in ntfscmp.c 2010-12-21 15:51:07 +01:00
Jean-Pierre André 8f4aa0883b Strengthened variable types 2010-12-21 15:51:07 +01:00
Jean-Pierre André 1ca4a556b2 Silenced warnings for unmatching printf-type formats 2010-12-21 15:51:07 +01:00
Jean-Pierre André bb142bc742 Fixed deleting files using ignore_case option 2010-12-21 15:51:07 +01:00
Jean-Pierre André cc0cf6901d Added descriptions of options recover/norecover to the manual 2010-12-21 15:50:13 +01:00
Erik Larsson c5ecb91ffe Merge remote branch 'linux-ntfs/libntfs-3g_port-edge' into ntfsprogs_merge.edge
Conflicts:
	ChangeLog
	libntfs/libntfs.8.in
2010-12-19 15:20:24 +01:00
Erik Larsson 2a1fb5f489 Merge branch 'ntfsprogs_merge' into ntfsprogs_merge.v2_0_0 2010-12-19 15:12:57 +01:00
Erik Larsson de22c98ec0 Removed the 'ntfs_home' string from utils.c/h since it was referring to Linux-NTFS and it was a duplicate symbol (an equivalent string exists in volume.c/h). 2010-12-19 15:11:28 +01:00
Erik Larsson 5a595b9585 Build fix for UUID code in mkntfs. 2010-12-19 09:42:54 +01:00
Erik Larsson ef0190cbd7 Merge branch 'master' into libntfs-3g_port-edge
Conflicts:
	configure.ac
	libntfs/bootsect.c
	libntfs/logging.c
	ntfsprogs/ntfsmount.c
2010-12-19 09:06:45 +01:00
Erik Larsson 48c1a753fe Removed the libntfs FreeBSD I/O layer.
This might be a good idea to import into libntfs-3g later to remove the dependency on external patches in FreeBSD (and Mac OS X when using raw devices).
2010-12-17 09:41:34 +01:00
Erik Larsson 58b40c8cf1 Deleted libntfs example crypto configuration file and removed the check for libconfig in configure.ac. (libconfig is not used in libntfs-3g.) 2010-12-17 09:37:19 +01:00
Erik Larsson 1edc6fbc9a Removed 'libntfs' manpage. (We may want to create a 'libntfs-3g' manpage using this one as a template later.) 2010-12-17 09:31:34 +01:00
Erik Larsson a432192b37 Removed libntfs' version of misc.c (unused). 2010-12-17 09:29:29 +01:00
Erik Larsson b0760b6efa Removed crypto.c/crypto.h which was an addition to libntfs that was unused by ntfsprogs. 2010-12-17 09:27:13 +01:00
Erik Larsson bcdc76f12d Merge remote branch 'linux-ntfs/libntfs-3g_port-v2_0_0' into PERMISSION_HANDLING_BRANCH
Conflicts:
	.cvsignore
	AUTHORS
	CREDITS
	ChangeLog
	NEWS
	README
	TODO.libntfs
	autogen.sh
	configure.ac
	include/ntfs/Makefile.am
	libntfs-3g/misc.c
	libntfs/Makefile.am
	libntfs/gnome-vfs-method.c
	libntfs/gnome-vfs-module.c
	ntfsprogs.spec.in
	ntfsprogs/.cvsignore
	ntfsprogs/mkntfs.c
	ntfsprogs/ntfscat.8.in
	ntfsprogs/ntfsclone.c
	ntfsprogs/ntfscp.8.in
	ntfsprogs/ntfsinfo.c
	ntfsprogs/ntfsprogs.8.in
	ntfsprogs/ntfsresize.c
	ntfsprogs/ntfsrm.c
	ntfsprogs/ntfsundelete.h
	ntfsprogs/upcase.c
	ntfsprogs/utils.c
	test/Makefile.am
2010-12-17 09:04:01 +01:00
Erik Larsson e12b5f2c7f ntfsclone manpage: Fixed typo 'clonning'. 2010-12-16 17:36:25 +01:00
Erik Larsson cdc930e4bf ntfsprogs manpage: Added a reference to the ntfs-3g manpage in the "SEE ALSO" section. 2010-12-16 17:36:12 +01:00
Erik Larsson 8deb6a323c ntfsprogs manpages: Updated the link to where the package can be downloaded. It now points at "http://www.tuxera.com/community/". 2010-12-16 17:35:59 +01:00
Erik Larsson 64d5d4da1d ntfsprogs manpages: Updated references to the 'ntfsprogs package' to reference the ntfs-3g package instead. 2010-12-16 17:35:48 +01:00
Erik Larsson 2188eab0a0 ntfsprogs manpages: Replaced all references to the linux-ntfs-dev mailing list with the ntfs-3g-devel mailing list. 2010-12-16 17:35:40 +01:00
Erik Larsson 2d8befcc07 ntfsprogs manpages: Changed 'ntfsprogs' reference in headers into 'ntfs-3g'.
The version number following 'ntfsprogs' is really the ntfs-3g version number, so the substitution seems appropriate.
2010-12-16 17:35:22 +01:00
Erik Larsson dedaf225e3 Cleaned out a seemingly unused declaration from Makefile.am in ntfsprogs. 2010-12-16 17:35:14 +01:00
Erik Larsson 7287c05ff4 Made ntfsprogs compilation conditional and turned off by default. It is enabled with '--enable-ntfsprogs'. 2010-12-16 17:35:06 +01:00
Erik Larsson f3a30779dd Moved list.h into ntfsprogs and got rid of include/ntfs completely. 2010-12-16 17:34:47 +01:00
Erik Larsson daa1f3edcd Bugfixes for 'make extra'. 2010-12-16 10:08:34 +01:00
Erik Larsson 5a41022810 Removed the libntfs-gnomevfs module as it does not seem reasonable to keep maintaining it in ntfs-3g. 2010-12-16 10:08:27 +01:00
Erik Larsson 3efdd4cf0b Merge remote branch 'linux-ntfs/libntfs-3g_port' into ntfsprogs_merge.redo
Conflicts:
        configure.ac
2010-12-16 10:04:22 +01:00
Erik Larsson dd19736b9e 'include' and 'libntfs' TODO files are not applicable to ntfs-3g which uses libntfs-3g and not libntfs. 2010-12-16 10:01:13 +01:00
Erik Larsson 3c6497819f These two files from ntfsprogs are not used by ntfs-3g (and will never be). 2010-12-16 10:01:04 +01:00
Erik Larsson 2634f01ef0 Cleaned out some .cvsignore files that came from ntfsprogs. 2010-12-16 10:00:56 +01:00
Erik Larsson d35be909a4 Removed the 'doc' directory from ntfsprogs.
It contains interesting information but this information is available elsewhere and we want to stay as close to ntfs-3g as possible. No unnecessary added files.
2010-12-16 10:00:27 +01:00
Erik Larsson 7fbfe73dda Removed libntfs-specific test code. 2010-12-16 10:00:07 +01:00
Erik Larsson 16dbcbec0c Restored 'local' includes for all the ntfsprogs instead of using system includes (e.g. #include "yada.h" instead of #include <ntfs-3g/yada.h>). 2010-12-16 09:59:42 +01:00
Erik Larsson 639bd5475c Fixed ntfsprogs/Makefile.am to link against internally built libntfs-3g. 2010-12-15 17:19:20 +01:00
Erik Larsson 02bab2956c Merge remote branch 'linux-ntfs/libntfs-3g_port' into PERMISSION_HANDLING_BRANCH
Conflicts:
	AUTHORS
	COPYING
	CREDITS
	ChangeLog
	Makefile.am
	NEWS
	README
	autogen.sh
	configure.ac
	include/Makefile.am
2010-12-15 17:12:30 +01:00
Erik Larsson f9c7a548c7 Removed tree.h/tree.c as it was only referenced by the 'rich' code. 2010-12-15 13:43:38 +01:00
Erik Larsson d953fec34e Increased patchstate version number. 2010-12-09 12:29:15 +01:00
Erik Larsson 7a95c46e3d Bugfix for ntfs_mbstoucs_libntfscompat: Take the the \0 terminator into account when determining whether reallocing is necessary. 2010-12-09 12:17:11 +01:00
Erik Larsson e81fd0ee2a Important bugfix for ntfs_mbstoucs_libntfscompat: We reallocated too little memory. 2010-12-09 12:15:50 +01:00
Erik Larsson 9c581432cb Important bugfix for ntfs_mbstoucs_libntfscompat: Typo in memcpy operation led to the wrong data being copied! 2010-12-09 12:14:13 +01:00
Erik Larsson 6922b7c8d0 Disabled installation of the remaining (internal) headers when doing a 'make install'. 2010-12-04 09:41:30 +01:00
Erik Larsson 066ef925b3 Changed references to libntfs in libntfs-gnomevfs.8.in, now reflecting that libntfs-3g is the underlying library and that libntfs is not included with this version of ntfsprogs. 2010-12-04 09:39:19 +01:00
Erik Larsson 78b40e4b4c mkntfs.c: Fixed two references to missing member 'guid' in 'ntfs_volume'. 2010-12-03 07:52:31 +01:00
Erik Larsson 86eb7504eb gnome-vfs-method.c: Fixed one occurrence of NTFS_MNT_RDONLY. 2010-12-03 07:51:56 +01:00
Erik Larsson 9c0c2bf633 ntfsprogs/Makefile.am: Added libgcrypt's CFLAGS and LIBS when building ntfsdecrypt. 2010-12-03 07:50:47 +01:00
Erik Larsson 6bf6464aeb Merge branch 'libntfs-3g_port' into libntfs-3g_port-v2_0_0 2010-12-02 22:40:15 +01:00
Erik Larsson 7b62a83286 utils.h: Added missing typedef leMFT_REF. 2010-12-02 22:39:06 +01:00
Erik Larsson 3ddcb40f23 ntfsdump_logfile.c: Removed unnecessary reference to unsupported mount option NTFS_MNT_FORENSIC. (The mount option is pointless as we are mounting the volume in read-only mode anyway.) 2010-12-02 22:37:23 +01:00
Erik Larsson d52190c3cb Fixed reference to deprecated utility 'libgnutls-config' in ntfsprogs' Makefile.am. 2010-12-02 22:37:16 +01:00
Erik Larsson 18789cdeaa Replaced all occurrences of the libntfs mount flag NTFS_MNT_FORCE with the libntfs-3g mount flag MS_RECOVER.
Note: The NTFS_MNT_FORCE, in addition to what MS_RECOVER does, also bypasses the check for the 'dirty' bit in libntfs' ntfs_mount.
However, this check does not exist in libntfs-3g (libntfs-3g will not check or change the dirty bit, being confident that it can handle volumes marked as 'dirty'), so in essence the same behaviour is achieved with MS_RECOVER.
2010-12-02 22:37:06 +01:00
Erik Larsson 6ff5d3f8a7 Replaced all occurrences of the libntfs mount flag NTFS_MNT_RDONLY with the corresponding libntfs-3g mount flag MS_RDONLY. 2010-12-02 22:36:58 +01:00
Erik Larsson 665555491b ntfsundelete.h: Added missing include 'utils.h'. 2010-12-02 22:36:46 +01:00
Erik Larsson 6b65b6024e ntfscp.c: libntfs-3g has added an additional argument to ntfs_create (le32 securid). We pass 0 as 'securid' as this is what should be passed when there is no inheritable security descriptor.
This can of course be discussed. Maybe we should inherit something? From parent? I don't know enough about this.
2010-12-02 22:36:37 +01:00
Erik Larsson 2acadfd360 mkntfs.c: Fixed reference to 'guid' member of ntfs_volume which does not exist in libntfs-3g. 2010-12-02 22:35:20 +01:00
Erik Larsson 6b513b1c55 Replaced references to NVolSetWasDirty with appropriate substitutions.
libntfs (unlike libntfs-3g) sets the volume dirty bit automatically on ntfs_mount (if not already set) and also automatically clears the volume dirty bit on ntfs_umount (if it was not already set before mount). The 'WasDirty' flag is set to indicate that the volume was already dirty when it was mounted, so setting it means bypassing the 'clear dirty flag' behaviour on unmount (it does not mean 'set dirty flag on unmount').

NVolSetWasDirty is accordingly replaced with the actions that were intended:
- If the intention was to leave the dirty bit set on unmount, we explicitly set the bit if it is not already set.
- If the intention was to simply update the 'WasDirty' bit to be consistent with earlier changes, we just comment out the statement.
2010-12-02 22:34:45 +01:00
Erik Larsson f5f3878a8e Replaced all occurrences of the libntfs-specific NVolWasDirty macro with a test for the VOLUME_IS_DIRTY flag in vol->flags.
This is not a perfect conversion. The VOLUME_IS_DIRTY flag reflects the _current_ state of the volume dirty bit and not the mount-time state.
However, since libntfs-3g (as opposed to libntfs) does not automatically change the dirty bit on mount and unmount (only when ntfs_volume_write_flags is called explicitly), and these tests are done directly after a mount (ntfsclone.c, ntfscp.c, ntfsresize.c, ntfswipe.c, utils.c) or when the volume is in an appropriate state (ntfsfix.c), the result will be the same.
2010-12-02 22:34:35 +01:00
Erik Larsson dd3d394010 utils.h: Added ntfs_attr_get_name, a simple inline function from libntfs that was referenced in the ntfsprogs code. 2010-12-02 22:34:00 +01:00
Erik Larsson 41e27e116a Added 'misc.h' as an include to some source files because of missing ntfs_malloc / ntfs_calloc signatures. 2010-12-02 22:31:56 +01:00
Erik Larsson 844d3213a9 ntfsck.c: Adapted includes to libntfs-3g. 2010-12-02 22:31:44 +01:00
Erik Larsson 713fbb390e Merge commit 'v2_0_0' into libntfs-3g_port-v2_0_0
Conflicts:
	configure.ac
	include/ntfs/Makefile.am
	include/ntfs/attrib.h
	include/ntfs/bitmap.h
	include/ntfs/collate.h
	include/ntfs/debug.h
	include/ntfs/dir.h
	include/ntfs/endians.h
	include/ntfs/index.h
	include/ntfs/inode.h
	include/ntfs/layout.h
	include/ntfs/logfile.h
	include/ntfs/logging.h
	include/ntfs/mft.h
	include/ntfs/ntfstime.h
	include/ntfs/runlist.h
	include/ntfs/support.h
	include/ntfs/types.h
	include/ntfs/unistr.h
	include/ntfs/volume.h
	libntfs/Makefile.am
	libntfs/attrib.c
	libntfs/attrlist.c
	libntfs/bitmap.c
	libntfs/bootsect.c
	libntfs/collate.c
	libntfs/compress.c
	libntfs/debug.c
	libntfs/device.c
	libntfs/device_io.c
	libntfs/dir.c
	libntfs/index.c
	libntfs/inode.c
	libntfs/lcnalloc.c
	libntfs/logfile.c
	libntfs/logging.c
	libntfs/mft.c
	libntfs/mst.c
	libntfs/runlist.c
	libntfs/security.c
	libntfs/unistr.c
	libntfs/unix_io.c
	libntfs/volume.c
	libntfs/win32_io.c
	ntfsprogs/Makefile.am
	ntfsprogs/mkntfs.c
	ntfsprogs/ntfscat.c
	ntfsprogs/ntfsclone.c
	ntfsprogs/ntfscmp.c
	ntfsprogs/ntfscp.c
	ntfsprogs/ntfsinfo.c
	ntfsprogs/ntfsmount.8.in
	ntfsprogs/ntfsmount.c
	ntfsprogs/ntfsundelete.c
	ntfsprogs/upcase.c
2010-12-02 22:31:21 +01:00
Erik Larsson ce6a516a56 Removed the 'rich' functionality including the ntfsrm tool.
This change should be reverted once the 'rich' stuff is ported to libntfs-3g, but right now it seems like too much work.
2010-12-02 17:10:57 +01:00
Erik Larsson efb3204b76 utils.h: Updated ntfs_mbstoucs_libntfscompat to comply better with how libntfs' implementation works (with respect to preallocated buffers). 2010-12-02 17:05:48 +01:00
Erik Larsson 6f42c011be ntfswipe.c: Adapt to the changed interface of ntfs_rl_pwrite in libntfs-3g.
ntfs_rl_pwrite has an additional parameter, ofs, in libntfs-3g. Setting ofs to 0 seems to imply the same behaviour as expected from the libntfs equivalent.
2010-12-02 17:03:08 +01:00
Erik Larsson 7478b2396c ntfsmove.c: Adapted calls to ntfs_get_size_for_mapping_pairs to the libntfs-3g interface.
Note: libntfs-3g has a 'max_size' variable to cap the size calculation, but this variable is frequently set to INT_MAX in the libntfs-3g code itself when there is no desire to limit the size calculation. We will do the same here.
2010-12-02 16:56:27 +01:00
Erik Larsson 13bef7f308 ntfstruncate.c: Changed one reference to ntfs_mbstoucs into ntfs_mbstoucs_libntfscompat. 2010-12-02 16:51:49 +01:00
Erik Larsson 196f7f6461 Commented out all references to 'version.h' in the 'extra' utilities until libntfs-3g supports such functionality. 2010-12-02 16:49:56 +01:00
Erik Larsson 07bc8d9d17 Redirected all libntfs includes in the 'extra' utilities to libntfs-3g. 2010-12-02 16:47:06 +01:00
Erik Larsson a0ee1d225d Redirected libntfs includes in gnome-vfs-method.c to libntfs-3g. (And fixed Makefile.am accordingly.) 2010-12-02 16:38:39 +01:00
Erik Larsson 5b9b4c7e49 Removing all references to the libntfs library version until we have such functionality in libntfs-3g. 2010-12-02 16:38:16 +01:00
Erik Larsson bcc00717b0 The legacy FUSE module (ntfsmount) goes away. (ntfs-3g takes care of that part.) 2010-12-02 16:37:57 +01:00
Erik Larsson fc989c67b5 Removed the automatic 'configure' that happens in autogen.sh. It was really annoying me. 2010-12-02 16:37:47 +01:00
Erik Larsson 6d92eb591c Re-added include/ and libntfs/ to the root Makefile.am. 2010-12-02 16:37:34 +01:00
Erik Larsson e20dad4854 Keeping include/ directory for now (and away goes the 'list.h' symlink). 2010-12-02 16:37:23 +01:00
Erik Larsson f893a421c2 Removed libntfs-specific sources. 2010-12-02 16:37:09 +01:00
Erik Larsson c3fa61b4e1 Added symlink to list.h. 2010-12-02 16:36:50 +01:00
Erik Larsson c3571d8cde configure.ac: Fixed typo in error message. 2010-12-02 16:36:39 +01:00
Erik Larsson 3e34aebfc3 Temporary fix while the ntfs_file_values_compare situation is resolved.
Revert if ntfs_file_values_compare is re-added to libntfs-3g, and clean up otherwise.
2010-12-02 16:36:18 +01:00
Erik Larsson 4a641c85e0 Adapted code to latest libntfs-3g, based on PERMISSION_HANDLING_BRANCH. Now requires libntfs-3g version 2010.5.22 minimum. 2010-12-02 16:35:27 +01:00
Erik Larsson 16ba09b70f Introduced a pkg-config check for libntfs-3g at configure time, using the CFLAGS and LDFLAGS specified in the .pc file. 2010-12-02 16:35:12 +01:00
Erik Larsson 9e20bbeec4 This port of ntfsprogs doesn't need the old libntfs, so don't compile it (disregard completely). 2010-12-02 16:34:51 +01:00
Erik Larsson 7a3ddf1e14 Modernized check for libgnutls using pkg-config. (Had to do it, since libgnutls doesn't have the necessary .m4 file in more recent releases.) 2010-12-02 16:34:41 +01:00
Erik Larsson 36b876375e Commented out all instances of MS_NOATIME being passed to ntfs_mount, as libntfs-3g does not support that flag.
In fact, this is how libntfs-3g operates normally, so the MS_NOATIME flag is not needed. However, other utilities might incorrectly assume that the library updates access times for them.
Investigating whether access time needs to be manually updated in other utilities is TODO.
2010-12-02 16:31:43 +01:00
Erik Larsson ee3297311d utils.h: Fixed absent definition of MAX_PATH by copying the definition from libntfs's headers (dir.h). 2010-12-02 16:16:47 +01:00
Erik Larsson 9b6523ab42 mkntfs.c: Signature of 'ntfs_boot_sector_is_ntfs' has changed in libntfs-3g (unused variable 'silent' has been removed). 2010-12-02 16:13:25 +01:00
Erik Larsson 058e47afbd Updated references to members of INDEX_HEADER and INDEX_ENTRY that have been renamed in libntfs-3g.
INDEX_HEADER: flags -> ih_flags
INDEX_ENTRY: flags -> ie_flags
2010-12-02 16:10:18 +01:00
Erik Larsson b538215ddb Replaced all occurrences of ntfs_mbstoucs with a compatibility wrapper function (ntfs_mbstoucs_libntfscompat).
The interface and semantics of ntfs_mbstoucs differ between libntfs and libntfs-3g, so this compatibility wrapper tries to address the differences.
2010-12-02 16:05:22 +01:00
Erik Larsson f03d683fa0 Commented out all references to 'version.h' (which doesn't exist in libntfs-3g) and added a stub implementation of ntfs_libntfs_version in utils.h to allow things to compile. 2010-12-02 15:58:14 +01:00
Erik Larsson 1860eff1da Updated all includes in the basic ntfsprogs utilities for libntfs-3g. 2010-12-02 15:57:58 +01:00
Erik Larsson 237b937a65 Updated build configuration of ntfsprogs to use libntfs-3g's includes and libraries. 2010-12-02 15:57:43 +01:00
Erik Larsson 8bed21697d configure.ac: Appended a tail to the version number to show that this is a version meant to be used with the ntfs-3g libraries. Also changed the email address to indicate that this fork is managed by the ntfs-3g developers. 2010-12-02 15:57:28 +01:00
Jean-Pierre André 48caa7a45e Took care of alignments needed on some processors 2010-11-09 09:43:31 +01:00
Jean-Pierre André a70e40021d Added detail to an error message to discriminate from a similar one 2010-11-09 09:41:00 +01:00
Jean-Pierre André 135cb75249 Fixed logging corrupted $UpCase 2010-11-09 09:40:02 +01:00
Jean-Pierre André 351aec3f7a Enabled renaming of system extended attributes 2010-10-26 08:59:52 +02:00
Jean-Pierre André f43e972342 Removed obsolete comments 2010-10-26 08:59:52 +02:00
Jean-Pierre André 2f82b18b4b Removed an obsolete debug sequence 2010-10-26 08:59:52 +02:00
Jean-Pierre André 563f5dda3f Implemented a basic check on upcase table 2010-10-26 08:59:51 +02:00
Jean-Pierre André 8b910e9e80 Improved names comparing on big-endian computers 2010-10-26 08:59:51 +02:00
Jean-Pierre André 518196ba5e Improved rebuilding a runlist 2010-10-26 08:59:51 +02:00
Jean-Pierre André 1898b11481 Improved appending data to fragmented files 2010-10-26 08:59:51 +02:00
Jean-Pierre André dd25fce933 Fixed Posix ACLs for big-endian computers 2010-10-26 08:59:51 +02:00
Jean-Pierre André a92c57735b Added an extended attribute name for creation time 2010-10-26 08:59:51 +02:00
Jean-Pierre André 13b578d9b1 Added a big endian extended attribute name for attrib and times 2010-10-26 08:59:51 +02:00
Jean-Pierre André 9c0e3a7b4e Enabled use of fuse cacheing in lowntfs-3g under conditions 2010-10-26 08:59:51 +02:00
Jean-Pierre André e1ef554dd2 Grouped system extended attributes functions into a dedicated module 2010-10-26 08:59:51 +02:00
Jean-Pierre André 1afaf16912 Implemented the sync mount option 2010-10-26 08:59:51 +02:00
Jean-Pierre André ecbc2b9103 Implemented fsync() and fsyncdir() 2010-10-26 08:59:51 +02:00
Jean-Pierre André dd4910b935 Forced alignment on cached structs 2010-10-26 08:59:51 +02:00
Jean-Pierre André 23aae785c4 Fixed stat(2) for system files with no data 2010-10-25 12:13:28 +02:00
Szabolcs Szakacsits 5aed8491a7 release 2010.10.2 2010-10-02 14:19:40 +03:00
Jean-Pierre André b7fbd01ccd Fixed mounting with a SLinux context (from Fedora #502946) 2010-10-01 10:43:31 +02:00
Jean-Pierre André e40c942f3a Checked Posix ACL versions 2010-10-01 10:41:32 +02:00
Jean-Pierre André 07e686a744 Made sure Posix ACLs are not padded by compiler 2010-10-01 10:38:35 +02:00
Jean-Pierre André 270b640b99 Fixed adding options -n --no-mtab needed by automount 2010-09-16 18:44:11 +02:00
Jean-Pierre André 9b129fa1dd Added options -n --no-mtab needed by automount 2010-09-16 15:33:03 +02:00
Jean-Pierre André 66b6a9c219 Fixed checking for already mounted device on non-Linux platforms 2010-08-28 14:02:08 +02:00
Jean-Pierre André 008d8c5df9 Fixed character translations when standard functions are not available 2010-08-28 13:59:43 +02:00
Jean-Pierre André a704299aa5 Made miscellaneous clarifications to the ntfs-3g manual 2010-08-28 13:58:29 +02:00
Szabolcs Szakacsits ab137b3070 release 2010.8.8 2010-08-07 03:26:57 +03:00
Jean-Pierre André d0725eb251 Fixed rounding to cluster end for compressed files 2010-08-06 21:36:38 +02:00
Jean-Pierre André 654568a1d1 Removed the signature of deprecated ntfs_file_values_compare() 2010-08-06 21:33:47 +02:00
Szabolcs Szakacsits cae96e64ac release 2010.7.23-RC 2010-07-23 16:01:56 +03:00
Jean-Pierre André a75becd7c5 Cancelled the disabling of bmap() in lowntfs-3g 2010-07-22 18:41:36 +02:00
Jean-Pierre André c6c14cb256 Fixed zeroing the end of fragmented ex-holes 2010-07-22 15:04:53 +02:00
Jean-Pierre André acccb62f9f Fixed checking for write errors in setxattr() 2010-07-22 15:03:52 +02:00
Jean-Pierre André f76d0aacf1 Fixed processing end of partial runlist for compressed files 2010-07-22 15:02:09 +02:00
Jean-Pierre André 400632dea5 Fixed updating compressed sizes 2010-07-22 15:00:37 +02:00
Jean-Pierre André 04c561a0d1 Fixed checking whether the device is not already mounted 2010-07-22 14:58:10 +02:00
Jean-Pierre André 776117baf3 Fixed processing of options silent and no_def_opts 2010-07-22 14:52:23 +02:00
Jean-Pierre André 891b7e97b3 Improved sanity checks on a security descriptor 2010-07-22 14:49:46 +02:00
Jean-Pierre André f65aa991a9 Fixed excessive cluster allocation within big holes 2010-07-22 14:48:19 +02:00
Jean-Pierre André 09df7eade5 Fixed creating empty encrypted extended attributes 2010-07-22 14:46:01 +02:00
Jean-Pierre André 5533eb565f Fixed bad sanity check before compressing (was permissive) 2010-07-22 14:40:24 +02:00
Jean-Pierre André 1377f009e7 Fixed error returns when writing compressed data 2010-07-22 14:39:19 +02:00
Jean-Pierre André 49ab780739 Fixed a sanity check when closing a compressed file 2010-07-22 14:37:01 +02:00
Szabolcs Szakacsits 114e795611 release 2010.6.31-RC 2010-06-30 05:17:43 +03:00
Jean-Pierre André 233bf2929a Removed support of bmap() with external fuse older than 2.8 2010-06-29 19:27:25 +02:00
Szabolcs Szakacsits e47b85c07e release 2010.6.30-RC 2010-06-29 18:39:26 +03:00
Jean-Pierre André 0103bcdb60 Fixed use of utimensat() with external fuse older than 2.8 2010-06-29 11:34:14 +02:00
Szabolcs Szakacsits a63eac5e44 release 2010.6.28-RC 2010-06-27 01:36:31 +03:00
Jean-Pierre André a52c79b46b Fixed loops when trying to read a broken compressed file 2010-06-18 14:04:23 +02:00
Jean-Pierre André b1de6e16fb Fixed compressed attribute made non resident to leave space for another one 2010-06-18 14:02:58 +02:00
Jean-Pierre André f2f4e8dc07 Fixed a possible null dereference when creating a stream 2010-06-18 13:59:06 +02:00
Jean-Pierre André 29f760f7e7 renamed option default_permissions to permissions 2010-06-14 14:42:00 +02:00
Jean-Pierre André ed448ea8b4 fixed cached allocation for compressed files 2010-06-14 14:40:17 +02:00
Jean-Pierre André 207318b504 fixed compression when a runlist relocation is needed 2010-06-14 14:33:34 +02:00
Jean-Pierre André 4d73c7c4f1 Fixed characters not allowed by Windows in names 2010-06-03 10:13:30 +02:00
Jean-Pierre André 15c4d282ce Enable/disable compression according to option 2010-06-03 10:11:42 +02:00
Jean-Pierre André 07d86b0cfd Reenabled compression in root directory 2010-06-03 10:07:27 +02:00
Jean-Pierre André ba083200aa Fixed close() after a fragmented truncate of a compressed file 2010-06-03 10:06:08 +02:00
Jean-Pierre André cc4b358383 Fixed freeing a full compression block when fragmented 2010-05-28 16:33:50 +02:00
Jean-Pierre André b20d1020fc Fixed data size after an upsizing truncate of a compressed file 2010-05-28 16:32:28 +02:00
Jean-Pierre André 1eed61e1a9 enabled downsizing compressed files 2010-05-25 10:29:34 +02:00
Jean-Pierre André a192775e2a developed overwriting compressed files 2010-05-25 10:25:31 +02:00
Jean-Pierre André e3537c3376 reversed default for showing/hiding hidden files 2010-05-25 10:18:20 +02:00
Jean-Pierre André ac070299ac defined an option windows_names to enforce windows names 2010-05-25 10:16:18 +02:00
Jean-Pierre André 41d23fba05 removed unneeded synchronizations 2010-05-25 10:14:15 +02:00
Jean-Pierre André 693aa8780d enabled case insensitive file names in lowntfs-3g 2010-05-25 10:12:44 +02:00
Jean-Pierre André 81f1de0559 removed duplicated code in lowntfs-3g 2010-05-25 10:06:27 +02:00
Jean-Pierre André 2e86428fc0 redefined a default user mapping (a few changes in mount options) 2010-05-25 10:05:10 +02:00
Jean-Pierre André 3745d0a1e3 marked files whose name has a dot initial as "hidden" if option hide_dot_files 2010-05-25 09:58:36 +02:00
Jean-Pierre André 51a9ab8c48 fixed compressions on parent directory or NTFS version < 3.0 2010-05-25 09:52:34 +02:00
Jean-Pierre André 74134fc76d fixed alignment of cached data 2010-05-25 09:49:52 +02:00
Szabolcs Szakacsits 0578c15957 release 2010.5.22 2010-05-20 03:32:57 +03:00
Jean-Pierre André 8ae0ee326a Fixed building secaudit and usermap 2010-05-19 09:05:27 +02:00
Szabolcs Szakacsits 04f38c6727 release 2010.5.16 2010-05-16 14:26:22 +03:00
Jean-Pierre André 80e4b2754b Merge branch 'PERMISSION_HANDLING_BRANCH' of ssh://ntfs-3g.git.sourceforge.net/gitroot/ntfs-3g/ntfs-3g into PERMISSION_HANDLING_BRANCH 2010-05-16 08:18:32 +02:00
Jean-Pierre André 8e98f616dd Temporarily disabled MacOSX features in lowntfs-3g (Erik Larsson) 2010-05-16 08:17:36 +02:00
Szabolcs Szakacsits 0e66530846 release 2010.5.15 2010-05-15 00:14:42 +03:00
Jean-Pierre André 02b11579cc fixed wrong flags when uid/gid are forced in mount options 2010-05-12 09:30:08 +02:00
Jean-Pierre André 911328be86 removed dynamically created file config.h.in 2010-05-10 10:18:47 +02:00
Jean-Pierre André fc4bace81d Merge branch 'PERMISSION_HANDLING_BRANCH' of ssh://ntfs-3g.git.sourceforge.net/gitroot/ntfs-3g/ntfs-3g into PERMISSION_HANDLING_BRANCH 2010-04-19 11:43:07 +02:00
Jean-Pierre André df8e581464 fixed the condition for executing utime() and utimensat() 2010-04-19 11:10:54 +02:00
Jean-Pierre André c9d40485b4 fixed a possible index block with no key in 2010-04-19 11:10:30 +02:00
Jean-Pierre André b1c051b768 fixed compiler warnings on OpenSolaris 2010-04-19 11:10:01 +02:00
Jean-Pierre André 984be554e3 fixed a bad condition for security descriptor upgrade 2010-04-19 11:09:31 +02:00
Jean-Pierre André 3e48b337d8 fixed conditional code for self-test in secaudit 2010-04-19 11:08:54 +02:00
Jean-Pierre André b1f9d5201a fixed a bug in ACL inheritance 2010-04-19 11:05:20 +02:00
Jean-Pierre André fcb114502d fixed an error checking when extending a file list in lowntfs-3g 2010-04-19 11:04:13 +02:00
Jean-Pierre André 3e4826f758 fixed modifying the read-only flag on a directory 2010-04-19 11:03:54 +02:00
Jean-Pierre André 9438188703 fixed a bad error checking when closing a compressed file 2010-04-19 11:03:30 +02:00
Jean-Pierre André 81eb764163 fixed a compilation issue with uClibc 2010-04-19 11:02:46 +02:00
Jean-Pierre André 84c93479d8 fixed a compilation issue with uClibc 2010-04-19 10:53:31 +02:00
Jean-Pierre André 3199d256c9 developped lowntfs-3g a driver variant using the fuse low-level interface 2010-04-19 10:52:45 +02:00
Szabolcs Szakacsits 48be24db46 release 2010.3.6 2010-03-06 18:08:01 +02:00
Jean-Pierre André 1bb7443eb6 Fixed setting archive bit on file and alternated data stream creation 2010-02-24 12:08:56 +01:00
Jean-Pierre André 1bdd93e237 Fixed setting reparse tags in parent directories 2010-02-17 21:26:40 +01:00
Jean-Pierre André d9f8647ef9 Fixed enabling permissions when no UserMapping file is found 2010-02-17 11:47:14 +01:00
Jean-Pierre André 7449af78ca Fixed an error return in the main mount function 2010-02-17 11:45:39 +01:00
Jean-Pierre André 4c08471932 Extended copyright to 2010 2010-02-17 11:44:13 +01:00
Jean-Pierre André e4d19093ba #ifdef'ed code which require implementation of extended attributes 2010-02-17 11:43:22 +01:00
Jean-Pierre André bb80ecc29f Reorganized processing of setattr() to care for all sets of attributes 2010-02-17 11:41:54 +01:00
Jean-Pierre André 43d5dfaf9f Used ntfs timestamp format to avoid loss of precision 2010-02-17 11:39:37 +01:00
Jean-Pierre André 5ef11317f2 Implemented selective timestamp setting for utimensat(2) 2010-02-17 11:36:56 +01:00
szaka 7b30b160c2 release 2010.2.6-RC 2010-02-06 09:17:46 +00:00
szaka 205088a76b update date of manuals 2010-02-06 09:17:06 +00:00
jpandre d49ac7351c Fixed a bug disabling the Posix ACLs 2010-01-21 18:44:31 +00:00
jpandre c8fa404931 Fixed a return error code (Fabian Keil) 2010-01-21 08:15:27 +00:00
jpandre 6306826077 Removed an unneeded variable (Fabian Keil) 2010-01-21 08:13:27 +00:00
jpandre 897faa3e54 Set an error code when running unprivileged (Fabian Keil) 2010-01-21 08:11:27 +00:00
jpandre 42f7d07997 Avoided a possible null pointer dereference (Fabian Keil) 2010-01-21 08:09:13 +00:00
jpandre b10590b354 Avoided setting a variable to itself (Fabian Keil) 2010-01-21 08:07:21 +00:00
jpandre 07ccad8eb6 Escaped difficulties with the diversity of boolean definitions 2010-01-17 09:35:32 +00:00
jpandre eaf0ecaa8d Fixed compilation of secaudit on OpenSolaris 2010-01-16 18:27:17 +00:00
jpandre f1bd6652b1 Fixed uninitialized variable when closing a file on a read-only partition 2010-01-16 18:17:55 +00:00
jpandre cd8c8a1aa8 Adapted to possible inclusion of stdbool.h (Erik Larsson) 2010-01-16 18:14:46 +00:00
jpandre c03b68ca8d Used st_[acm]timespec instead of st_[acm]tim on MacOSX (Erik Larsson) 2010-01-16 18:10:33 +00:00
jpandre 31abc47c7c Secured against use of external fuse not patched for UTIME_NOW 2010-01-16 09:35:24 +00:00
jpandre 3eada57e45 Added checks for uninitialized variables for configure option --enable-warnings 2010-01-16 09:31:57 +00:00
jpandre cac199ebb1 Logged problematic use of uid==0 and gid!=0 2010-01-16 09:29:28 +00:00
jpandre 6f72ec189d Logged the outcome of making $TXF_DATA resident 2010-01-16 09:26:01 +00:00
jpandre da39179421 Merged Anton's patch for $TXF_DATA attribute 2010-01-08 11:15:46 +00:00
jpandre d78add4e8f Developed time stamping up to 100ns resolution 2010-01-04 08:24:44 +00:00
jpandre ee18659989 Avoided possible double openings of root directory 2010-01-04 08:12:17 +00:00
jpandre c708a2bdee Fixed TXF_DATA attribute on root directory when made non-resident 2010-01-04 08:09:44 +00:00
jpandre 393af928d9 Prevented TXF_DATA attribute from being made non-resident 2010-01-04 08:07:29 +00:00
jpandre 05ead49d4e Avoid a compiler warning 2010-01-04 08:04:30 +00:00
jpandre 800ffca71a Relocated fuse flags (avoid alignment) 2010-01-04 08:02:59 +00:00
jpandre 17a629229d Developed selective timestamp setting for utimensat(2) 2009-12-23 14:51:07 +00:00
jpandre b8a83add46 Ported secaudit to opensolaris 2009-12-19 13:26:56 +00:00
jpandre d75c254771 Fixed a wrong comment 2009-12-19 09:58:26 +00:00
jpandre 6271663b4e Skip extended attribute related functions when not supported locally 2009-12-19 09:20:59 +00:00
mechie a27d20247e This commit was manufactured by cvs2svn to create branch
'PERMISSION_HANDLING_BRANCH'.
2009-12-19 08:01:19 +00:00
jpandre 1bbb7b8861 Avoid a compiler warning (opensolaris) 2009-12-19 07:44:35 +00:00
jpandre 9f92518396 Grouped permission mode setting in the parameter file 2009-12-18 10:31:42 +00:00
jpandre 9218a5449c Fixed erroneous comment 2009-12-18 09:13:54 +00:00
jpandre cf705f011e Cosmetic change 2009-12-18 09:12:54 +00:00
jpandre d9eae2038b Made where permissions are checked easier to select, and logged selection 2009-12-18 09:08:15 +00:00
jpandre 9dd9daeb6d Implemented low-level interface to fuse 2009-12-18 08:43:45 +00:00
jpandre 6072a95591 Cached looked-up inodes for subsequent use 2009-12-18 08:27:05 +00:00
jpandre d75f69d80e Cached inode data for subsequent use 2009-12-18 08:12:23 +00:00
jpandre 41a371f4a7 Redesigned caches for indexing cached entries 2009-12-17 17:36:06 +00:00
jpandre 7c88ccb95b Grouped parameters affecting the global behavior in a specific file 2009-12-17 15:24:02 +00:00
jpandre c468e74acd Avoided a compiler warning 2009-12-17 09:17:16 +00:00
jpandre c1adbc1787 Implemented getting/setting/removing object ids 2009-12-17 09:07:56 +00:00
jpandre d990f7996c Changed the interfaces to use extended attributes 2009-12-17 08:24:13 +00:00
jpandre 9cad01c628 Fixed the return code for the restore function of secaudit 2009-12-16 11:44:44 +00:00
jpandre 7bea2202d7 Made direct calls to collation functions 2009-12-16 10:20:57 +00:00
jpandre 195945cdc0 Evaluated file names collations in a single parsing 2009-12-16 09:45:28 +00:00
jpandre 2db43fc118 Included <limits.h> explicitly, needed in some environments 2009-12-15 18:25:15 +00:00
jpandre 985ef5c2e8 Avoid a compiler warning 2009-12-15 18:21:57 +00:00
jpandre b842a6720e Made sanity checks when setting reparse data of known type 2009-12-15 09:39:29 +00:00
jpandre 2f8ced2ddd Kept junctions points absolute or relative as specified 2009-12-15 09:25:36 +00:00
jpandre c5c51ec1fe Simplified interfaces for checking permissions 2009-12-14 17:23:12 +00:00
jpandre bae437d845 Included <sys/stat.h> needed in acls.c on some platforms 2009-12-14 17:17:08 +00:00
jpandre 3c323eecf1 Avoided checking group membership when group and other have same permissions 2009-12-11 14:39:59 +00:00
jpandre efd2a9701a Avoided translating file names when available in cache 2009-12-11 10:11:38 +00:00
jpandre e3f8ce6bee Removing the "AC_C_CONST" macro, may cause unwanted redefinition of "const" 2009-12-10 14:57:33 +00:00
jpandre 5c464acada Concealed a warning for unused result in fusermount 2009-12-10 13:28:30 +00:00
jpandre 758a99ea87 Avoided double copy of dir when closing a file in an open dir 2009-12-10 10:04:53 +00:00
jpandre 91a3909048 Concealed the unused parameters in usermap 2009-12-10 08:51:25 +00:00
jpandre b32bbcf48a Worked around "const" possibly redefined in config.h 2009-12-10 08:46:30 +00:00
jpandre a9fdd65cd4 Replace <attr/xattr.h> by <sys/xattr.h> from glibc 2009-12-10 08:45:02 +00:00
jpandre 7a876eca36 Fixed possible memory leaks after char translation errors 2009-12-09 11:20:20 +00:00
jpandre e23481624f Improved UTF8<-->UTF16 translations 2009-12-09 11:19:27 +00:00
jpandre 029faaabc6 Restricted compression to volumes with cluster size not greater than 4096 2009-12-09 10:52:21 +00:00
jpandre 52d5e40f93 Fixed memory allocation for translating junction points 2009-12-09 10:48:35 +00:00
szaka e5a1325ed3 remove unused device_io.c 2009-12-03 06:17:43 +00:00
jpandre 38d77ef0dc Added device_io.c and secaudit.h for "make dist" (Erik Larsson) 2009-12-01 15:22:29 +00:00
jpandre 20fb2395fd Simplified tracking of forced time stamps 2009-11-26 13:34:42 +00:00
jpandre 2d05631ad1 Fixed renaming to same inode 2009-11-26 13:30:14 +00:00
jpandre 22ecdf8298 Fixed synchronization of attribs and timestamps to parent directory 2009-11-25 14:37:00 +00:00
jpandre 9279c2e493 Fixed inappropriate casts 2009-11-25 14:29:08 +00:00
jpandre a69136d90b Downgraded an error message 2009-11-25 14:22:28 +00:00
jpandre 37c3740aff Made a function static to avoid a compiler warning 2009-11-25 14:19:38 +00:00
jpandre 9b987fb923 Disabled ownership checking when permissions are disabled 2009-11-25 14:15:52 +00:00
jpandre 1fecf5d891 Fixed the return code after removing a reparse index 2009-11-24 14:22:09 +00:00
jpandre a75724fea8 Fixed a few misleading endianness types 2009-11-24 14:18:53 +00:00
jpandre d81be7fda7 Reformatted or downgraded a few encryption error messages 2009-11-18 16:56:06 +00:00
jpandre ad25d7a0ac Applied patches for Mac OS X (Erik Larsson) 2009-11-18 16:37:15 +00:00
szaka bf82fc305b release 2009.11.14 2009-11-13 20:49:39 +00:00
szaka 3e2102ee36 update manuals 2009-11-13 19:36:22 +00:00
szaka 80f3a5885a install ntfs-3g.usermap and ntfs-3g.secaudit manual pages 2009-11-13 19:35:57 +00:00
szaka 8911ad93e1 ntfs-3g. prefix secaudit and usermapping to avoid potential name conflicts 2009-11-13 19:04:48 +00:00
szaka bf08272b88 Update manual date 2009-11-13 18:29:13 +00:00
szaka 2363eb7fbc README update 2009-11-13 17:27:53 +00:00
jpandre 504e6fcec0 Fixed locating a Windows junction or symlink when last entry in an index node 2009-11-07 08:31:17 +00:00
jpandre f8de613801 Fixed identifying correct case in junction points 2009-11-07 08:28:43 +00:00
szaka 41783e39e4 Mac OS X Unicode normalization form conversion (Erik Larsson) 2009-11-06 00:14:39 +00:00
jpandre eb3ec90d80 OS X: implement setchgtime(), it fixes Firefox errors (Erik Larsson) 2009-11-05 11:48:27 +00:00
jpandre 9901ea3532 ntfs_inode_open: don't log "No STANDARD_INFORMATION" for extended MFT records 2009-11-05 11:44:38 +00:00
jpandre af4f6a406a fix format breaking new lines in error messages 2009-11-05 11:43:36 +00:00
jpandre 3af7bebe7b Mac OS X Unicode normalization form conversion (Erik Larsson) 2009-11-05 11:40:44 +00:00
jpandre c910b8596b ntfs_fsync: fix comment (Erik Larsson) 2009-11-05 11:30:47 +00:00
jpandre 01b530685d Mac OS X true fsync (Erik Larsson) 2009-11-05 11:30:05 +00:00
jpandre 63ef915ed5 ntfs_fuse_filler: truncate too large filenames on OS X (Erik Larsson) 2009-11-05 11:27:10 +00:00
jpandre 79cc70f23c fix passing buffer after partial read/write (Jean-Pierre Andre, Szabolcs Szakacsits) 2009-11-05 11:24:39 +00:00
szaka 2005c92981 add COPYING file explicitely because autogen.sh doesn't create it automatic
since COPYING.LIB was added (Tom "spot" Callaway, Szabolcs Szakacsits)
2009-11-04 23:25:07 +00:00
jpandre b78d895575 Added indexing of reparse data into $Extend/$Reparse 2009-11-03 14:35:53 +00:00
jpandre ad69474a5a Allowed security descriptors up to 64K in secaudit 2009-11-03 14:27:57 +00:00
jpandre 12bfcc5f93 Removed obsolete debugging code 2009-11-03 14:25:00 +00:00
jpandre 2b6ea3b392 Accepted ACL_REVISION_DS as a valid ACL revision in secaudit 2009-11-03 14:21:08 +00:00
jpandre 716fdbaf33 Updated a copyright notice 2009-11-03 14:05:58 +00:00
jpandre 65731ee9c3 Added option "efs_raw" to the manual 2009-11-01 17:43:59 +00:00
jpandre 0226f08a5e Created a manual entry for usermap 2009-10-28 15:19:14 +00:00
jpandre a39bd05923 Warned against using the locale option in the ntfs-3g manual 2009-10-28 15:16:32 +00:00
jpandre bd6abd39de Reinserted the description of option allow_other in the ntfs-3g manual 2009-10-28 15:15:28 +00:00
jpandre 3a95774575 Accepted ACL_REVISION_DS as a valid ACL revision 2009-10-28 15:08:21 +00:00
jpandre f40b6edb32 Avoided a compiler warning 2009-10-28 15:07:02 +00:00
jpandre 54539d14a2 Added manual for secaudit 2009-10-19 08:22:52 +00:00
jpandre 6afa1ed6c4 Updated documentation files to describe features added in ntfs-3g.2009.10.5-RC 2009-10-14 10:22:30 +00:00
szaka c7f012484e release 2009.10.5-RC 2009-10-04 02:13:13 +00:00
szaka a9b7c5f91b remove unused util.h and util.c 2009-10-04 02:09:08 +00:00
szaka 1e1dadd38d merge ntfs-3g.probe updates from HEAD 2009-10-04 02:08:26 +00:00
szaka 4f8330f728 remove integrated posixacls.patch 2009-10-04 02:02:52 +00:00
szaka b3cbe9e4bd remove unused version.c version.h 2009-10-04 02:02:04 +00:00
szaka edcc2d373e add COPYING.LIB for fuse-lite 2009-10-04 01:54:39 +00:00
szaka c49ae0afb0 add secaudit and usermap utilities 2009-10-04 01:50:28 +00:00
szaka 745a840fc4 release 2009.10.4-RC 2009-10-03 08:40:24 +00:00
szaka 85f2ba96cc fix build: fix fuse-lite Makefile.am 2009-10-03 08:11:02 +00:00
szaka 172fad19d9 fix build process: add m4/.keep 2009-10-03 08:00:54 +00:00
szaka 8c019ac29c release 2009.10.3-RC 2009-10-03 07:54:11 +00:00
szaka 34ac269f49 add missing fuse-lite files 2009-10-03 07:19:30 +00:00
jpandre 892f763d31 Fixed cluster allocation when overwriting a hole in a sparse file 2009-09-29 18:52:02 +00:00
jpandre f0ea07fdf3 Fixed ownership of mount point on non-Linux 2009-09-18 19:53:38 +00:00
jpandre 61f7084020 Fixed avoidance of a double opening of an inode in create() 2009-09-18 19:51:10 +00:00
jpandre b46c8daad5 Enabled Posix ACLs with older kernels 2009-09-18 19:40:59 +00:00
jpandre 12437acea9 Avoided a double opening of an inode in create() 2009-09-18 16:31:46 +00:00
jpandre 31f7abf640 Fixed access control for utime() 2009-09-18 16:28:22 +00:00
jpandre e4e485df64 Fixed a double inode closing in listxattr() 2009-09-18 16:22:22 +00:00
jpandre f59d0e6ec7 Fixed access control in access() calls 2009-09-18 16:20:10 +00:00
jpandre e4b3c59cb1 Accepted initial spaces in Win32/DOS names 2009-09-18 16:17:21 +00:00
jpandre 84605fd3d7 Fixed a possible memory leak when setting a DOS name 2009-09-18 16:15:36 +00:00
jpandre c085f70be1 Developed the removal of a DOS name 2009-08-14 14:46:46 +00:00
jpandre 5bee9d73f0 Allowed to set a DOS name exactly the same as the long name 2009-08-14 14:44:12 +00:00
jpandre 1d26eb2b97 Fixed checking spaces in Win32 names 2009-08-12 15:35:11 +00:00
jpandre 35b7293401 Fixed possible memory leak when setting a DOS name 2009-08-12 15:33:05 +00:00
jpandre d312da70fd Fixed return code when querying a non-existent dos name 2009-08-12 15:15:59 +00:00
jpandre 88473752c5 Allowed creating holes in compressed files 2009-08-11 08:02:59 +00:00
jpandre b725b77e88 Inserted conditions on fuse patches to avoid constraints on older kernels 2009-07-30 13:11:50 +00:00
jpandre 8db3f0a2ab Returned EPERM for getting/setting efsinfo without option efs_raw 2009-07-20 13:00:43 +00:00
jpandre 588d9099b2 Inserted <stdarg.h>, useful for testing 2009-07-20 12:57:38 +00:00
jpandre 5e650c0c91 Developped getting and setting NTFS times 2009-07-09 15:20:14 +00:00
jpandre 78285e42b4 Reverted setting archive flag on unlinking (only Windows Explorer does it) 2009-07-09 12:28:04 +00:00
jpandre 8af1460957 Fixed setting archive flag in link()/unlink() 2009-07-07 18:54:13 +00:00
jpandre fe18b65f95 Fixed most of compile-time warnings in fuse-lite 2009-07-06 10:59:34 +00:00
jpandre 06e553b04d Fixed permissions of created files when parent directory has a default ACL 2009-07-04 19:14:56 +00:00
jpandre 9a4672ca65 Developped getting and setting DOS names (short 8+3 names) 2009-07-01 19:45:59 +00:00
jpandre 3ddbce3ea6 Changed conditions to activate protection modes 2009-07-01 19:35:04 +00:00
jpandre 278abb9382 Developped handling of Windows archive flag 2009-07-01 19:32:00 +00:00
jpandre f259fb44df Improved cluster allocation on volumes too filled 2009-07-01 19:16:33 +00:00
jpandre 5b7a193d26 Fixed erroneous rejections of setting efs info 2009-07-01 18:56:00 +00:00
jpandre 9ce63a72d5 Fixed a data compression bug causing suboptimal compression 2009-06-17 08:07:58 +00:00
jpandre 6a54eac8ad Displayed compile-time options when help is requested 2009-06-17 08:06:45 +00:00
jpandre d76c7f6172 Logged user mapping errors (which occur before mounting) 2009-06-17 08:05:09 +00:00
jpandre c79b3777ca Implemented backup/restoring of encrypted files (by Martin Bene) 2009-05-20 14:17:31 +00:00
jpandre 1cd46c2241 Fixed errno when setting security or trusted xattr as non-root 2009-05-17 20:13:28 +00:00
jpandre 220883485a Fixed permissions for symlinks when there is no user mapping 2009-05-17 19:59:26 +00:00
jpandre c453008681 Fixed native NTFS inheritance 2009-05-17 19:54:08 +00:00
jpandre 2a2cb4ffb2 Fixed interpretation of ACLs for default Posix ACLS (inheritance) 2009-05-17 19:50:53 +00:00
Yura Pakhuchiy 763d811d29 ntfsmount: Filter out uhelper mount option 2009-05-10 16:38:41 +03:00
jpandre f41cf451f5 Set compression parameters before making data non resident 2009-04-25 12:06:40 +00:00
jpandre c87fc027df Secured write position to compressed files 2009-04-25 12:02:20 +00:00
jpandre 54f745e3f3 Fixed partial writings for compressed files 2009-04-25 11:56:34 +00:00
jpandre bcc9b7dbdc Fixed cluster releases for compressed files 2009-04-25 11:52:00 +00:00
jpandre 3615874502 Fixed execution access by root when Posix ACLs are enabled on kernel >= 2.6.29 2009-04-21 13:00:24 +00:00
jpandre 765e8d3677 Fixed access control to system extended attributes when Posix ACLs are enabled 2009-04-20 15:47:46 +00:00
jpandre fc78c03c39 Fixed an endianness error in default uppercase table 2009-04-20 15:27:03 +00:00
jpandre 717da2a52c Fixed endianness oddities 2009-04-20 15:23:52 +00:00
jpandre d898b64a04 Changed interface for translating permissions to avoid a version dependency 2009-04-10 07:10:04 +00:00
jpandre eb282c019a Inserted a reference to lzhuf.c from which the search for matches was borrowed 2009-04-08 19:24:53 +00:00
jpandre c86e0dbf6b Improved the loop for searching matches 2009-04-08 19:21:57 +00:00
jpandre ab872500b3 Copied the compression flags in the file name attribute 2009-04-08 19:18:13 +00:00
jpandre e4136e654c Set the data flags in base attribute and all the extents 2009-04-08 19:15:29 +00:00
jpandre 58541b47f9 Checked the actual data format for block map request 2009-04-08 19:04:05 +00:00
jpandre 2fbaecd759 Extended transparent compression support to sequential writing to compressed files 2009-04-03 13:33:24 +00:00
jpandre e2d1f3a1c3 Fixed bad macro usage 2009-04-03 12:45:13 +00:00
jpandre 9836e3f22d Checked NTFS version before setting a reparse point 2009-04-03 06:55:28 +00:00
jpandre 03755a9ba5 Adapted to ntfs-3g-2009.4.4 2009-04-03 06:53:12 +00:00
Olaf Rempel 48f652e0e1 ntfsclone: fix restore from stdin
When doing a ntfclone-restore from stdin and stdin is then closed,
ntfsclone will loop forever:
$ cat corrupt_image.gz | gzip -d | ntfsclone -r -O somedisk -

With this patch the io_all() loop will return an error when the
input-stream is closed.
2009-03-28 00:25:58 +02:00
jpandre 1e822076d6 Adapted to ntfs-3g.2009.3.8 2009-03-27 09:15:24 +00:00
jpandre 2a1d75a3da Adapted to ntfs-3g.2009.3.8 2009-03-27 09:10:00 +00:00
jpandre cd4b23f0a6 Fixed an endianness error 2009-03-27 08:46:19 +00:00
jpandre a13ee0c82c Fed the free spaces in context for calls from security API 2009-03-27 08:36:07 +00:00
Yura Pakhuchiy d6c0cc5786 Substitute current version into libntfs man page 2009-03-24 16:56:32 +02:00
jpandre 86c1f05336 Fixed misplaced parentheses when checking a junction point 2009-03-23 16:12:06 +00:00
jpandre aa54558345 Fixed wrong size (quota_charged, usn) 2009-03-23 16:09:24 +00:00
jpandre 5689ebd55d Fixed endianness errors 2009-03-23 16:05:11 +00:00
jpandre cc96d22ed6 Fixed an endianness declaration 2009-03-11 16:18:18 +00:00
jpandre 935b1beca8 Fixed creating new reparse points (Faisal Puthuparackat) 2009-03-02 20:26:18 +00:00
jpandre 224c2fcda2 Changed attribute name offset when there is no name (Faisal Puthuparackat) 2009-03-02 20:24:16 +00:00
jpandre 19dda5be83 Allowed setting/clearing compression flag for a directory 2009-03-02 20:20:24 +00:00
jpandre 071b5f0cb8 Removed temporary code for comparing mapping pairs size to older version 2009-03-02 20:17:34 +00:00
jpandre 571c057d05 Fixed moving the standard information attribute to an extended MFT record (Szabolcs Szakacsits) 2009-02-27 08:15:06 +00:00
jpandre ddfb2175a9 Improved creating gaps in sparse files 2009-02-13 10:37:53 +00:00
jpandre 93b695f1cc Adapted to ntfs-3g-2009.2.1 2009-02-12 20:32:21 +00:00
jpandre 8191533495 Fixed computation of runlists 2009-02-12 16:51:52 +00:00
jpandre 2dc7362ba9 Improved computation of runlist for fragmented files O(n) instead of O(n*n) 2009-02-03 17:12:04 +00:00
jpandre 42968369c4 Fixed access control to extended attributes when Posix ACLs are enabled 2009-01-29 09:27:14 +00:00
jpandre 2145789d66 Returned no support when extended attributes are enabled and Posix ACL are not 2009-01-29 09:25:35 +00:00
jpandre 9a5e5bbfe3 Avoided logging of removal of non-existent extended attribute 2009-01-27 12:59:10 +00:00
jpandre 12a566eca6 Fixed listing of non-user extended attributes 2009-01-26 09:02:19 +00:00
jpandre 4953a60b7b Fixed access to user extended attributes when Posix ACLs are enabled 2009-01-26 09:00:36 +00:00
jpandre 11216c6942 Adapted to ntfs-3g-2009.1.1 2009-01-23 11:11:44 +00:00
jpandre 638228121d Implemented security, trusted and open name spaces for extended attributes 2009-01-23 11:02:34 +00:00
jpandre 3787dcad77 Fixed checking access to parent directory for removing an extended attribute 2009-01-17 14:29:15 +00:00
jpandre b73ba7f15c Avoided errno pollution when removing a reparse point 2009-01-17 08:39:23 +00:00
jpandre 9b996d31b9 Relocated code for setting/retrieving NTFS attribs 2009-01-17 08:37:17 +00:00
jpandre 0feae8177a Fixed the return value of ntfs_set_file_attributes() 2009-01-06 11:25:55 +00:00
jpandre ca6466c6bb Mapped a few NTFS internal data to extended attributes 2009-01-05 13:56:05 +00:00
jpandre d3f3a19866 Adapted to ntfs-3g.1.5222-RC 2009-01-05 13:28:06 +00:00
jpandre 4898e594b8 Avoided sorting Posix ACEs when there is only one 2008-12-24 15:35:21 +00:00
jpandre f443601201 Avoided a full ACL compare when not needed to determine a default user mapping 2008-12-24 15:33:08 +00:00
jpandre 25e3cad534 Changed the sequencing of operations to compute the size of an ACL 2008-12-24 15:30:25 +00:00
jpandre 33cb0cbd7e Strengthened the consistency checks on ACLs 2008-12-24 15:27:34 +00:00
jpandre f0fbd111e0 Fixed a memory leak in the security API (impacted tools) 2008-12-24 15:09:44 +00:00
jpandre 26681fe0fe Fixed copy of special flags in the security API (for tools) 2008-12-24 15:04:31 +00:00
szaka 50702ea690 add --disable-posix-acl configure option 2008-12-06 12:34:37 +00:00
szaka ab15086e7e add "-Wformat -Wformat-security" to --enable-warnings compiler warnings 2008-12-06 11:38:01 +00:00
jpandre 6faf38df12 Adapted to ntfs-3g.1.5130 2008-12-01 15:29:23 +00:00
jpandre c4c3c8f90f Fixed inclusion of two functions whatever ACL option selected 2008-12-01 15:07:49 +00:00
jpandre 150a7879db Fixed warnings from gcc >= 4.3.2 2008-12-01 14:49:40 +00:00
jpandre 0aab674589 Cosmetic fixes 2008-11-29 10:52:03 +00:00
jpandre ee37dcab6d Interpreted symbolic links created by Vista as symbolic links 2008-11-26 15:57:20 +00:00
jpandre e39b2a5d0d Processed an alternate format for Windows symlinks 2008-11-13 09:40:42 +00:00
jpandre 751483b465 Inserted the new files reparse.c and reparse.h in the build process 2008-11-04 13:39:02 +00:00
jpandre 4c39b0332f Fixed filtering of junction points 2008-11-04 13:36:08 +00:00
jpandre 33bccc53c9 Implemented an interpretation of junction points 2008-11-02 09:14:57 +00:00
jpandre 0b88fffd78 Enabled protections if no mount option but user mapping file is found 2008-10-08 12:34:17 +00:00
jpandre 5b1e042af4 Avoided compiler warnings for unused parameters 2008-10-02 07:46:19 +00:00
jpandre 0d2f805af6 Made the interface to get/set an NTFS ACL available in non-Posix ACL builds 2008-10-02 07:42:54 +00:00
jpandre cbca88095d Fixed type of argument for file creation 2008-09-21 17:27:21 +00:00
jpandre e5286c09d6 Adapted to ntfs-3g.1.2926-RC 2008-09-19 13:39:38 +00:00
jpandre f857740a4d Renamed inode_cache to xinode_cache for easier reference 2008-09-19 13:27:55 +00:00
jpandre 939a4a20b7 Relocated the setting of the Windows read-only flag 2008-09-09 15:40:57 +00:00
jpandre 0634272756 Fixed return value for Posix ACL removal 2008-09-09 15:36:55 +00:00
jpandre a675f60863 Declared mapping data as const in a few interfaces 2008-09-09 15:26:38 +00:00
jpandre 5770560fab Subdivided the building of NTFS ACLs 2008-09-09 15:19:42 +00:00
jpandre c699b0a0a5 Collected ownership of mount point for a default user mapping 2008-09-09 15:06:55 +00:00
jpandre 362036a684 Removed unneeded files 2008-09-08 07:31:23 +00:00
jpandre a453456d6b Fixed building a security context for truncate() and create() when Posix ACL are disabled 2008-09-06 15:00:24 +00:00
jpandre f76204d517 Fixed code triggering a compiler warning 2008-09-06 14:55:20 +00:00
jpandre 4b1da71f51 Removed patches from wrong version 2008-09-06 14:53:24 +00:00
jpandre 703d1c37dc Fixed bugs in Posix ACL cacheing 2008-09-06 14:45:35 +00:00
jpandre 67618ba2c4 Updated files needed to make a build 2008-09-06 14:42:31 +00:00
jpandre a58ff9073d Improved bit countings 2008-09-06 09:34:23 +00:00
jpandre 8b0358876a Reverted wrong fix for parent directory having a default Posix ACL - feed back from fuse needed 2008-09-05 14:06:43 +00:00
jpandre 1b9bbc0993 Removed temporary logging of bad Posix ACLs 2008-09-05 14:03:25 +00:00
jpandre d13ffc55f8 Fixed cacheing legacy directories (NTFS 1.x) for Posix ACLs 2008-09-05 13:59:23 +00:00
jpandre 9525c5c310 Fixed a memory leak in Posix ACL inheritance 2008-09-03 14:40:12 +00:00
jpandre 2cc7b4536e Fixed initial permissions when there is a default ACL 2008-09-02 15:19:47 +00:00
jpandre 834b3ab938 Fixed character encoding setting 2008-09-01 16:31:57 +00:00
jpandre cb59654f39 Implemented an extended attribute interface to get/set NTFS ACLs 2008-09-01 16:24:54 +00:00
jpandre 31e6a0b734 Implemented access control to getting/setting Posix ACL 2008-09-01 16:19:37 +00:00
jpandre d142d8539f Implemented access control to extended attributes 2008-09-01 16:16:11 +00:00
jpandre 92985f750c Fixed mask avoidance in Posix ACLs when there is no designated user/group 2008-09-01 15:41:16 +00:00
jpandre 08537782ce Reset errno to previous value when it does not mean an error 2008-08-30 10:55:33 +00:00
jpandre 94d299b848 Fixed ACE size while decoding a Posix ACL 2008-08-30 10:34:27 +00:00
jpandre 6bfd3ed546 Fixed a stupid name prefixing 2008-08-30 10:31:40 +00:00
jpandre 6d484cd842 Made ACL requests to always return unsupported when ACLs are disabled 2008-08-27 10:42:22 +00:00
jpandre fd60178d8f Made possible to mention root as a designated user or group 2008-08-27 08:35:53 +00:00
jpandre 25179bfe83 Enabled full endianness type checks 2008-08-27 08:21:36 +00:00
jpandre d3da724466 Redefined the options to activate the levels of permissions checking 2008-08-25 09:11:43 +00:00
jpandre 7d0293dc3c Enabled full endianness type checks 2008-08-25 09:06:48 +00:00
jpandre 58b3f86be6 Improved group permissions when using Posix ACLs 2008-08-25 09:04:26 +00:00
jpandre 13552eba52 Integrated full utf-8 to utf-16le conversions, based on code by Berhard Kaindl 2008-08-21 12:04:51 +00:00
jpandre f4bd4e5b52 Added a few casts for easier type checks 2008-08-21 11:05:16 +00:00
jpandre 62780e137b Cleaned and fixed endianness conversions 2008-08-21 11:02:35 +00:00
jpandre 225ec94d5c Fixed owner of files when different from Windows owner 2008-08-21 10:58:19 +00:00
jpandre 3b44e8890a Made use of fuse checks when "default_permissions" option is used 2008-08-21 10:55:18 +00:00
jpandre 713e6349c8 Redefined the options to activate the levels of checking 2008-08-21 10:42:03 +00:00
jpandre a12966408d Fixed permissions checks when opening a directory by open() 2008-08-21 10:37:01 +00:00
jpandre 012684d116 Made possible to have the owner mentioned again as a designated user 2008-08-21 10:32:40 +00:00
jpandre 38c3d868a4 Improved approximation for ACLs built by Windows Administrator 2008-08-21 10:30:38 +00:00
jpandre 7f42da0b07 Reorganized and split the security source file, a few interfaces changed 2008-08-21 10:27:46 +00:00
jpandre 6a47056d18 Merged the Posix ACL code, now it is a compile-time option 2008-08-21 10:08:20 +00:00
jpandre 499e106341 Adapted to ntfs-3g.1.2812 2008-08-16 15:17:47 +00:00
jpandre ca9e62559a Added entries in security API to process user mappings and Win32 attribs 2008-08-16 15:15:28 +00:00
jpandre 4a94021038 Fixed possible overflows in reading the user mapping file 2008-08-16 12:50:11 +00:00
jpandre a2dab6b2ff Fixed possible overflows in reading the user mapping file 2008-08-03 07:20:58 +00:00
jpandre 219491bf27 Added entries in security API to process user mappings and Win32 attribs 2008-08-03 07:19:20 +00:00
jpandre 1f64eafe7c Fixed a memory leak case in Posix ACL.
As this is a patch to standard version, all changes since ntfs-3g.1.2531SR.1
are also reflected.
2008-07-13 19:18:25 +00:00
jpandre 412838056a Adapted to ntfs-3g.1.2712 2008-07-13 17:55:57 +00:00
szaka 5dbdb30df8 add tabulated logging for the most common ntfs_mft_* functions 2008-06-30 11:18:49 +00:00
szaka a6d8c6b1a6 new: use tabulated logging; add ntfs_log_enter() and ntfs_log_leave()
and convert the most commonly used functions
2008-06-30 00:13:23 +00:00
szaka 1098244bbf copyright update 2008-06-29 23:13:32 +00:00
jpandre d30bd79b02 Fixed changing mode for files created by standard ntfs-3g 2008-06-16 16:21:43 +00:00
jpandre 767b4d075c Fixed deletions from a sticky directory (on kernels >= 2.6.25) 2008-06-02 10:56:23 +00:00
jpandre 7c05f13884 Adapted to ntfs-3g-1.2531 2008-05-30 07:40:22 +00:00
szaka 5e1c95de2c fix packaging: always distribute headers (Alon Bar-Lev) 2008-05-20 19:35:37 +00:00
szaka 6a59ac3583 fix: support build in a separate directory (Alon Bar-Lev) 2008-05-19 17:40:34 +00:00
jpandre 4f03c199df Adapted to ntfs-3g-1.2506 2008-05-14 08:27:55 +00:00
jpandre 2d9ddf144b Fixed execution right inheritance to plain files (Posix ACL only) 2008-04-23 12:07:48 +00:00
jpandre a6a5ba0834 Updates to Posix ACL patches (unrelated fixes and negative impact of reducing
changes to standard version)
2008-04-21 15:08:49 +00:00
jpandre 5d5615433f Work around access to files created by Windows in a directory created by Linux
as root
2008-04-21 14:09:32 +00:00
jpandre 7d3bff9b99 Code relocations, variable renamings or comment adjustments to
reduce differences to Posix ACL variant
2008-04-21 14:06:25 +00:00
jpandre 317c060cf6 Prevented Windows from inheriting execution right to plain files 2008-04-20 16:16:10 +00:00
jpandre 7b07593a18 Initial version of Posix ACLs patch 2008-04-20 10:54:28 +00:00
jpandre 3df7110f69 Fixed computation of implicit uid/gid 2008-04-20 09:45:30 +00:00
jpandre 9668345f61 Improved approximation of Windows-type inheritance 2008-04-20 09:25:27 +00:00
jpandre eb519fee8c Relocated a few functions 2008-04-17 16:14:59 +00:00
jpandre 0af78a2c5f Checked an error condition before allowing access 2008-04-17 14:05:22 +00:00
jpandre 5e30e6f204 Extended cacheing to any variable type 2008-04-17 13:26:52 +00:00
jpandre b929b94aaa Fixed trailing '/' circumstances and simplified path normalization 2008-04-17 10:26:15 +00:00
jpandre b8a6013531 Fixed an error return case in chown/chmod 2008-04-14 15:52:07 +00:00
jpandre 75a9b157f3 Adapted to ntfs-3g.1.2412 2008-04-14 15:49:28 +00:00
jpandre c2591fcd10 Fixed group ACE grants 2008-04-11 09:23:38 +00:00
jpandre 04c5867c8a Removed an unneeded group ACE 2008-04-09 20:21:49 +00:00
jpandre 0377cd7107 Improved consistency of ownership for chmod 2008-04-08 10:22:13 +00:00
jpandre 6b8648409c Improved denials to group 2008-04-08 10:15:26 +00:00
szaka 4b9ee4308b fix: symlink failed if the target was over 1024 bytes 2008-04-02 17:31:07 +00:00
szaka 77e5ff36d1 ntfs_make_room_for_attr(): "no space" condition must be ENOSPC, not EINVAL
ntfs_attr_add(): fix adding attribute which can be resident and non-resident
2008-04-02 17:21:11 +00:00
szaka 69423166cb fix: symlink failed or the size was truncated at modulo 256 if the target was over 255 bytes 2008-04-02 10:29:22 +00:00
szaka a07e900359 fix: 'noatime' additionally and unconditionally was passed to fuse 2008-03-31 19:02:44 +00:00
szaka 2f85653372 Fix build. libfuse-lite and include/fuse-lite must be symlinks to the
respective fuse lite directories.
2008-03-28 22:26:24 +00:00
jpandre e4a835076a Updating the source directory tree 2008-03-28 14:42:50 +00:00
jpandre 1146c83bc0 Updating the file tree
:x
:
x



::
2008-03-28 14:29:42 +00:00
jpandre e5fcb9e844 Fixed a bug in security API 2008-03-23 08:41:18 +00:00
jpandre d766714986 Fixed processing of security options 2008-03-14 09:13:30 +00:00
jpandre 5258a873f1 Improved processing of group membership 2008-03-13 18:36:06 +00:00
jpandre cc9d5c0b57 Fixed write checks for directories 2008-03-13 14:09:16 +00:00
jpandre 2fa89952ff Fixed cache creation when mount fails 2008-03-12 16:22:24 +00:00
jpandre be365af93b Made implicit user mapping more general and improved checks 2008-03-12 16:15:52 +00:00
jpandre 1f1ebf2548 Fixed consistency checks in security API 2008-03-12 16:05:39 +00:00
jpandre 3fb950c590 Implemented dynamic groups and a generic user mapping 2008-03-11 15:36:40 +00:00
jpandre 97a85f91f9 Fixed an endianness error 2008-03-11 10:42:45 +00:00
jpandre 53fa335624 Adapted to ntfs-3g.1.2310 2008-03-10 15:35:54 +00:00
jpandre beb5e6ae48 Changed representation of special mode bits in ACEs and put them in
canonical order
2008-03-10 11:28:59 +00:00
jpandre 8cc3d7d7b2 Improved consistency checks related to $Secure 2008-03-06 11:26:23 +00:00
jpandre 72e221d828 Fixed getting the group of files 2008-03-05 18:34:58 +00:00
jpandre a38b79897d Adapted to ntfs-3g.1.2216 2008-02-18 15:15:13 +00:00
jpandre 427c0dc48f Adapted to ntfs-3g-1.2129 2008-01-30 11:03:22 +00:00
jpandre c632244e15 Missing adaptation to ntfs-3g-1.2121-RC 2008-01-25 17:33:34 +00:00
jpandre 2ff8218406 Adapted to ntfs-3g-1.2121-RC 2008-01-23 08:16:23 +00:00
jpandre d7741bccc6 Moved user mapping file to hidden directory .NTFS-3G 2008-01-16 20:07:56 +00:00
jpandre 31d414ca1d Implemented an option to designate a user mapping file 2008-01-15 17:41:46 +00:00
jpandre d5fc330628 Improved search for the longest run of unallocated blocks 2008-01-15 17:35:05 +00:00
jpandre 038156ba82 Reengineered LRU caches, made generic, and applied to finding inode numbers 2008-01-10 17:32:55 +00:00
jpandre 076358d6fd Redefined ownership of files 2007-12-14 17:02:39 +00:00
jpandre 78bd8350ca Fixed a bug when getting permissions for the first time 2007-12-13 17:27:32 +00:00
jpandre 59a21e6110 Reengineered permissions cache 2007-12-13 09:14:51 +00:00
jpandre 7335c9af68 Fixed inserting users into groups 2007-12-09 08:33:54 +00:00
jpandre ecc7c2099f Fixed checking for unchanged owner in chgrp 2007-12-09 08:32:19 +00:00
jpandre 0f40622012 Developped processing of static supplementary groups 2007-12-07 20:07:17 +00:00
jpandre 99ff26cb0b Developped processing of static supplementary groups 2007-12-07 08:46:36 +00:00
jpandre 4a41445698 Added alignment checks in ACL sanity checking 2007-12-04 07:55:59 +00:00
jpandre 5513e46b16 Avoided a double check in unlink() 2007-12-04 07:53:44 +00:00
jpandre a892467a88 Fixed bad release of index root 2007-12-04 07:51:30 +00:00
jpandre 9557f92cd0 Fixed compatibility with Windows for allowing writes to group and world 2007-12-02 20:23:17 +00:00
jpandre d49a557167 Fixed recognition of alternate world SID 2007-12-02 20:22:22 +00:00
jpandre 3284b3fd4a Fixed a memory leak when user mapping is not activated 2007-11-29 11:17:42 +00:00
jpandre d78230bb7f Fixed audit functions 2007-11-24 09:25:22 +00:00
jpandre fe34d3f231 Extended security API for auditing security data 2007-11-23 10:50:15 +00:00
jpandre d6cbe236e9 Fixed "Dr Watson" situation again 2007-11-23 10:48:47 +00:00
jpandre 95038a1cb0 Fixed a double close error 2007-11-20 15:23:33 +00:00
jpandre f73e9ed9ce Fixed setting of read-only flag 2007-11-20 13:48:15 +00:00
jpandre 3a51d80655 Adjusted to v 1.1104 2007-11-20 11:05:49 +00:00
jpandre bd86c2e445 Adjusted to v 1.1120 2007-11-20 11:03:57 +00:00
jpandre 1e8eed2e92 Adjusted to v 1.1120 2007-11-20 10:58:22 +00:00
jpandre 9e788a40c5 Fixed apparent mode for symbolic links 2007-11-20 07:33:53 +00:00
jpandre b2025c15d0 Fixed access to files owned by root with access granted to a user 2007-11-20 07:25:03 +00:00
jpandre ea6d22763e Fixed flags checking in security descriptors 2007-11-20 07:21:56 +00:00
szaka 1146797ae0 update release to 1.1120-SA 2007-11-18 22:23:19 +00:00
szaka 6bbb912bca fix: unlink may failed with I/O error 2007-11-18 22:20:19 +00:00
szaka c38e349117 ntfs_readdir(): fix reading dirs over 600,000 files (GeorgeK, Szaka) 2007-11-15 07:21:43 +00:00
szaka d6f73c80e5 white space cleanup 2007-11-13 00:41:23 +00:00
szaka 906637db9e posix file time updates (Yura Pakhuchiy, Szabolcs Szakacsits) 2007-11-13 00:11:51 +00:00
jpandre eb0713793e Implemented ftruncate() with its special access checking 2007-11-12 13:33:40 +00:00
jpandre efe1ffec7a Fixed apparent protection mode for symbolic links 2007-11-12 13:31:54 +00:00
jpandre d519250d5b Tested security fields offset rather than flags in security API for consistency with "Dr Watson" case 2007-11-10 18:00:13 +00:00
jpandre 943248d0cf Considered security descriptors with no DACL as valid (for "DR Watson") 2007-11-10 15:52:37 +00:00
jpandre 84b00ba63a Set files created by unmapped users as created by root 2007-11-09 09:05:13 +00:00
jpandre e8d01bead0 Logged circumstances in which errno is set to EIO 2007-11-08 18:30:41 +00:00
jpandre fbadbb14b8 Fixed checking for writeable parent directory when truncating a file 2007-11-08 09:02:31 +00:00
jpandre 370b73adb5 Fixed check for sticky directory when unlinking 2007-11-07 10:03:16 +00:00
jpandre 67e5ba51d0 Deny hard link when source directory is protected 2007-11-07 09:25:00 +00:00
jpandre f7668a2577 Deny truncate of files in protected directory 2007-11-07 09:23:46 +00:00
jpandre 0c9744587e Deny rmdir from protected directory 2007-11-07 09:22:42 +00:00
jpandre 1f7e99be09 Cancelled incompatibility O_RDWR and O_WRONLY for open() 2007-11-07 09:21:17 +00:00
jpandre daf8003511 Fixed checking access to target directory in creating a hard link 2007-11-06 18:42:51 +00:00
jpandre afb21cdd92 Fixed clearing setgid if file group does not match process group 2007-11-06 16:39:24 +00:00
jpandre 90aaeea4ac Fixed checking parent dir is searchable to allow file opening 2007-11-06 16:37:16 +00:00
jpandre e9f4de2d94 Adjusted to v 1.1104 2007-11-05 17:16:48 +00:00
jpandre 2b2f210d57 Cleared gaps between $Secure:$SDS records to avoid warnings from chkdsk 2007-11-05 16:46:52 +00:00
jpandre dfdbc7c1f6 Fixed setuid and setgid (for directories, and if owner == group) 2007-11-01 20:51:15 +00:00
jpandre 38f0433943 Avoided any checks in chown() if neither owner nor group is changed 2007-11-01 20:47:35 +00:00
jpandre 0a6f37914c Fixed group ACE when group is owner and either setuid or setgid 2007-11-01 14:20:03 +00:00
jpandre d9afd54c5c Updated mtime after a successful chown/chgrp 2007-11-01 14:17:37 +00:00
jpandre 80eed372b6 Updated ctime in chmod() 2007-11-01 10:42:31 +00:00
jpandre 7f9fd9f4ea Reorganized file creation to avoid temporary settings (continued) 2007-10-31 07:29:56 +00:00
jpandre cd25021844 Reorganized file creation to avoid temporary security settings 2007-10-30 17:09:11 +00:00
jpandre 442cbe8a73 Fixed header after merging security attributes 2007-10-30 08:54:31 +00:00
jpandre c7850ddf82 Fixed condition for accepting a chgrp 2007-10-30 08:52:51 +00:00
jpandre a8dc8655d0 Adjusted to v 1.1030 2007-10-29 16:28:33 +00:00
Anton Altaparmakov fb4a13008e ntfsclone: Allow metadata cloning to block devices when --force option
is supplied. (Anton)
2007-10-26 11:28:51 +01:00
jpandre 444f617e7f Removed debugging instructions 2007-10-25 08:52:52 +00:00
jpandre d0a84b3ef3 Fixed size returned in security API 2007-10-24 10:02:32 +00:00
jpandre 9551e7eee6 Recognized local users group as meaning world 2007-10-24 07:18:44 +00:00
jpandre b31b4cb124 Returned the securid and size even if short buffer in security API 2007-10-24 06:37:52 +00:00
szaka 5167f7b5dd ntfs_security_hash(): big-endian fix (Erik Larsson) 2007-10-22 18:51:20 +00:00
jpandre c6830ecc23 Fixed a few errno returns 2007-10-22 12:58:06 +00:00
jpandre 4fa21ffe2d Accepted symbolic names for uid and gid in user mapping file 2007-10-21 16:45:06 +00:00
jpandre 8fb2068f41 Recognized the generic creator-owner SID 2007-10-21 16:14:30 +00:00
jpandre ece8b56697 Removed old unused code 2007-10-20 15:27:44 +00:00
jpandre 0c15d089ef Implemented cache extension for legacy directories 2007-10-20 12:40:22 +00:00
jpandre 0ea556dee5 Fixed logic of access() 2007-10-20 12:37:56 +00:00
jpandre 6a96a5cebd Checked volume designated in security API is not mounted 2007-10-20 07:07:03 +00:00
Yura Pakhuchiy ae0f9e8053 Update ChangeLog. 2007-10-19 21:31:32 +03:00
Yura Pakhuchiy 8d63e0b1a2 ntfsck: Use ntfs_pread instead ops->pread. (Noticed by Christophe GRENIER) 2007-10-19 21:22:59 +03:00
Yura Pakhuchiy cfda0077b5 Raise FUSE dependency 2007-10-19 21:18:04 +03:00
Yura Pakhuchiy ae6bad499a Avoid endless loop on damaged volumes 2007-10-19 21:16:24 +03:00
Yura Pakhuchiy 5a381d5a9e Remove some legacy logging traces 2007-10-19 21:15:23 +03:00
jpandre a597c1c608 Implemented special protection modes : sticky, setuid, setgid 2007-10-19 15:18:55 +00:00
jpandre 3ad5de1d1f Fixed security initialization for old volumes which do not have a $Secure file 2007-10-19 08:09:27 +00:00
jpandre 6886650afc Fixed several endianness errors 2007-10-19 07:16:21 +00:00
jpandre 62407b6b1e Made a double check before creating the first security id 2007-10-18 16:05:33 +00:00
jpandre 86084908e2 Reorganized ACL inheritance to allow inheritance in directories with a

							
						
2007-10-18 14:56:18 +00:00
jpandre 3db8bb1848 Stuffed zeroes into $SDS before writing into a new block, to prevent

							
						
2007-10-17 12:23:02 +00:00
jpandre 764dced1f1 Fixed errno when could not write to $SDS 2007-10-17 12:20:22 +00:00
jpandre 5f914d0492 Padded end of $SDH entries with 0x490049 like Windows (purpose unknown) 2007-10-17 12:17:51 +00:00
jpandre 85c536de3f Fixed unneeded generation of security id after a hash collision

							
						
2007-10-15 15:04:11 +00:00
jpandre d93d9562ee Fixed a special case in getting next index entry 2007-10-15 14:59:30 +00:00
jpandre 2ce866d4cd Fixed an error in closing security 2007-10-15 14:58:22 +00:00
jpandre f7ae72ca0a Updated a comment 2007-10-12 13:24:58 +00:00
jpandre ed5d8398a7 Defined an option for upgrading gracefully individual security attributes 2007-10-12 12:58:01 +00:00
jpandre 86f94559c2 Implemented an option for upgrading gracefully individual security attributes

							
						
2007-10-12 12:56:28 +00:00
jpandre 91a4873a23 Implemented a function giving next entry in an index

							
						
2007-10-12 12:54:49 +00:00
jpandre 5c1d979b88 Defined interface to a function giving next entry in an index

							
						
2007-10-12 12:53:06 +00:00
jpandre 3d52f33763 Added a field for security options 2007-10-12 12:51:03 +00:00
jpandre eb1839d187 Defined a security API

							
						
2007-10-12 12:49:58 +00:00
szaka 4eebc42d42 remove bogus format attribute which caused some gcc to crash 2007-10-10 19:37:25 +00:00
jpandre a8a33f0bc3 Reverted back relay for free() and consequences on const ptrs 2007-10-09 13:33:11 +00:00
jpandre 44326c40b7 reverted back relay for free() 2007-10-09 13:27:35 +00:00
jpandre 7cc6adba7c Fixed a missing inode closing 2007-10-09 11:59:33 +00:00
jpandre 0eebef6e06 Code cleaning : fixed machine-dependent cast when fprintf'ing with %lld 2007-10-09 09:05:43 +00:00
jpandre cd8e66dc3a Code cleaning : fixed machine-dependent casts when fprintf'ing with %lld 2007-10-09 09:05:06 +00:00
jpandre ccbd793fae An update in utils_mount_volume() which was missing 2007-10-09 08:21:14 +00:00
jpandre 0fcd72cf55 Cleaned code

							
						
2007-10-09 08:01:37 +00:00
jpandre 88772c9912 Cleaned code

							
						
2007-10-09 07:55:28 +00:00
jpandre 8032b960d0 Cleaned code

							
						
2007-10-09 07:51:08 +00:00
jpandre 728a9c1aad added a ntfs_free(const void*) 2007-10-09 07:40:53 +00:00
jpandre 8a210f7776 Cleaned code

							
						
2007-10-09 07:37:07 +00:00
jpandre 2e35668e86 - implemented partial key comparing for hash keys

							
						
2007-10-09 07:35:09 +00:00
jpandre f5b7ac0905 Cleaned code

							
						
2007-10-09 07:32:12 +00:00
jpandre 78c14e05a8 Cleaned code (added a few const to arguments where useful) 2007-10-09 07:30:40 +00:00
szaka 4206ceddce fix warnings 2007-10-08 22:03:31 +00:00
jpandre 773a9b3596 - Logged cache statistics

							
						
2007-10-06 14:52:55 +00:00
jpandre 13a68a1864 Upgraded to v1.1004 2007-10-06 14:48:10 +00:00
jpandre b0f972c764 - fixed a memory corruption case in cacheing of security attributes

							
						
2007-10-06 14:46:53 +00:00
jpandre 492dbcbe9e Checked consistency of standard information size and v3_Extensions flag 2007-10-06 14:41:23 +00:00
jpandre e84a56b165 Made two more functions public for temporary use in security.c 2007-10-06 14:39:08 +00:00
jpandre cc2e201f81 Fixed initial security id for created files 2007-10-06 14:37:22 +00:00
jpandre 66c79fde0c Removed an unneeded variable 2007-10-06 14:35:55 +00:00
jpandre 75f1f4c112 Upgraded to v1.1004 2007-10-06 14:34:49 +00:00
jpandre fe10799d0f New fields to store handles to $Secure

							
						
2007-10-06 14:32:12 +00:00
jpandre 006d0aad79 New structs for two-way cacheing 2007-10-06 14:27:25 +00:00
Yura Pakhuchiy eb8307dac3 Add libntfs sample config to EXTRA_DIST 2007-09-29 01:09:10 +03:00
Anton Altaparmakov e0e71a3776 Fix grammar in NEWS and add a few useful extra outputs about the
attribute list attribute in ntfsinfo.c.  (Anton)
2007-09-28 21:07:15 +01:00
Yura Pakhuchiy ae99cc4199 Update changelog 2007-09-28 16:52:47 +03:00
jpandre 7006a9452c Fixed and improved comments 2007-09-28 06:59:53 +00:00
jpandre b823389638 Removed outdated debug instructions 2007-09-28 06:56:51 +00:00
jpandre a774c2437d Fixed an error in creating initial non-inherited security descriptor 2007-09-28 06:53:42 +00:00
jpandre 49d6dabbab Claiming to be author as well, as a check whether I have understood

							
						
2007-09-28 06:49:47 +00:00
szaka 0d05ca69fe Jean-Pierre Andre's permission handling implementation 2007-09-27 22:35:58 +00:00
Yura Pakhuchiy 2f33075993 Apply fix from crypto.c to ntfsdecrypt 2007-09-27 16:41:22 +03:00
Yura Pakhuchiy 2d645bae53 Apply latest CVS on top. I will rewrite history properly later. 2007-09-27 16:36:53 +03:00
Yura Pakhuchiy e2deb0dad4 ntfsmount: Fill .st_mode in readdir(). (Szaka, Yura) 2007-09-27 16:29:57 +03:00
jpandre 99b4aba970 *** empty log message *** 2007-09-27 13:29:52 +00:00
Yura Pakhuchiy 2b1ef811e6 Add NTFS_MNT_INTERIX mount option to make libntfs recognize Interix files.
At present it influence only on ntfs_filldir(), but we can have ntfs_stat() and
other functions on which it will make more influence later.
2007-09-27 15:58:42 +03:00
Yura Pakhuchiy f24415abaa update AUTHORS 2007-09-26 23:08:23 +03:00
Yura Pakhuchiy a3a077dcef Update NEWS 2007-09-26 23:06:50 +03:00
Yura Pakhuchiy c0005bfa0f Add libntfs man page to build system 2007-09-26 22:51:41 +03:00
Yura Pakhuchiy a92649480c Add man-page for libntfs 2007-09-26 22:41:28 +03:00
Yura Pakhuchiy d54ad2d637 ntfsmount man page update 2007-09-26 18:19:08 +03:00
Yura Pakhuchiy 48e033623d ntfsmount: Do not allow user mount devices he normally do not have rights to 2007-09-25 14:42:33 +03:00
Yura Pakhuchiy f7068cf989 ntfscp docs update 2007-09-24 21:58:02 +03:00
Yura Pakhuchiy 45a641b408 ntfsmount: Fix recently introduced bug in attribute/inode close ordering in case if ntfs_fuse_open() failed. 2007-09-24 21:08:32 +03:00
Yura Pakhuchiy ad8097aa55 ntfsmount: minor memory managment fix 2007-09-24 20:27:54 +03:00
Yura Pakhuchiy 1b5fb2693c Introduce NTFS_ON_DEBUG macro to add one-liners which would be executed only if DEBUG is defined.
And use it to shut up valgrind crying about writing of unitialized buffer (we do not initialize part of attribute list left for padding)
2007-09-24 19:21:16 +03:00
Yura Pakhuchiy a81520731c Install mount.fuse.ntfs symlink (to match mount with subtype=ntfs option) 2007-09-23 00:50:45 +03:00
Yura Pakhuchiy 42f475f552 ntfsmount: Cache directory in which was performed last operation 2007-09-23 00:37:49 +03:00
Yura Pakhuchiy 36b8f621f9 libntfs: Sync and warn about not closed inodes in ntfs_umount 2007-09-23 00:36:18 +03:00
Yura Pakhuchiy 72ae9ade7e ntfs_delete: Add sanity check for case when user tries to delete inode with several references 2007-09-22 23:19:09 +03:00
Yura Pakhuchiy d788fc6591 Update TODO* files a bit 2007-09-22 18:29:16 +03:00
Yura Pakhuchiy dcf72f1315 ntfs_inode_close: Document that @ni can be NULL. 2007-09-21 18:43:05 +03:00
Yura Pakhuchiy 4f7f0f654e ntfsmount: Implement .fgetattr() 2007-09-21 17:58:07 +03:00
Yura Pakhuchiy 36af29fe72 ntfsmount: Implement .ftruncate() 2007-09-21 17:50:40 +03:00
Yura Pakhuchiy 3f8abbf2ca ntfsmount: Implement .create() 2007-09-21 17:40:22 +03:00
Yura Pakhuchiy d1a7006798 ntfsmount: Introduce macro NTFS_FUSE_GET_NA for receiving ntfs_attr* from fuse_file_info* 2007-09-21 15:51:50 +03:00
Yura Pakhuchiy 5151f826c4 ntfsmount: Save pointer to ntfs_attr in (fuse_file_info *)->fh and use it in ntfs_fuse_{read,write} 2007-09-20 15:46:31 +03:00
Yura Pakhuchiy 673c23d74a libntfs: Cache opened attributes. 2007-09-20 15:35:43 +03:00
Yura Pakhuchiy 038fea1b5b Cleanup
We calloc() buffer for attribute, but better always set na->crypto to NULL
explicitly just for any case
2007-09-20 14:21:58 +03:00
Yura Pakhuchiy c0e8e211f3 libntfs: Cache opened inodes. 2007-09-20 14:00:55 +03:00
Yura Pakhuchiy dc4e093df0 Fix stupidness because of which we always wrote out MFT record on close 2007-09-18 23:08:21 +03:00
Yura Pakhuchiy d6dc40150f formatting 2007-09-18 22:57:19 +03:00
mechie e859b1b109 This commit was manufactured by cvs2svn to create branch
'PERMISSION_HANDLING_BRANCH'.
2007-09-16 18:33:54 +00:00
Yura Pakhuchiy e5690b57d4 Allow mounting volumes with non-clean logfile with force mount option.
Volume left dirty upon umount. So, this is equal to running ntfsfix and then mounting with force option.
2007-09-16 00:15:46 +03:00
Yura Pakhuchiy bf3a7442eb ntfs_attr_pwrite: Write 4096 bytes blocks when possible. (David Fox, Szaka, Anton, Yura) 2007-09-15 23:09:20 +03:00
Yura Pakhuchiy 37476cf609 Introduce NTFS_MNT_FORCE instead of third parameter of utils_mount_volume 2007-09-15 18:12:32 +03:00
Yura Pakhuchiy 57cc7904c9 cleanups (Szaka) 2007-09-15 17:31:39 +03:00
Yura Pakhuchiy 942519d093 ntfsmount: Add bmap support. (Szaka, Yura) 2007-09-14 18:53:46 +03:00
Yura Pakhuchiy 5e4341c0ac Do not refuse mount if there is garbadge in hiberfil.sys file. (Szabolcs Szakacsits) 2007-09-14 13:09:14 +03:00
Yura Pakhuchiy e248e6b986 Make libntfs keep track number of free clusters and MFT records.
Thanks for idea to David Fox and Szabolcs Szakacsits.
2007-09-14 12:59:55 +03:00
Yura Pakhuchiy f5b9888eb6 formatting 2007-09-13 23:05:18 +03:00
Yura Pakhuchiy 398755a75e ntfsmount: Implement {no,}relatime (relative atime) options.
According to http://userweb.kernel.org/~akpm/mount-relative-atime.txt
Only several lines with new time handling ;-)
2007-09-13 20:42:00 +03:00
Yura Pakhuchiy e9f9d9905f Cleanup 2007-09-13 16:07:48 +03:00
Yura Pakhuchiy 5d05d42d05 properly fix st_blocks calculation 2007-09-12 17:52:21 +03:00
Yura Pakhuchiy 31a39d2a37 Fix memory corruption in case option parsing failed. 2007-09-12 16:43:27 +03:00
Yura Pakhuchiy 3504cc8796 Handle atime option 2007-09-12 16:15:54 +03:00
Yura Pakhuchiy ba89f9ebf4 More sane set-uid-root handling 2007-09-12 15:55:37 +03:00
Yura Pakhuchiy 9cd3246db7 cleanup 2007-09-11 20:56:34 +03:00
Yura Pakhuchiy 28226c183b Mount block devices with blkdev mount option 2007-09-11 19:46:20 +03:00
Yura Pakhuchiy 3b99cee600 Fix directory corruption in index code. (Szaka)
TODO/FIXME: This hardly readable code definitely needs rewrite. Take index.c from 1.13.1 and implement all properly.
2007-09-11 16:58:01 +03:00
Yura Pakhuchiy a9a1f28cf5 Fix previous fix to filler :) 2007-09-11 16:46:29 +03:00
Yura Pakhuchiy cc166f9f42 ntfs_readdir, ntfs_fuse_filler: return with error if FUSE filler failed. (Szaka) 2007-09-10 21:21:39 +03:00
Yura Pakhuchiy 030ea75bef Rename rpm ntfsprogs-fuse to ntfsmount 2007-09-10 19:26:38 +03:00
Yura Pakhuchiy a1103ccd61 Fix syslog logging handler to take in respect all logging flags.
This makes ntfs_log_perror, ntfs_log_trace, etc., behave correctly when
beeing used with it.
2007-09-10 18:38:29 +03:00
Yura Pakhuchiy 54d7899368 Workaround windows defragmentation tool bug.
Windows defragmentation tool do not update name offset correctly for unnamed
attributes, but chkdsk do not like when it negative, so do not change it at all
if it would become negative.  (Szaka)
2007-09-07 15:50:29 +03:00
Yura Pakhuchiy b392bd17c8 ntfsmount: Submit inode number during readdir
Some broken programs rely on that filesystem will submit inode number during
readdir() (what is optional). Make them happy since it is really not a problem.
(Ted Anderson, Szaka)
2007-09-07 15:39:30 +03:00
Yura Pakhuchiy ec2afb736c Fix cache handling in utils_attr_get_name. (Thanks to Bogdan for finding this bug) 2007-09-07 15:31:33 +03:00
Yura Pakhuchiy 82df6c1fea Rework time updates
- Library no longer perform time updates, only provide API for this
- Remove ntfs_inode_update_{a,}time() and introduce ntfs_inode_update_times()
- Make ntfsmount properly update times
- ntfs_delete() now takes pointer to pointer to ntfs_inode for while to delete and closes inode only in cases no more hard links left to file
2007-09-06 18:34:38 +03:00
Yura Pakhuchiy a1124ce7f4 Fix recent denial of __ntfs_create in reparse point 2007-09-06 18:11:53 +03:00
Yura Pakhuchiy 58ab68b024 ntfsmount: remove some traces of legacy code 2007-09-06 13:51:48 +03:00
Yura Pakhuchiy 9f51bdfd05 Catch and deny all junction/reparse point write operations. (Szaka) 2007-09-05 21:19:53 +03:00
Yura Pakhuchiy 7d6a8f2767 ntfs_ie_add(): cleanup (Szaka) 2007-09-05 21:00:16 +03:00
Yura Pakhuchiy aec646eebc Do not force debug output to be always shown even if --enable-debug specifiend during configure. Let user choose in runtime. 2007-09-05 16:47:03 +03:00
Yura Pakhuchiy 4679daa0af Fix hole instantiating and new API ntfs_rl_fill_zero
Thanks to Szaka for finding this bug and idea of factoring out zero filling code.
2007-09-05 16:38:51 +03:00
Yura Pakhuchiy 219d353226 Fix corner case in hole instantiating in ntfs_attr_pwrite(). (Szaka) 2007-09-04 17:20:13 +03:00
Yura Pakhuchiy 95b044cff3 Small enchantments and cleanups from ntfs-3g 2007-09-03 19:51:13 +03:00
Yura Pakhuchiy 3b64a5a512 trailing spaces 2007-09-03 19:39:24 +03:00
Yura Pakhuchiy 65a81e3563 ntfsclone do bad things about endians, so revert it to original state and put mark on it to not perform sparse bitwise checks 2007-08-23 17:58:52 +03:00
Yura Pakhuchiy f5a2ae79a9 Improve endian self-test per discussion with Anton. 2007-08-23 17:39:00 +03:00
Yura Pakhuchiy c0b691ca17 Merge --enable-debug and --enable-debug-logging. Introduce --enable-sparse. 2007-08-22 21:29:19 +03:00
Yura Pakhuchiy 391929cff3 Export NTFS_EFS string 2007-08-22 19:31:24 +03:00
Yura Pakhuchiy 6df32ed1ab ntfsinfo: Dump content of LOGGED_UTILITY_STREAM in hex in verbose mode 2007-08-22 19:30:12 +03:00
Yura Pakhuchiy 4b58df6817 New API: ntfs_attr_get_name
Add new API ntfs_attr_get_name - returns pointer to unicode name of attribute.

TODO: I believe we have several such local helpers in ntfsprogs and libntfs.
Find and replace them with this one.
2007-08-22 19:28:44 +03:00
Yura Pakhuchiy ad0c5f59c9 Transparently integrate reading of encrypted files into library
This adds crypto.[ch], several exported functions that you are not interested
to use and dependency on >=libconfig-1.0.1 to read list of PFX files with keys.
See libntfs/config for example configuration file.
2007-08-22 16:55:57 +03:00
Yura Pakhuchiy efe2c9642c minor cleanup 2007-08-16 13:52:18 +03:00
Yura Pakhuchiy 09affc5d42 Whitespaces cleanup 2007-07-31 20:52:36 +03:00
Yura Pakhuchiy 67f0ef364b fix CREDITS to be in utf8, not in mixed encodings 2007-07-23 18:11:39 +03:00
Yura Pakhuchiy ea4d352f7e Fix sparse warnings from git HEAD version 2007-07-21 22:01:57 +03:00
Yura Pakhuchiy 87b686f9c9 Undef __bitwise and __force in case someone else defined them before us 2007-07-21 15:13:57 +03:00
Yura Pakhuchiy 311ecc507e Memleak 2007-07-21 15:11:42 +03:00
Yura Pakhuchiy 1947aacb89 Cleanup 2007-07-01 01:52:48 +03:00
Yura Pakhuchiy 8981594cf0 ntfsdecrypt: Fix sparse warnings. 2007-06-30 20:19:25 +03:00
Yura Pakhuchiy 7a68bb3ea0 Endian fixes for gnome-vfs module. Thanks to Anton for tip. 2007-06-10 14:30:41 +03:00
Yura Pakhuchiy d059090386 info: nice LCN dumping 2007-06-08 13:48:28 +03:00
Yura Pakhuchiy 0d264b7d25 Introduce sparse endian annotations. Adopt library (also fix 2 real bugs) and progs (lots of bugs). 2007-06-08 13:47:57 +03:00
Yura Pakhuchiy def36146b7 Sparse 0.3 do not longer requires this workaround! 2007-06-08 13:46:10 +03:00
Yura Pakhuchiy 48c336fd6a O(1) mapping pairs update for normal files 2007-06-08 13:45:28 +03:00
Yura Pakhuchiy b99d331f78 We do not need to map whole runlist in this case, only until @pos. Introduce ntfs_attr_map_runlist_range to implement this. 2007-06-08 13:41:10 +03:00
Yura Pakhuchiy e404ce8203 Fix 64bit warnings (Yuval) 2007-06-08 13:36:37 +03:00
Yura Pakhuchiy e6620be16d Do not create holes in ntfs_attr_pwrite that will be instantiated right after creation
* Add new API: __ntfs_attr_truncate that allow user to select whether holes should be created or clusters allocated
* Update ntfs_attr_pwrite and ntfscp to use it.
2007-06-08 13:35:47 +03:00
Yura Pakhuchiy 52d034e5f3 ntfsmount: fix errno in truncate() operation 2007-06-08 13:34:16 +03:00
aia21 62d49cb175 Minor updates for OSX compatibility, i.e. glibtoolize not libtoolize, and
automake 1.10 fix, etc.
2007-03-19 14:39:44 +00:00
yura 2c7fd02349 ntfsmount: use utimens() instead of deprecated utime(). 2007-03-13 18:52:02 +00:00
yura 48399b98b3 cleanup 2007-03-13 18:45:51 +00:00
yura 01dad951c2 minor cleanups 2007-03-13 18:39:47 +00:00
aia21 3575e2089e - mkntfs: Use Vista $Boot rather than XP one. (Anton) 2007-03-06 15:44:30 +00:00
yura 857573a2e4 minor style fix and changelog description 2007-01-07 19:19:53 +00:00
uvman dcc13dca8b ni->allocated_size for resident files is rounded up to multiples of 8. A '>> 9' on such value may round up or down. Fix it to always round up. Samba 3 use st_blocks to detect if a file is sparse. ActiveSync 4 fails on sparse files. 2007-01-07 19:08:22 +00:00
yura 197a4cc756 - upgrade to new shiny fuse option parsing API instead of my old hackish one (more readable and -4kb code)
- remove show_sys_files and add case_insensitive options
2007-01-03 18:27:10 +00:00
aia21 f6adc3fc78 - mkntfs: Create more Vista like volumes. We now match the security
descriptor attributes (but not yet the security descriptors stored in
  $Secure).  (Anton)
- libntfs: Rewrite ntfs_upcase_table_build() to generate a Vista
  compatible upcase table ($UpCase).  (Anton)
- mkntfs: Remove own generation of upcase table, i.e. delete
  ntfsprogs/upcase.[ch] and use ntfs_upcase_table_build() supplied by
  libntfs.  (Anton)
2006-12-19 16:31:52 +00:00
yura 452b99f01b oops, committed temporary thing by accident
hope this will work for everyone
2006-12-18 13:39:23 +00:00
yura bedd6f4a13 add some debug output useful on freebsd for aligned access testing 2006-12-18 13:32:58 +00:00
yura 3c668b7d03 - O_EXCL already handled by MNT_NOT_EXCLUSIVE at more early stage
- fix comments
2006-12-15 17:00:02 +00:00
aia21 1fa522a0a1 - libntfs: Add support for FreeBSD 5.0+ sector aligned access
requirements.  (Max Khon)

With some modifications from me...
2006-12-15 15:21:27 +00:00
aia21 0911eb8b0d Make volumes created with mkntfs more compliant with Vista (still not finished). 2006-12-15 14:52:43 +00:00
aia21 5f3079c2bb Fix ntfstruncate build breakage. 2006-12-13 10:51:32 +00:00
aia21 19257df7f0 Update version to 2.0.0, update NEWS, update mkntfs man page and mkntfs itself.
- mkntfs: As announced, remove the deprecated support for creation of
  NTFS 1.2/3.0 volumes.  We now create NTFS 3.1 volumes only.  (Anton)
- mkntfs: Remove lots of unused/unneeded debugging code.  (Anton)
2006-12-13 10:46:49 +00:00
aia21 78c46fd3c3 - Do not create object id attribute on NTFS 1.2 volumes.
- Create object id attribute after volume flags attribute.
2006-12-13 09:17:14 +00:00
aia21 1a4fb3431c - mkntfs: Generate a random DCE compliant UUID for the created volume
and include --with-uuid[=PFX] and --without-uuid options.  (Anton)
- configure.ac: Set language to C.  (Anton)
- mkntfs: Always set default cluster size to 4096 bytes regardless of
  volume size.  This is what Windows Vista does and it makes perfect
  sense from a performance point of view.  (Anton)
2006-12-13 00:11:50 +00:00
yura 914cf8f2be Workaround for this bogus s64 warnings. Thanks, Linus! 2006-12-12 20:27:32 +00:00
yura 10b22550cd more sparse fixes
left only endianness and this stupid problems with s64
2006-12-12 19:00:00 +00:00
yura 2e44b6ca7c fix some sparse warnings
btw, it looks like sparse loses it head when it see something like:

void foo(s64 *bar)
{
	...
}

...

{
	s64 baz;

	foo(&baz);
	...
}
2006-12-12 15:44:52 +00:00
yura 7b60afcc2f fix sparse errors. and first steps towards endianness checking 2006-12-12 15:02:25 +00:00
aia21 a38ead2f20 Szaka prefers to have the lofgile reset and dirty bit setting done even if they
are already done so remove the conditionals I added.
2006-12-11 10:41:34 +00:00
yura 2b611a1461 fix clusters per index block calculation (Szaka) 2006-12-11 03:16:22 +00:00
yura c616e29663 ntfsck by Yuval to extra dist with minor changes from me 2006-12-11 03:06:35 +00:00
yura 19089b08bd one place with mount option description 2006-12-11 03:03:30 +00:00
yura 03fabce6eb o fix magicNTFS defenition
o remove NTFS_SB_MAGIC because it is unusefull
o rename magicNTFS -> NTFS_SB_MAGIC
o make bootsect.c use NTFS_SB_MAGIC instead of hardcoded value
2006-12-11 03:02:23 +00:00
aia21 43b61b82e7 If pread/pwrite are not supported by the OS, set the device pread()/pwrite()
pointers to NULL so we automatically use seek() + read()/write() from now on.
2006-12-10 19:38:02 +00:00
aia21 f73d77d568 - Implement ntfs_pread() and ntfs_pwrite() in terms of device
operations pread() and pwrite() respectively and fall back to using
  seek() + read()/write() if no pread()/pwrite() device operation is
  supplied or the OS does not support the pread()/pwrite() system call.
  Adapt unix_io pread()/pwrite() device operations to use pread()/
  pwrite() system call and adapt win32_io device operations to not
  supply pread()/pwrite().  (Csaba Henk, Anton)
2006-12-09 14:01:12 +00:00
aia21 8640540b53 Warn about VOLUME_MOUNTED_ON_NT4 wrt Vista in layout.h and do not set the flag
in ntfsfix.
2006-12-09 11:27:37 +00:00
yura 82747f3c47 ntfsmount: fix rename if destination already exists. 2006-12-06 19:51:59 +00:00
yura c475778b47 Turn ntfs_pathname_to_inode() into ntfs_pathname_to_inode_num() which
returns ntfs inode number instead of opened inode itself.
Reimplement ntfs_pathname_to_inode() as wrapper to new API.
2006-12-06 18:50:13 +00:00
szaka 3cd5cb9c8a Don't check free space if output file is FIFO (Andree Leidenfrost) 2006-12-03 18:26:58 +00:00
yura 33ffbb2af7 rename --enable-fuse-module to more clear --enable-ntfsmount and cleanup autotools scripts a bit 2006-12-03 14:19:29 +00:00
aia21 0089670e1c Use NTFS_MNT_FORENSIC with ntfsresize to restore old behaviour as it is
documented, i.e. that ntfsresize does not do any modifciations until you say
so.  Also reinstate code to do the journal emptying and setting of dirty flag
on the volume because of it.  However update the code so that those things are
only done if they were not already the case.
2006-12-03 08:59:57 +00:00
yura fb40779709 Force using FUSE 2.6.1 that have proper error message in case of missing fuseblk 2006-12-01 16:04:56 +00:00
aia21 f40bef7246 Disable unmounting at the point of no return when we start doing serious
modifications to the volume.  Hopefully Szaka will be happy now.  (-:
2006-11-28 13:45:42 +00:00
aia21 a32aa26d0b - Fix ntfsresize to unmount the volume when finished/exiting so it does
not leave the volume in an inconsistent state.  Somewhat crude
  solution using atexit() but it works...  (Anton)
2006-11-28 11:00:52 +00:00
aia21 5302d23f7b - Empty the journal at mount time. (Anton)
- Set the volume dirty bit at mount time (if it is not set already and
  clear it again at umount time but only if it was not set to start
  with.  (Anton)
2006-11-28 10:09:56 +00:00
yura fbfbe3b48e force distro developers to fix their broken init scripts 2006-11-25 21:44:35 +00:00
yura f738f39bdf oops, introduced stupiedness during one of recent cleanups 2006-11-25 21:35:39 +00:00
yura f12f4aefb7 ntfs_log_error("Failed.\n") is evil. TODO: Implement ntfs_log_errortrace 2006-11-25 21:10:35 +00:00
yura 3cd59df400 bit more nice error messages 2006-11-25 18:38:47 +00:00
yura 8df298aec2 Introduce MNT_NTFS_NOT_EXCLUSIVE mount option that tells libntfs do
not open volume exclusively. Useful if libntfs user cares about this
himself, eg. FUSE with blkdev option.
2006-11-25 17:37:37 +00:00
yura 4b7868ddc2 ntfsmount: Umount volume in DESTROY. This is guarantees that all data would be s
ynced before umount return for volumes mounted with blkdev option.

Thanks to Miklos for information about blkdev.
2006-11-25 14:57:54 +00:00
yura 668780d84d bot more verbose debug 2006-11-25 14:28:47 +00:00
yura 18c8f75c7b make ntfs_attr_rm to always close attribute (both on success and failure) 2006-11-22 18:28:13 +00:00
yura 05a034e423 fix st_blocks calculation 2006-11-21 16:24:37 +00:00
yura 4adc3817c6 ntfsmount: always accept {f,d,}mask in octal to be as mount command 2006-11-21 15:40:56 +00:00
yura b538578ab7 Fix free clusters and MFT records calculation 2006-11-21 15:31:09 +00:00
yura c14589175f apply latest fixes from ntfs-3g to enddianess
now everything should work on BE machines!
2006-11-20 17:44:36 +00:00
yura 0da86b6723 port from ntfs-3g fixes to error cases in index code 2006-11-20 17:30:13 +00:00
yura a604622314 Windows cares only about first 4 records in $MFTMirr and ignores
everything beyond them. Update libntfs behaviour to be like in
windows. Leave @mftmirr_size for case if will want to change something in the
future.
2006-11-20 16:21:57 +00:00
yura ef66794423 cleanups 2006-11-20 15:59:14 +00:00
yura f7fe727b09 80 chars lines long fixes 2006-11-19 20:19:18 +00:00
yura b33658bc61 cleanups 2006-11-17 22:51:29 +00:00
yura 18dec0543d add support for read errors in free disk space calculation (szaka) 2006-11-17 22:35:21 +00:00
yura 188cbd9a41 use optarg instead of argv[optind - 1] 2006-11-17 22:14:55 +00:00
yura 7d1016fe97 Treat filenames in POSIX namespace as case insensitive in case of case insensitive mounts. 2006-11-15 23:15:17 +00:00
yura 0ac08318a6 use nice error messages from ntfs-3g 2006-11-13 17:01:53 +00:00
yura 9635a4793e Disable debug logging by default (seriously increase speed) 2006-11-13 15:38:43 +00:00
yura cb27c9f616 * Rename MS_{RDONLY,NOATIME} to NTFS_MNT_{RDONLY,NOATIME}.

							
						
2006-11-12 22:46:50 +00:00
yura cb5f0a1e94 * fmask=0111 and dmask=0 by default
* bit more nice mount messages
2006-11-10 17:23:12 +00:00
yura 28f24fbc2c revert factoring out ntfs_attr_fill_hole(), agree that it should be refactored,
but passing all args as pointers and changing them there (especially
update_from that changes only inside new function, but rollback depends on it
in pwrite)
2006-11-10 16:07:45 +00:00
yura f2e1ff96d2 Spent really a lot of time applying various "optimizations" from ntfs-3g and
finally figured out that ntfs-3g is faster than ntfsmount only because of
3 reasons:
1) turned on noatime option by default
2) ntfs-3g builds without debug output by default
3) the only real optimization: almost always add resident attributes.
However by accident patch in ntfs-3g for 3) breaks several code paths (why
I am not surprised?), thus I rewrote whole ntfs_attr_add() logic.
2006-11-09 21:19:11 +00:00
aia21 025f07a269 Make a little nicer. 2006-11-07 10:37:25 +00:00
yura d556675a29 Fix typo and build with disabled error handling 2006-11-06 17:11:02 +00:00
yura 45e3b4acd0 upgrade to FUSE 2.6 API 2006-11-06 12:51:44 +00:00
yura c65bacb25b ntfsmount: require FUSE version >= 2.6.0 for build. Fixes fusermount
lookup problem and allows to drop compatibility code.
2006-11-05 21:40:57 +00:00
yura 116a467dc0 * fix ntfsmount build

							
						
2006-11-05 14:42:46 +00:00
uvman 76fc32ed87 Fix a memleak. (Szaka) 2006-11-01 22:37:31 +00:00
uvman be6b5ce977 Factor ntfs_attr_fill_hole() out of ntfs_attr_pwrite(). (Szaka) 2006-11-01 20:20:18 +00:00
uvman 1598a68d67 Fix compilation on environments that one can not assign to "va_list args" (e.g. Debian Alpha). Do so by removing the unused log_reason code. Originally, Szaka asked FlatCap for it but never used it. I've asked Szaka if he is going to use it but he did not reply. I got an implicit answer in the form of ntfs-3g commit. Therefore, commit an updated version of the patch I've sent the Debian package maintainer. 2006-11-01 14:05:09 +00:00
uvman 7d585a0327 Change callers of malloc() to ntfs_malloc() (Szaka). Fix compilition (Yuval). 2006-11-01 13:30:40 +00:00
uvman 483522ec1f Introduce misc.c - Proud home of functions with no other home, starting with ntfs_[mc]alloc. (Szaka) 2006-11-01 12:31:11 +00:00
yura 1b1a135bbd one more endian bug in ntfsinfo 2006-10-30 23:23:40 +00:00
uvman f6d6db57db Fix wrong error logic that would lead to segfault when malloc fails. 2006-10-30 19:40:56 +00:00
uvman 3e3196133c Avoid a memory leak on the error code path. 2006-10-30 13:43:09 +00:00
uvman 22108e36a1 More big-endiness fixes. (zhanglinbao, Yuval) 2006-10-30 13:29:45 +00:00
uvman 036e748cb9 I was assuming memmove() would copy byte by byte if it detects a smaller than word gap. Anton pointed out that it doesn't, glibc sources confirm, the C99 standard claims otherwise. Revert the compress.c patch as implementation is more important than specification. 2006-10-29 08:59:21 +00:00
uvman 561cb42743 Move ntfs_index_entry_mark_dirty() from index.h to index.c. (Szaka) 2006-10-29 00:55:45 +00:00
uvman aa5ee310d0 Changelog entries for non-trivial commits of the last hour. 2006-10-29 00:09:23 +00:00
uvman fe1405393f Change ntfs_collate()'s signature to size_t's. Move ntfs_is_collation_rule_supported to the .c file and rewrite it to be shorter. 2006-10-29 00:01:17 +00:00
uvman b8ecbf7b94 Spelling fix. 2006-10-28 23:46:30 +00:00
uvman 87d87073c7 The periodic 'int is not neccessarily 32bit' fixes. 2006-10-28 23:45:22 +00:00
uvman 15eb2c38a6 constify string argument. 2006-10-28 23:41:41 +00:00
uvman 5c4b9c1056 C99 declarations before code fixes. 2006-10-28 23:40:11 +00:00
uvman f51136ac9d Forgot to advance the dest buffer (shame on me) 2006-10-28 23:35:56 +00:00
uvman c59a3aedbd memmove() already deals with overlap, is optimized, is ANSI C and only takes one line to call. 2006-10-28 23:15:44 +00:00
uvman 2991c40d90 Remove double-commenting. Why use C++-style comments for multilines anyway? 2006-10-28 23:11:25 +00:00
uvman 8fd26af3fb Fix memleak. Remove dead code. 2006-10-28 23:08:24 +00:00
uvman 08db1a719b Aid basic static code checkers to see that ctx can not be null in this code path. 2006-10-28 23:06:49 +00:00
uvman 11c38fa46d Anton is still the maintainer. 2006-10-27 21:21:20 +00:00
yura ab3519cbcd Always instantiate holes 2006-10-27 14:18:02 +00:00
yura b1583bdce6 Fix several memleaks 2006-10-27 14:15:32 +00:00
uvman 57d1067a22 Oops, edited the wrong file. Add zhanglinbao to CREDITS for his big-endiness testing and fixes. Add my mail address. anti-spam changes (if it helps nowdays). Misc changes. (Yuval) 2006-10-27 13:06:11 +00:00
uvman 83d70bb9b7 Change contact address to -dev. Add Mario to project members. Add zhanglinbao to CREDITS for his big-endiness testing and fixes. Add my mail address. anti-spam changes (if it helps nowdays). Misc changes. (Yuval, Szaka) 2006-10-27 13:00:08 +00:00
uvman ff55ecb513 Whitespace cleanup 2006-10-27 12:24:29 +00:00
aia21 880529ee5a Revert part of 1.71: Gratuituous API/ABI change. 2006-10-27 09:05:56 +00:00
aia21 8ddea064b9 Revert 1.13 commit from Yuval: Gratuitous API/ABI change. 2006-10-27 09:04:08 +00:00
uvman bd1837335b trace output updates. (Szaka, Yuval) 2006-10-26 20:45:28 +00:00
uvman ca2fb9a467 Remove inline keywords from static non-one-liners of '.c' files. 2006-10-26 19:10:05 +00:00
uvman fc7553ad2b [Inconstant,Damaged] metadata -> Inconsistent metadata 2006-10-25 18:57:15 +00:00
uvman c55aea3ad4 Use le32 conversion macros for u32 variables of INDEX_HEADER. (zhanglinbao2000, Yuval) 2006-10-25 16:49:00 +00:00
uvman 480fdb14d5 One more errno save/restore. 2006-10-22 01:11:48 +00:00
uvman 7b6f7e98d4 Remove saving and restoring errno around logging calls as these will not change errno anyway. Remove save/restore only if the saved value will not be used. 2006-10-22 00:23:29 +00:00
aia21 ff289408c5 fix for large sector sizes 2006-10-20 19:55:50 +00:00
aia21 3d56b14bca fix a packing bug 2006-10-20 19:54:22 +00:00
aia21 49559ce57c fix a silly bug. 2006-10-20 19:53:50 +00:00
uvman cc12bccc05 Allow reusing ntfs_device after close. 2006-10-18 14:44:23 +00:00
uvman 6efbbabba6 Spelling fix. 2006-10-18 14:43:04 +00:00
uvman acb04c0435 Remove unneeded padding. The compiler will pad if it wan't to. 2006-10-18 14:41:41 +00:00
aia21 9aa76186f3 Update ChangeLog... 2006-10-10 10:29:53 +00:00
aia21 0c86fccdc9 Fix GUID to string conversion to follow documentation (details: it is not
little endian at all, it is a binary sequence)...

See remarks section at:

http://windowssdk.msdn.microsoft.com/en-us/library/96ff78dc.aspx
2006-10-10 10:29:11 +00:00
uvman 911c577e07 Hil: Allow ntfscp to create the destination file if it does not already exists by calling ntfs_create(). 2006-10-04 20:57:03 +00:00
uvman b7b4c98633 Hil: Allow ntfscp to create the destination file if it does not already exists by calling ntfs_create(). 2006-10-04 00:47:04 +00:00
uvman 8cfa94abc3 Remove code that was already marked as broken and commented out. 2006-09-25 17:03:48 +00:00
uvman a117a21941 Comment documentation fixes. 2006-09-25 16:58:38 +00:00
aia21 2afc70711a Forgot to not apply endianness swapping for old style images when restoring... 2006-08-23 13:21:04 +00:00
aia21 35dcfaac9e Fix endianness problems in both image restore and image create (and in metadata
cloning as well).  (Anton)
2006-08-23 11:58:55 +00:00
aia21 cb35fe2fea Make ntfsclone image format extensible. (Anton) 2006-08-23 11:22:07 +00:00
aia21 5128685d88 - ntfsclone: Define endianness safe image format. (Anton)
- ntfsclone: Redefine image format version number to be the image
  format version and not the NTFS version of the imaged volume which is
  totally useless.  (Anton)
2006-08-23 10:18:34 +00:00
aia21 280c74470f Print both decimal and hexadecimal in ntfsinfo.
(This follows several patches where we kept switching things from decimal
to hex to decimal because different people apparently use different number
systems in their heads.  I am on the hex front myself so I added hex output
which was taken out recently by Szaka so he probably is on the dec front...
In any case having both should make us all happy...)
2006-08-16 09:24:19 +00:00
aia21 a36323bc62 Make ntfsinfo more resilient to corrupt metadata. Otherwise it can cause an
infinite loop...
2006-08-16 08:14:22 +00:00
yura d15ed62ae4 a bit of cleanups 2006-08-14 03:52:56 +00:00
yura 5a36ead2f4 fix endianness in ntfsinfo preparation fix to index code
btw, Szaka, you really should consider installing some cross-compiler for BE systems and qemu to test your changes.
2006-08-14 03:52:09 +00:00
szaka 2bb9a9a913 fixes & improvements to ntfsclone, ntfscmp, ntfsinfo during ntfs-3g development 2006-08-13 19:48:08 +00:00
szaka cccf6fd94d Dump all VCN's in the same numeral system 2006-08-13 19:09:22 +00:00
szaka 3664395e5f ntfs_dump_flags(): dump FILE_ATTR_DIRECTORY 2006-08-13 19:02:30 +00:00
szaka a89dce7b38 convert all malloc() to ntfs_malloc() 2006-08-13 18:59:56 +00:00
szaka babfacfbd2 dump padding between the Update Sequence Array and the first attribute 2006-08-13 18:58:21 +00:00
szaka 551812d8bc use MFT_RECORD *mrec during dumps 2006-08-13 18:57:37 +00:00
szaka af055de0c4 fix missing bracket in the former patch 2006-08-13 18:56:25 +00:00
szaka 074b025366 ntfs_dump_index_entries(): cleanup subnode VCN calculation 2006-08-13 18:51:55 +00:00
szaka 2daa9f3c94 add ntfs_dump_bytes(); ntfs_dump_attr_list(): dump ATTR_LIST_ENTRY paddings 2006-08-13 18:48:31 +00:00
szaka 952926725d ntfs_dump_attr_index_allocation(): dump number of entries per block too 2006-08-13 18:46:22 +00:00
szaka 3c06d7d9c5 ntfs_dump_attr_index_allocation(): don't return if an INDX is corrupt 2006-08-13 18:45:57 +00:00
szaka 0fce94937b redirect stderr to /dev/null if --debug isn't used in debug mode 2006-08-13 18:44:46 +00:00
szaka 0573a8ff53 fix segfaults when SDS has absolute security descriptor 2006-08-13 18:43:12 +00:00
szaka 89ded2378c make stdout line buffered 2006-08-13 18:41:13 +00:00
szaka 10e6070b18 fix output indenting 2006-08-13 18:40:35 +00:00
szaka b51d98dd90 add ntfs_dump_index_block() and use it 2006-08-13 18:39:35 +00:00
szaka a5bb7301ec add ntfs_dump_index_header(); dump full ia INDEX_HEADER 2006-08-13 18:35:05 +00:00
szaka beb044b036 rename 'Flags:' fields to be unique 2006-08-13 18:23:01 +00:00
szaka c4a3f8b3e9 convert all malloc,calloc to ntfs_{malloc,calloc} 2006-08-13 16:06:57 +00:00
szaka 6ae2cece3c fine grained AT_INDEX_ALLOCATION comparison 2006-08-13 15:50:12 +00:00
szaka 39b9061d8b wipe_index_allocation_timestamps(): don't try to dump empty ia 2006-08-13 15:15:08 +00:00
szaka 5c0ce5407e metadata cloning: write out extent records 2006-08-13 15:00:27 +00:00
szaka 58699ef91b more detailed error messages 2006-08-13 14:52:19 +00:00
szaka d727768a80 convert all malloc,calloc to ntfs_{malloc,calloc} 2006-08-13 14:49:35 +00:00
szaka bd659977c2 don't create image files with executable bit set 2006-08-13 14:40:28 +00:00
szaka 0dae4a9c77 fix missing error outputs 2006-08-13 14:34:07 +00:00
szaka c41b7a65a1 upgrade_to_large_index(): fix double freeing ctx in certain error situation 2006-08-13 14:17:02 +00:00
szaka 64a319948b convert all malloc,calloc to ntfs_{malloc,calloc} 2006-08-13 13:46:40 +00:00
szaka 600b5d4fa6 fix mkntfs_get_page_size() declaration 2006-08-13 13:38:38 +00:00
yura a00ee02388 had not noticed lack of externs :( 2006-08-03 04:30:41 +00:00
yura 1493070b8e Fix include order. Thanks, Yuval! 2006-08-03 02:49:00 +00:00
aia21 aea6c7ea4f Change version to 1.13.2-WIP not 3.0.0-WIP and bump libntfs version to reflect
incompatible source and binary interface changes...
2006-08-02 11:19:39 +00:00
yura 70aef8d69c Prevent index root to be moved out from base mft record 2006-08-02 03:57:40 +00:00
yura 08689c171e Merge index code from ntfs-3g. Clean it a bit and fix adding index allocation when index root in the base mft record. 2006-08-02 03:55:41 +00:00
yura 9d0f9aec4c Add new API ntfs_attr_exist() that checks whether attribute with selected type and name already present in inode. (Szaka) 2006-08-02 03:12:34 +00:00
yura b86f4a41c1 introduce ntfs_[cm]alloc 2006-08-02 03:11:12 +00:00
yura 47a2ca1154 80 chars per line cleanup 2006-08-02 01:33:54 +00:00
yura 2338377ec3 bit move verbose in ntfs_delete() 2006-07-28 23:15:35 +00:00
yura bb5991cb36 Set vol->mft_ni->flags. (Szaka) 2006-07-27 18:44:08 +00:00
yura d5ce628f10 commit some fix to runlsi handling code from ntfs-3g
Rich/Anton can you please review it?
2006-07-27 18:12:23 +00:00
aia21 0873318cbb Yura uses ntfs_attr_lookup() in a way it never was anticipated to work so my
fix broke his way of working.  This is a middle ground where both should work.
This still leaves a bug in collation of attribute list entries though which
needs to be investigated and fixed...
2006-07-27 08:38:17 +00:00
aia21 f3117bf03a Hopefully final test. 2006-07-24 08:59:55 +00:00
aia21 8361597275 And another test... 2006-07-24 08:57:30 +00:00
aia21 858034e322 Cvs checkin email test... 2006-07-24 08:48:40 +00:00
aia21 179966fb0c Fix long standing stupendously stupid bug in libntfs/attrib.c::
ntfs_external_attr_find() and also port a bugfix from the advanced
ntfs kernel driver to the same function.  (Anton)
2006-07-23 21:43:08 +00:00
yura c654fca276 fix CVS dir presense after "make dist" 2006-07-22 20:41:07 +00:00
yura a3a318a8b4 forgot "cvs delete" 2006-07-22 19:39:59 +00:00
uvman ae37e54d8c Avoid a double-free error. ntfs_empty_logfile() has no reason to close na/ni anyway, and is only called from ntfs_logfile_reset() which already closes them, so these lines can be safely removed. 2006-07-21 23:16:09 +00:00
uvman a1a13da74a Commit mft extensions right away. Don't wait for a clean unmount, or you may face data loss. 2006-07-21 23:03:59 +00:00
uvman 9efb57918f Fix a logic error that made 'ls -ls' show the wrong file size for compressed and sparse files. 2006-07-21 22:04:44 +00:00
yura 0d94460169 be bit more verbose 2006-07-17 11:55:29 +00:00
yura 28a2b1f2b0 prepare to Szaka's code merge: remove not working Rich's index code 2006-07-17 11:49:52 +00:00
yura 2d137b6900 create SD in __ntfs_create 2006-07-13 16:01:52 +00:00
yura 035df31eae move ROUND_{UP,DOWN} to support.h, make second parameter to be order in which
we should power 2 (to prevent incorrect use)
2006-07-13 02:49:07 +00:00
yura 5369c19613 support missing owner and group in sd 2006-07-13 02:35:32 +00:00
yura dde61e1091 ntfsinfo: cosmetic fix in SDS dumping 2006-07-01 11:14:08 +00:00
aia21 755e9cafbd The 1.13.1 release is here! 2006-06-21 09:40:17 +00:00
szaka f61d45b970 fix 64 bit destination size calculation on Mac OS X 2006-06-15 18:43:24 +00:00
yura 345247a596 ntfs_link(): prevent creating of recursive directary structure.
FUSE incorrectly handles case insensitive filesystems: when I try to rename
"/Dir" to "/DIR", ntfsmount receive rename("/Dir", "/DIR/Dir") call.
This patch do not fix rename, but prevent fs corruption. I will mail Miklos
about this problem.
2006-06-03 22:09:24 +00:00
yura 6b0018def4 Fix bug with renaming directories with names in DOS and WIN32 namespaces. 2006-06-03 21:37:27 +00:00
aia21 c0f991b525 - Fix STUPID vcn printing bug in ntfsinfo that waster over 18 hours of my life
trying to debug the ntfs driver when it was ntfsinfo that was wrong. )))-:

- Switch vcn output in index listings to show the vcn in hex not decimal.

- Show index block flags for each index block.
2006-05-20 21:27:15 +00:00
aia21 14659dfc20 Fix ntfsmount compilation. 2006-05-19 04:22:53 +00:00
uvman 02194004ab mkntfs.c refactoring and compile fix for Cygwin 2006-05-16 12:12:45 +00:00
uvman bcbb7e06e2 configure.ac fix for Cygwin 2006-05-16 11:58:22 +00:00
cha0smaster d0cd21d4e3 vimspell rules 2006-05-15 21:35:38 +00:00
cha0smaster 8842271dde This code should be in fuse, if should exist at all. 2006-04-27 22:22:02 +00:00
szaka a3ec003be1 Workaround for libfuse not being able to find fusermount when mount(8) used 2006-04-27 21:05:38 +00:00
szaka 4f13e396a4 ntfs_dump_attr_standard_information(): don't dump some fields multiply times 2006-04-23 11:01:07 +00:00
szaka 63b431150e Dump USA, USN and LSN for index records 2006-04-23 10:06:39 +00:00
antona 422725fce4 Update a comment for a field. 2006-04-21 16:12:48 +00:00
antona 5cd2da96ac Fix compile warnings that have sneaked in. 2006-04-19 22:03:58 +00:00
antona f399140b7d - Improve ntfsinfo to dump standard info completely and filename
attribute completely and index entry (filename) completely and all in
  correct order.  Essential for hunting bugs in directory operations
  code...  (Anton)
2006-04-19 21:43:11 +00:00
szaka 00348fc7f5 Warn about bad sectors if pure disk I/O fails with EIO. This is regularly
reported with faulty disks.
2006-04-18 22:03:09 +00:00
szaka b594b42db5 Set PKG_CONFIG_PATH during build time so we should find .pc files in the
most typical pkgconfig directories
2006-04-18 21:40:32 +00:00
szaka 03946d896e Print more info on relocations in verbose mode 2006-04-18 21:37:24 +00:00
szaka 46383e5600 Update with ntfscmp changes 2006-04-11 22:48:14 +00:00
szaka 0213e2e596 Build and install ntfscmp by default 2006-04-11 22:47:22 +00:00
szaka 52178a0fac Fix typos 2006-04-11 22:46:09 +00:00
szaka ec3e7d60cd Update ntfsprogs manual 2006-04-11 22:14:38 +00:00
szaka 40ff51032b Update ntfscmp TODO list 2006-04-11 21:52:32 +00:00
szaka adb27b68cc Add ntfscmp manual 2006-04-11 21:50:39 +00:00
cha0smaster d3b82fa6cd fix VCN size in index.c 2006-04-06 17:00:33 +00:00
szaka c7a53338c0 Fix all incorrect getopt_long() return value usages. 2006-04-05 12:43:06 +00:00
szaka 15e00fcf6c Fix bogus reference to ntfsundelete 2006-04-05 02:59:12 +00:00
szaka 45bccaf546 Implement special $BadClus:$Bad handling 2006-04-05 02:56:52 +00:00
szaka 6873bab2f1 Compare the full attribute headers for non-resident attributes 2006-04-05 02:55:43 +00:00
szaka 134319ae80 libntfs: add and ntfs_inode_badclus_bad() and convert all copy-pastes
to use them
2006-04-05 02:53:40 +00:00
szaka 6772bb4649 Fix ntfsclone idempotency 2006-04-05 02:50:44 +00:00
szaka 813933e1bc libntfs: add ntfs_mft_usn_dec() and convert all copy-pastes to use them 2006-04-05 02:49:24 +00:00
szaka 8bbdf4f8c4 Quota attributum instantiation order change for better FORMAT conformance 2006-04-05 02:48:02 +00:00
szaka be823c7a1e libntfs: add ntfs_str2ucs and ntfs_freeucs function, and convert
copy-pastes to use them
2006-04-05 02:45:55 +00:00
szaka ce894973ed Cleanup has_bad_sectors() for code reuse; update copyrights 2006-03-30 00:15:32 +00:00
szaka 0887a0e261 Update a few copyrights 2006-03-29 22:54:22 +00:00
antona 7b5472724f fix an ommission in Szaka's cleanup. 2006-03-29 22:44:17 +00:00
szaka 3ffb67ef0f Move $ObjId/$O data dumping to its logical place, from ntfs_dump_index_key()
to ntfs_dump_index_data()
2006-03-29 22:35:54 +00:00
szaka 7a776e2810 ntfsinfo: dump either a minimal (default) or the entire attribute
header (--verbose) for all attributes types. Also removed a lot of
redundant code and made some formatting corrections.
2006-03-29 22:29:26 +00:00
antona 8bf1dc2232 Update my copyright for the files changed in the last commits. 2006-03-27 22:49:50 +00:00
antona 588ef46e86 Change ntfsinfo to dump the key data as well as the keys themselves
when dumping the $ObjId/$O index.  (Anton)
2006-03-27 22:46:13 +00:00
antona cf631e3398 Fix comparison of $MFT and $MFTMirr to not bail out when there are
unused, invalid mft records which are the same in both $MFT and
$MFTMirr.  Ported from kernel driver 2.1.27 release and aplied both
to libntfs/volume.c mount related code and to ntfsprogs/ntfsfix.c's
fixup code.  (Anton)
2006-03-27 22:43:09 +00:00
antona f4344d6261 Change utils_parse_size() to use a base of 0 instead of 10 when
calling strtoll().  This automagically allows specification of
numbers in hex (and octal if anyone is crazy enough to use that) in
addition to decimal numbers on the command line options to most if
not all utilities.  (Anton)
2006-03-27 22:39:38 +00:00
szaka b4fa78dc58 ntfsclone: the --metadata option will wipe the timestamps in the
index allocation attributes as well. This further decreases the
compressed metadata image size by 10-25% and more importantly it
eliminates non-interesting ntfscmp differences.
2006-03-27 21:40:26 +00:00
szaka ddc558f1ec libntfs: add ntfs_index_root_get() which reads the index root of an attribute 2006-03-27 21:14:56 +00:00
szaka a8e6766e43 make get_index_root() slightly sexier 2006-03-27 20:50:51 +00:00
szaka de46da8ade cleanup get_index_root() named attribute usage 2006-03-27 20:27:38 +00:00
szaka 65c67d5f84 Use more meaningful error messages 2006-03-27 20:14:22 +00:00
szaka 8d11cc8061 cleanup: use ntfs_attr_readall() 2006-03-27 20:10:39 +00:00
szaka 9b801db7c8 libntfs: add ntfs_attr_readall() which reads the entire data from an attribute 2006-03-27 20:01:36 +00:00
szaka b7aee150a4 ntfs_attr_readall(): fix ntfs_attr leaks in error cases 2006-03-27 19:33:20 +00:00
szaka d511f34dce fix attr->name_length endianess conversions: name_length is u8, not u16 2006-03-26 18:14:33 +00:00
szaka 775b208f68 ntfsinfo: fix two freed memory usage when dumping $SDS and index allocation
entries; factor out ntfs_attr_readall();
2006-03-26 16:49:42 +00:00
szaka 43f2ab6ec3 mkntfs: set the physical drive and the extended boot signature to 0x80
in the Extended BPB which are needed to boot from disk
2006-03-14 21:20:20 +00:00
szaka 7685cb47e5 Update version to 1.13.1-WIP 2006-03-14 19:07:35 +00:00
szaka 6b05529c37 Show all cluster accounting mismatches when --verbose used 2006-03-13 20:41:02 +00:00
szaka 8bcd0c2fe8 Remove confusing inode enumeration messages: it just hides the valuable
info and can be get by using --verbose
2006-03-13 20:34:41 +00:00
szaka 033eaf429f identify files even if their clusters aren't set in $Bitmap (useful to
find potentially corrupted files)
2006-03-13 20:25:46 +00:00
cha0smaster 51085b8a6a update TODO* 2006-03-09 14:13:18 +00:00
cha0smaster f279223990 - Fix build with --disable-gnome-vfs --enable-fuse-module. (Gentoo) 2006-03-06 18:38:37 +00:00
cha0smaster f424e61b96 Fix bug in ntfs_attr_pwrite() when we sometimes lose current run in the runlist. 2006-03-04 13:56:34 +00:00
cha0smaster 01309e4ec9 formatting 2006-03-04 00:06:49 +00:00
antona 7c718e1099 Update for date for 1.13.0 release. 2006-02-27 09:09:50 +00:00
antona 63982b15fd Fix compilation on FreeBSD. (Christophe) 2006-02-24 15:49:59 +00:00
antona 49fd93718c Cope with attribute list attribute having invalid flags. Windows
copes with this and even chkdsk does not detect or fix this so we
have to cope with it, too.  Thanks to a Pawel for reporting the
problem.  (Anton)
2006-02-24 09:20:10 +00:00
cha0smaster 74a95a993b comment ni->{allocated,data}_size 2006-02-23 22:54:55 +00:00
cha0smaster b4abfe7de4 Add Mario to credits 2006-02-23 00:36:33 +00:00
cha0smaster b0f4e5099e ntfs_create: add for any case check 2006-02-23 00:29:04 +00:00
antona 45c9aa137e - Deal with missing syslog function by making code conditional on
presence of syslog.h header file (DOS/djgpp).  (Christophe)
- Avoid clash with existing constants (OSX).  (Christophe)
2006-02-22 14:20:08 +00:00
cha0smaster 6497828e53 While fixing allocated/compressed size I lost correct data size value by accident. 2006-02-21 18:57:34 +00:00
antona 90596212bf Update documentation for allocated_size in file name attribute. 2006-02-21 11:43:49 +00:00
cha0smaster 241c7585a6 Fix runlist setting and incorrect file sizes in the index. 2006-02-21 04:40:20 +00:00
cha0smaster 559d28d2ee cleanup 2006-02-21 03:40:24 +00:00
cha0smaster 0fccdd6be5 update ntfsmount man page 2006-02-20 17:11:24 +00:00
cha0smaster 9bcf003f26 ntfs_attr_pwrite: Fix very serious bug, when sometimes not whole mapped runlist was passsed to ntfs_attr_update_mapping_pairs. 2006-02-20 00:48:35 +00:00
cha0smaster a0d011018b ntfsmount: add no_detach option 2006-02-20 00:32:01 +00:00
szaka d533c39e36 Compare attribute headers as well. This nicely shows now that compression
and allocation sizes aren't set correctly for sparse files in libntfs.
2006-02-19 12:50:54 +00:00
cha0smaster 2fa889ff26 cleanups 2006-02-19 00:37:15 +00:00
cha0smaster 6ba0e1d1e0 fix bug with sparse attribute shinking when runlist is not changed. (already fixed such for expanding, do not know why I forgot to update shrinking) 2006-02-19 00:36:23 +00:00
szaka eff628922a Add a section about windows cloning 2006-02-18 20:36:33 +00:00
cha0smaster 32420ad699 implement POC of syslog logging handler, make ntfsmount to use it 2006-02-13 01:23:31 +00:00
szaka e6a7600508 Restructure "Filesystem check failed!" message and have a more explanatory
one in the ERROR line because several front-ends show only this line, nothing
else, which greatly confused many users what's going on and what to do next.
2006-02-12 22:09:58 +00:00
szaka 67f0045637 Update obsolete description 2006-02-12 02:00:45 +00:00
szaka 45b78af9b2 Update credit 2006-02-12 01:30:34 +00:00
szaka c87059fa77 Fix $BadClust:$Bad AT_ATTRIBUTE_LIST detection which bug was introduced
recently only in the CVS version of ntfsresize; add also more info about
bad sectors.
2006-02-11 19:55:05 +00:00
cha0smaster dc751c641b cleanup 2006-02-10 11:00:47 +00:00
szaka d34acd45bf __ntfs_create(): fix cluster leaks for some special files when index entry
creation fails
2006-02-09 21:43:52 +00:00
szaka b5f4182861 Add some important debugging, tracing info 2006-02-09 21:40:00 +00:00
antona 52db9eecbe Fix two potential runlist merge bugs (one was without effect the other possible
free memory dereference).
Fix the "make test" testing of the rl mering code to work again (it needs to
use printf not the fancy logging macros).
2006-02-08 22:15:30 +00:00
szaka 31cc1d2f45 Wiped timestamp data stats were off by 5% in general 2006-02-06 22:17:24 +00:00
szaka 43b4d8a4e1 --metadata sets timestamps to the Epoch time as mkntfs does with -T. This
increases the compressed image sizes by only 0.3-0.8% but ntfsclone creates
now the exact same metadata images as mkntfs, which fact can be used for QA.
2006-02-06 20:51:17 +00:00
szaka f599394450 Shorten 'ntfsprogs version @VERSION@' to only 'ntfsprogs @VERSION@' in the
headers so it won't overwrite/overlap so easily with the update time in the
center if the @VERSION@ is too long (e.g. <VERSION>-WIP-<DATE>-<TIME>)
2006-02-06 01:05:01 +00:00
szaka 1e05dd5d9a Note tar brokenness, update examples 2006-02-06 00:48:23 +00:00
szaka fae8feea65 Explain dirty volume 2006-02-05 22:10:01 +00:00
szaka 16b8bc1fd4 Write MFT records with the same USN during metadata cloning. This eases
ntfsclone self-regression, which itself is going to validate other codes
2006-02-05 19:35:20 +00:00
szaka 31fac08864 Dump MFT Record Header fields which weren't yet 2006-02-05 18:56:04 +00:00
szaka fefc3e5195 ntfsresize, ntfsclone: always use MS_NOATIME 2006-02-05 16:39:35 +00:00
szaka c0e5461995 Credit Erik Sornes for implementing NTFS 3.x version support for mkntfs 2006-02-04 23:21:48 +00:00
szaka fb244d7c70 Explain the tons of mkntfs bugs 2006-02-04 22:56:13 +00:00
szaka a8a29084b5 Remove old, redundant g_mft_size calculation 2006-02-04 19:53:22 +00:00
szaka aaf7b25015 fix ntfs_device_sector_size_get() description 2006-02-04 19:24:14 +00:00
szaka 9d51139377 Fix typo 2006-02-04 13:39:19 +00:00
szaka c47236819d Explain EBUSY if volume opening failed 2006-02-04 13:34:37 +00:00
antona ca37cdb7f8 Don't do it at the end and do it as we go along instead as I am already doing
in the kernel driver.
2006-02-04 06:11:28 +00:00
antona cd948e75c0 Fix upcase table to be little endian. With this bug fixed the volumes produced
by mkntfs on little and big endian machines are identical (except for the
volume serial number - probably ought to standardize that when using the -T
switch).
2006-02-04 06:06:04 +00:00
antona 952d221711 Tons of bug fixes to mkntfs. 2006-02-04 05:42:59 +00:00
antona e5a3006f47 Only use O_EXCL if mounting r/w. 2006-02-04 02:42:42 +00:00
antona 3420b5faec Another fix for OSX. 2006-02-03 23:55:40 +00:00
antona 584ca613ef Fix a Linux warning after a fix for OSX. 2006-02-03 23:52:55 +00:00
antona 4d64cb21e7 Fixes for OSX. 2006-02-03 23:40:39 +00:00
antona 3dc68c0602 Fix a warning. 2006-02-03 23:25:24 +00:00
antona 135282539b Fixes to previous commit. 2006-02-03 23:11:35 +00:00
antona af9fd39611 Wheee! Lots of last minute fixes and enhancements.
- Compiler warning fixes for gnome-vfs and fuse modules. (Anton)
- Change volume mounting (actually device opening) to happen with
  O_EXCL bit set so at least on Linux no one can change the device
  block size under our feet.  (Anton)
- Change volume mounting and mkntfs to set the device block size to the
  sector size using BLKBSZSET ioctl (Linux only).  This should be
  optimal for performance and should fixes the bug of not being able to
  create the backup boot sector if the number of sectors on the device
  is odd, the sector size is 512 bytes, and the kernel is 2.4.  (Anton)
- Enforce cluster size, mft record size, and index record size to be at
  least equal to the sector size and verify they are still valid and in
  particular display a warning message if the volume will not be
  mountable by the kernel driver (it requires mft record size and index
  record size to be below or equal to the system page size which we
  determine using sysconf()).  (Anton)
2006-02-03 22:19:17 +00:00
szaka e57cc4521a Add CHKDSK_UNDERWAY to ntfsinfo 2006-02-03 18:44:13 +00:00
antona 29ed836b4b Update VOLUME_FLAGS_MASK, too. 2006-02-03 09:23:03 +00:00
antona 4b0fb6faff Add VOLUME_CHDSK_UNDERWAY flag to volume flags (layout.h). Thanks to Szaka for
the information.
2006-02-03 09:03:09 +00:00
antona 90a6130039 Update version number for the release 1.13.0. 2006-02-02 14:55:22 +00:00
antona e236c14c4a Prepare for next release. 2006-02-02 14:40:53 +00:00
antona e0c2231543 Fix stupid bug in libntfs/bitmap.c::ntfs_bitmap_set_bits_in_run()
which caused bits to not be cleared or set if the first bit in the
run was not a multiple of eight.  (Anton)
2006-02-02 13:57:00 +00:00
cha0smaster ad13b78697 ntfsmount: fix 25 API compatibility 2006-02-01 23:55:07 +00:00
cha0smaster c11567824a ntfsmount: fix ls output in case some files can not be accessed due to windows named data streams accees interface 2006-02-01 18:24:58 +00:00
cha0smaster 63f5ddb8c2 ntfsmount:
Support FUSE versions from 2.3.0 to 2.5.1 under Linux and 2.5.X under FreeBSD.
Warning tested only under FUSE-2.4.1. Will test under FUSE-2.5.1 at home.
2006-02-01 17:37:34 +00:00
cha0smaster e2450ad61a tidy up djgpp S_IF{SOCK,LNK} fix 2006-01-30 22:10:31 +00:00
cha0smaster ead758ed7c ntfsmount: Rename "succeed_chmod" -> "silent". Do not return error on chown too. 2006-01-30 21:53:42 +00:00
szaka 541f7ade32 Check for sys/sysmacros to get major and minor definitions (Christophe) 2006-01-29 14:09:57 +00:00
szaka 770aded28d Define S_IFLNK and S_IFSOCK for djgpp (Christophe) 2006-01-29 14:07:45 +00:00
szaka 0130863e72 Improved dumping SDS entries: stop at bogus values instead of crashing and
don't stop at empty entries
2006-01-29 01:24:24 +00:00
antona bbb3e160dd Update TODO with config.h sort out needed... 2006-01-27 12:29:40 +00:00
cha0smaster 8410f3b00b minor change 2006-01-25 23:36:09 +00:00
cha0smaster c66e272987 update about direct_io 2006-01-24 16:57:47 +00:00
szaka 6616612ea6 Set the size of the $SECURITY_DESCRIPTOR of the root directory appropriately
and as 'format' also does (the extra space was unused garbage)
2006-01-15 12:55:04 +00:00
szaka 53883b3fde Fix off-by-one in ACL dumping, one ACE was missed 2006-01-14 00:54:51 +00:00
szaka 6f05bf0407 Refer by the sort URL to the manual pages 2006-01-08 21:01:23 +00:00
szaka 35aa4a725b Fix URL to the manual pages on the web 2006-01-08 20:57:00 +00:00
cha0smaster ff72ed6141 Oops, by accident commited incomplete stuff to dir.h 2006-01-08 15:56:03 +00:00
cha0smaster e975db6fd5 should fix build under Solaris 2006-01-08 15:53:27 +00:00
szaka a88f330d2b Fix some typos 2006-01-08 15:12:19 +00:00
szaka dc22f3e142 Adjust $LogFile size for 3.1 volumes which got much bigger (the small
$LogFile became a performance bootleneck for the increasingly faster disks)
2006-01-08 14:54:55 +00:00
szaka 1df657f193 Removed legacy ntfsfix comments, it still kept confusing people 2006-01-08 13:30:42 +00:00
szaka 6b36031ff4 More manual reverts, updates 2006-01-07 22:21:25 +00:00
szaka 68290078e1 Revert to the unambiguous update dates for all manual pages 2006-01-07 18:41:38 +00:00
cha0smaster 36add45fe7 Fix build under systems other than Linux and FreeBSD. 2006-01-07 16:00:21 +00:00
szaka 67c087d77f Version 3.0 isn't supported (wasn't checked) 2006-01-07 15:30:19 +00:00
szaka 98c16f8ae0 Change the NTFS version short option from the cryptic -w to -N 2006-01-07 09:29:29 +00:00
szaka 283db0a99e Don't create SDS entries which aren't needed 2006-01-07 08:31:09 +00:00
szaka a79dc381b7 ntfsinfo: dump $Secure:$SDS in verbose mode 2006-01-07 08:20:33 +00:00
szaka d003694463 Fix more formatting broken by somebody's "cleanup" 2006-01-07 06:26:43 +00:00
cha0smaster eba747ac93 * Add NTFS_DEV_LIST define. Use it everywhere instead of linux-ntfs-dev@lists.sf.net.
* Replace all ntfs_log_trace where we ask to send mail to us with ntfs_log_error
2005-12-18 16:27:20 +00:00
szaka 58e93f46e0 Restore more formatting, etc issues broken by white space, etc cleanups 2005-12-07 21:52:46 +00:00
szaka ca689776fa Fix --info option description which got broken by a white space cleanup 2005-12-07 21:04:37 +00:00
flatcap 04ebd8256d The addition of one hundred and forty-five linefeeds. Thanks Yura! 2005-12-04 22:42:51 +00:00
cha0smaster df8ce8fd42 dir.c::ntfs_delete(): Fix bug with deletion hard links to directories. See comment to ntfs_link() if care for why we support this case. 2005-12-03 18:04:44 +00:00
cha0smaster de23d9f540 determine to where pass kernel_cache option without #if's 2005-12-03 16:40:20 +00:00
cha0smaster 9d6a1cd081 minor fixes to comments 2005-12-03 16:18:15 +00:00
cha0smaster d6cb8dd55d require FUSE-2.4.2 under FreeBSD, because eariler versions have problems with readdir 2005-12-02 17:32:34 +00:00
cha0smaster e47ed2e413 more warning fixes 2005-12-02 17:09:41 +00:00
cha0smaster 96e6c64860 fix error message 2005-12-01 20:46:03 +00:00
cha0smaster 01787c8c54 update site 2005-12-01 20:44:18 +00:00
cha0smaster eb1ab436d8 update 2005-12-01 13:16:34 +00:00
cha0smaster d4872f5045 ntfsmount: Mount point is optional parameter 2005-12-01 13:15:49 +00:00
cha0smaster 77fb717ef3 Fix warnings on FreeBSD 2005-11-30 16:58:03 +00:00
cha0smaster 3001c88d64 Easier FreeBSD support, allow FUSE >= 2.3 for FreeBSD 2005-11-30 16:54:11 +00:00
cha0smaster 69240e3c50 Require FUSE-2.5.0 for FreeBSD 2005-11-29 20:47:44 +00:00
cha0smaster bb864c9f98 update 2005-11-29 18:03:28 +00:00
cha0smaster 172a8bbe4f oops, should do FUSE_USE_VERSION magic before including <fuse.h> 2005-11-29 18:00:06 +00:00
cha0smaster c705170a5f ntfsmount: Add FreeBSD support. 2005-11-29 17:57:53 +00:00
cha0smaster 8298b35bc8 use ntfstime.h instead of time.h 2005-11-27 16:50:45 +00:00
cha0smaster 8afff2c7e2 minor fix to usage output 2005-11-27 15:26:39 +00:00
cha0smaster 1a6c6417d9 improve readability 2005-11-27 15:26:02 +00:00
szaka 22ff6e8c41 remove old, unused logging macros 2005-11-27 12:35:29 +00:00
szaka c940df9079 remove usage of old logging macros 2005-11-27 12:31:39 +00:00
szaka f827828d5c All errors go to stdout either directly or by redirection from stderr 2005-11-27 11:51:10 +00:00
szaka 93fabaf0c4 Removed usage of the old logging macros 2005-11-27 11:38:06 +00:00
flatcap 71c5c068b5 use the new logging
add a few function comments (to help folding)
2005-11-26 23:53:22 +00:00
szaka f1a50e9bd8 Removed old logging macro usage 2005-11-26 17:58:17 +00:00
szaka 7e9f1270e2 clean up 2005-11-26 01:46:20 +00:00
szaka c5bceb84de ntfs_get_attribute_value(): report in error what's the non-zero attribute flags 2005-11-26 01:08:12 +00:00
cha0smaster 25c31eb40b ntfsmount: add static inline to mark free space outdated (Thanks Szaka) 2005-11-25 14:31:29 +00:00
cha0smaster e0787d0983 ntfsmount: Mark information about free MFT records and clusters outdate after write operations everywhere. 2005-11-24 15:06:11 +00:00
cha0smaster ce1aabed3b FreeBSD and Cygwin do not know about MS_NOATIME too. Fix this. 2005-11-24 14:23:38 +00:00
cha0smaster 398004a863 cool! it works as expected 2005-11-23 09:17:13 +00:00
cha0smaster c960ae5994 one more test 2005-11-23 09:16:10 +00:00
cha0smaster eee85bf430 revert last commit and
test multiline
commit
message.
2005-11-23 09:15:01 +00:00
cha0smaster a0b6ee0988 CIA test commit 2005-11-23 09:13:43 +00:00
flatcap 493b3a6bcd minor corrections 2005-11-22 01:14:36 +00:00
flatcap c7c229bd15 more minor manual mending 2005-11-22 00:17:23 +00:00
flatcap af6f7606e4 tidy evil roff usage
add/document missing options
add missing authors
standardise program usage()
standardise options look
update download and contact details
2005-11-21 21:25:14 +00:00
flatcap abf0cfba5d use new logging 2005-11-20 14:15:33 +00:00
flatcap 0f7ee235ed comments for unions 2005-11-20 11:34:30 +00:00
flatcap 14821aa976 remove my temporaray code/comments 2005-11-20 11:21:54 +00:00
szaka d7f102b670 fix typo 2005-11-20 00:18:09 +00:00
szaka 927cd331d8 Create files with sequence numbers starting from 1 in $Extend (part 2) 2005-11-20 00:06:11 +00:00
flatcap 68a9bdd3a2 every function returns 2005-11-19 16:54:28 +00:00
flatcap 03fa945ee0 banish the e-word 2005-11-19 16:44:36 +00:00
flatcap 80a2ddee09 moved ioctl to device.c
remove g_volume_size (unnecessary)
Reworked mkntfs_override_phys_params:
  Split up complicated error expressions
  Made error messages more legible
  Demoted some errors to warnings
  Factored out the "Windows won't boot" message
2005-11-19 14:56:24 +00:00
flatcap 8ee10753ce move a useful ioctl here, from mkntfs 2005-11-19 14:55:51 +00:00
cha0smaster 2bc1f13f99 fix stupid bug in / filename syncing. reenable atime updates for /. 2005-11-18 16:18:18 +00:00
cha0smaster a55ac531e4 typo fix. Thanks Yuval. 2005-11-18 15:56:31 +00:00
szaka e90fdddc08 - added INDEX_ATTR_DIRECTORY_I30 timestamps dumping
- ntfs_dump_index_entries(): reformatted switch to fit the used code style
- ntfs_dump_index_entries(): removed redundant opts.verbose check
- whitespace cleanup
2005-11-18 00:29:36 +00:00
szaka 3db9973bcf ntfsclone: --metadata also wipes out the timestamps in the $I30 and
in the /$Extend/$Quota:$Q index root attributes
2005-11-18 00:24:45 +00:00
szaka d311052205 Create files with sequence numbers starting from 1 in $Extend 2005-11-18 00:14:05 +00:00
cha0smaster 2367a06b6e Rework time updates, more close to like windows does. Still do not update for / because of sync problems. 2005-11-17 18:00:58 +00:00
szaka e4cb2b5a4e - switched all calloc() calls to ntfs_calloc()
- fixed all missing ntfs_calloc() error checking
2005-11-16 22:07:48 +00:00
szaka 1e14b996c0 - fixed -T/--zero-time for 3.x volumes
- reordered initialization of $Quota indexes
- added ntfs_calloc()
- fixed all missing memory allocation error handlings in initialize_quota()
2005-11-16 21:36:20 +00:00
cha0smaster f7b087b07d it seems that atime updates in fuse a broken, handle them ourselves 2005-11-16 17:09:12 +00:00
cha0smaster fadcc0df7c Do not update time for system files (inode number < FILE_first_user) in ntfs_attr_p{read,write}. Who cares about them, but this solves segfault during umount. 2005-11-16 16:27:27 +00:00
flatcap 418da4bd4b it came from space (and ate my brackets) 2005-11-16 02:58:49 +00:00
flatcap 354c6442a9 a handful more of subjective cleanups 2005-11-16 02:55:16 +00:00
szaka 94e1647414 More comments on SDH_INDEX_DATA's reserved_II field 2005-11-16 00:17:53 +00:00
szaka 1b856b5451 Dump $Secure $SDH and $SII, $Quota $O and $R index attribute data;
Fix printf field width specifiers
2005-11-16 00:13:10 +00:00
cha0smaster 5266967632 ntfsmount: pass MS_NOATIME flag to ntfs_mount, let VFS care about access time. 2005-11-15 16:41:39 +00:00
cha0smaster e58a468d0c * Fix bug with updating atime on read-only volumes. (Thanks to Szaka and Anton)
* Add MS_NOATIME to ntfs_mount. (By Yuval's request)
2005-11-15 16:31:40 +00:00
flatcap 56c8393be0 fix memleak in create_hardlink_res
transfer ownership of attrdef and vol_name to the volume
2005-11-15 16:24:23 +00:00
flatcap fd63d57947 *ahem* zero isn't true 2005-11-15 14:48:10 +00:00
flatcap 03e481e349 tidy 8 variables whose scope was quite limited 2005-11-15 04:14:37 +00:00
szaka 025768668b Pad QUOTA_O_INDEX_DATA with the magic 32 value. 2005-11-15 01:02:12 +00:00
szaka ae643af3cd Update QUOTA_CONTROL_ENTRY and QUOTA_O_INDEX_DATA description 2005-11-15 01:00:22 +00:00
cha0smaster f7fe30a0aa Automatically update access and change time in ntfs_attr_p{read,write} and ntfs_attr_truncate. 2005-11-14 15:31:23 +00:00
cha0smaster 0e808deef1 * update ntfsmount to new logging, remove all #ifdef #DEBUG, add debug option
* ntfsmount: enable kernel_cache for fuse >= 2.4.0 by default
* ntfscp fix style in code introduced by Rich
2005-11-14 12:19:39 +00:00
cha0smaster 632b146410 Add @from_vcn parameter to ntfs_attr_update_mapping_pairs, update all
users to submit it, thus write speed to very fragmented files
dramatically increased, while write speed to low fragmented files
stayed at approximately same level.
2005-11-14 00:17:19 +00:00
szaka f7f2bf570d initialize_secure(): fix segfault when non-allocated objects were referenced
(thanks to ef)
2005-11-13 22:40:19 +00:00
szaka 2db620bda1 ntfsclone: check the available free space for --save-image too 2005-11-13 21:48:35 +00:00
szaka 7b6a5ef21d Fix fs creation with 32 and 64 kB cluster size; also if only one cluster
contains all system files then fill the rest of it with empty, formatted
records as 'format' also does
2005-11-13 20:04:29 +00:00
szaka 6cd1ea6e75 ntfs_device_mount(): explain a bit better what fails and how 2005-11-13 19:25:05 +00:00
szaka 3e459eb923 mkntfs: fix segfault when volume has more than 2^31 clusters 2005-11-13 02:38:17 +00:00
szaka f480d3f8ad Log also what actually fails, not only the reason 2005-11-12 20:52:38 +00:00
szaka 7b68432c72 Name consistently the same $SDS, $SDH and $SII fields 2005-11-12 15:35:51 +00:00
szaka fc103ec4b0 output cosmetic change; explicit check for /$Extend/$ObjId in get_index_attr_type() 2005-11-12 12:59:20 +00:00
uvman 4137f63c7a Report the MFT record flags properly in ntfsinfo. 2005-11-11 23:55:14 +00:00
uvman 0d651e54d3 Give a better name to MFT_RECORD_IS_8 and rename FILE_ATTR_DUP_* to match this meaning. 2005-11-11 23:35:56 +00:00
cha0smaster 3c2c988f96 That was ntfsmount bug with '.' and '..', no need for a workaround. 2005-11-10 21:26:41 +00:00
szaka 77a5597521 Restore correct V3.1 $AttrDef creation which got last by the recent command
line parsing rewrite. Thanks to ntfscmp for catching this! :)
2005-11-10 20:54:00 +00:00
szaka c832d4b2e2 remove ObjectID creation and all related code: ObjectID's are created and
managed based on (mostly) DLT Service requests, format doesn't care about them
2005-11-10 20:24:07 +00:00
cha0smaster 4652ad72c6 * implement symblic link creation in ntfs_create
* rename ntfs_create -> __ntfs_create. add wrapers ntfs_create{_symlink,_device}
* ntfsmount: implement .symlink
* ntfsmount: fix readdir to emulate . and .. when needed
2005-11-10 18:13:15 +00:00
flatcap f45436a9df send progress bar to the progress log (quietable by --quiet) 2005-11-10 05:28:33 +00:00
flatcap 1b49db1f65 turn on progress logging by default 2005-11-10 05:27:45 +00:00
flatcap 247753251d quiet, verbose, debug don't need to be options
num_clusters, index_block_size, attr_defs(_len) moved to volume
2005-11-10 05:13:57 +00:00
flatcap 3666ce3d2c ntfsundelete options fix 2005-11-10 03:22:42 +00:00
flatcap 1b55906132 -u now just means undelete
-i, --inodes takes a range of inodes to be recovered
remove interactive option (it wasn't implemented)
2005-11-10 03:20:47 +00:00
flatcap 6e9be81f55 -u now just means undelete
-i, --inodes takes a range of inodes to be recovered
tidy usage
remove interactive option (it wasn't implemented)
2005-11-10 03:20:27 +00:00
cha0smaster 1254b2951c Fix stupidness introduced in latest changesets. Thanks to Yuval for comments. 2005-11-08 19:49:52 +00:00
cha0smaster 2c3dfcba27 Teech ntfs_create() to create Interix charcter and block devices. Add @dev parameter to ntfs_create() for this. 2005-11-08 16:13:17 +00:00
cha0smaster 53446b07f8 - Change @type parameter for ntfs_create() to be dev_t rather than internal NTFS_DT_* constants.
- Teech ntfs_create() to create FIFOs and sockets.
2005-11-08 15:15:37 +00:00
szaka c1fb378985 VIEW_INDEX is also present in $STANDARD_INFORMATION 2005-11-07 22:28:46 +00:00
szaka 1e3ce5d1dd FILE_ATTR_DUP_VIEW_INDEX_PRESENT is also present in $STANDARD_INFORMATION
on 3.x volumes
2005-11-07 22:22:43 +00:00
szaka caa0bf5c4b metadata cloning: wipe metadata timestamps too 2005-11-07 21:38:58 +00:00
szaka da654b4207 shortened opt.metadata_only to opt.metadata 2005-11-07 21:13:31 +00:00
szaka 594c23aff0 ntfsclone: check available free space on the destination 2005-11-07 20:49:18 +00:00
cha0smaster a732881c5e see changelog 2005-11-07 20:37:07 +00:00
flatcap 23a84fe825 use ntfs_mbstoucs and ntfs_ucstombs (library) instead of stoucs and ucstos (local)
fix a few latent bugs where unicode string lengths were handled
2005-11-07 04:53:28 +00:00
flatcap 2a2ecd2abd parse_options - make sure it always spots missing options
fix mem leak in upgrade_to_large_index
fix bug - srandom called before options parsed
start separating user-type things from lib-type things
(e-22)
2005-11-06 21:40:26 +00:00
flatcap d605234a3a document new options 2005-11-06 21:26:23 +00:00
uvman a0665cf5bd Add myself to the copyright list on ntfsinfo.c 2005-11-06 14:18:12 +00:00
uvman c09fc7ac81 Add myself to the copyright list on win32_io.c 2005-11-06 14:16:24 +00:00
uvman 09c562fdd3 Disclaim any copyright holding on layout.h 2005-11-06 14:15:38 +00:00
flatcap ef9d593949 replace the command line parsing
mkntfs now supports long options
(e-11)
2005-11-06 02:19:19 +00:00
cha0smaster 300f86ac21 * layout.h: update about special INTX files.
* ntfsmount: implement readlink() and add support of symlinks, charcter and block devices to stat().
2005-11-05 22:54:43 +00:00
flatcap de5de5a9c3 global variables don't belong in opts
highlight the global nature of the variables in their name
2005-11-05 06:11:42 +00:00
flatcap 559d3c54e4 more tidying 2005-11-05 05:03:05 +00:00
flatcap 0efe6a43f1 use new logging (not completely finished)
much code tidying
2005-11-05 01:41:39 +00:00
flatcap 77cc19fd5d fix build warning 2005-11-05 01:34:40 +00:00
flatcap a41e58f8aa simplify a few things 2005-11-05 01:34:21 +00:00
cha0smaster 5bbb43d947 fix really hard to trigger bug in ntfs_delete 2005-11-04 22:43:10 +00:00
szaka 5660554d88 Set the the same $STANDARD_INFORMATION flags as format for NTFS 3.1 does 2005-11-03 21:56:52 +00:00
uvman 9e9179b307 Comment format improvements 2005-11-03 19:20:14 +00:00
szaka 44b2d2333c Dump $Quota:$O key SID according to the standard textual representation 2005-11-03 01:43:27 +00:00
szaka e71ca132c5 Create files in $Extend in the same order as 'format' does. This shouldn't
actually matter but it makes ntfscmp happier and helps great deal to catch
easily incorrectly created volumes.
2005-11-02 23:14:39 +00:00
szaka c4d66f6c8b Don't create 'System Volume Information'. This is never created by format,
it's either a side-effect of Distributed Link Tracking Client Service,
System Recovery Service, Index Service, WinFS, etc.
2005-11-02 21:03:29 +00:00
szaka 0ffab99a56 mkntfs: don't fill the last $MFT cluster with empty MFT records.
This is needed to conform to Windows' format behavior for NTFS v3.1
2005-11-02 20:47:19 +00:00
flatcap b2606af8ab a few typos 2005-11-02 18:06:48 +00:00
flatcap 83b9eddfc9 provide some meaningful function descriptions 2005-11-02 17:34:08 +00:00
szaka 8cfde9cdfd Fix $Quota::$O key sub authority dumping; dump authorities in hexa 2005-11-01 23:14:34 +00:00
szaka c10f046225 simplified ntfs_generate_guid() 2005-11-01 21:09:52 +00:00
szaka 987f33e5df ntfs_ prefix generate_guid() 2005-11-01 20:24:37 +00:00
szaka b82289f526 fix casting to quota's owner_id 2005-11-01 20:19:32 +00:00
szaka c21d01fe7f fix type of owner_id in QUOTA_O_INDEX_DATA 2005-11-01 20:18:27 +00:00
szaka 1a40e3d4cd Add missing full stops; rename SDS to $SDS 2005-11-01 20:01:03 +00:00
szaka 80923d64dd Fix type of reserved_II in SDH_INDEX_DATA; resolve some magic constants 2005-11-01 19:56:08 +00:00
szaka 9f4b2b4a2c Fix NTFS version 3.x index entries creation. Everybody is MUCH happier now!
Erik got this right in his patch, it got non-functional due to libntfs changes.
2005-11-01 00:12:08 +00:00
flatcap 63c4123bbb another comment 2005-10-31 01:19:27 +00:00
flatcap 9c2e3a8206 add/update function comment blocks
(ok, they need words, but it's a start)
2005-10-31 01:15:12 +00:00
szaka c47717581a dump index attribute keys 2005-10-30 23:31:44 +00:00
szaka 370bea1395 ntfsinfo: figure out and dump index attribute types 2005-10-30 22:53:38 +00:00
szaka e677d9ebf9 Fix GUID example 2005-10-30 22:42:00 +00:00
szaka ae42186cf5 utils_inode_get_name(): fix return value in case of success (the function
always returned with failure beforehand)
2005-10-30 22:41:20 +00:00
flatcap 121d05deb6 add/update function comment blocks
(ok, they need words, but it's a start)
2005-10-30 16:12:22 +00:00
flatcap 2a8ae5c3fb upgrade to use new logging
change stderror messages to ntfs_log_perror
2005-10-29 01:05:11 +00:00
flatcap 4e6dd9b97b upgrade to use new logging
change stderror messages to ntfs_log_perror
2005-10-29 00:08:43 +00:00
cha0smaster 9d92722737 Rest fixes from A Costa 2005-10-28 19:00:14 +00:00
flatcap aa3807bc27 upgrade to use new logging
(all logging to stderr)
2005-10-28 18:59:29 +00:00
flatcap a009bf0b5a perror -> ntfs_log_perror 2005-10-28 18:57:06 +00:00
flatcap 9cf4759476 upgrade to use new logging 2005-10-28 18:39:52 +00:00
flatcap 325ab7c64d mistake parsing quiet 2005-10-28 18:26:49 +00:00
flatcap 8a363705cd upgrade to use new logging
change stderror messages to ntfs_log_perror
2005-10-28 18:23:32 +00:00
flatcap 7960f45998 upgrade to use new logging
change stderror messages to ntfs_log_perror
2005-10-28 18:15:24 +00:00
szaka d5a925b3bf ntfsinfo and ntfsls follow the convention how other utilities read
the device argument: no -d or --device option is needed
2005-10-28 18:00:44 +00:00
flatcap 09368b5e83 fix bug in ntfs_log_parse_option - quiet needs you to clear a level, not set it 2005-10-28 16:52:29 +00:00
flatcap 755ef674e8 upgrade to use new logging
change stderror messages to ntfs_log_perror
note: since the logging changes to utils.c, the --quiet option doesn't do anything
2005-10-28 16:47:41 +00:00
cha0smaster 4b81ab7e3b Add 'xattr' named data streams access interface. 2005-10-28 16:06:04 +00:00
flatcap 7f96d02758 typo 2005-10-28 15:31:41 +00:00
szaka 7ae3cd3e82 Fix two more typos (A. Costa) 2005-10-28 15:14:49 +00:00
cha0smaster a7c595fe3c fix build 2005-10-28 13:17:53 +00:00
uvman 56f119b245 Surround error-prone macros with parentheses 2005-10-28 13:00:48 +00:00
uvman 5b949d07fa Fix comment formats. 2005-10-28 12:55:41 +00:00
uvman 8f43f0ef4c Match parameter names between .h and .c files 2005-10-28 12:47:49 +00:00
cha0smaster 0b55f323c2 spelling fixes from debian 2005-10-28 09:43:47 +00:00
flatcap 59ce9b4285 remove old logging macros
add more traces
2005-10-28 04:47:52 +00:00
flatcap 8aa6d76741 more evil spaces 2005-10-28 04:41:54 +00:00
flatcap ec842e871a remove some old defines 2005-10-28 04:41:39 +00:00
flatcap 8892ba7ac6 remove some colour hacks
remove a few #ifdef DEBUGs and RM_WRITEs
throw in lots of extra traces
2005-10-28 04:32:21 +00:00
flatcap 16dd9defa5 email typo 2005-10-28 04:31:45 +00:00
flatcap 4e5c1c6efa rebuild logging again.
today's arrangement has five handlers:
ntfs_log_handler_fprintf (renamed from printf)
ntfs_log_handler_null (does nothing, default)
ntfs_log_handler_stdout (everything to stdout)
ntfs_log_handler_outerr (info to stdout, errors to stderr)
ntfs_log_handler_stderr (everything to stderr)
the colour handler has gone away to be replaced by a flag:
NTFS_LOG_FLAG_COLOUR
2005-10-28 04:12:22 +00:00
antona fa2217bafa Minor todying. 2005-10-27 21:55:59 +00:00
antona 0e4a1ca252 Fix ntfsdecrypt endianness bugs thus it now works on OSX running on
a dual G5!  (Anton)
2005-10-27 21:46:00 +00:00
cha0smaster 73474b68db Fix ntfs_non_resident_attr_expand bug, that occured if we enlarge
sparse or compressed file, but do not need to allocate new clusters to
perfrom this.
2005-10-27 21:20:30 +00:00
cha0smaster 1ce16eddb7 minor cleanup 2005-10-27 20:42:10 +00:00
szaka 8b1263c217 Working with regular files needs no longer --force, except for mkntfs 2005-10-27 18:45:45 +00:00
cha0smaster 01585fd7cd Always pass "use_ino" to fuse_new, since it's ok to have several files with sameinode number. 2005-10-27 13:01:58 +00:00
cha0smaster 9fb63e797e Pass use_ino to fuse_new if named data streams access is not 'windows'. 2005-10-27 11:37:49 +00:00
flatcap 8a584700c5 whitespace fixes - no code changes 2005-10-26 22:54:57 +00:00
flatcap c59d76aed2 missing include 2005-10-26 20:52:53 +00:00
flatcap 1ee8d8b9e2 restore call to ntfs_set_locale
(utils only uses stderr, now)
2005-10-26 20:48:38 +00:00
flatcap 5bd198d66e logging renames
utils only uses stderr, now
whitespace fixes
2005-10-26 20:48:00 +00:00
flatcap a244edbe1c tidy up
wrap lines
2005-10-26 20:47:14 +00:00
flatcap 1f68df3f69 shorten ntfs_logging_* to ntfs_log_* 2005-10-26 20:46:37 +00:00
flatcap c27c1a40cb explain rm's elements in ntfs_inode, ntfs_volume 2005-10-26 20:45:58 +00:00
szaka 0dc3b0597c fflush() ntfs_log_ streams. (Christophe) 2005-10-26 19:24:45 +00:00
antona 98e5cda13e Add some debugging to ntfsdecrypt.c to allow printing of the private
key after it is decrypted (this is ifdeffed out by default).  (Anton)
2005-10-25 22:12:25 +00:00
uvman ef7bda1d7b Update changelog about Dputs, Dprintf, ..., Sprintf 2005-10-25 18:34:18 +00:00
cha0smaster c84e54a441 fix build 2005-10-25 11:54:26 +00:00
uvman 0dd0cdc6be Remove {Dputs, Dprintf, Dperror} and convert callers to ntfs_log_*. Make ntfsinfo use ntfs_logging_parse_option(). 2005-10-25 01:28:10 +00:00
szaka f9cdaed3db temporary fix for the corrupted stdout due to the recent logging changes 2005-10-24 21:20:10 +00:00
uvman 7cbc0a6cb6 Remove any uses of the old logging system (Dputs, Dprintf, ...) from libntfs. 2005-10-24 20:50:05 +00:00
szaka 746dff1a24 NTFS_INDEX_ prefix $I30, $SII, $SDH, $O and $Q indexes 2005-10-23 18:35:58 +00:00
szaka 9be56ad848 ntfscat can display named attributes, streams too 2005-10-23 14:00:37 +00:00
cha0smaster 8980ec6d76 ntfsmount: Add 'streams_interface=' option to select named data streams access interface. Currently supported interfaces are 'none' and 'windows'. 2005-10-23 11:54:00 +00:00
cha0smaster b7aaeece53 documment need ea flag 2005-10-22 20:22:21 +00:00
szaka dd3ce28cd2 Factor out fix_mount() and fix_mftmirr() from main()
Avoid freeing NULL's to end non-constuctive discussion about its usage
2005-10-22 19:54:01 +00:00
flatcap 0c2247c7ca new header files to tidy build process 2005-10-21 18:08:28 +00:00
flatcap f4e427e91a implement logging in libntfs
fix whitespace
fix build problems
tidy source code
and more...
2005-10-21 18:05:13 +00:00
cha0smaster 8c53ea8d4f *** empty log message *** 2005-10-20 15:38:21 +00:00
flatcap a2c8e7befe fix a few build warnings 2005-10-20 13:49:56 +00:00
uvman 705814c9d7 Allow building libntfs as a shared library on Cygwin. This should not disturb non-Cygwin enviroments, but not tested. As a side-effect it generates ugly informational messages about importing extern variables. These are not errors or warnings, just info. 2005-10-20 00:59:22 +00:00
uvman 570705dcab Add a comment to some typedefs per discussion on linux-ntfs-dev 2005-10-20 00:56:11 +00:00
szaka 24cb1ec6e8 fix warnings 2005-10-19 22:10:57 +00:00
szaka 8f03f5a6ca Optionally create NTFS version 3.0 (W2K) or 3.1 (XP, W2K3, Vista).
Contributed by Erik Sornes. No side-effect for v1.2 NTFS which is still
the default. The implementation needs some minor work: see e.g. the chkdsk
messages and the result of ntfscmp'ing the two images.
2005-10-19 22:04:46 +00:00
antona a7fd01e543 $EA can be resident and non-resident. Fix libntfs/attrib.c::
ntfs_attr_can_be_resident() apropriately.  (Anton)
2005-10-19 08:13:44 +00:00
cha0smaster fe408380c7 typo fix 2005-10-17 20:21:22 +00:00
flatcap ea2c4c6c61 fix build warning - duplicate definition 2005-10-17 14:07:28 +00:00
flatcap 2a8d602d9f ntfsrm has been split up and merged into libntfs.
currently it's #ifdef'd out.
tree.c - code for handling directory trees
rich.c - a few helpers without a home (this file will go away soon)
Note: ntfsrm isn't in the build any more (you need to ./configure --enable-rich; make extras).  When rm is less intrusive, again, I'll put it back in the build.
2005-10-16 23:33:03 +00:00
flatcap 139f6c6603 prevent a few name clashes with the new rm code 2005-10-16 22:37:48 +00:00
flatcap bde3e0063b centralised logging system 2005-10-16 21:57:00 +00:00
flatcap 2436151e59 fix warning (uninitialised variable) 2005-10-16 21:37:12 +00:00
flatcap 8fa46025d5 trailing whitespace 2005-10-16 19:21:47 +00:00
szaka 27a9764d3a Check and report bad sectors before cluster allocation check because
chkdsk doesn't always fix $Bitmap with bad sectors
2005-10-16 18:50:56 +00:00
szaka 48feb16fa9 Factor out cluster allocation check 2005-10-16 11:12:08 +00:00
antona a570ee7b37 Fix endiannes bug in libntfs/index.c. (Anton) 2005-10-16 00:07:14 +00:00
antona 85c866fcea More endianness fixes! 2005-10-15 23:51:13 +00:00
antona 6803fa4b76 Fix endianness bug in ntfsinfo. (Anton) 2005-10-15 23:44:57 +00:00
antona 1d4958d38c Fix endianness bug (le16 instead of le32 when accessing mft record
bytes_in_use) in volume.c::ntfs_volume_write_flags() and
ntfsfix.c::OLD_ntfs_volume_set_flags().  (Anton)
2005-10-15 23:13:49 +00:00
antona 3adf923766 Fix compilation and warnings in ntfsdecrypt.c on OSX/gcc4.0.1. The
compilation failure was because we use strnlen() which is gnu
specific and not present on my current version of OSX so ntfsdecrypt
now provides own version if it is not present on system.  (Anton)
2005-10-15 22:30:20 +00:00
antona da1495a11d Fix compilation on OSX in ntfscmp.c where stderr = stdout is not legal (but
happens to work on Linux) to do portable low-level file descriptor mangling.
2005-10-15 21:48:37 +00:00
antona f5961c075e - Fix compilation on OSX in ntfsclone.c where stderr = stdout
is not legal (but happens to work on Linux) to do proper
  low-level file descriptor mangling which is portable.  (Anton)
- Add test/runlist-data to EXTRA_DIST so it gets included in the
  distribution otherwise make test fails on released sources.  Solution
  is not perfect as it also adds the test/runlist-data/CVS directory
  but it will do at least for me.  (Anton)
2005-10-15 21:44:17 +00:00
antona b9422552da Fix compilation on OSX in ntfsresize.c where stderr = stdout is not
legal (but happens to work on Linux) to do proper low-level file
descriptor mangling which is portable.  (Anton)
2005-10-15 21:26:16 +00:00
antona e46d4e8959 Fix silly bug introduced in 1.12.0 which breaks ntfsfix (and others
possibly) when calling ntfs_attr_lookup() with AT_UNNAMED name and
no ntfs inode in the search context.  (Anton)
2005-10-15 20:52:41 +00:00
antona a3ab2bc6a0 Fix stupidity. 2005-10-15 11:34:26 +00:00
antona bc4bee7b2f Fix bogus le16_to_cpu() which shouldbe le32_to_cpu() when accessing
the attribute list entry attribute type in some places in
libntfs/attrib.c.  (Anton)
2005-10-15 11:33:42 +00:00
antona 9c062a8531 Update changelog 2005-10-15 11:16:32 +00:00
antona 01a929556c Re-add getgccver but a completely different version. This is to cope with all
OS I tried it on (Solaris, OSX, Linux, NetBSD, FreeBSD) and various gcc flavours
including weird ones like "3.5-blah".
2005-10-15 11:14:43 +00:00
antona be4c70b45e Argh, found one compiler that gives a minor version including text so cut it
off the versions.
2005-10-15 10:16:26 +00:00
antona c0b2d7dab2 Remove getgccver script and just use -dumpversion option to get the version
directly inside configure.ac.
2005-10-15 09:53:36 +00:00
antona b67fb5e78f Add a comment about the valid size for $EFS attribute value. 2005-10-15 09:15:46 +00:00
antona 62f9636080 Temporarily disable use of the legal ansi character checking in
libntfs/unistr.c::ntfs_names_collate() pending a proper fix at some
point.  (Anton)
2005-10-13 08:26:02 +00:00
flatcap 42de4cf905 tidy up some __attribute__ usage 2005-10-12 11:52:40 +00:00
flatcap e44bb7afb7 fix build bug - wouldn't build without DEBUG defined 2005-10-11 23:09:07 +00:00
antona f0ff7e83e4 Forgot to update the release date! 2005-10-10 13:04:33 +00:00
antona a40d7e55d6 - Revert patch from Christophe applied by Yura.
- Provide a realpath() alternative for systems which do not have it.
  This is _much_ nicer as it avoids the horrible #ifdef gunk in the code...
2005-10-10 12:55:11 +00:00
cha0smaster bf91f7c0fc Apply patch from Christophe. 2005-10-10 11:04:56 +00:00
cha0smaster b1c1348d37 fix build under cygwin if FSCTL_GET_NTFS_VOLUME_DATA is not defined 2005-10-09 13:35:15 +00:00
szaka 9e589a7bce Fix some corner cases and all memory leaks; handle corrupt NTFS more gracefully 2005-10-09 12:53:44 +00:00
antona cc57c76cd5 Move mount.ntfs-fuse and mkfs.ntfs to be symlinks instead of
hardlinks and move both to /sbin rather than prefix/sbin.  Note we
still obey $destdir so building packages works as well as installing
into alternate chroot / other system still works.
2005-10-07 23:01:23 +00:00
antona ff86e350bc Update changelog and bump version number on ntfsprogs and libntfs appropriately.
NOTE: If anyone makes libntfs changes that modify the interfaces, please update
the libntfs version appropriately before the next release (see configure.ac for
explanation of how to update the version).
2005-10-07 16:00:42 +00:00
antona 4c3687fc64 Fix hardcoded location for hardlink on uninstall. (Anton, Szaka) 2005-10-07 15:52:29 +00:00
cha0smaster fdd8dbd819 fix spec too 2005-10-07 15:18:47 +00:00
cha0smaster 8854585270 oops, fix previous fix 2005-10-07 15:15:13 +00:00
cha0smaster 093431f2f7 revert 1.49, mount.ntfs-fuse should be in /sbin, not /usr/sbin or /usr/local/sbin 2005-10-07 15:13:10 +00:00
antona 0377e979d0 Various fixes before release. 2005-10-07 15:02:15 +00:00
antona 0c293d0407 - Add API (actually renamed from what Rich/FlatCap did):
volume.[hc]::ntfs_libntfs_version() which returns a pointer to a
  static const string of the libntfs verion, i.e. at the moment this is
  "8.0.0".  This required moving the version specifications from
  libntfs/Makefile.am to configure.ac.  This should hopefully have the
  sideeffect that I will remember to increment it when incrementing the
  ntfsprogs version number when making a release given the two are
  right under one another.  (Anton)
- Change ALL utilities to display the libntfs version they are running
  on.  This should make debugging easier in the case that people are
  running mismatched utilities/library.  (Anton)
2005-10-07 14:10:56 +00:00
cha0smaster 3814896a5b fix compiler warning 2005-10-07 13:26:44 +00:00
antona 3d46df6b4a Prepare for 1.12.0 release. 2005-10-07 12:52:52 +00:00
antona 5f6a0988e3 Fix compiler warning. 2005-10-07 12:47:03 +00:00
antona 9b1a8920fb Fix "make test". 2005-10-07 12:41:34 +00:00
antona 31ee9de6ac Fix stupid bug in mkntfs which caused it to fail even though only the
backup boot sector could not be written because a 2.4 kernel is used
and the partition has an odd number of sectors.  (Anton)
2005-10-07 12:21:32 +00:00
szaka ae276bbfe1 Fix 'make install' and 'make uninstall' if FUSE isn't enabled 2005-10-05 20:11:23 +00:00
uvman 81d7457fe8 Add all reasonable warning flags supported by GCC 3.2+ to --enable-warnings. 2005-10-05 19:13:54 +00:00
antona 95ab175a92 revert manual to say that the volume is marked dirty. Anton 2005-10-05 13:32:39 +00:00
antona 8172a1a9b3 Add test/.cvsignore with the right things in it... 2005-10-05 13:12:22 +00:00
antona aa7e3cc98e return volume set dirty functionality to ntfsfix on Yura's request. Anton 2005-10-05 13:01:10 +00:00
cha0smaster ce52b49c36 Minor man pages updates 2005-10-05 11:14:30 +00:00
szaka 4f74c30984 Revert to the original output but by also fixing the "format string" warnings 2005-10-04 22:03:13 +00:00
cha0smaster ecc920583e revert utils.c revision 1.46, because it breaks ntfsmount output 2005-10-04 21:42:07 +00:00
uvman 62579b84d4 compiler warnings fixes. 2005-10-04 20:36:42 +00:00
cha0smaster fa46de6b6f accept noauto mount option for better support mounting via fstab 2005-10-04 20:00:22 +00:00
cha0smaster e0dd52faae update changelog 2005-10-03 21:11:25 +00:00
cha0smaster cc9bc93221 * change interface: ntfsmount device mnt_point -o opts
* hardlink ntfsmount to /sbin/mount.ntfs-fuse, thus volume can be mounted via fstab without any helpers
* update man page for ntfsmount
2005-10-03 21:07:24 +00:00
cha0smaster 96f31a07ed Add locale options to ntfsmount. 2005-10-03 19:48:54 +00:00
cha0smaster f292546aed EPERM is returned if windows was hibernated 2005-10-01 00:42:11 +00:00
cha0smaster 75668af15e last optimizations to ntfs_delete was incorrect, revert it 2005-10-01 00:34:53 +00:00
szaka 54891f3112 Emphasize Windows needs to be rebooted twice after chkdsk /f 2005-09-30 20:29:58 +00:00
szaka 39403911a4 Clarify --force usage 2005-09-30 19:51:12 +00:00
szaka d07aab11f5 Update unclean_journal_msg 2005-09-30 19:46:45 +00:00
antona 3c3507c4a3 Fix the update. 2005-09-30 19:26:06 +00:00
antona b24f640e24 Update. 2005-09-30 19:25:41 +00:00
antona 813354f56d Add missing options to mkntfs' getopt() parsing string. (What a silly bug!)
Fix a compile warning in ntfscmp.
2005-09-30 19:24:13 +00:00
cha0smaster dff50dc5ba oops, forgot one s/_lookup/_find 2005-09-30 18:57:00 +00:00
flatcap 519d68eb53 remove some junk 2005-09-30 16:58:20 +00:00
cha0smaster ad2e6baf35 Refix my previous fix to fix. :-)
Comment thinks better.
2005-09-30 13:13:38 +00:00
cha0smaster 7aeed859b9 Revert Anton's code that breaks functions needed for attribute resize. 2005-09-30 09:52:05 +00:00
cha0smaster 27d923bffb typo fix 2005-09-30 09:45:54 +00:00
szaka ab2ad80ae7 Accept incorrect $Bitmap size if it covers the entire volume 2005-09-29 23:30:15 +00:00
flatcap 9ee916bbd0 need config.h for the autoconf #ifdefs 2005-09-29 12:50:39 +00:00
flatcap 1b5ee7b7a3 need config.h for the autoconf #ifdefs 2005-09-29 12:44:42 +00:00
antona 8db479a6b1 Patch from Christophe:
A lot of headers are checked by autoconf (AC_CHECK_HEADERS in configure.ac).
Please find a patch that add the missing "#ifdef" to the source code.
2005-09-28 13:47:47 +00:00
antona 151d0ecb61 Fix the double free that just got added. There was only half a memory leak...
It was a cut and paste error, not a real memory leak.
2005-09-27 18:03:00 +00:00
flatcap 6691212129 fix a memory leak - vol->vol_ni 2005-09-27 17:11:30 +00:00
flatcap 2aa1cfe3d9 fix a build warning 2005-09-27 15:25:19 +00:00
antona 339abc36b4 More $LogFile handling fixes: when chkdsk has been run, it can leave the
restart pages in the journal without multi sector transfer protection
fixups (i.e. the update sequence array is empty and in fact does not
exist).
2005-09-26 13:18:29 +00:00
antona 4b1b89109d Fix the definition of the CHKD ntfs record magic. It had an off by
two error causing it to be CHKB instead of CHKD.
2005-09-26 13:11:00 +00:00
szaka 431258997d Fix saving by sectors during --rescue 2005-09-25 21:42:47 +00:00
szaka a0338ab9b2 Fix uninteded output and typo 2005-09-25 19:35:56 +00:00
szaka 660b44f3ed Fix --enable-really-statici: mkntfs redefined ntfs_attr_put_search_ctx() 2005-09-25 19:22:11 +00:00
cha0smaster 5ca19a130b fix stupid bug in ntfs_delete, optimize it a bit 2005-09-25 14:12:44 +00:00
cha0smaster 8afb8a0daa minor cleanup 2005-09-25 11:42:26 +00:00
szaka 44e60c37c4 Fix 'make extra' (ntfsmove) compilation 2005-09-24 23:46:54 +00:00
antona 2a104d8eda Megapatch!!! Check evecrything!!! I probably broke everything!!! 2005-09-24 22:54:55 +00:00
szaka 99e18269b7 Hint user the --rescue option if they have bad sectors 2005-09-24 21:36:51 +00:00
antona 3a50e66a59 Fix a very(!) longstanding bug in ntfs_attr_find() and co.
Also reapply fix to unistr.c name collation.
2005-09-24 20:28:23 +00:00
szaka eb51c61ba4 Emphasize that disk partitioning must use sector as the unit instead of
cylinder to avoid shifting of the partition
2005-09-24 20:12:36 +00:00
cha0smaster 53ffb79352 fix potential bug 2005-09-24 17:06:35 +00:00
cha0smaster d8daee604f Update NEWS and ChangeLog 2005-09-24 17:00:26 +00:00
cha0smaster cba53f8895 * ntfsmount: implement rename
* update man page for ntfsmount
2005-09-24 16:19:29 +00:00
szaka 24de91b8fa - Support journals which have been modified by chkdsk. (Anton, Szaka)
- Support journals ($LogFile) with only one restart page as well as
  journals with two different restart pages.  (Anton, Szaka)
2005-09-24 15:59:53 +00:00
szaka 054d6777d5 Fix ntfs_names_collate() input sanity check intrudoced in cleanups by
reverting to the original one
2005-09-24 15:29:54 +00:00
cha0smaster 464eab4178 add ntfs_link, update ntfsmount to use it 2005-09-24 15:20:49 +00:00
cha0smaster 7fee848c26 attrib.c: fix line to be <=80 characters long 2005-09-24 13:06:59 +00:00
cha0smaster c9294cb701 Remove 'use_ino' because I'm afraid I can not use it with "file:stream" nammed data stream access interface. :-( 2005-09-24 13:05:36 +00:00
cha0smaster 48b8edc464 fix attribute list adding 2005-09-24 13:03:07 +00:00
flatcap 531305cc1e Christophe: add easily accessible version info to libntfs 2005-09-22 16:41:43 +00:00
flatcap 6effd0bc6f minor improvements to test build 2005-09-20 19:24:09 +00:00
szaka 192348fa0a ntfsclone manual: update --ignore-fs-check option description 2005-09-20 16:24:26 +00:00
flatcap 7f8ad30c09 more code juggling
try and sort out transfer
2005-09-20 00:05:49 +00:00
flatcap 374f5ac4f7 *cough* remove some debug #ifdefs 2005-09-19 20:58:54 +00:00
flatcap 459f98c2b2 fix a couple of range bugs (insert,replace)
Anton: fix mergeable - use to merge non-adjacent holes
Anton: factor out "tail" in replace - simplifying code
comment and retest code
2005-09-19 20:50:01 +00:00
cha0smaster 94be253f74 minor ntfsmount cleanup 2005-09-16 14:30:08 +00:00
cha0smaster 3629d931c6 Fix resident attribute adding: Add @val to ntfs_attr_add and @val and @size to ntfs_resident_attr_record_add.
Still need to fix attribute lis entry adding. :-(
2005-09-16 14:28:18 +00:00
flatcap ab9fb6a01f runlist behaviour changed! please check your applications.
test case 16, where a run is added beyond the end of a file, now behaves
differently.  the discontinuity (gap) is now filled with a "not mapped"
run (before the preceding hole would have been extended).

Anton's bugfix applied and tested
minor code tidyups
loads more comments in runlist_{insert,append,split,replace}
test cases checked and updated where necessary
valgrind happy
2005-09-15 23:42:02 +00:00
flatcap eb6b8d8159 add a PHONY dependency to "test" target to make sure it's run 2005-09-14 12:23:08 +00:00
flatcap 01f648c952 removing a few unnecessary memsets in the test code revealed a minor
buffer overrun.
create runlist tests working on unmapped regions (copies of tests 1-14)
2005-09-13 18:51:16 +00:00
flatcap d75567112c put the test code where it's more useful 2005-09-13 14:30:51 +00:00
flatcap 0ae7e885d1 bug fix - reading uninitialised memory 2005-09-13 12:51:34 +00:00
antona ea0202921d Clarify the logfile check/hibernation warning. (Yuval) 2005-09-10 07:55:58 +00:00
cha0smaster 3164c705f7 ntfsmount: Apply patch from Yuval to fix 'df' output. 2005-08-31 14:31:53 +00:00
cha0smaster c3727658ca * Fix filenames collation.
* Minor comment cleanup.
2005-08-26 20:17:08 +00:00
cha0smaster f80efa5e9a Make ntfsdecrypt compile. 2005-08-26 12:25:13 +00:00
cha0smaster 14702e50f2 ntfsmount: Aplly patch from Yuval with minor fixes to it.
Temporary remove kernel_cache from default options.
2005-08-26 12:23:00 +00:00
antona 190e59886f Define PATH_MAX if not defined in ntfsprogs/ntfsmount.c and
libntfs/volume.c.  Needed to compile on DOS with djgpp.  (Christophe)
2005-08-26 11:44:11 +00:00
szaka 605726b340 ntfscmp: new util for development, debugging, testing, etc. 2005-08-25 20:42:54 +00:00
cha0smaster 0835682401 refix previous fix to man page :) 2005-08-23 12:38:37 +00:00
cha0smaster ca83f4d63c fix brokeness introduced in the last Anton's cleanup 2005-08-23 12:17:39 +00:00
cha0smaster 1ed76a2d3e small fix to ntfsmount man page 2005-08-23 12:07:26 +00:00
cha0smaster 6f8cd6e5ef Cleanups and memleak fix to error code paths of ntfs_create. 2005-08-22 21:33:07 +00:00
antona c7eaee5a0f Some cleanups. 2005-08-22 09:00:16 +00:00
antona 2ea4ad30ec Add comment about this being ntfs 1.2 acls. 2005-08-22 08:30:38 +00:00
szaka dc284e1e10 Fix gigaleak in ntfscluster, utils.c::mft_next_record() 2005-08-21 09:46:29 +00:00
szaka d29a3e9b97 Fix incorrect volume usage calculation 2005-08-21 00:50:14 +00:00
antona 0f3a85c8e3 Only include sys/ioctl.h in libntfs/device.c if ./configure detected
it to be present.  (Christophe)
2005-08-19 16:01:15 +00:00
flatcap fa99ae3d0f more housekeeping - no code changes 2005-08-17 15:59:27 +00:00
flatcap 96e1f45319 housekeeping - no code changes 2005-08-17 14:53:07 +00:00
flatcap db1e9afb1f create an index alloc (needs work) 2005-08-17 14:33:16 +00:00
flatcap 49a4f377f3 fix up dt root add 2005-08-16 13:33:12 +00:00
flatcap b312a44483 change utils_dump_mem to take a void ptr
update the comments a bit
2005-08-16 13:25:15 +00:00
szaka 6d7ca452ff Articulate --bad-sectors a bit better 2005-08-15 21:44:10 +00:00
szaka a9e02e7687 Hard link mkfs.ntfs and mkfs.ntfs.8 with mkntfs and mkntfs.8 2005-08-15 20:48:48 +00:00
cha0smaster 3c6381db2f Thoght that FUSE will check if directory is empty, it didn't. Add such check to ntfs_delete. 2005-08-15 00:50:19 +00:00
flatcap 301c8bd331 tidy up complicated mft mess 2005-08-14 22:22:06 +00:00
flatcap 14ab52fb23 give the new file some dummy data 2005-08-14 16:08:44 +00:00
cha0smaster 30263fb749 fix stupidness introduced just before commit 2005-08-14 16:06:33 +00:00
flatcap a1ef87e393 tidy up error message 2005-08-14 15:56:31 +00:00
cha0smaster 9028a53dfc Sorry it's very large commit (46K of diffs between my local tree and CVS HEAD
before commit), file and directory creation/deletion recursively requested many
changes. See ChangeLog for description of all changes.
2005-08-14 15:44:46 +00:00
flatcap 4e292d96f1 remove old version of dt_alloc_children
clean up inode handling
fix ridiculous mft reading bug
mftrec mark free -> set inuse
inc attrib instance ids
successfully create a file
2005-08-14 12:26:55 +00:00
antona 0152ddb1b2 Update for more correct EFS information. 2005-08-14 06:16:35 +00:00
flatcap fd54e78256 more code to start testing add
keep track of dir names
2005-08-11 13:59:08 +00:00
flatcap 8567df0b6d display year in long listing 2005-08-11 13:53:08 +00:00
antona 68aab0dacd Minor cleanup. 2005-08-10 11:33:10 +00:00
antona c9d112e9ea Fix ntfsdecrypt to also work with passwordless files. Note this
requires a patched gnutls library or it still does not work.  (Anton)
2005-08-10 10:17:03 +00:00
antona 8ffbca582f Add comment about broken gnutls empty password handling. 2005-08-09 11:07:26 +00:00
antona 5dd973f683 Fix some memleaks in ntfsdecrypt and do some cleanups there.
Fix testing whether to compile crypto code in configure.ac.
2005-08-09 10:57:40 +00:00
antona 9f71cc30e7 - Update for Yura's memleak fix.
- Fix some typos.
2005-08-09 09:03:29 +00:00
antona 497922351a Fix accidental damage. 2005-08-08 21:20:06 +00:00
antona b98295d84f Add conf.libgnutlstest to .cvsignore 2005-08-08 21:19:14 +00:00
antona f0af821fd1 Add detection for gnutls and make minimum 1.2.3.
Also make minimum for libgcrypt 1.2.0.  Don't know if we work with earlier
versions.
2005-08-08 21:17:15 +00:00
cha0smaster 6a9aca9a22 ntfsmount: fix small memleak 2005-08-08 13:14:41 +00:00
antona 59e70eab49 Update for the next release. 2005-08-08 09:17:22 +00:00
antona 16ed5a54b2 Fix breakage introduced by Yuval. 2005-08-06 14:46:42 +00:00
antona 518c9d6fee Deal with non-password better. 2005-08-06 14:37:31 +00:00
uvman cd37ed9527 fix a few warnings in ntfsdecrypt and make it work. 2005-08-06 14:17:31 +00:00
uvman 4b8ebe26bb Fix a nasty bug in unistr.c 2005-08-06 12:37:30 +00:00
antona d0dd037463 Set password to NULL instead of empty string "" so GNU TLS assumes it is not
encrypted.
2005-08-06 06:11:56 +00:00
antona 3b7afbc6f6 Ouch! Have been forgetting to bump libntfs version between releases. )))-:
Now bump it for next release.
2005-08-05 23:51:26 +00:00
antona 640573bf12 Finish next stage in ntfsdecrypt evolution. It is now almost finished in that
it fully works to decrypt any ntfs enecrypted file both from Linux and Windows.
All you need to supply is your private key in form of a .prx file as exported
for example by the cypher command in XP SP2 or otherwise as exported by the
management console's certificate manager plugin.
2005-08-05 23:41:52 +00:00
szaka a0adaafe38 Credit Ralf Beyer 2005-08-05 17:28:41 +00:00
cha0smaster 490176db7b update README about ntfsmount 2005-08-04 19:49:38 +00:00
antona 8d86fdefec Fix make extra directly after ./configure. Thanks to Yuval for the bug report. 2005-08-04 13:12:41 +00:00
antona 6d265e99ea Update 2005-08-04 12:22:28 +00:00
antona 704f7ea214 Remove efs stuff from todo as it is now done. 2005-08-04 12:21:23 +00:00
antona 74650cc050 pkgconfig does not support libgcrypt. Use autoconf macro instead. 2005-08-04 11:59:28 +00:00
antona d658b8f019 Fix typo in ChangeLog (thanks Szaka!).
Do more detection in configure.ac and in particular check for getopt_long,
windows.h, wincrypt.h, and gcrypt.h and most importantly (for now) give command
line option to enable crypto stuff and autodetect if libgcrypt is present.
And only build ntfsdecrypt (still make extra only) only if both --enable-crypto
was specified AND libgcrypt was found.
2005-08-04 10:36:35 +00:00
antona 6124aafffb Move timeconv to ntfstime, update changelog, and news for new release. 2005-08-04 09:59:39 +00:00
antona 41d459b15c Improve on decompression fix from Yura. 2005-08-04 08:09:58 +00:00
cha0smaster 6d4e6d9893 * fix ntfs_attr_open
* update for 1.11.2
2005-08-04 00:00:27 +00:00
szaka 4e8e7ae9fa Fix for ntfs_rl_truncate() EIO: always set the correct size for $BadClus:$Bad,
even if Windows set it incorrectly
2005-08-03 22:40:29 +00:00
cha0smaster 36c5f89d13 Fix ntfsmount warnings. 2005-08-03 22:29:14 +00:00
szaka 26bedb9462 rl_expand(): make it a bit more readable 2005-08-03 21:46:35 +00:00
szaka 22590fea7e rl_expand(): check if new length isn't already more than requested 2005-08-03 21:35:22 +00:00
cha0smaster 0959ea9907 Fix ntfs_is_cb_compressed for nasty runlist merging case in which
compression block was incorrectly treated as not compressed.
2005-08-03 21:25:42 +00:00
cha0smaster 39ec2a8347 ntfsmount: perror => Eprintf on partial {read,write}. 2005-08-03 14:06:04 +00:00
cha0smaster fe67916350 * attrib.c: refix ntfs_attr_p{read,write}
* ntfsmount.c: code that now not really needed, but for any case
2005-08-03 13:52:50 +00:00
antona 55760d93e8 Remove include of openssl/md5.h as that is no longer used. 2005-08-02 09:48:42 +00:00
antona 7e53648b59 Fix a warning. 2005-08-02 09:44:58 +00:00
antona fd68e4ed66 Update 2005-08-02 08:54:19 +00:00
szaka 06052dafcf Replaced all occurances of ENOTSUP to EOPNOTSUPP to be in better harmony
with the kernel driver
2005-08-01 22:10:38 +00:00
cha0smaster fd2e6eb09d ntfsmount: fix nr_links for directories. 2005-08-01 22:04:27 +00:00
szaka cebd8ec132 White space cleanup 2005-08-01 20:33:26 +00:00
szaka 78297900bd Let the user know if the journal file couldn't be checked or was unlean 2005-08-01 20:22:24 +00:00
cha0smaster f7e5e1cc26 * Fix ntfs_attr_p{read,write}. (see Changelog)
* Minor fixes and some stubs for uncommitted code.
* Update README about ./autogen.sh.
2005-08-01 13:40:51 +00:00
szaka 03556cdd8b Remove the last remained, autogenerated file 2005-07-30 17:00:00 +00:00
szaka d292ae2d27 Fix random errno returned by ntfs_inode_open() if the MFT record wasn't in use 2005-07-30 16:36:24 +00:00
cha0smaster 7aebba2e12 minor improvements to index.h and ntfsmount.c 2005-07-29 21:37:09 +00:00
cha0smaster 6c5775628f Remove hope all autogenerated files 2005-07-29 21:16:27 +00:00
antona 46ff0a83a8 More removals... 2005-07-29 21:09:07 +00:00
antona e195dadcd8 Remove more files. 2005-07-29 20:56:35 +00:00
antona db07edcf74 config.h.in and config.guess are autogenerated... 2005-07-29 20:51:48 +00:00
cha0smaster edac1701b6 Update for aclocal.m4 remove 2005-07-29 19:45:15 +00:00
cha0smaster 49e3b9ac9f aclocal.m4 is autogenerated file too 2005-07-29 19:42:04 +00:00
antona 304f060a76 Add all Makefile.in to maintainer-clean target. 2005-07-29 15:51:49 +00:00
antona 62f87128ad Remove Makefile.in and configure with make maintainer-clean. 2005-07-29 15:35:55 +00:00
antona 69f55f1ee5 Remove all Makefile.in files and add them all to all .cvsignores. 2005-07-29 15:10:19 +00:00
antona 3ccd12241a Start the build system cleanup. Add AM_MAINTAINER_MODE to configure.ac and
remove configure and Makefile.in.  Also add Makefile.in to .cvsignore.
2005-07-29 15:04:57 +00:00
cha0smaster 4088de1017 Change errno and print more verbose message in case if logfile check failed. 2005-07-29 14:44:23 +00:00
antona f0ff698c22 Update some efs info (the 16byte fields in the header are md5 hashes of the
decrypted fek, ddfs, and drfs.  windows uses them as a sanity check and a check
that the efs attribute has not been tampered with.)
2005-07-29 09:54:02 +00:00
cha0smaster fb433d4ad3 Fix unistr.c::ntfs_mbstoucs on systems with utf8 locale. 2005-07-28 21:20:23 +00:00
antona 1a029f788e Remove Openssl linking in for decrypt.c from Makefile.am and update build
system.
2005-07-28 16:24:27 +00:00
antona 79e9e30ee3 Use libgcrypt instead of openssl for desx_key_expand's MD5 hashing. 2005-07-28 16:18:20 +00:00
antona 5b087e6d8a Fix a core dump. 2005-07-28 15:14:40 +00:00
antona f67d8fcee1 Use double indirection in case libgcrypt clones the key for you hack for
closing the des cipher.
2005-07-28 11:27:31 +00:00
antona 2546690ee1 Add EFS structure definitions to layout.h and adapt ntfsdecrypt for it.
More fixes/cleanups to decrypt.c.
This was all Yuval's work but I did some renaming afterwards and some
whitespace cleanups.
2005-07-28 10:36:31 +00:00
antona 0a18d2fce7 Fix some stupid mistakes from the cleanup. 2005-07-27 21:33:00 +00:00
antona 997e23fb15 Fixes to last cleanup. 2005-07-27 18:17:31 +00:00
antona 8c54a0b1a9 First pass at massive cleanup of ntfsdectypt/decrypt. 2005-07-27 15:55:42 +00:00
antona 0eb4cfbb42 Some more cleanups I missed last time. 2005-07-27 10:48:46 +00:00
antona bb3c2172b8 Run through Lindent and some manual aftercleanups. 2005-07-27 10:30:57 +00:00
antona d723668d27 decrypt.c:
- Finally working desx decryption thanks to Yuval figuring out that ntfs uses
  des encryption when decrypting!!!  (Yuval)
- Make it compile on Linux.  (Anton)
- Add CALG_DES constant for Linux.  (Anton)
2005-07-27 09:18:26 +00:00
antona 7cd7b2416f finally have verified des key expansion to be correct and have test cases for
it and des decryption.  Currently the des test fails.  It appears ntfs does not
use standard des encryption.  )-:  Perhaps it uses the export non-restricted
40-bit des key instead of 56-bit des...
2005-07-26 16:35:00 +00:00
antona 54b65e2b3c Fixes for key order for desx. Still doesn't work but now keys are correct. 2005-07-26 01:32:51 +00:00
antona 261f059e3e - Fix bug I introduced causing the IV to be wrong for AES decryption.
- Fix a bug where we fail to supply the buffer size when exporting the key.
  Not sure how that ever worked...
2005-07-25 23:23:48 +00:00
cha0smaster a70ca11003 update 2005-07-25 22:08:42 +00:00
cha0smaster 0de66be9c0 ntfscp.c: fix bug intoduced by Anton in changeset 1.21
ntfsinfo: more info on index dumping
dir.c, layout.h: minor fixes
2005-07-25 22:05:27 +00:00
szaka 61ee94dfb2 Don't show detailed resizing related info by default since the only real
restriction to shrink to the smallest size possible is the relocation of
the first $MFT $DATA extent, usually around 3 GB.
2005-07-25 21:19:08 +00:00
szaka 7943e71620 Support resizing into the middle of a $MFT $DATA extent 2005-07-25 20:40:07 +00:00
szaka 34c676fad3 Support relocation of $MFT with $ATTRIBUTE_LIST 2005-07-24 22:34:36 +00:00
antona 6377902ed4 Update decryption for desx after more reverse engineering. Still doesn't work
though.  )-:
2005-07-24 14:42:43 +00:00
szaka f6c4797379 Fix in relocate_attributes(): don't stop processing of MFT record attributes
at AT_DATA of $BadClus and $Bitmap. In practice, there aren't non-resident
attributes after them so this recent bug shouldn't have caused data loss.
2005-07-24 09:06:55 +00:00
cha0smaster e48bd91bbf * Fix bug in index.c (see Changelog).
* Minor fixes to attr{ib,list}.c.
2005-07-23 00:50:31 +00:00
antona 00c7127551 First attempts at DesX decryption (not working yet!). 2005-07-22 23:45:32 +00:00
antona 93194b37a0 Add a function to ntfsprogs/decrypt.c that expands an on-disk desx key from 128
bits to the needed 192 bits so it can be used for {en,de}cryption.
Note I couldn't face using the completely insane libgcrypt api so I used
openssl's libcrypto instead...  Anyone feel free to swap once we have it
working.
2005-07-21 12:12:37 +00:00
cha0smaster b39a2a401f - Move ntfs2utc and utc2ntfs from utils.[ch] to timeconv.h.
- Add [acm]time fields to struct ntfs_inode and set them during ntfs_inode_open.  Update ntfsmount to use them.
- Bump version, update autoscripts.
2005-07-20 19:06:28 +00:00
cha0smaster 0f4d02e9e4 ntfsls: not all files started with '$' are system files, check by inode number instead. 2005-07-20 16:04:40 +00:00
antona e55c6769e1 Apply some updates after doing some reverse engineering. 2005-07-20 10:59:06 +00:00
antona 0dac29a487 Update for 1.11.1 release. 2005-07-20 08:14:52 +00:00
cha0smaster 01946494c2 Fix typos in ChangeLog 2005-07-19 23:22:37 +00:00
cha0smaster c8cb65fcd9 Make @outs_len to be 0 when @**outs NULL in ntfs_ucstombs calls. Previous code
it correct since @outs_len is ingored when @**outs == NULL, but may confuse
because it was equal to @ins_len what is incorrect (eg. international utf8
characters).
2005-07-19 23:13:26 +00:00
cha0smaster 53a1ae67f9 * Fix similar bug in ntfs_fuse_getxattr.
* Update changelog.
2005-07-19 22:58:51 +00:00
cha0smaster 7b9cac2912 Update ChangeLog and auto scripts. 2005-07-19 21:36:07 +00:00
cha0smaster 37b4c63829 ntfsmount:
* Fix bug in inside ntfs_fuse_filler, it's sometimes allocated to small buffer.  (Thanks to Rich for finding this bug)
* Fix bug in error handling of ntfs_fuse_readdir.

ARGH, why we already had release?
2005-07-19 21:22:24 +00:00
antona 1fa9a39d9a Do the 1.11.0 release. 2005-07-19 09:59:51 +00:00
flatcap cc1f72948b fix careless mst write
move truncate out of the commit path
2005-07-19 01:56:41 +00:00
flatcap ad7821f458 remove some old code 2005-07-18 23:53:14 +00:00
flatcap 807e7e6dfc remove some old code 2005-07-18 23:42:40 +00:00
szaka a0580d00e1 Update ntfsresize TODO 2005-07-18 22:32:37 +00:00
szaka d016f808d5 Fix read-only shrinkage failure if new size was too small by relocating and
writing $Bitmap:$DATA only once. This also improves performance.
2005-07-18 22:09:47 +00:00
flatcap 50075bb971 fix some sloppy memory management
tidy up ie handling
2005-07-18 21:45:08 +00:00
cha0smaster b3e4bbcd57 Update TODOs for some things I probably will do someday. 2005-07-18 21:14:26 +00:00
antona 6292bc5d8f Fix compilation under Cygwin (and make sure it still works on Linux). 2005-07-18 20:47:48 +00:00
antona 82fc3cd557 Fix compiler warning under Cygwin. 2005-07-18 20:38:33 +00:00
szaka a3ac693fca Move the check for $Bitmap AT_ATTRIBUTE_LIST into resize constraints 2005-07-18 20:34:41 +00:00
flatcap 50c4959f1e root remove got size wrong
a few typos
2005-07-18 16:10:05 +00:00
antona 422b858af0 Oops. Made a cut and paste error when updating the spec file. Fix it. 2005-07-18 16:02:40 +00:00
antona f2ff3915a5 Update spec file for ntfsmount utility to be in separate rpm ntfsprogs-fuse. 2005-07-18 15:59:38 +00:00
antona 2fbe1a701c - Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC from configure.ac as we
do not provide replacement functions for them and they break cross
  compilation.  (Christophe)
- Update everything for 1.11.0 release.
2005-07-18 13:51:16 +00:00
cha0smaster fc2382b742 libntfs/volume.c: fix ntfs_check_if_mounted to cope with dirrerent names of same file.
ntfsprogs/ntfsmount.c: don't put relative path to /etc/mtab.
2005-07-18 02:09:43 +00:00
antona d8b586c014 Add ntfsdecrypt to .cvsignore. 2005-07-16 18:19:17 +00:00
antona b48dae0c5f Make ntfsdecrypt compile under Linux. 2005-07-16 07:00:57 +00:00
antona 4ed406e68e Add new utility (make extra) - ntfsdecrypt. (Yuval) 2005-07-16 06:53:40 +00:00
cha0smaster 0b75b12544 ntfsmount:
* use mount function from utils.[ch]
* remove fsname option (need to support if volume already mounted)
* add force option to support mount from utils
* update manual page
* fix tiny memleak
2005-07-15 15:53:22 +00:00
flatcap 2c942cb3f4 tidy up dt rollback and commit 2005-07-13 22:55:01 +00:00
szaka 2b2e127d26 Fix segfault during $Bitmap shrinkage introduced very recently by not
differentiating shrinkage and enlargement
2005-07-13 19:37:51 +00:00
szaka 436b290d03 Fix one-time memory leak in relocate_attributes() 2005-07-13 17:47:37 +00:00
szaka c5e05165c9 Fix memory leak in ignore_bad_clusters() 2005-07-13 17:07:13 +00:00
flatcap 60f27a9a8f prevent a likely error from upsetting the info collection
fix a few error messages
2005-07-13 00:50:52 +00:00
szaka 8b148a061f ntfsresize: give more hint if an $MFT run should be split. This will be the
next most common restriction when $MFT with ATTRIBUTE_LIST will be supported
2005-07-12 22:03:13 +00:00
szaka 8be0570dab Prepare collect_resize_constraints() for $MFT with AT_ATTRIBUTE_LIST support 2005-07-12 21:46:40 +00:00
flatcap 5bfce5ff73 no code changes, merely reordered some functions 2005-07-12 17:58:47 +00:00
flatcap 0fc1835e47 fix some sloppy memory management
tidy up bmp handling
2005-07-12 17:13:29 +00:00
szaka 9f50872ec2 Spelling typos, Debian bug #300073 2005-07-12 16:18:10 +00:00
flatcap 40f00bd76b another bmp test
fix bmp handling again
fix dt commit for iroot
fix dt root replace
rm now cleanly removes last dir entry
2005-07-11 11:54:38 +00:00
szaka 4c2cfb2583 Rephrase mentioning "dirty" volumes so people hopefully won't think that
Windows repairs what ntfsresize damaged. The real function of leaving
the volume dirty is to make Windows create the backup boot sector because
we can't know where the partitioner will exactly resizes (they optionally
round to some cylinder boundary, defined by ad hoc, arbitrariy rules).
2005-07-10 23:09:02 +00:00
szaka d37968ee84 Update ntfsfix manual 2005-07-10 22:44:00 +00:00
antona f12ba9ab00 I am a muppet. I forgot to update the version number in configure.ac before
running autogen.sh last time.  )-:
2005-07-10 21:47:23 +00:00
antona 47b52b54e3 Update changelog, fox more mkntfs bugs (thanks Timur!) and update build system
to SuSE 9.3 again.
2005-07-10 21:42:39 +00:00
cha0smaster 48af715f60 * Add check to auto scripts for FUSE to be >= 2.3.0.
* Move ntfsmount back to standard programs set.
2005-07-10 12:38:46 +00:00
antona b942e2c03a Move ntfsmount to extra programs as it doesn't even approximate being
compilable!  (At least on my machine which has fuse 2.2.1.)
And I need a working snapshot for Timur.
2005-07-09 21:32:17 +00:00
antona 9cd8edce5f mkntfs: Fix backup bootsector creation. Thanks to Timur Amirkhanov
for pointing this stupidity out.  (We forgot to set the size before
doing it.)  (Anton)
2005-07-09 21:24:02 +00:00
cha0smaster 9b483d4f42 ntfsinfo: add range check in EA dumping
ntfsmount: fix name in comment
2005-07-09 01:11:46 +00:00
cha0smaster bfbb32f071 Dump every EA record only in verbose mode. 2005-07-09 00:59:30 +00:00
cha0smaster 0b060773f5 - layout.h: update info about EA's.
- ntfsinfo: dump EA and EA_INFORMATION attributes.
2005-07-09 00:09:53 +00:00
flatcap 5693c1fcfb try removing the last entry in a dir (unsucessful, but close) 2005-07-08 18:45:44 +00:00
szaka 7145ab4b19 Document --bad-sectors of ntfsresize; update acknowledgement & known issues 2005-07-07 21:20:04 +00:00
flatcap 7a142ef54c got bored. don't read the diffs. 2005-07-06 22:47:01 +00:00
cha0smaster cb13f36956 Fix typos, patch from debian version of nftsprogs 1.9.4-2. 2005-07-05 16:34:15 +00:00
cha0smaster 1a088a4fdf NEWS: update my name to be in format similar to names in other news. 2005-07-05 05:04:31 +00:00
cha0smaster eb3639e0be ntfsmount:
* Fix named data streams access interface.
* New option: succeed_chmod to avoid chmod errors.
2005-07-05 04:54:28 +00:00
cha0smaster c3586d1d8c Submit ntfsmount manual page.
As usual forgot "cvs new" before commit. :-)
2005-07-05 01:19:20 +00:00
cha0smaster 7553a8da53 * ntfsmount: change default fmask and dmask to 0177 and 0077 respectively.
* Update NEWS, ntfsprogs.8.in, .cvsignore
* Update build system to install nftsmount man page.
2005-07-05 01:18:02 +00:00
flatcap a32e3eca7e fix a few sign warnings 2005-07-04 16:34:14 +00:00
szaka 2af728c6c4 ntfsresize: support bad clusters list ($BadClus:$Bad) 2005-07-03 23:21:01 +00:00
cha0smaster 23181e4d49 ../commit 2005-07-03 15:26:19 +00:00
cha0smaster d31a69bb23 Use gete{u,g}id instead of get{u,g}id. (Thanks to Anton for suggestion.) 2005-07-03 13:07:15 +00:00
cha0smaster 9276557d28 - Change default fsname to "ntfs#device". (Suggested by Miklos Szeredi)
- Fix error handling when no dev option given.
2005-07-03 12:14:57 +00:00
cha0smaster 96f4a39aaf ntfsmount: it's not a error when file didn't contain unnamed data attribute. E.g. $Secure. 2005-07-03 01:49:17 +00:00
cha0smaster 58f7b6b345 Forgot to commit ntfsmount itself. :-) 2005-07-03 00:35:48 +00:00
cha0smaster 3727a729c2 - Add new utility - ntfsmount. It's a FUSE module that rely on libntfs. So,
you need FUSE to compile it, xattr is also highly recommended. This module
support file overwrite changing it size and can list/read/write/add/remove
named data streams via xattr interface.
- Update auto{make,conf} stuff respectively.
2005-07-03 00:18:37 +00:00
cha0smaster 3adc040305 Add change protype of ntfs_attr_pwrite: make @b const. 2005-07-02 19:16:18 +00:00
cha0smaster 67731b14c8 Update changelog for changes that were lost after 1.10.0 release. 2005-07-02 18:30:46 +00:00
cha0smaster 9deb743974 Optimize a bit previous ntfs_inode_close fix. 2005-07-02 17:48:59 +00:00
cha0smaster b8e1188102 Fix memory managament error in ntfs_inode_close. ntfs_extent_inode_open
allocates buffer for up to 4 extent inodes, to prevent many reallocates.
But ntfs_inode_close always reallocate buffer to store exactly @nr_extents
inodes. Bug will arise in following scenario:
1) ntfs_extent_inode_open (1 extent, allocate buffer for 4)
2) ntfs_extent_inode_open (2 extents, use already allocated buffer)
3) ntfs_inode_close(extent_ni) (1 extent, reallocate buffer for 1 extent)
4) ntfs_extent_inode_open (2 extents, don't reallocate buffer because it should be for 4 elements, but really it's for 1, write to unitialized space, segfault)
2005-07-02 13:58:02 +00:00
cha0smaster fbe45ebac6 Fix valgrind varning about writing unitialized buffer. 2005-07-02 13:47:29 +00:00
szaka 3f7c609ab2 truncate_bitmap_data_attr(): no need to distinguish shrinkage & enlargement 2005-06-30 21:13:34 +00:00
szaka fa2e20b14b ntfsclone man: examples use gzip instead of bzip2; some clarifications 2005-06-28 21:09:35 +00:00
szaka 5e6227da65 Version is 1.10.1-WIP. Feel free to ./autogen.sh 2005-06-28 20:53:13 +00:00
szaka 307c9b43e2 ntfsresize: show device name -- useful for bug reports 2005-06-27 21:18:40 +00:00
szaka 60d0ed80a5 Detect and hint users if the destination fs doesn't support sparse files 2005-06-27 21:03:06 +00:00
szaka 70530ad551 ntfs_inode_close(): ElectricFence is unhappy with realloc(x,0) as free(x)
thus we distinguish these two cases
2005-06-27 20:30:09 +00:00
szaka 666619ff85 Trying to better guide lost people to the solutions of the non-ntfs
related partition table corruptions
2005-06-26 20:43:21 +00:00
szaka f8dad91b81 Added ntfsclone's rescue capability 2005-06-26 20:11:03 +00:00
szaka 2afa525533 Added ntfscp
Updated ntfsfix and ntfsclone
Added Yuval Fledel and Yura Pakhuchiy to the list of authors
2005-06-26 20:09:26 +00:00
cha0smaster 1dce9cf4ea NTFSCP: don't use printf inside signal handler. 2005-06-25 16:37:50 +00:00
szaka d8dd64d425 Correct ntfs_inode_sync_file_name comment typos 2005-06-25 13:15:12 +00:00
flatcap 31c31a244d ntfsrm:
fix a couple of crashes
	slightly simplify bitmap logic
	wasn't using mst pwrite for INDX
	rm works again
	bmp commit was overwriting end of attr
	strip down bitmap set
	bitmaps: handle cluster boundaries correctly
	overhaul the bitmap code
	ntfs_binary_print
2005-06-23 18:55:03 +00:00
cha0smaster e5a90b161b ntfscp: Fix signal handling. 2005-06-21 13:06:53 +00:00
antona 39b759ee99 Fix compiler warnings under cygwin. 2005-06-21 09:57:22 +00:00
antona 31a8750c4d Fix compiler warnings in libntfs when compiling under cygwin. 2005-06-21 09:55:15 +00:00
antona fb7586c5ac Update todo files with usnjrnl stuff. 2005-06-20 14:44:45 +00:00
antona ca873f0474 Eeek. Someone did a commit just as I was about to commit so the commit
message was lost!  )-:

Now again...

Monster commit from me due to lack of time.  Sorry about that.

Features:

- Version to 1.10.0
- Update readme, etc ready for release.
- Update build system to suse linux 9.3 versions.
- Fix warnings appearing for me on suse 9.3 with --enable-warnings --enable-debug.
- Set attr_name to NULL in libntfs/attrib.c::__ntfs_attr_init() and fixup all
  callers apropriately.  Thanks to FlatCap/Rich for pointing this out.
- Determine endianness in ./configure and use that in addition to existing
  mechanisms for determining endianness.
2005-06-20 14:31:30 +00:00
flatcap 0e364b49aa ntfscat now works with attribute names
ntfscat now removes fixup from:
  $MFT/$DATA
  $MFTMirr/$DATA
  anydir/$INDEX_ALLOCATION
2005-06-20 14:24:53 +00:00
flatcap 09936e5c22 typos 2005-06-20 14:23:50 +00:00
flatcap 086fd4cc0c probably a bug in __ntfs_attr_init 2005-06-20 14:23:27 +00:00
flatcap 949043ab36 Tidy whitespace: trailing space; <space><tab> at the beginning of lines
Fix warnings about sign differences
Fix warnings about unused parameters
Tidy a few functions that didn't have { on a new line
2005-06-19 21:09:40 +00:00
antona cc992ab0f6 Add more things to .cvsignore files. 2005-06-19 13:20:40 +00:00
antona 3a421dc96c Remove BitKeeper/etc/ignore file as it is no longer in use. 2005-06-17 10:44:55 +00:00
cha0smaster 5becfe6c30 - Fix build without config.h.
- Fix gcc4 very large warning in ntfsrm.
2005-06-16 23:16:32 +00:00
cha0smaster e323ed6a03 Move utils_pathname_to_inode from to library (dir.c), adapt it for library, rename it to ntfs_pathname_to_inode, update all users. 2005-06-12 18:12:55 +00:00
cha0smaster b1dfa2b306 - Fix memleak in ntfs_attr_pwrite
- Update layout.h a bit to be a kernel driver like.
2005-06-12 15:23:25 +00:00
szaka 6e1106fc79 - fix mangled formatting in ntfsclone: use more space for wipe statistics 2005-06-12 14:35:57 +00:00
szaka 532e1b71cf - fix bogus extra error message in ntfsresize 2005-06-12 13:44:34 +00:00
szaka 3517936355 - ntfsresize manual update 2005-06-12 13:39:23 +00:00
szaka b4a712b9e1 - Use consistent option and parameter naming convention 2005-06-12 11:02:50 +00:00
szaka 4fcd676f63 - More explanatory error message about failing to open a volume 2005-06-12 10:15:21 +00:00
szaka 8dae1da562 - Revised ntfsclone's usage() message 2005-06-12 09:55:45 +00:00
szaka 954b728dba - Rephrase ntfs_bugs: don't imply that tools have lots of bugs.
That's not true and it unnecessary worries people (originally the
ntfs_bugs idea was taken from the GNU coreutils that _DO_ have often
bugs but they aren't so critical concerning user's data integrity)
2005-06-12 09:24:11 +00:00
szaka dd0b3bdc7e - Add descriptions for the new command line options 2005-06-11 15:30:07 +00:00
cha0smaster 676d8782e8 - Update attribute definition handling. (Anton, Yura) 2005-06-09 22:09:39 +00:00
cha0smaster aae6371c9d Move namespace dumping into separate function and use it in attribute and index dumping. 2005-06-09 13:08:23 +00:00
flatcap 95c2b79c45 ignore built/generated files 2005-06-09 09:29:34 +00:00
flatcap 554b27dd47 ignore built/generated files 2005-06-09 09:05:30 +00:00
flatcap e5c8b9606e Cristi Klein - display the namespace of the file's name 2005-06-09 08:29:03 +00:00
cha0smaster 373e47acb5 Fix coding style. 2005-06-08 18:02:29 +00:00
cha0smaster 94cc7ff15f Move flags dumping into the separate function. 2005-06-08 18:01:46 +00:00
antona dd52588aae Use dynamic buffer in ntfs_device_win32_find_partition().
Based on patch from Yuval.
2005-06-06 14:51:09 +00:00
antona 1aeb91827c Update build for changes to function detection in configure.ac. 2005-06-06 14:31:37 +00:00
antona 62a4484a94 Finally fix the win32 write support problems. 2005-06-06 14:30:38 +00:00
antona b10eb4cb2d Minor cleanup 2005-06-06 14:29:47 +00:00
antona 6bfbf20a19 Fix warnings. (Yuval) 2005-06-06 14:21:53 +00:00
antona 01ac8414ea Fix typo. 2005-06-06 09:18:33 +00:00
cha0smaster d2ed58e6a2 Anyway, this extra check will not harm anybody, but in case windows support such names it's will be useful. 2005-06-06 04:26:28 +00:00
cha0smaster 410432bc9d - Fix bug in index.c pointed by Anton, many thanks to him.
- Small updates all over the place:
   * NEWS
   * ntfscp manual page
   * ntfsinfo prints parent directory for FILE_NAME attribute
   * year in ntfscp copyright
2005-06-05 23:48:55 +00:00
antona 26945d1e81 Add some offset comments. 2005-06-05 20:06:45 +00:00
cha0smaster 4b000b3d13 - Implement FILE_NAME attributes update in index during inode sync and enable code that set/clean sparse bit. Also add new inode state bit FileNameDirty to indicate that FILE_NAME attributes need update. At least after attribute resize we leave absolutely consist volume.
- Bugfixes to collate.c and index.c.
- Minor formating fixed to ntfscp and ntfsinfo.
2005-06-05 14:55:08 +00:00
cha0smaster 7cd9b6b22d Small formating fix to ntfsinfo. 2005-06-04 15:20:46 +00:00
cha0smaster 048a1857be Fix some bugs and warnings in code that I commited tonight. 2005-06-04 15:20:00 +00:00
cha0smaster 2d8dc1736d - Port collate.[ch] from kernel to library and implement

							
						
2005-06-04 00:57:58 +00:00
antona c4cb316418 mkntfs: Add new option -T which fakes the time to be 00:00:00 UTC,
Jan 1, 1970 instead of the current system time.
2005-06-03 22:22:12 +00:00
antona 8f45d909c1 Only output message that volume is being set dirty if we are actually setting
the dirty flag.  Otherwise the message is pointless.
2005-06-03 21:53:02 +00:00
antona d530c02e49 Ooops. Forgot to actually use our fnSetFilePointerEx() instead of
SetFilePointerEx() directly...
2005-06-03 10:33:35 +00:00
antona b8a543a27e Do dynamic run-time detection of SetFilePointerEx() instead of defunct
autoconf crap.
Also, fix a really stupid bug in the emulated SetFilePointerEx() which caused
the segfaults.  (It unconditionally wrote to a pointer even when it was NULL.)
2005-06-03 10:27:32 +00:00
szaka 683b707b43 Don't mark NTFS dirty if the backup boot sector could be created 2005-06-02 18:36:43 +00:00
szaka 6aa5cc17fe ntfsresize: fix segfault during fsck if $Bitmap was larger than expected 2005-05-24 21:13:51 +00:00
flatcap 0c72b6f242 Giang Nguyen - remove redundancy 2005-05-23 12:07:02 +00:00
antona 430c1c975d Remove some BK specific files. 2005-05-21 13:05:24 +00:00
antona cf2646d607 Update 2005-05-19 21:54:59 +00:00
antona 4b0bc259ca Minor update to NEWS and remove BK specific ChangeSet file. 2005-05-19 21:51:12 +00:00
antona 56ca79a6d6 Force commits to fix permissions. 2005-05-19 21:49:44 +00:00
antona 1a76cc4821 Change pointer to bkbits to cvs on SF.net. 2005-05-19 21:34:18 +00:00
antona 104d4e6d21 Update copyright to include 2005. 2005-05-19 21:27:30 +00:00
antona 655bcdfa50 Try to add the execute bit that was lost in the BK to CVS conversion. 2005-05-19 20:47:09 +00:00
szaka 1cefeefd61 - hint to the user what to do if the partition is hibernated 2005-05-10 17:00:03 +00:00
szaka fbbefe0c70 - read-write ntfs_mount() returns EPERM if the partition is hibernated 2005-05-10 16:53:48 +00:00
szaka 16ffe6063d - remark that Longhorn uses the same NTFS 3.1 format as XP and W2K3 2005-05-10 16:44:58 +00:00
szaka 1a5e15bb5b - fix handle_undelete() declaration (compiler warning) 2005-05-10 16:37:01 +00:00
cantab.net!aia21 c4761f35bf Update
(Logical change 1.699)
2005-04-25 07:26:08 +00:00
cantab.net!aia21 4ec0dcd627 For a long while asked feature. The attached patch should be against the
latest ntfsprogs snapshot. Includes,

  - ntfsclone: --rescue works at the lowest, sector and not cluster level
    thus more data can be rescued. The contents of the unreadable sectors
    are filled by character '?' and the beginning of such sectors are
    marked as "BadSectoR\0". Thanks to Krishna Mohan Gundu for his help.

  - ntfsclone: fixed an off-by-one error during --metadata in function
    wipe_data().

Szaka

BKrev: 426c9b90FNkcF-oy_jpYpC-q83TwMg
2005-04-25 07:26:08 +00:00
cantab.net!aia21 50bde64860 For a long while asked feature. The attached patch should be against the
latest ntfsprogs snapshot. Includes,

  - ntfsclone: --rescue works at the lowest, sector and not cluster level
    thus more data can be rescued. The contents of the unreadable sectors
    are filled by character '?' and the beginning of such sectors are
    marked as "BadSectoR\0". Thanks to Krishna Mohan Gundu for his help.

  - ntfsclone: fixed an off-by-one error during --metadata in function
    wipe_data().

Szaka

(Logical change 1.699)
2005-04-25 07:26:08 +00:00
cantab.net!aia21 b13242445a Update
(Logical change 1.698)
2005-04-22 13:52:16 +00:00
cantab.net!aia21 307659837c Major rewrite, in particular seek, read, and write related code.
(Logical change 1.698)
2005-04-22 13:52:16 +00:00
cantab.net!aia21 032d26b4d4 Major rewrite of libntfs/win32_io.c and in particular seek, read, and
write related code.  Thanks to Timur Amirkhanov for pointing out to me that
the file position handling was fscked (e.g. mkntfs would create corrupt
volumes as a consequence).  Code is completely untested as I do not have
Cygwin to compile it on...

BKrev: 42690190Z588-jUGrwf4jrHM0KQn4Q
2005-04-22 13:52:16 +00:00
cantab.net!aia21 ac492c10bb update
(Logical change 1.697)
2005-04-19 12:01:38 +00:00
cantab.net!aia21 caabc1a6e3 ntfsresize: fix segfault during filesystem check if NTFS was corrupted
in a way that clusters were referenced outside of the volume.  (Szaka)

BKrev: 4264f322kLK1elKzmWbvyC038CZfdQ
2005-04-19 12:01:38 +00:00
cantab.net!aia21 12d49f4972 fix segfault during filesystem check if NTFS was corrupted
in a way that clusters were referenced outside of the volume.  (Szaka)

(Logical change 1.697)
2005-04-19 12:01:38 +00:00
cantab.net!aia21 b64eacea30 Update with SUSE 9.3 build tools.
BKrev: 4264f2dajuzJzdLKdVen9MeMZL901w
2005-04-19 12:00:26 +00:00
cantab.net!aia21 ac13794c54 Update with SUSE 9.3 build tools.
(Logical change 1.696)
2005-04-19 12:00:26 +00:00
void!yura cef94e5b9f Update my email address
BKrev: 425406d5nQblCrnOTOlfENExATIciQ
2005-04-06 15:57:09 +00:00
void!yura 0ea4c16aa9 Update my email address
(Logical change 1.695)
2005-04-06 15:57:09 +00:00
void!yura 9b0a58972a update
(Logical change 1.694)
2005-04-06 15:47:43 +00:00
void!yura 36f9acd20b nftscp: add ability to specify directory as destination file
BKrev: 4254049fN7qBHuqVSWHfB2RW9JcUqA
2005-04-06 15:47:43 +00:00
void!yura 1465436e8c nftscp: add ability to specify directory as destination file
(Logical change 1.694)
2005-04-06 15:47:43 +00:00
flatcap.org!ntfs 14cd02ffc1 Updates from Holger for regex undelete
Fix up code formatting

(Logical change 1.693)
2005-03-23 13:01:27 +00:00
flatcap.org!ntfs 8bb191b3bc Updates from Holger for regex undelete
BKrev: 424168a7wTQkSHMpz1L2EZoJ0qf-0g
2005-03-23 13:01:27 +00:00
flatcap.org!ntfs 1173ab9c98 Updates from Holger for regex undelete
(Logical change 1.693)
2005-03-23 13:01:27 +00:00
cantab.net!aia21 1327ff636d post-incoming.mail:
Final updates - add bk patch at bottom.

BKrev: 42399463IeMabVOIlym6OACBpx3P8A
2005-03-17 14:29:55 +00:00
cantab.net!aia21 79a057d686 Final updates - add bk patch at bottom.
(Logical change 1.692)
2005-03-17 14:29:55 +00:00
elisa-laajakaista.fi!szaka 51351b843c ntfsclone: make --metadata work with the new $Logfile checking code.
Save at least the first 16 KiB of $Logfile (the two RSTR records
should always be included if present). Save also records used for
checking empty $Logfile.

BKrev: 422a03c9ItD874I8pN-jyUsdbOTlmA
2005-03-05 19:08:57 +00:00
elisa-laajakaista.fi!szaka da1b0e094b ntfsclone: make --metadata work with the new $Logfile checking code.
Save at least the first 16 KiB of $Logfile (the two RSTR records
should always be included if present). Save also records used for
checking empty $Logfile.

(Logical change 1.691)
2005-03-05 19:08:57 +00:00
elisa-laajakaista.fi!szaka c5f5dfb4c3 Make --metadata work with the new $Logfile checking code.
Save at least the first 16 KiB of $Logfile (the two RSTR records
should always be included if present). Save also records used for
checking empty $Logfile. (Szaka)

(Logical change 1.691)
2005-03-05 19:08:57 +00:00
cantab.net!aia21 defa17062c post-incoming.mail:
Another fix.
  (thanks to Yura for spotting - $SUBJECT was broken as $rev
  was not set at the time $SUBJECT was set).

BKrev: 4228ba6aUZSEBSCULwr8KSKdFrrnjg
2005-03-04 19:43:38 +00:00
cantab.net!aia21 c84780235a Another fix.
(thanks to Yura for spotting - $SUBJECT was broken as $rev
was not set at the time $SUBJECT was set).

(Logical change 1.690)
2005-03-04 19:43:38 +00:00
cantab.net!aia21 54feb7fd76 post-incoming.mail:
Change reply to to be ntfs-dev rather than me.
  Thanks to Yura for suggestion.

BKrev: 422875ccCILxnmh8RlaO2fwrhuEL2g
2005-03-04 14:50:52 +00:00
cantab.net!aia21 fb8870b110 Change reply to to be ntfs-dev rather than me.
Thanks to Yura for suggestion.

(Logical change 1.689)
2005-03-04 14:50:52 +00:00
cantab.net!aia21 5219ebb9d4 Update for testing of mail trigger.
(Logical change 1.688)
2005-03-04 09:55:48 +00:00
cantab.net!aia21 304f2cb271 TODO.libntfs:
Update for testing of mail trigger.

BKrev: 422830a4jrPNQqy0AewDatkaVbvSpA
2005-03-04 09:55:48 +00:00
cantab.net!aia21 818d28e9e0 post-incoming.mail:
Update to use mail instead of sendmail and to not set the from address.  Set the reply-to address instead.

BKrev: 4228303aU1gillVzr6_TF4yxpitRlw
2005-03-04 09:54:02 +00:00
cantab.net!aia21 f31be4c723 Update to use mail instead of sendmail and to not set the from address. Set the reply-to address instead.
(Logical change 1.687)
2005-03-04 09:54:02 +00:00
cantab.net!aia21 19b8d3c7d1 Update
(Logical change 1.686)
2005-03-03 23:57:13 +00:00
cantab.net!aia21 4c5e25dec6 ChangeLog:
Update

BKrev: 4227a459SlEUu3hEtFrIh-6TGmERVA
2005-03-03 23:57:13 +00:00
cantab.net!aia21 6564e30222 post-incoming.mail:
A trigger script that will only work on bkbits.net and on a successful
	push to bkbits repository will email to the linux-ntfs-cvs list all
	the changesets that were pushed (one changeset per email).
	Lets hope bkbits.net will allow sending of email...

BKrev: 4227a2f13rs39mKM8X7rXoigEfr1MA
2005-03-03 23:51:13 +00:00
cantab.net!aia21 156b261684 (Logical change 1.685) 2005-03-03 23:51:13 +00:00
cantab.net!aia21 43c5886527 Initial revision 2005-03-03 23:51:13 +00:00
cantab.net!aia21 4710f94556 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2005/02/21 16:08:33+00:00 cantab.net!aia21
Makefile.am:
  Fix from Christophe Grenier: some versions of make
  do not accept -C switch.

BKrev: 4226f7a4bxHFmOj7JovIaxsG6Cuk9g
2005-03-03 11:40:20 +00:00
cantab.net!aia21 6728963c80 Fix from Christophe Grenier: some versions of make
do not accept -C switch.

(Logical change 1.684)
2005-03-03 11:40:20 +00:00
elisa-laajakaista.fi!szaka 6ba06e46af ntfsfix: fix invalid mft records in $MFTMirr.
BKrev: 4224f698endjkUqfVbh7JtpoyGL1EQ
2005-03-01 23:11:20 +00:00
elisa-laajakaista.fi!szaka 420c3cb606 ntfsfix: fix invalid mft records in $MFTMirr.
(Logical change 1.683)
2005-03-01 23:11:20 +00:00
elisa-laajakaista.fi!szaka 52fa43efb8 Fix invalid mft records in $MFTMirr.
(Logical change 1.683)
2005-03-01 23:11:20 +00:00
elisa-laajakaista.fi!szaka 356c6a696a ntfsclone: added a new option, --rescue. It ignores read errors
so disks having bad sectors (dying disks) can be rescued. The content
of the cluster having bad sectors is filled by character '2' and the
start of the cluster is marked by "BadClusteR".

BKrev: 4224e310P8YT4an8mcedLrCIP9tSCA
2005-03-01 21:48:00 +00:00
elisa-laajakaista.fi!szaka cb2cd394b3 ntfsclone: added a new option, --rescue. It ignores read errors
so disks having bad sectors (dying disks) can be rescued. The content
of the cluster having bad sectors is filled by character '2' and the
start of the cluster is marked by "BadClusteR".

(Logical change 1.682)
2005-03-01 21:48:00 +00:00
elisa-laajakaista.fi!szaka f1780f9d64 Added a new option, --rescue. It ignores read errors so disks having
bad sectors (dying disks) can be rescued. The content of the cluster
having bad sectors is filled by character '2' and the start of the
cluster is marked by "BadClusteR".

(Logical change 1.682)
2005-03-01 21:48:00 +00:00
elisa-laajakaista.fi!szaka 741f6c537d ntfsclone: added a new option, --ignore-fs-check. It can be used only with
the --metadata option. The clusters causing the inconsistency are saved too.

BKrev: 42236fa8GQE3SOjV9ne1Sq-No6GQnA
2005-02-28 19:23:20 +00:00
elisa-laajakaista.fi!szaka 5d86dff231 ntfsclone: added a new option, --ignore-fs-check. It can be used only with
the --metadata option. The clusters causing the inconsistency are saved too.

(Logical change 1.681)
2005-02-28 19:23:20 +00:00
elisa-laajakaista.fi!szaka 1d176ad7e0 Added a new option, --ignore-fs-check. It can be used only with the --metadata option. The clusters causing the inconsistency are saved too.
(Logical change 1.681)
2005-02-28 19:23:20 +00:00
elisa-laajakaista.fi!szaka 7124baccf9 ntfsfix: empty journal and mark volume dirty for chkdsk if ntfs_mount failed. This makes read-write mounting of NTFS metadata images possible by
ntfsprogs and the kernel driver what were created by versions of ntfsclone previous than 2.0.0.

BKrev: 42190d46Qu5r-ZIsesz9vi1f1qtyWg
2005-02-20 22:20:54 +00:00
elisa-laajakaista.fi!szaka c65b34b709 ntfsfix: empty journal and mark volume dirty for chkdsk if ntfs_mount failed. This makes read-write mounting of NTFS metadata images possible by
ntfsprogs and the kernel driver what were created by versions of ntfsclone previous than 2.0.0.

(Logical change 1.680)
2005-02-20 22:20:54 +00:00
elisa-laajakaista.fi!szaka bef59fbd6e Empty journal and mark volume dirty for chkdsk if ntfs_mount failed. This makes read-write mounting of NTFS metadata images possible by
ntfsprogs and the kernel driver what were created by versions of ntfsclone previous than 2.0.0.

(Logical change 1.680)
2005-02-20 22:20:54 +00:00
elisa-laajakaista.fi!szaka f6a7caf21d use getopt, added --help and --version, some output cleanup
(Logical change 1.679)
2005-02-19 19:34:37 +00:00
elisa-laajakaista.fi!szaka 5a6cca21d6 ntfsfix: use getopt, added --help and --version, some output cleanup
BKrev: 421794cdiFigoKPnuBWmBZvI6fQZhg
2005-02-19 19:34:37 +00:00
elisa-laajakaista.fi!szaka e9159478ea ntfsfix: use getopt, added --help and --version, some output cleanup
(Logical change 1.679)
2005-02-19 19:34:37 +00:00
void!yura 95880b7e7e Fix memleak in ntfs_attr_update_mapping_pairs
BKrev: 4214dc14MoItzDP41J0WsUdHOpxgpA
2005-02-17 18:01:56 +00:00
void!yura 03a03359a1 Fix memleak in ntfs_attr_update_mapping_pairs
(Logical change 1.678)
2005-02-17 18:01:56 +00:00
cantab.net!aia21 b6b7655c55 Update
(Logical change 1.677)
2005-02-17 17:03:50 +00:00
cantab.net!aia21 a4ffebf8cc Fix a nasty runlist merge bug when merging two holes. (Anton)
BKrev: 4214ce76fM5rgprlNMJANEjBqiYW5A
2005-02-17 17:03:50 +00:00
cantab.net!aia21 9028469456 Fix a nasty runlist merge bug when merging two holes. (Anton)
(Logical change 1.677)
2005-02-17 17:03:50 +00:00
void!yura 942f72b655 ntfsprogs/ntfsinfo.c
I completely forgot about mst protection when I was writing index dumping code. Fix this.

BKrev: 42090daa4A9PHd3jWSO20LUW-xKjkg
2005-02-08 19:06:18 +00:00
void!yura 5180f05279 I completely forgot about mst protection when I was writing index dumping code. Fix this.
(Logical change 1.676)
2005-02-08 19:06:18 +00:00
void!yura ba6a74ea79 ntfscp: Added SIGINT (Ctrl+C) handler, improved error handling in
sync failed case.  (Yura)

BKrev: 4207d317Q2Kubdv8apElMfrJP4gonA
2005-02-07 20:44:07 +00:00
void!yura b8da6570e0 ntfscp: Added SIGINT (Ctrl+C) handler, improved error handling in
sync failed case.  (Yura)

(Logical change 1.675)
2005-02-07 20:44:07 +00:00
elisa-laajakaista.fi!szaka 77e10d23f6 ntfsclone manual: exit codes are documented
BKrev: 420156fbAdW-ZDk7dNjWn3-b1ciQXw
2005-02-02 22:40:59 +00:00
elisa-laajakaista.fi!szaka 3244499edb document exit codes
(Logical change 1.674)
2005-02-02 22:40:59 +00:00
void!yura 8e54c3eb91 don't check logfile for readonly mounts
BKrev: 41ffc9c9Kytrl_hpghI33W2lQp80aw
2005-02-01 18:26:17 +00:00
void!yura 51a83b1699 don't check logfile for readonly mounts
(Logical change 1.673)
2005-02-01 18:26:17 +00:00
void!yura d5eac44ab9 update
(Logical change 1.672)
2005-01-30 18:13:25 +00:00
void!yura 0a16746ca2 remove logfile reset
(Logical change 1.672)
2005-01-30 18:13:25 +00:00
void!yura da9448455b integrate logfile checking with mount and remove logfile reset in ntfs{cp,wipe}
BKrev: 41fd23c5jaIWucfAYQS-WvoWvD4yQg
2005-01-30 18:13:25 +00:00
void!yura 3ca5f1fc5d integrate logfile checking with mount
(Logical change 1.672)
2005-01-30 18:13:25 +00:00
void!yura 036213cece I realized that my previous chanset fixed one bug, but introduced new one.
This will fix both (I hope) and beautificaty function look a bit.

BKrev: 41fa42a3oQCyXLav2cTUU_9dBinuqQ
2005-01-28 13:48:19 +00:00
void!yura ed945d174c I realized that my previous chanset fixed one bug, but introduced new one.
This will fix both (I hope) and beautificaty function look a bit.

(Logical change 1.671)
2005-01-28 13:48:19 +00:00
void!yura a40e33ca54 Fix rare occuring bug in ntfs_attrlist_entry_add. Read updated comment if interesting.
BKrev: 41f9347fAv2hbWDbzN33FjccJQO2Wg
2005-01-27 18:35:43 +00:00
void!yura 03dcb59a6b Fix rare occuring bug in ntfs_attrlist_entry_add. Read updated comment if interesting.
(Logical change 1.670)
2005-01-27 18:35:43 +00:00
void!yura bec7bec3fd ntfs_inode_attach_all_extents: don't try to attach base inode to itself and optimize algorithm a bit.
BKrev: 41f9336ceOEH9Zh792NjnqZbQunoyw
2005-01-27 18:31:08 +00:00
void!yura 98ac77e115 ntfs_inode_attach_all_extents: don't try to attach base inode to itself and optimize algorithm a bit.
(Logical change 1.669)
2005-01-27 18:31:08 +00:00
void!yura 3d44967a5d fix return value of ntfscp
BKrev: 41f8f23eUfbD4PZBBplD8MHSYBV_Hg
2005-01-27 13:53:02 +00:00
void!yura b03f4a6ec7 fix return value of ntfscp
(Logical change 1.668)
2005-01-27 13:53:02 +00:00
void!yura ec9d6fb631 Fix stupid bug trying to sync standard information for not base inode.
BKrev: 41f829b59clwRDNpWZQZSi9SCP7ANQ
2005-01-26 23:37:25 +00:00
void!yura e89f48810a Fix stupid bug trying to sync standard information for not base inode.
(Logical change 1.667)
2005-01-26 23:37:25 +00:00
void!yura 5a3d9dc1e7 include/ntfs/logfile.h
Export functions from logfile.c.
include/ntfs/volume.h
    Add LogFileEmpty to volume flags.
libntfs/volume.c
    Make ntfs_logfile_reset use ntfs_empty_logfile.
libntfs/logfile.c
    Port logfile cheking from kernel to library.

BKrev: 41f6bd059nd7bi-4x4l68wcxmkToPg
2005-01-25 21:41:25 +00:00
void!yura 1354e9b446 Update.
(Logical change 1.666)
2005-01-25 21:41:25 +00:00
void!yura 317f6f4b62 Make ntfs_logfile_reset use ntfs_empty_logfile.
(Logical change 1.666)
2005-01-25 21:41:25 +00:00
void!yura e2ed469c89 Initial revision 2005-01-25 21:41:25 +00:00
void!yura 3b95cca52c Export functions from logfile.c.
(Logical change 1.666)
2005-01-25 21:41:25 +00:00
void!yura ce10af07a3 Add LogFileEmpty to volume flags.
(Logical change 1.666)
2005-01-25 21:41:25 +00:00
void!yura 0def64e981 (Logical change 1.666) 2005-01-25 21:41:25 +00:00
void!yura 28ece97041 Add logfile.c to build
BKrev: 41f6a22bNT0wqtIFbCtBzwnI5LYmkg
2005-01-25 19:46:51 +00:00
void!yura 39e6fa1339 Add logfile.c to build
(Logical change 1.665)
2005-01-25 19:46:51 +00:00
cantab.net!aia21 db616a258b Fix type casts after Yura's prototype changes.
BKrev: 41ee3712inb3MBnjx8VQvosLYW6dmw
2005-01-19 10:31:46 +00:00
cantab.net!aia21 9fca23feb2 Fix type casts after Yura's prototype changes.
(Logical change 1.664)
2005-01-19 10:31:46 +00:00
void!yura cdbe8ff9cd fix gcc4 warnings in attrib.c
BKrev: 41ebd418KvjyVtRX0RBqA4U86B4oKA
2005-01-17 15:04:56 +00:00
void!yura 668403c146 fix gcc4 warnings in attrib.c
(Logical change 1.663)
2005-01-17 15:04:56 +00:00
void!yura 59ef20eb76 fix some complier warning in mkntfs
BKrev: 41ebd2e8SmcjY0GAm-qtPIHbwCot6g
2005-01-17 14:59:52 +00:00
void!yura d162076f14 fix some complier warning in mkntfs
(Logical change 1.662)
2005-01-17 14:59:52 +00:00
void!yura baa43516ce fix bug spotted bug gcc4 in error handling of ntfsinfo
BKrev: 41eba9d5TrJErKTr8O-5B1scjpl0ng
2005-01-17 12:04:37 +00:00
void!yura 0a68326fc6 fix bug spotted bug gcc4 in error handling of ntfsinfo
(Logical change 1.661)
2005-01-17 12:04:37 +00:00
void!yura cb9689d421 change prototypes of ntfs_write_significant_bytes and
ntfs_mapping_pairs_build to fix a lot of compiler warnings.

BKrev: 41eba869TOtqC6gWYMfaBlcxOkAQ4A
2005-01-17 11:58:33 +00:00
void!yura 954c8d121e change prototypes of ntfs_write_significant_bytes and
ntfs_mapping_pairs_build to fix a lot of compiler warnings.

(Logical change 1.660)
2005-01-17 11:58:33 +00:00
void!yura 6853d9c4f3 fix compiler warning about ntfs_inode_sync_standard_information
BKrev: 41eba68c6ODPYdC8QMNOMW9ODpaf4A
2005-01-17 11:50:36 +00:00
void!yura 3dd3b08b07 fix compiler warning about ntfs_inode_sync_standard_information
(Logical change 1.659)
2005-01-17 11:50:36 +00:00
void!yura f4924c7655 offsetof already defined in stddef.h in gcc4, so add check to prevent redefinition.
BKrev: 41eba598pDkLIlngKM_xFU-DD3sM1Q
2005-01-17 11:46:32 +00:00
void!yura a82280f235 offsetof already defined in stddef.h in gcc4, so add check to prevent redefinition.
(Logical change 1.658)
2005-01-17 11:46:32 +00:00
(none)!yura 84fccf8a8b Fix bug that I introduced in changeset 1.495 sle{16,32,64} should be u{16,32,64} not s{16,32,64}.
BKrev: 41e6a98eTs0UY8wiH-gemb4Ft7owCA
2005-01-13 17:02:06 +00:00
(none)!yura fdfb1ea71a Fix bug that I introduced in changeset 1.495 sle{16,32,64} should be u{16,32,64} not s{16,32,64}.
(Logical change 1.657)
2005-01-13 17:02:06 +00:00
(none)!yura d77c4c3f1a Update logfile.h to be sync with kernel. Update ntfsdump_logfile accordingly.
BKrev: 41e699e30QMMtcmAeX1saJVCULGwoA
2005-01-13 15:55:15 +00:00
(none)!yura 1be3d9fe66 Update logfile.h to be sync with kernel. Update ntfsdump_logfile accordingly.
(Logical change 1.656)
2005-01-13 15:55:15 +00:00
(none)!yura fc903141f8 add {s,}le{16,32,64} and le{VCN,LCN,LSN} to include/ntfs/types.h
BKrev: 41e6947eaBR5d3hrshHMBBiadTpMvw
2005-01-13 15:32:14 +00:00
(none)!yura 925de23711 add {s,}le{16,32,64} and le{VCN,LCN,LSN} to include/ntfs/types.h
(Logical change 1.655)
2005-01-13 15:32:14 +00:00
cantab.net!aia21 3a159392e3 Update to more recent build tools.
BKrev: 41e645e8dAeNqi46ZFzGbDvRRJGXYg
2005-01-13 09:56:56 +00:00
cantab.net!aia21 a05c3cc3e1 Update to more recent build tools.
(Logical change 1.654)
2005-01-13 09:56:56 +00:00
(none)!yura 08293a1a28 Rename NTFS_SECTOR_SIZE to NTFS_BLOCK_SIZE to keep in sync with kernel driver.
BKrev: 41e436ecw_gRdvsNI5O_80WR0Gaizg
2005-01-11 20:28:28 +00:00
(none)!yura 14db887f8e Rename NTFS_SECTOR_SIZE to NTFS_BLOCK_SIZE to keep in sync with kernel driver.
(Logical change 1.653)
2005-01-11 20:28:28 +00:00
(none)!yura eab699277f Fix potential bug in ntfs_inode_sync_standard_information (potential,
because standard information seems always to be in the base mft record)

BKrev: 41caabaakKs29-8ja4gdzl-QNV_1EQ
2004-12-23 11:27:38 +00:00
(none)!yura 81fd8478ff Fix potential bug in ntfs_inode_sync_standard_information (potential,
because standard information seems always to be in the base mft record)

(Logical change 1.652)
2004-12-23 11:27:38 +00:00
(none)!yura b86f85b7f1 Update.
(Logical change 1.651)
2004-12-22 18:06:07 +00:00
(none)!yura f3d6f4c509 Update standard information during inode sync.
BKrev: 41c9b78fWhDoeYhhQ88S2erLCWWtGA
2004-12-22 18:06:07 +00:00
(none)!yura 59a2803283 Update standard information during inode sync.
(Logical change 1.651)
2004-12-22 18:06:07 +00:00
(none)!yura be6b3c9bdd attrib.c: I understood that it's safe to uncomment some pieces of code.
BKrev: 41c9a406U4cuL4pvCIZaVzQ_Ck-YCg
2004-12-22 16:42:46 +00:00
(none)!yura 48dee17d12 I understood that it's safe to uncomment some pieces of code.
(Logical change 1.650)
2004-12-22 16:42:46 +00:00
(none)!yura 29e21e6833 Fix error message in NAttrSet##flag: should not be called for not data attributes.
BKrev: 41c9a1fa1DY9yWJzdou2x9g6dVCHDQ
2004-12-22 16:34:02 +00:00
(none)!yura 8d8b53331f Fix error message in NAttrSet##flag: should not be called for not data attributes.
(Logical change 1.649)
2004-12-22 16:34:02 +00:00
(none)!yura a35819aceb Set NIno{Compressed,Sparse,Encrypted} during ntfs_inode_open
BKrev: 41c99e03NjRVGmr9sydCgZU6DMqq9Q
2004-12-22 16:17:07 +00:00
(none)!yura 5325a7c608 Set NIno{Compressed,Sparse,Encrypted} during ntfs_inode_open
(Logical change 1.648)
2004-12-22 16:17:07 +00:00
cantab.net!aia21 a49787860d Manual merge
2004/12/22 12:40:19+02:00 (none)!yura
ntfsinfo: dump flags names for STANDARD_INFORMATION and FILE_NAME.

BKrev: 41c98342kN_XIzHVKErey7McLiNzzA
2004-12-22 14:22:58 +00:00
cantab.net!aia21 cabfe89386 Manual merge
2004/12/22 12:40:19+02:00 (none)!yura
Update.

(Logical change 1.647)
2004-12-22 14:22:58 +00:00
(none)!yura 88f940caed ntfsinfo: dump flags names for STANDARD_INFORMATION and FILE_NAME.
(Logical change 1.647)
2004-12-22 14:22:58 +00:00
cantab.net!aia21 19fbf5b490 Update
(Logical change 1.646)
2004-12-22 14:22:09 +00:00
cantab.net!aia21 4a54f5e714 Rename/move inode.[hc]::ntfs_inode_{add,rm}_attr() to
attrib.[hc]::ntfs_attr_{add,rm}(), respectively.  (Anton)

BKrev: 41c98311ZQbTDnqH0udx3c4vncCSig
2004-12-22 14:22:09 +00:00
cantab.net!aia21 140a6d2479 Rename/move inode.[hc]::ntfs_inode_{add,rm}_attr() to
attrib.[hc]::ntfs_attr_{add,rm}(), respectively.  (Anton)

(Logical change 1.646)
2004-12-22 14:22:09 +00:00
cantab.net!aia21 b12041e518 Update
(Logical change 1.645)
2004-12-22 14:04:41 +00:00
cantab.net!aia21 d1e57fd633 Move NAttr{Sparse,Compressed,Encrypted} to inode struct preserving
the previous interface.  (Yura, with fixes from Anton)

BKrev: 41c97ef9o2yO3PbIh3WejVzzMMIETg
2004-12-22 14:04:41 +00:00
cantab.net!aia21 db7c9da42f Move NAttr{Sparse,Compressed,Encrypted} to inode struct preserving
the previous interface.  (Yura, with fixes from Anton)

(Logical change 1.645)
2004-12-22 14:04:41 +00:00
cantab.net!aia21 003b867d71 Update build for change to configure.ac.
(Logical change 1.644)
2004-12-17 14:41:57 +00:00
cantab.net!aia21 61f74f81f1 Patch for a better compilation under NT 4 that lacks
SetFilePointerEx and FSCTL_GET_NTFS_VOLUME_DATA.  (Christophe)

BKrev: 41c2f035meU-oiQolFwOAFIV7OeCPQ
2004-12-17 14:41:57 +00:00
cantab.net!aia21 725e19422c Patch for a better compilation under NT 4 that lacks
SetFilePointerEx and FSCTL_GET_NTFS_VOLUME_DATA.  (Christophe)

(Logical change 1.644)
2004-12-17 14:41:57 +00:00
cantab.net!aia21 1c1a2f2af9 Add check for SetFilePointerEx. (Christophe)
(Logical change 1.644)
2004-12-17 14:41:57 +00:00
(none)!yura 48a398a6e6 ntfsinfo: print "file attributes" field for $FILE_NAME attribute.
BKrev: 41a86300PYEgxUP939fHbd_BBfyubA
2004-11-27 11:20:32 +00:00
(none)!yura ff195c0f84 ntfsinfo: print "file attributes" field for $FILE_NAME attribute.
(Logical change 1.643)
2004-11-27 11:20:32 +00:00
(none)!yura 96ff6fe960 Implement attribute move out in case attribute is to small to add
compressed_size field to it and we have no free space in the current
mft record.

BKrev: 41a09a81ODSa1CLrpjjK6e74PN2jnQ
2004-11-21 13:39:13 +00:00
(none)!yura 173cbd1d54 Implement attribute move out in case attribute is to small to add
compressed_size field to it and we have no free space in the current
mft record.

(Logical change 1.642)
2004-11-21 13:39:13 +00:00
(none)!yura 8dcb7e6852 Fix bug in ntfs_inode_add_attr.
BKrev: 41a08ab7g4spRz9gpwxtXxFf5jSrKw
2004-11-21 12:31:51 +00:00
(none)!yura 9c6cce1bf2 Fix bug in ntfs_inode_add_attr.
(Logical change 1.641)
2004-11-21 12:31:51 +00:00
(none)!yura 8b719cc327 Fix format string in ntfs_rl_sparse and ntfs_rl_get_compressed_size.
BKrev: 41a08a7dvbuXnY0ZiKG1i8FynnTz3Q
2004-11-21 12:30:53 +00:00
(none)!yura 2afeb1523d Fix format string in ntfs_rl_sparse and ntfs_rl_get_compressed_size.
(Logical change 1.640)
2004-11-21 12:30:53 +00:00
(none)!yura a6ab2850c8 Add @extra parameter to ntfs_attr_record_move_away. New attribute record
holder must have free @extra bytes after moving attribute record to it.

BKrev: 41a07845skJ0l_pdf42AEMl_Si5boQ
2004-11-21 11:13:09 +00:00
(none)!yura e2ba16e3db Add @extra parameter to ntfs_attr_record_move_away. New attribute record
holder must have free @extra bytes after moving attribute record to it.

(Logical change 1.639)
2004-11-21 11:13:09 +00:00
(none)!yura b41f4cee48 Minor fix to ntfscp manual.
BKrev: 41a073faMCe2qBZzDNeaZPeniq5L2A
2004-11-21 10:54:50 +00:00
(none)!yura 0ba0971e01 Minor fix to ntfscp manual.
(Logical change 1.638)
2004-11-21 10:54:50 +00:00
(none)!yura 502c6fec99 Rename layout.h::ATTR_RECORD::{compressed_non_,non_,}resident_attr_end
to more shorter {non_,}resident_end and compressed_end.

BKrev: 41a073a252tDwjKVM6s63XUHqvNcSA
2004-11-21 10:53:22 +00:00
(none)!yura a6258ef736 Rename layout.h::ATTR_RECORD::{compressed_non_,non_,}resident_attr_end
to more shorter {non_,}resident_end and compressed_end.

(Logical change 1.637)
2004-11-21 10:53:22 +00:00
(none)!yura 46f3161850 fix ntfs_rl_sparse and ntfs_rl_get_compressed_size name in their comments
BKrev: 419675c0D20MWzCvwt_DdbcT2SV13w
2004-11-13 20:59:44 +00:00
(none)!yura 793120bfb6 fix ntfs_rl_sparse and ntfs_rl_get_compressed_size name in their comments
(Logical change 1.636)
2004-11-13 20:59:44 +00:00
cantab.net!aia21 160532d4d4 runlist.c:
Fix bug in ntfs_rl_get_compressed_size() and optimize it a bit.

BKrev: 4195c762muNP0_1nHUpkjuegERrApw
2004-11-13 08:35:46 +00:00
cantab.net!aia21 cdf56dbe79 Fix bug in ntfs_rl_get_compressed_size() and optimize it a bit.
(Logical change 1.635)
2004-11-13 08:35:46 +00:00
(none)!yura 44287b3105 Implement code that set/clean sparse bit. But I have to disable it for now
(look to the comment of the ntfs_attr_update_mapping_pairs).

BKrev: 4194f3c7Jt4ZLN9W3PTgygzllzTDLA
2004-11-12 17:32:55 +00:00
(none)!yura 4ae8b449af Implement code that set/clean sparse bit. But I have to disable it for now
(look to the comment of the ntfs_attr_update_mapping_pairs).

(Logical change 1.634)
2004-11-12 17:32:55 +00:00
(none)!yura 73ea11fafe Endians fix in ntfs_attrlist_entry_add.
BKrev: 4194eea06J3yMkpJJgvYMX_5eQobGA
2004-11-12 17:10:56 +00:00
(none)!yura 339c87da38 Endians fix in ntfs_attrlist_entry_add.
(Logical change 1.633)
2004-11-12 17:10:56 +00:00
(none)!yura 2a2aecdb2a Update.
(Logical change 1.632)
2004-11-12 17:09:24 +00:00
(none)!yura 5adfb1d473 New API's ntfs_runlist_sparse and ntfs_rl_get_compressed_size.
BKrev: 4194ee4441icGuSxPWAw60S_Ndw3sA
2004-11-12 17:09:24 +00:00
(none)!yura 38be5f3e95 New API's ntfs_runlist_sparse and ntfs_rl_get_compressed_size.
(Logical change 1.632)
2004-11-12 17:09:24 +00:00
(none)!yura 9a7dd7f07b Add prototypes.
(Logical change 1.632)
2004-11-12 17:09:24 +00:00
(none)!yura a7e52eb84c Comments and message fixes in ntfs_attr_update_mapping_pairs.
BKrev: 41923d62hSjdSzc1dqBNcmzXQ46tJg
2004-11-10 16:10:10 +00:00
(none)!yura 9afb493617 Comments and message fixes in ntfs_attr_update_mapping_pairs.
(Logical change 1.631)
2004-11-10 16:10:10 +00:00
(none)!yura 5e6279ea44 update
(Logical change 1.630)
2004-11-06 23:40:05 +00:00
(none)!yura ae2a0dcd67 Update TODO.libntfs
BKrev: 418d60d5od7UkKq7DTZz0Okf-Hn-Iw
2004-11-06 23:40:05 +00:00
(none)!yura eff8a17e3a fix some paths of attribute instantiating code
BKrev: 418bf414UJJePYorUIy0Csa9zfpqsQ
2004-11-05 21:43:48 +00:00
(none)!yura c99889736e fix some paths of attribute instantiating code
(Logical change 1.629)
2004-11-05 21:43:48 +00:00
(none)!yura 162bfe84ea Change prototype of ntfs_cluster_alloc like in kernel driver.
BKrev: 418bdc48J4yw6vJL6qRVfoNUCsHDzA
2004-11-05 20:02:16 +00:00
(none)!yura 1c283737c5 Change prototype of ntfs_cluster_alloc like in kernel driver.
(Logical change 1.628)
2004-11-05 20:02:16 +00:00
(none)!yura 77802ca092 Update
(Logical change 1.627)
2004-11-05 19:53:34 +00:00
(none)!yura 9d2f97b1a6 - ntfs_attr_pwrite now can instantiate holes
- modify ntfs_non_resident_attr_expand to add sparse runs

BKrev: 418bda3eH2ZS7J2hnWNdlPI3lJiQPQ
2004-11-05 19:53:34 +00:00
(none)!yura 93d9ed05aa - ntfs_attr_pwrite now can instantiate holes
- modify ntfs_non_resident_attr_expand to add sparse runs

(Logical change 1.627)
2004-11-05 19:53:34 +00:00
(none)!yura 4ae0866f34 Update outdated ENOTSUP return values.
BKrev: 418b8ea4B1JACzPBhKfPdRIblGRfUA
2004-11-05 14:31:00 +00:00
(none)!yura e7f6573732 Update outdated ENOTSUP return values.
(Logical change 1.626)
2004-11-05 14:31:00 +00:00
(none)!yura 377a40152c small cleanup
(Logical change 1.625)
2004-11-05 13:54:34 +00:00
(none)!yura df4d60490a ntfs_attr_pwrite: write zeros between initializes_size and @pos if needed.
BKrev: 418b861a2TW-S8wn3PQCJK7qfVP4FQ
2004-11-05 13:54:34 +00:00
(none)!yura 8073aaff7d ntfs_attr_pwrite: write zeros between initializes_size and @pos if needed.
(Logical change 1.625)
2004-11-05 13:54:34 +00:00
(none)!yura 77dcf60585 Implement writing beyond data_size in ntfs_attr_pwrite.
BKrev: 418b6a03Nyjy4m8jNKZ70Qd-Q1N84A
2004-11-05 11:54:43 +00:00
(none)!yura 3bfc11a073 Implement writing beyond data_size in ntfs_attr_pwrite.
(Logical change 1.624)
2004-11-05 11:54:43 +00:00
(none)!yura 65ae70558f cleanup to attrib.c
BKrev: 418a502dPJSc01KTwJVX-25nywiQ_g
2004-11-04 15:52:13 +00:00
(none)!yura 104b710f20 cleanup to attrib.c
(Logical change 1.623)
2004-11-04 15:52:13 +00:00
(none)!yura c12b94b680 libntfs/attrib.c
Remove check that prevent attributes in inodes with attribute list become resident from ntfs_attr_make_resident.
    Bugfix and cleanups for ntfs_attr_make_resident.
libntfs/inode.c
    Fix determine of resident or not should be new attribute in ntfs_inode_add_attr.

BKrev: 418a4d46ONTb_ji4e2MwdUXQK5YApQ
2004-11-04 15:39:50 +00:00
(none)!yura 8b1c81fd64 Remove check that prevent attributes in inodes with attribute list become resident from ntfs_attr_make_resident.
Bugfix and cleanups to ntfs_attr_make_resident.

(Logical change 1.622)
2004-11-04 15:39:50 +00:00
(none)!yura a90e99ff95 Fix determine of resident or not should be new attribute in ntfs_inode_add_attr.
(Logical change 1.622)
2004-11-04 15:39:50 +00:00
(none)!yura acacc69673 Remove unused function ntfs_rl_merge. (Thanks to Adrian Bunk for spoting it)
BKrev: 41838d5fYDusPYs9U9n0NfxXm37MwQ
2004-10-30 12:47:27 +00:00
(none)!yura 415693011c Remove unused function ntfs_rl_merge. (Thanks to Adrian Bunk for spoting it)
(Logical change 1.621)
2004-10-30 12:47:27 +00:00
(none)!yura 6e0d6ad83a remove unused code from ntfs_resident_attr_value_resize
BKrev: 4176a37cZ_r7R0Ln3gE60EIKfwZKCA
2004-10-20 17:42:20 +00:00
(none)!yura b47cb7aa81 remove unused code from ntfs_resident_attr_value_resize
(Logical change 1.620)
2004-10-20 17:42:20 +00:00
(none)!yura ee0450214c fix stupid bug in ntfs_attr_truncate
BKrev: 41741b122DNVWax83-TEbjTn7liF0g
2004-10-18 19:35:46 +00:00
(none)!yura fb156edd1a fix stupid bug in ntfs_attr_truncate
(Logical change 1.619)
2004-10-18 19:35:46 +00:00
(none)!yura 89e2179873 add proper rollback to ntfs_inode_add_attrlist
BKrev: 4173f079PUTHIaPQJeJcLxYSyORTrQ
2004-10-18 16:34:01 +00:00
(none)!yura 7df47f7703 add proper rollback to ntfs_inode_add_attrlist
(Logical change 1.618)
2004-10-18 16:34:01 +00:00
cantab.net!aia21 a4da04e601 mkntfs.c: Change block to from unsigned long to unsigned long long in
append_to_bad_blocks() and mkntfs_fill_device_with_zeroes().
ntfsclone: Fix compiler warning.

BKrev: 417399d9oeRjVdMzFJsvAA9PiVndDA
2004-10-18 10:24:25 +00:00
cantab.net!aia21 3009ea72ab Fix compiler warning.
(Logical change 1.617)
2004-10-18 10:24:25 +00:00
cantab.net!aia21 781e041a1f Change block to from unsigned long to unsigned long long in
append_to_bad_blocks() and mkntfs_fill_device_with_zeroes().

(Logical change 1.617)
2004-10-18 10:24:25 +00:00
(none)!yura 359d4200f0 replace 0 with NULL where applicable in the attrib.c, attrlist.c, inode.c
BKrev: 41739429kLNSj8xDB3WSYAIs4lmr-A
2004-10-18 10:00:09 +00:00
(none)!yura 135a0559c8 replace 0 with NULL where applicable
(Logical change 1.616)
2004-10-18 10:00:09 +00:00
(none)!yura 111985f640 - Remove attrlist.[ch]::ntfs_attrlist_set because it was very bad idea to separate it from ntfs_attrlist_entry_{add,rm}.
- Update ntfs_attrlist_entry_{add,rm} and ntfs_inode_add_attrlist to work without it.
- Some other fixes, improvements and cleanups.

BKrev: 41729637NPxuXPAjFk50pAF9xvH8wA
2004-10-17 15:56:39 +00:00
(none)!yura 3cb8b787bd - Remove attrlist.[ch]::ntfs_attrlist_set because it was very bad idea to separate it from ntfs_attrlist_entry_{add,rm}.
- Update ntfs_attrlist_entry_{add,rm} and ntfs_inode_add_attrlist to work without it.
- Some other fixes, improvements and cleanups.

(Logical change 1.615)
2004-10-17 15:56:39 +00:00
(none)!yura 758dcd21ce Validate attribute type in ntfs_inode_add_attr().
BKrev: 4172405dY0oM8MxEI_-3zKcJoWh9Og
2004-10-17 09:50:21 +00:00
(none)!yura 827ed37ec3 Validate attribute type in ntfs_inode_add_attr().
(Logical change 1.614)
2004-10-17 09:50:21 +00:00
(none)!yura c59b032f7e update
(Logical change 1.613)
2004-10-15 11:38:45 +00:00
(none)!yura 1ff0764a9a make a bit more beautiful assignment in ntfs_non_resident_attr_record_add
(Logical change 1.613)
2004-10-15 11:38:45 +00:00
(none)!yura da44d62de5 libntfs/inode.c
add new api ntfs_inode_rm_attr

BKrev: 416fb6c5UJo6r-ccGM42THTliC4E7Q
2004-10-15 11:38:45 +00:00
(none)!yura 38c81c83f2 add ntfs_inode_rm_attr prototype
(Logical change 1.613)
2004-10-15 11:38:45 +00:00
(none)!yura 28cdf0d524 add new api ntfs_inode_rm_attr
(Logical change 1.613)
2004-10-15 11:38:45 +00:00
(none)!yura 5d5f6497e9 update
(Logical change 1.612)
2004-10-14 18:23:21 +00:00
(none)!yura f548a3a600 make it add attribute if it's not present
(Logical change 1.612)
2004-10-14 18:23:21 +00:00
(none)!yura a3e26fc943 libntfs/attrib.c
improve ntfs_non_resident_attr_record_add
libntfs/inode.c
    add new high level API ntfs_inode_add_attr
ntfsprogs/ntfscp.c
    make it add attribute if it's not present

BKrev: 416ec419HnAni3_E-QRUdjSqXIewVA
2004-10-14 18:23:21 +00:00
(none)!yura 76cc3b3c6a improve ntfs_non_resident_attr_record_add
(Logical change 1.612)
2004-10-14 18:23:21 +00:00
(none)!yura af2b917b4c add prototype
(Logical change 1.612)
2004-10-14 18:23:21 +00:00
(none)!yura c8e53dcdec add new high level API ntfs_inode_add_attr
(Logical change 1.612)
2004-10-14 18:23:21 +00:00
(none)!yura bf1ae66f7a libntfs/attrib.c
add check that $ATTRIBUTE_LIST should be <= 0x40000 to ntfs_attr_size_bounds_check
libntfs/inode.c
    fix stupid bug in ntfs_inode_free_space

BKrev: 416d18ffNrhuyxbcth6w8ds5JRh4Ng
2004-10-13 12:01:03 +00:00
(none)!yura 1a9a051f31 fix stupid bug in ntfs_inode_free_space
(Logical change 1.611)
2004-10-13 12:01:03 +00:00
(none)!yura 01161bc99b add check that $ATTRIBUTE_LIST should be <= 0x40000 to ntfs_attr_size_bounds_check
(Logical change 1.611)
2004-10-13 12:01:03 +00:00
cantab.net!aia21 e837874f4d Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2004/10/13 11:56:11+01:00 cantab.net!aia21
Enforce minimum inode allocation 24 in ntfs_mft_bitmap_find_free_rec().

BKrev: 416d09d8cXUix_GqQSl2ZqRUV4WJrQ
2004-10-13 10:56:24 +00:00
cantab.net!aia21 3f58b75146 Enforce minimum inode allocation 24 in ntfs_mft_bitmap_find_free_rec().
(Logical change 1.610)
2004-10-13 10:56:24 +00:00
(none)!yura 34256e4de3 change example in ntfscp manual page
BKrev: 416d029ff6r7VejadliJYsZCxYXRxg
2004-10-13 10:25:35 +00:00
(none)!yura d65e2dc5e8 change example in ntfscp manual page
(Logical change 1.609)
2004-10-13 10:25:35 +00:00
(none)!yura a0dba650ad fixes and cleanup to attribute resize functions
BKrev: 416cfa89PO2Jcma4ogMT4sIEoThfBw
2004-10-13 09:51:05 +00:00
(none)!yura 09fe1580a3 fixes and cleanup to attribute resize functions
(Logical change 1.608)
2004-10-13 09:51:05 +00:00
(none)!yura 2c0c003bc2 move ntfscp from extra to standard program set
BKrev: 416c38eexoaBvJwLf4g1CKNQMt1gQg
2004-10-12 20:05:02 +00:00
(none)!yura 488e4b5d30 move ntfscp from extra to standard program set
(Logical change 1.607)
2004-10-12 20:05:02 +00:00
(none)!yura 8267fcedca (Logical change 1.607) 2004-10-12 20:05:02 +00:00
(none)!yura 240634b7ed Initial revision 2004-10-12 20:05:02 +00:00
(none)!yura 8294cf4918 varios bug fixes (I hope the last) to attribute resize functions and cleanups
BKrev: 416c0858T8ftbtk4Pn2XHqXSDPHMpg
2004-10-12 16:37:44 +00:00
(none)!yura 58bd93a1cd varios bug fixes (I hope the last) to attribute resize functions and cleanups
(Logical change 1.606)
2004-10-12 16:37:44 +00:00
(none)!yura 253616b549 fix bug in ntfs_attr_make_non_resident
BKrev: 416adcdeoE0bhQ2bImr8M0Y2A9XO_g
2004-10-11 19:19:58 +00:00
(none)!yura 48ab100d94 fix bug in ntfs_attr_make_non_resident
(Logical change 1.605)
2004-10-11 19:19:58 +00:00
(none)!yura 1adc469856 fix stupid bugs in nammed attributes resize
BKrev: 416ad2480z_-FXKRX4MEoCFNyWkS3A
2004-10-11 18:34:48 +00:00
(none)!yura e8dcfe2deb fix stupid bugs in nammed attributes resize
(Logical change 1.604)
2004-10-11 18:34:48 +00:00
(none)!yura 7c1b950052 update
(Logical change 1.603)
2004-10-11 16:26:16 +00:00
(none)!yura 324ed328f5 ntfs_attr_truncate check if newsize is equal to na->data_size and don't do anything in this case
(Logical change 1.603)
2004-10-11 16:26:16 +00:00
(none)!yura 8dd4f91c86 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into chaos.(none):/home/yura/NTFS/ntfsprogs

2004/10/11 19:24:16+03:00 (none)!yura
libntfs/attrib.c
    ntfs_attr_truncate check if newsize is equal to na->data_size and don't do anything in this case
ntfsprogs/ntfscp.c
    - Add --attibute, --attr-name and --inode attribute to ntfscp.

BKrev: 416ab428Nm5JpqQ1SZiusTTohVl4UQ
2004-10-11 16:26:16 +00:00
(none)!yura 9af64b54ff - Add --attibute, --attr-name and --inode attribute to ntfscp.
(Logical change 1.603)
2004-10-11 16:26:16 +00:00
cantab.net!aia21 f75629f67f Refix the device memleak fix in error code path.
BKrev: 416aaa1awNAzg4nl8ngSYQ8obqOIPg
2004-10-11 15:43:22 +00:00
cantab.net!aia21 84a4fd30bf Refix the device memleak fix in error code path.
(Logical change 1.602)
2004-10-11 15:43:22 +00:00
flatcap.org!ntfs d5457c0a23 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfsprogs

2004/10/11 16:21:37+01:00 flatcap.org!ntfs
libntfs: fix memleak on error path

BKrev: 416aa5deipnrVgXH0idDbYgEJsG-KA
2004-10-11 15:25:18 +00:00
flatcap.org!ntfs b0d1673503 Auto merged
2004/10/11 16:21:37+01:00 flatcap.org!ntfs
fix memleak on error path

(Logical change 1.601)
2004-10-11 15:25:18 +00:00
(none)!yura 0565e56f8f Remove inode.h::NIno{Clear,Set,}AttrListNonResident and attr_list_rl field from inode.h::_ntfs_inode struct. Adapt all users.
BKrev: 416a4f73uSf8_X3yHhtIbxouc_yhKQ
2004-10-11 09:16:35 +00:00
(none)!yura 419e3ce8b7 Remove inode.h::NIno{Clear,Set,}AttrListNonResident and attr_list_rl field from inode.h::_ntfs_inode struct. Adapt all users.
(Logical change 1.600)
2004-10-11 09:16:35 +00:00
(none)!yura 07a8918a4c update
(Logical change 1.599)
2004-10-10 17:20:48 +00:00
(none)!yura d76664e911 include/ntfs/layout.h
- add new 0 length fields to ATTR_RECORD, they can be used to get size of attribute
libntfs/attrib.c
    - add ntfs_attr_record_move_away
    - make ntfs_attr_update_mapping_pairs use ntfs_inode_free_space
    - cleanups
libntfs/attrlist.c
    - update ntfs_attrlist_set
libntfs/inode.c
    - add ntfs_inode_free_space and ntfs_inode_attach_all_extents
    - update ntfs_inode_add_attrlist to use ntfs_inode_free_space

BKrev: 41696f70ou_XEXyBluVWUB8Eb9zooA
2004-10-10 17:20:48 +00:00
(none)!yura d42a5b46f4 - update ntfs_attrlist_set
(Logical change 1.599)
2004-10-10 17:20:48 +00:00
(none)!yura a9ba7534a1 - add prototypes
(Logical change 1.599)
2004-10-10 17:20:48 +00:00
(none)!yura daad6adcea - add prototype
(Logical change 1.599)
2004-10-10 17:20:48 +00:00
(none)!yura 1154b815de - add ntfs_inode_free_space and ntfs_inode_attach_all_extents
- update ntfs_inode_add_attrlist to use ntfs_inode_free_space

(Logical change 1.599)
2004-10-10 17:20:48 +00:00
(none)!yura 3f9fac7647 - add ntfs_attr_record_move_away
- make ntfs_attr_update_mapping_pairs use ntfs_inode_free_space
- cleanups

(Logical change 1.599)
2004-10-10 17:20:48 +00:00
(none)!yura db92f7bfbf - add new 0 length fields to ATTR_RECORD, they can be used to get size of attribute
(Logical change 1.599)
2004-10-10 17:20:48 +00:00
flatcap.org!ntfs 660c6015bc commit dt and bmp
BKrev: 4167c9cdLzvaKJCE85XpowXz8impjA
2004-10-09 11:21:49 +00:00
flatcap.org!ntfs 8152150f91 commit dt and bmp
(Logical change 1.598)
2004-10-09 11:21:49 +00:00
(none)!yura 14c99d8ce7 fix to previous patch: forgot to mark inode dirty
BKrev: 4166c93ci3E-odYulDRz9V9H22hYtw
2004-10-08 17:07:08 +00:00
(none)!yura a5e9859b29 fix to previous patch: forgot to mark inode dirty
(Logical change 1.597)
2004-10-08 17:07:08 +00:00
(none)!yura f79110c80d Update.
(Logical change 1.596)
2004-10-08 16:50:36 +00:00
(none)!yura 48f70024ab Improve ntfs_resident_attr_resize to try make attributes non-resident
when such convert is reasonable.

BKrev: 4166c55c5ZBRybysFdgaaov3Ek5WrA
2004-10-08 16:50:36 +00:00
(none)!yura 1b5c000662 Improve ntfs_resident_attr_resize to try make attributes non-resident
when such convert is reasonable.

(Logical change 1.596)
2004-10-08 16:50:36 +00:00
(none)!yura 100b892e5b small bugfix and cleanup
(Logical change 1.595)
2004-10-08 15:48:03 +00:00
(none)!yura 14f9590053 libntfs/attrib.c
small bugfix and cleanup

BKrev: 4166b6b3uBaS3uZB5_Ht7IHOzYu2BQ
2004-10-08 15:48:03 +00:00
(none)!yura 94a479e005 one more fix
(Logical change 1.594)
2004-10-07 16:46:16 +00:00
(none)!yura 0f4bb99ea1 libntfs/attrib.c
one more fix

BKrev: 416572d8LTKSfbQ8LJtMf2cQN32yGg
2004-10-07 16:46:16 +00:00
(none)!yura a85cbd7bd3 libntfs/attrib.c
fix some stupid bugs

BKrev: 4165717djPCbL1sKSjq_8_DTEs2faQ
2004-10-07 16:40:29 +00:00
(none)!yura 59407ac0ff fix some stupid bugs
(Logical change 1.593)
2004-10-07 16:40:29 +00:00
(none)!yura a929f9f0ba Update.
(Logical change 1.592)
2004-10-07 14:04:09 +00:00
(none)!yura ad7b4d8fc1 Add new API attrib.[ch]::ntfs_attr_record_move_to and make ntfs_resident_attr_resize use it.
BKrev: 41654cd9yv0ylraU7X-ejcf6Xkw5PQ
2004-10-07 14:04:09 +00:00
(none)!yura d4d69304ff - Add new API ntfs_attr_record_move_to and make ntfs_resident_attr_resize use it.
- Cleanups.

(Logical change 1.592)
2004-10-07 14:04:09 +00:00
(none)!yura 988c84f887 fix to my previous fix
BKrev: 415d8e2dnflzSZLbpMRzkP3gsIqDeQ
2004-10-01 17:04:45 +00:00
(none)!yura a4d40d673a fix to my previous fix
(Logical change 1.591)
2004-10-01 17:04:45 +00:00
cantab.net!aia21 1dafa90ef7 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2004/10/01 14:56:31+01:00 cantab.net!aia21
Fix stupid typo where I had >> vol->cluster_size instead of
>> vol->cluster_size_bits.

BKrev: 415d621aaIQOwfG2GYxE99Z3o4DfPQ
2004-10-01 13:56:42 +00:00
cantab.net!aia21 b81e3f8959 Fix stupid typo where I had >> vol->cluster_size instead of
>> vol->cluster_size_bits.

(Logical change 1.590)
2004-10-01 13:56:42 +00:00
(none)!yura 83598b5e1d libntfs/attrib.c
- Mapping pairs offset fixes.
    - Indent fixes.
    - ntfs_non_resident_attr_expand: fix some error code paths.

BKrev: 415d4d04vMDn9ENkB_Z6ugjj76cnKw
2004-10-01 12:26:44 +00:00
(none)!yura b89f1ee8f6 - Mapping pairs offset fixes.
- Indent fixes.
- ntfs_non_resident_attr_expand: fix some error code paths.

(Logical change 1.589)
2004-10-01 12:26:44 +00:00
elisa-laajakaista.fi!szaka 8dc76eeeb0 ntfsclone TODO update
(Logical change 1.588)
2004-09-30 22:27:04 +00:00
elisa-laajakaista.fi!szaka 72025c9e74 TODO.ntfsprogs: ntfsclone TODO update
BKrev: 415c8838hG6eORtv1B3eQmENm1MjtA
2004-09-30 22:27:04 +00:00
elisa-laajakaista.fi!szaka f7957bf3a6 ntfsclone: honor bad clusters list ($BadClus:$Bad), known bad sectors aren't tried to be saved anymore (Szaka)
BKrev: 415c4d900JnOJDvMItDMUakPDPNXrw
2004-09-30 18:16:48 +00:00
elisa-laajakaista.fi!szaka 63b6f9ff3f ntfsclone: honor bad clusters list ($BadClus:$Bad), known bad sectors aren't tried to be saved anymore (Szaka)
(Logical change 1.587)
2004-09-30 18:16:48 +00:00
elisa-laajakaista.fi!szaka ec00d338cb honor bad clusters list ($BadClus:$Bad), known bad sectors aren't tried to be saved anymore (Szaka)
(Logical change 1.587)
2004-09-30 18:16:48 +00:00
cantab.net!aia21 5d3b1b0f2b Rename scpu_to_le{16,32,64}() to cpu_to_sle{16,32,64}() to match the kernel.
BKrev: 415c1f8fCHgsWh4EEJdrb4uAQkKqcg
2004-09-30 15:00:31 +00:00
cantab.net!aia21 8b3c03e173 Rename scpu_to_le{16,32,64}() to cpu_to_sle{16,32,64}() to match the kernel.
(Logical change 1.586)
2004-09-30 15:00:31 +00:00
(none)!yura 67ca77c25c Use ntfs_attr_reinit_search_ctx instead ntfs_attr_init_search_ctx, because Anton fixed bug prevent us doing so.
BKrev: 415ada4enbsYCkE7_BGDvs3Pcp3UmA
2004-09-29 15:52:46 +00:00
(none)!yura 59ab6cdb33 Use ntfs_attr_reinit_search_ctx instead ntfs_attr_init_search_ctx, because Anton fixed bug prevent us doing so.
(Logical change 1.585)
2004-09-29 15:52:46 +00:00
(none)!yura 21613e7190 ntfs_mapping_pairs_build:
- Make it set stop vcn even function doesn't failed.
- Minor bugfix.

(Logical change 1.584)
2004-09-29 15:43:22 +00:00
(none)!yura 030e531012 SCCS merged
2004/09/29 18:21:24+03:00 (none)!yura
SCCS merged

2004/09/29 18:16:34+03:00 (none)!yura
Update.

(Logical change 1.584)
2004-09-29 15:43:22 +00:00
(none)!yura 6f27be95ef Merge
2004/09/29 18:35:01+03:00 (none)!yura
Merge

2004/09/29 18:16:34+03:00 (none)!yura
include/ntfs/attrlist.h
    Add new helper ntfs_attrlist_mark_dirty.
libntfs/attrib.c
    - Deallocate clusters when free atribute list.
    - Write ntfs_attr_update_mapping_pairs and make ntfs_non_resident_attr_{shrink,expand} use it.
libntfs/runlist.c
    ntfs_mapping_pairs_build:
    - Make it set stop vcn even function doesn't failed.
    - Minor bugfix.

BKrev: 415ad81aQ8d6CL2cbK7X90Wi0br1bQ
2004-09-29 15:43:22 +00:00
(none)!yura bb9c8afe60 Auto merged
2004/09/29 18:35:00+03:00 (none)!yura
SCCS merged

2004/09/29 18:16:34+03:00 (none)!yura
- Deallocate clusters when free atribute list.
- Write ntfs_attr_update_mapping_pairs and make ntfs_non_resident_attr_{shrink,expand} use it.

(Logical change 1.584)
2004-09-29 15:43:22 +00:00
(none)!yura 4b95d5ce3e Add ntfs_attr_update_mapping_pairs prototype.
(Logical change 1.584)
2004-09-29 15:43:22 +00:00
(none)!yura 746c36a4be Add new helper ntfs_attrlist_mark_dirty.
(Logical change 1.584)
2004-09-29 15:43:22 +00:00
cantab.net!aia21 a18fb7244f Update
(Logical change 1.583)
2004-09-29 14:45:16 +00:00
cantab.net!aia21 e3c44c8ff6 Always clear ctx->al_entry in ntfs_attr_reinit_search_ctx().
BKrev: 415aca7cWCu3EBuiI-NQXNcdSEJJ1w
2004-09-29 14:45:16 +00:00
cantab.net!aia21 75c1ed8b5d Always clear ctx->al_entry in ntfs_attr_reinit_search_ctx().
(Logical change 1.583)
2004-09-29 14:45:16 +00:00
elisa-laajakaista.fi!szaka b7d713c8f1 - ntfsclone: save by using our, not NTFS cluster allocation bitmap.
This gives more control in the future what to save.

BKrev: 4159f713A1Kny6AMt_QTXVbjQHuaJQ
2004-09-28 23:43:15 +00:00
elisa-laajakaista.fi!szaka e68a61101a - ntfsclone: save by using our, not NTFS cluster allocation bitmap.
This gives more control in the future what to save.

(Logical change 1.582)
2004-09-28 23:43:15 +00:00
elisa-laajakaista.fi!szaka 6afc38f179 libntfs/attrib.c
- suppress bogus gcc warning about uninitialized 'err' variable
libntfs/inode.c
    - fix err <-> errno typo that could cause bogus return value

BKrev: 4159ae841VJpVyLgXynZsPdWhzT-sw
2004-09-28 18:33:40 +00:00
elisa-laajakaista.fi!szaka 82efae551e - suppress bogus gcc warning about uninitialized 'err' variable
(Logical change 1.581)
2004-09-28 18:33:40 +00:00
elisa-laajakaista.fi!szaka f9ac10a85e - fix err <-> errno typo that could cause bogus return value
(Logical change 1.581)
2004-09-28 18:33:40 +00:00
(none)!yura 442fcef5bf libntfs/attrib.c
Make ntfs_attr_record_rm use ntfs_attrlist_need and delete attribute list if it is doesn't need.
libntfs/attrlist.c
    Add new API: ntfs_attrlist_need.

BKrev: 41571913K5_56FJcIFfiZdKO5TzzLA
2004-09-26 19:31:31 +00:00
(none)!yura 1e589f3db3 Update.
(Logical change 1.580)
2004-09-26 19:31:31 +00:00
(none)!yura b2f2facc29 Make ntfs_attr_record_rm use ntfs_attrlist_need and delete attribute list if it is doesn't need.
(Logical change 1.580)
2004-09-26 19:31:31 +00:00
(none)!yura c78630e1dd Add prototype.
(Logical change 1.580)
2004-09-26 19:31:31 +00:00
(none)!yura a373b59fd3 Add new API: ntfs_attrlist_need.
(Logical change 1.580)
2004-09-26 19:31:31 +00:00
(none)!yura e418cf5345 Update.
(Logical change 1.579)
2004-09-25 20:10:16 +00:00
(none)!yura 52300dca77 - add tfs_inode_add_attrlist prototype.
(Logical change 1.579)
2004-09-25 20:10:16 +00:00
(none)!yura 756a0a84ca - add ntfs_resident_attr_record_add prototype.
(Logical change 1.579)
2004-09-25 20:10:16 +00:00
(none)!yura 5dee144063 - add ntfs_attrlist_set prototype.
(Logical change 1.579)
2004-09-25 20:10:16 +00:00
(none)!yura 64bd37518d - New API: inode.[ch]::ntfs_inode_add_attrlist.
(Logical change 1.579)
2004-09-25 20:10:16 +00:00
(none)!yura 7428b93f99 - New API: attrib.[ch]::ntfs_resident_attr_record_add.
- Update ntfs_non_resident_attr_expand to use ntfs_inode_add_attrlist.
- Fixes and cleanups.

(Logical change 1.579)
2004-09-25 20:10:16 +00:00
(none)!yura 03e0ea814b - Move out common part of ntfs_attrlist_entry_{add,rm} to new API:
attrlist.[ch]::ntfs_attrlist_set.
- New API: attrib.[ch]::ntfs_resident_attr_record_add.
- New API: inode.[ch]::ntfs_inode_add_attrlist.
- Update ntfs_non_resident_attr_expand to use ntfs_inode_add_attrlist.
- Fixes and cleanups.

BKrev: 4155d0a843h4sN5M00iw90cHNdqjGg
2004-09-25 20:10:16 +00:00
(none)!yura 0f462c337c - Move out common part of ntfs_attrlist_entry_{add,rm} to new API:
attrlist.[ch]::ntfs_attrlist_set.
- Fixes and cleanups.

(Logical change 1.579)
2004-09-25 20:10:16 +00:00
(none)!yura 5df65f81b4 fixes for attribute list handling
BKrev: 4151d100khiVVozIQDZ6mpBDs1O2pA
2004-09-22 19:22:40 +00:00
(none)!yura bff0f300ff fixes for attribute list handling
(Logical change 1.578)
2004-09-22 19:22:40 +00:00
cantab.net!aia21 528dcd3401 Minor updates ntfs_external_attr_find().
BKrev: 415039c84awHHCAMTIvzV4afH7U3hA
2004-09-21 14:25:12 +00:00
cantab.net!aia21 acff9f4c43 Minor updates ntfs_external_attr_find().
(Logical change 1.577)
2004-09-21 14:25:12 +00:00
cantab.net!aia21 a8b99bcc35 No need to allocate a copy of the attribute name to be passed to
ntfs_attr_open().

BKrev: 41501a3fHnVUJMGglXL696y8gQiNuA
2004-09-21 12:10:39 +00:00
cantab.net!aia21 e461268d28 No need to allocate a copy of the attribute name to be passed to
ntfs_attr_open().

(Logical change 1.576)
2004-09-21 12:10:39 +00:00
(none)!yura da83a15a1c - not update initialized size in ntfs_non_resident_attr_expand
- fix compiler warnings

BKrev: 414f138ewxm4G0dfx0lyMpyZzwAVZA
2004-09-20 17:29:50 +00:00
(none)!yura 92f4878951 - not update initialized size in ntfs_non_resident_attr_expand
- fix compiler warnings

(Logical change 1.575)
2004-09-20 17:29:50 +00:00
(none)!yura 7443484bdc - fix compiler warnings
(Logical change 1.575)
2004-09-20 17:29:50 +00:00
cantab.net!aia21 dcdc79fd71 Fix warnings and endianness conversion errors.
BKrev: 414ef819T-8EpHmwk8-u9rlHouaMeg
2004-09-20 15:32:41 +00:00
cantab.net!aia21 2bf52eb259 Fix warnings and endianness conversion errors.
(Logical change 1.574)
2004-09-20 15:32:41 +00:00
cantab.net!aia21 47cc459e5b Fix typo.
(Logical change 1.573)
2004-09-20 15:27:55 +00:00
cantab.net!aia21 3415c47df1 Add NInoAttrListTestAndSetDirty() and TestAndClearDirty().
(Logical change 1.573)
2004-09-20 15:27:55 +00:00
cantab.net!aia21 1446547a5b - Only write out dirty attribute list if such is present.
- Use TestAndClearDirty and SetDirty on error for concurency fix.

BKrev: 414ef6fbfY7Uifjubp81QHek-9TZBA
2004-09-20 15:27:55 +00:00
cantab.net!aia21 5356fc247d - Only write out dirty attribute list if such is present.
- Use TestAndClearDirty and SetDirty on error for concurency fix.

(Logical change 1.573)
2004-09-20 15:27:55 +00:00
cantab.net!aia21 a241e062ac Clear attribute list dirty when clearing attr list presence.
BKrev: 414ef3bfUub5iXZoT0IA26ZPfBPI4g
2004-09-20 15:14:07 +00:00
cantab.net!aia21 b83b08ec73 Clear attribute list dirty when clearing attr list presence.
(Logical change 1.572)
2004-09-20 15:14:07 +00:00
cantab.net!aia21 510238c99a Remove clearing of directory flag. It is zero.
BKrev: 414eefd6sHJMzZPWbGOMXuYfrxERHA
2004-09-20 14:57:26 +00:00
cantab.net!aia21 76fd9217b7 Remove clearing of directory flag. It is zero.
(Logical change 1.571)
2004-09-20 14:57:26 +00:00
cantab.net!aia21 4a7a060f86 Update
(Logical change 1.570)
2004-09-20 14:46:38 +00:00
cantab.net!aia21 9f2f8ad317 - Make ntfs_attr_open() make a copy of the attribute name unless it is
one of the internal names.  (Anton)

(Logical change 1.570)
2004-09-20 14:46:38 +00:00
cantab.net!aia21 48c44604f1 - Add new API unistr.[hc]::ntfs_ucsndup(). (Anton)
- Make libntfs/attrib.c::ntfs_attr_open() make a copy of the attribute
  name unless it is one of the internal names.  (Anton)

BKrev: 414eed4e-b-WtoHDDYoiR7AtbpBDuQ
2004-09-20 14:46:38 +00:00
cantab.net!aia21 a70e770622 - Add new API unistr.[hc]::ntfs_ucsndup(). (Anton)
(Logical change 1.570)
2004-09-20 14:46:38 +00:00
(none)!yura edc3e44834 Update
(Logical change 1.569)
2004-09-20 11:31:28 +00:00
(none)!yura 6df8562e4d Attribute handling functions always update highest_vcn, if it was modified.
BKrev: 414ebf903MzP7itu-K5cf3MX-T-QFQ
2004-09-20 11:31:28 +00:00
(none)!yura f725bfae32 Attribute handling functions always update highest_vcn, if it was modified.
(Logical change 1.569)
2004-09-20 11:31:28 +00:00
(none)!yura eba2ebee2c Update
(Logical change 1.568)
2004-09-19 19:30:37 +00:00
(none)!yura 3aa1acaa90 Small update
(Logical change 1.568)
2004-09-19 19:30:37 +00:00
(none)!yura cc15a37332 Export ntfs_make_room_for_attr, ntfs_non_resident_attr_record_add and ntfs_attr_record_rm.
(Logical change 1.568)
2004-09-19 19:30:37 +00:00
(none)!yura 1fc3ddd8f4 ChangeLog
Update
include/ntfs/attrib.h
    Export ntfs_make_room_for_attr, ntfs_non_resident_attr_record_add and ntfs_attr_record_rm.
libntfs/attrib.c
    Small update

BKrev: 414dde5dkXXw_RpbqUSlgeoKjhY80w
2004-09-19 19:30:37 +00:00
(none)!yura 332be40f05 remove trainling spaces
(Logical change 1.567)
2004-09-19 18:59:25 +00:00
(none)!yura 1eea8a75f1 Fix highest_vcn updating for ATTRIBUTE_LIST and small fixes.
BKrev: 414dd70dNqcHy2BV_SuAnBaODDCQJw
2004-09-19 18:59:25 +00:00
(none)!yura 3c5e052974 Fix highest_vcn updating for ATTRIBUTE_LIST and small endian fix.
(Logical change 1.567)
2004-09-19 18:59:25 +00:00
(none)!yura 21a7090b05 libntfs/attrib.c
- add ntfs_attr_record_rm
    - add rollback to ntfs_non_resident_attr_expand
libntfs/attrlist.c
    - implement ntfs_attrlist_entry_rm

BKrev: 414d9a334g7JdLWOwzZEpfPjLmSY2Q
2004-09-19 14:39:47 +00:00
(none)!yura c30049a41e - more debug output
(Logical change 1.566)
2004-09-19 14:39:47 +00:00
(none)!yura 3337c4f57f - implement ntfs_attrlist_entry_rm
(Logical change 1.566)
2004-09-19 14:39:47 +00:00
(none)!yura 02bda1c69a - add ntfs_attr_record_rm
- add rollback to ntfs_non_resident_attr_expand

(Logical change 1.566)
2004-09-19 14:39:47 +00:00
(none)!yura 5218c4086a some fixes
BKrev: 414c650eSTmaZ1wlZW8uWH9SckwkqQ
2004-09-18 16:40:46 +00:00
(none)!yura 8d7e4f3847 some fixes
(Logical change 1.565)
2004-09-18 16:40:46 +00:00
(none)!yura aa2b031d57 fix name copying in ntfs_attrlist_entry_add()
BKrev: 414b1fa9vjCEx_P4F3qlJsuk5lcxSA
2004-09-17 17:32:25 +00:00
(none)!yura 9be64ab8c7 fix name copying in ntfs_attrlist_entry_add()
(Logical change 1.564)
2004-09-17 17:32:25 +00:00
(none)!yura 921a40e14b rename: ntfs_not_resident_attr_record_add -> ntfs_non_resident_attr_record_add
ntfs_non_resident_attr_record_add:
 - add cheking for attribute can be non-resident
 - fixed bug: forgot copy name to attribute

(Logical change 1.563)
2004-09-17 16:34:45 +00:00
(none)!yura 6f222626bd rename: ntfs_not_resident_attr_record_add -> ntfs_non_resident_attr_record_add
ntfs_non_resident_attr_record_add:
     - add cheking for attribute can be non-resident
     - fixed bug: forgot copy name to attribute

BKrev: 414b1225MaMTJrbt8-xVWXsidXIBSA
2004-09-17 16:34:45 +00:00
(none)!yura 70bdd48d07 SCCS merged
2004/09/17 19:05:41+03:00 (none)!yura
- port ntfs_make_room_for_attr from mkntfs
- add new API: ntfs_not_resident_attr_record_add
- make ntfs_not_resident_attr_expand allocate new extent records
(warning: there is no rollback at present, old is obsolete, so I removed it.
I will write new rollback as soon as possible)

(Logical change 1.562)
2004-09-17 16:07:04 +00:00
(none)!yura 4c66b37c29 Merge
2004/09/17 19:05:41+03:00 (none)!yura
libntfs/attrib.c
    - port ntfs_make_room_for_attr from mkntfs
    - add new API: ntfs_not_resident_attr_record_add
    - make ntfs_not_resident_attr_expand allocate new extent records
    (warning: there is no rollback at present, old is obsolete, so I removed it.
    I will write new rollback as soon as possible)
libntfs/attrlist.c
    - remove mref from ntfs_attrlist_entry_add prototype and adapt code
    - fix stupid bug with unmapped runlist in ntfs_attrlist_entry_add
    - one stupid bug in ntfs_attrlist_entry_add: vcn is 64bit long

BKrev: 414b0ba8h8uT2wLqBHPo7wYbRB28SA
2004-09-17 16:07:04 +00:00
(none)!yura 5a428e00fc - remove mref from ntfs_attrlist_entry_add prototype and adapt code
- fix stupid bug with unmapped runlist in ntfs_attrlist_entry_add
- one stupid bug in ntfs_attrlist_entry_add: vcn is 64bit long

(Logical change 1.562)
2004-09-17 16:07:04 +00:00
(none)!yura dc152cd323 - remove mref from ntfs_attrlist_entry_add prototype
(Logical change 1.562)
2004-09-17 16:07:04 +00:00
cantab.net!aia21 56c34f1d84 attrib.c:
Add check for new attribute size being large enough
  to store the attribute length in ntfs_attr_rec_resize().
support.h:
  Add offsetof() macro.

BKrev: 414a16fe-gHs80ssPQL93LI7mXvkrg
2004-09-16 22:43:10 +00:00
cantab.net!aia21 e4220d109a Update
(Logical change 1.561)
2004-09-16 22:43:10 +00:00
cantab.net!aia21 8dde1ae7ba Add offsetof() macro.
(Logical change 1.561)
2004-09-16 22:43:10 +00:00
cantab.net!aia21 07b1e1a361 Add check for new attribute size being large enough
to store the attribute length in ntfs_attr_rec_resize().

(Logical change 1.561)
2004-09-16 22:43:10 +00:00
cantab.net!aia21 50e082c5e7 Update
(Logical change 1.560)
2004-09-16 10:22:11 +00:00
cantab.net!aia21 87a450573c ChangeLog:
Update

BKrev: 41496953dmLfNhvicuTcWkfNP6zSPw
2004-09-16 10:22:11 +00:00
cantab.net!aia21 75bc06b8c7 Make output fit on 80-column-wide screen.
(Logical change 1.559)
2004-09-16 10:10:20 +00:00
cantab.net!aia21 1d433b4804 Fix bugs in handling of ->extent_nis in base inodes.
BKrev: 4149668cub46ApUQaDgnHkoNBtZrow
2004-09-16 10:10:20 +00:00
cantab.net!aia21 307c09774e Fix bugs in handling of ->extent_nis in base inodes.
(Logical change 1.559)
2004-09-16 10:10:20 +00:00
cantab.net!aia21 fe587b2319 Update
(Logical change 1.558)
2004-09-16 09:32:23 +00:00
cantab.net!aia21 9c86b21e87 (Logical change 1.558) 2004-09-16 09:32:23 +00:00
cantab.net!aia21 5d703b9636 Initial revision 2004-09-16 09:32:23 +00:00
cantab.net!aia21 6070d2444d Add ntfsmftalloc utility to the extra utilities to help test the mft
record allocator.  (Anton)

BKrev: 41495da7KaNsz8r71SASgz4NItVHqg
2004-09-16 09:32:23 +00:00
cantab.net!aia21 abf32ee708 Add ntfsmftalloc to extra build.
(Logical change 1.558)
2004-09-16 09:32:23 +00:00
cantab.net!aia21 7b1e701f45 Add ntfsmftalloc to BK ignore.
(Logical change 1.558)
2004-09-16 09:32:23 +00:00
cantab.net!aia21 592856a932 Write out dirty extent inodes in ntfs_inode_close() when closing a base
inode.

BKrev: 41495d163mAAQakZ-2RbNfUsYgIMNA
2004-09-16 09:29:58 +00:00
cantab.net!aia21 2b745a3542 Write out dirty extent inodes in ntfs_inode_close() when closing a base
inode.

(Logical change 1.557)
2004-09-16 09:29:58 +00:00
cantab.net!aia21 11b4d56de2 Final fixes for ntfs_mft_record_alloc() that fell out from extensive testing.
BKrev: 41494c94eB_nDWV1ZAq9mlWHYWZxKA
2004-09-16 08:19:32 +00:00
cantab.net!aia21 ba4192c33c Final fixes for ntfs_mft_record_alloc() that fell out from extensive testing.
(Logical change 1.556)
2004-09-16 08:19:32 +00:00
cantab.net!aia21 ea45fe28cb Need to sync inodes before closing attributes or the umount fails.
BKrev: 41494c6cf3xZ6_T22478nJ8L--eDIA
2004-09-16 08:18:52 +00:00
cantab.net!aia21 93f8096673 Need to sync inodes before closing attributes or the umount fails.
(Logical change 1.555)
2004-09-16 08:18:52 +00:00
cantab.net!aia21 21248874a3 Update.
(Logical change 1.554)
2004-09-15 15:21:47 +00:00
cantab.net!aia21 154d44ded5 Finish off ntfs_mft_record_alloc() and its error handling.
BKrev: 41485e0bcRs9SyABvxabHxuN3S8How
2004-09-15 15:21:47 +00:00
cantab.net!aia21 9656a23b5e Finish off ntfs_mft_record_alloc() and its error handling.
(Logical change 1.554)
2004-09-15 15:21:47 +00:00
cantab.net!aia21 35d7e2b7f3 More code refactoring in ntfs_mft_record_alloc() together with more error
recovery code.

BKrev: 41483a70eUEA6m4YibD4f3LtUCXipw
2004-09-15 12:49:52 +00:00
cantab.net!aia21 caf2f0ad97 More code refactoring in ntfs_mft_record_alloc() together with more error
recovery code.

(Logical change 1.553)
2004-09-15 12:49:52 +00:00
cantab.net!aia21 f4af163c83 More work on ntfs_mft_record_alloc(): Factor out some code, start with
some error handling and a bug fix here or there...

BKrev: 4146ebad93IQRhTV0-qh5cm2_uMTFA
2004-09-14 13:01:33 +00:00
cantab.net!aia21 0de81b2f41 More work on ntfs_mft_record_alloc(): Factor out some code, start with
some error handling and a bug fix here or there...

(Logical change 1.552)
2004-09-14 13:01:33 +00:00
cantab.net!aia21 e74eeb2c0b Update ntfs_mft_record_alloc() prototype to reflect reality.
(Logical change 1.551)
2004-09-13 14:44:01 +00:00
cantab.net!aia21 b627f802bd First cut of ntfs_mft_record_alloc() ported from my old ntfs allocator that
I wrote several years ago.  Note this is completely untested and there is
no error handling at all yet.  I will be porting/adding the error handling
next.  (Anton)

BKrev: 4145b231iWDh2kpXUh1ulPv001Mm2w
2004-09-13 14:44:01 +00:00
cantab.net!aia21 8fdb6981ff First cut of ntfs_mft_record_alloc() ported from my old ntfs allocator that
I wrote several years ago.  Note this is completely untested and there is
no error handling at all yet.  I will be porting/adding the error handling
next.  (Anton)

(Logical change 1.551)
2004-09-13 14:44:01 +00:00
cantab.net!aia21 ad7acfacc2 Remove no longer needed forward declaration.
(Logical change 1.550)
2004-09-13 14:39:50 +00:00
cantab.net!aia21 4f63b84653 Export ntfs_inode_allocate().
BKrev: 4145b136SFdgwIOifbl6Qr0m3mj-LA
2004-09-13 14:39:50 +00:00
cantab.net!aia21 b766a97941 Export ntfs_inode_allocate().
(Logical change 1.550)
2004-09-13 14:39:50 +00:00
cantab.net!aia21 89306d3012 Remove vol->nr_mft_records and update all users. (Anton)
BKrev: 41457666lLrPSKGHfofyEGuWtqunEw
2004-09-13 10:28:54 +00:00
cantab.net!aia21 b82469ba50 Remove vol->nr_mft_records and update all users. (Anton)
(Logical change 1.549)
2004-09-13 10:28:54 +00:00
cantab.net!aia21 a5b6b89456 Update
(Logical change 1.548)
2004-09-13 09:31:42 +00:00
cantab.net!aia21 dc4d7921e1 Cleanup the ntfs_mapping_pairs_build enhancement.
BKrev: 414568feNrnD8KlGyp0pnPL1hN-Iow
2004-09-13 09:31:42 +00:00
cantab.net!aia21 1159ab3656 Cleanup the ntfs_mapping_pairs_build enhancement.
(Logical change 1.548)
2004-09-13 09:31:42 +00:00
(none)!yura a95cff8404 update
(Logical change 1.547)
2004-09-12 18:46:04 +00:00
(none)!yura 88228c1e42 Add @stopped_at parameter to ntfs_mapping_pairs_build and adapt all callers.
BKrev: 4144996cMCQGevlUEAEKqnoCoJ6KgQ
2004-09-12 18:46:04 +00:00
(none)!yura 27e0e7a0c7 Add @stopped_at parameter to ntfs_mapping_pairs_build and adapt all callers.
(Logical change 1.547)
2004-09-12 18:46:04 +00:00
(none)!yura 64e1f672cf ntfs_inode_sync: write dirty attribute list to disk
(Logical change 1.546)
2004-09-12 11:00:06 +00:00
(none)!yura 0819f47293 new API: ntfs_attrlist_entry_add - add an attribute list attribute entry
(Logical change 1.546)
2004-09-12 11:00:06 +00:00
(none)!yura 893742e5c2 libntfs/attrlist.c
new API: ntfs_attrlist_entry_add - add an attribute list attribute entry
libntfs/inode.c
    ntfs_inode_sync: write dirty attribute list to disk



BKrev: 41442c36YT3aG199TQCym5eOhikRIg
2004-09-12 11:00:06 +00:00
(none)!yura d7f49f5880 added prototype for ntfs_attrlist_entry_add
(Logical change 1.546)
2004-09-12 11:00:06 +00:00
(none)!yura 8930729433 update
(Logical change 1.545)
2004-09-11 16:23:34 +00:00
(none)!yura 72b5b3c6fb ntfsinfo: make it display attribute instance and dump attribute list entries in verbose mode
(Logical change 1.545)
2004-09-11 16:23:34 +00:00
(none)!yura 8227235187 libntfs/attrib.c
fixes for attribute list
ntfsprogs/ntfsinfo.c
    ntfsinfo: make it display attribute instance and dump attribute list entries in verbose mode


BKrev: 41432686JHwH9Y7abtLYmq9IlTeqgg
2004-09-11 16:23:34 +00:00
(none)!yura a7b9eefee8 fixes for attribute list
(Logical change 1.545)
2004-09-11 16:23:34 +00:00
cantab.net!aia21 9a79c9711e Fix a potential memory leak (in error code path of
ntfs_non_resident_attr_expand()).

BKrev: 4141b263JdzoM6pPhwKvmFB0VIHggg
2004-09-10 13:55:47 +00:00
cantab.net!aia21 8ab5e7daf5 Fix a potential memory leak (in error code path of
ntfs_non_resident_attr_expand()).

(Logical change 1.544)
2004-09-10 13:55:47 +00:00
(none)!yura a5c2060597 update
(Logical change 1.543)
2004-09-09 17:21:40 +00:00
(none)!yura 6e2b7ed686 Improvement to ntfs_non_resident_attr_expand: expand multi extent
attributes if we don't need to allocate new mft records to perform
this.

BKrev: 414091241Goff10vbL-jmjKtITvsng
2004-09-09 17:21:40 +00:00
(none)!yura b46a0cd23d Improvement to ntfs_non_resident_attr_expand: expand multi extent
attributes if we don't need to allocate new mft records to perform
this.

(Logical change 1.543)
2004-09-09 17:21:40 +00:00
cantab.net!aia21 cb0ffbc3ec Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2004/09/09 15:27:50+01:00 cantab.net!aia21
Fix silly porting typo in new debug output functions.

BKrev: 4140686famFyf_sTpR2vN7x7RglrNg
2004-09-09 14:27:59 +00:00
cantab.net!aia21 fe4fd6b59e Fix silly porting typo.
(Logical change 1.542)
2004-09-09 14:27:59 +00:00
(none)!yura 92492d6d91 update
(Logical change 1.541)
2004-09-09 14:18:53 +00:00
(none)!yura 64fd09d1bd ntfscp: Not longer update $FILE_NAME attributes, because Windows
doesn't update them unless a rename operation occur.

(Logical change 1.541)
2004-09-09 14:18:53 +00:00
(none)!yura c2fd1360e7 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into chaos.(none):/home/yura/NTFS/ntfsprogs

2004/09/09 17:16:16+03:00 (none)!yura
ntfscp: Not longer update $FILE_NAME attributes, because Windows
doesn't update them unless a rename operation occur.

BKrev: 4140664dMzZNBYMbtVds5GyGXtdTaQ
2004-09-09 14:18:53 +00:00
cantab.net!aia21 cfb642de57 Update build to SuSE 9.2 beta 1 tools (autoconf,automake,libtool,...).
BKrev: 4140614b1uy5xffrxLeWI7Hu-Z7iRQ
2004-09-09 13:57:31 +00:00
cantab.net!aia21 a085e4b501 Update build to SuSE 9.2 beta 1 tools (autoconf,automake,libtool,...).
(Logical change 1.540)
2004-09-09 13:57:31 +00:00
cantab.net!aia21 e1249adc6c Fix typo.
(Logical change 1.539)
2004-09-09 13:56:46 +00:00
cantab.net!aia21 1bc8af5747 Export ntfs_attr_record_resize.
BKrev: 4140611ebRiuo9Q-1bZjCS6aayFcNQ
2004-09-09 13:56:46 +00:00
cantab.net!aia21 cbbd254b20 Export ntfs_attr_record_resize.
(Logical change 1.539)
2004-09-09 13:56:46 +00:00
cantab.net!aia21 3da1cc0cb9 Merge.
2004/09/06 11:07:20+01:00 cantab.net!aia21
Add ntfs_debug() and ntfs_error() to make kernel<->userspace porting easier.

(Logical change 1.538)
2004-09-09 07:54:06 +00:00
cantab.net!aia21 3d754433c8 Merge
2004/09/06 11:16:23+01:00 cantab.net!aia21
Fix all warnings in gnome-vfs-method/module generated by
--enable-warnings switch to configure.

2004/09/06 11:07:21+01:00 cantab.net!aia21
Add ntfs_debug() and ntfs_error() to make kernel<->userspace porting easier.

BKrev: 41400c1efCaK8DxrxgwPG4p071sooA
2004-09-09 07:54:06 +00:00
cantab.net!aia21 7deafa1bcb Fix all warnings generated by --enable-warnings switch to configure.
(Logical change 1.538)
2004-09-09 07:54:06 +00:00
cantab.net!aia21 44fa8df74b Add ntfs_volume->sb pointer for kernel porting easyness (it is really only
for benefit of being able to call ntfs_error(vol->sb, blah...);

(Logical change 1.538)
2004-09-09 07:54:06 +00:00
cantab.net!aia21 d6fc63d0b1 Add ntfs_debug() and ntfs_error() to make kernel<->userspace porting easier.
(Logical change 1.538)
2004-09-09 07:54:06 +00:00
(none)!yura 38cc93f5e7 update Changelog
BKrev: 413f34b5oJ5NUxbIvCWEM0qqiix3wA
2004-09-08 16:35:01 +00:00
(none)!yura 674fdcbc7d update
(Logical change 1.537)
2004-09-08 16:35:01 +00:00
(none)!yura e252cfd1fb - Added dumping of index records from $INDEX_ROOT and $INDEX_ALLOCATION
- Changed message for resident $INDEX_ALLOCION to print error, because it shouldn't be resident

BKrev: 413f330aNaPVFFoBGD1AKNClj5UZyg
2004-09-08 16:27:54 +00:00
(none)!yura 3d8ff9eb46 - Added dumping of index records from $INDEX_ROOT and $INDEX_ALLOCATION
- Changed message for resident $INDEX_ALLOCION to print error, because it shouldn't be resident

(Logical change 1.536)
2004-09-08 16:27:54 +00:00
(none)!yura 682a037a7f Make ntfscp update all $FILE_NAME attributes, not only first
BKrev: 413eef8bX2Usv96nigHTX27N5JZzOg
2004-09-08 11:39:55 +00:00
(none)!yura 38a92b52ae Make ntfscp update all $FILE_NAME attributes, not only first
(Logical change 1.535)
2004-09-08 11:39:55 +00:00
cantab.net!aia21 27a017de70 Update library version for source/binary incompatible API changes.
(Logical change 1.534)
2004-09-06 09:44:16 +00:00
cantab.net!aia21 dcdc9a4b7a Start 2.0.0-WIP
(Logical change 1.534)
2004-09-06 09:44:16 +00:00
cantab.net!aia21 338daf2d36 - Update library version for source/binary incompatible API changes.
- Start 2.0.0-WIP.

BKrev: 413c3170UYNp9Tc5rzJJ0IJO-qce1Q
2004-09-06 09:44:16 +00:00
cantab.net!aia21 f32afd249e Add start_vcn parameter to ntfs_get_size_for_mapping_pairs() and
ntfs_mapping_pairs_build() and adapt all callers.

BKrev: 413c2d74zrWuiQNUP4PbL7sodzPb-A
2004-09-06 09:27:16 +00:00
cantab.net!aia21 06086ae5c7 Add start_vcn parameter to ntfs_get_size_for_mapping_pairs() and
ntfs_mapping_pairs_build() and adapt all callers.

(Logical change 1.533)
2004-09-06 09:27:16 +00:00
cantab.net!aia21 3dc22bbae1 configure.ac, configure:
Update version.

BKrev: 41399567ha0o5IztXvbqXpHspCXvHg
2004-09-04 10:13:59 +00:00
cantab.net!aia21 558b679d8c Update version.
(Logical change 1.532)
2004-09-04 10:13:59 +00:00
cantab.net!aia21 756e93cd89 Update.
(Logical change 1.531)
2004-09-04 09:58:47 +00:00
cantab.net!aia21 5590665329 ChangeLog, NEWS:
Update.

BKrev: 413991d7EdGCuLK1QVcvITXZvMOZZw
2004-09-04 09:58:47 +00:00
elisa-laajakaista.fi!szaka da2a82fbf2 rewrote most of the examples, minor corrections
(Logical change 1.530)
2004-09-03 21:16:56 +00:00
elisa-laajakaista.fi!szaka 088dce5f91 ntfsclone manual: rewrote most of the examples, minor corrections
BKrev: 4138df48bLpqZAa29f1nkrKBRPAZLg
2004-09-03 21:16:56 +00:00
elisa-laajakaista.fi!szaka b37f1d99fb ntfsclone: special image format support was implemented for sparseness encoding/decoding (Per Olofsson)
(Logical change 1.529)
2004-09-03 20:00:47 +00:00
elisa-laajakaista.fi!szaka ecd038b30e Updated for 1.9.4 release
(Logical change 1.529)
2004-09-03 20:00:47 +00:00
elisa-laajakaista.fi!szaka 0b2c6586d8 Fix ntfsclone crash when --restore-image was used for block device outputs (Masaru Kawashima, Szaka)
(Logical change 1.529)
2004-09-03 20:00:47 +00:00
elisa-laajakaista.fi!szaka 2d473b8b01 - Fix ntfsclone crash when --restore-image was used for block device outputs (Masaru Kawashima, Szaka)
- Changelog update
- TODO.ntfsprogs update

BKrev: 4138cd6fRHza2Zjo3e-LVMJ-S4d5sw
2004-09-03 20:00:47 +00:00
(none)!yura 1c64629939 Made ntfscp update file size in $FILE_NAME(0x30) attribute
BKrev: 41388405lGSjrUAMLBGnTGBbVfXCZg
2004-09-03 14:47:33 +00:00
(none)!yura 52337e4d91 Made ntfscp update file size in $FILE_NAME(0x30) attribute
(Logical change 1.528)
2004-09-03 14:47:33 +00:00
(none)!yura 9dbc52edf8 Move "ntfsls -R" change to proper place (mistakenly was placed to 1.9.2)
BKrev: 41387ac2KGbl_4d5O4zTCB_u1aqG5A
2004-09-03 14:08:02 +00:00
(none)!yura cbb262f047 Move "ntfsls -R" change to proper place (mistakenly was placed to 1.9.2)
(Logical change 1.527)
2004-09-03 14:08:02 +00:00
cantab.net!aia21 0647ddffc5 Fix a warning.
(Logical change 1.526)
2004-09-03 13:48:30 +00:00
!uv 9d954ff33b Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into atlas.:D:/temp/ntfs/ntfsprogs

2004/09/03 13:07:15+01:00 cantab.net!aia21
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2004/09/03 13:06:45+01:00 cantab.net!aia21
Fix a warning in ntfsundelete.c.

BKrev: 4138762eZ4Y9GpbZ3OP2xjOhxoRfUg
2004-09-03 13:48:30 +00:00
!uv dfd3525124 Update about the win32 rewrite.
(Logical change 1.525)
2004-09-03 13:47:56 +00:00
!uv c89ab0033c Update NEWS about the win32 rewrite.
BKrev: 4138760coHV6PLTsUWWZP2B3dHXhHw
2004-09-03 13:47:56 +00:00
!uv 93ea479ad6 win32_io.c: Inline macros that are only used once.
BKrev: 4138735ba4p56xcVpMrDeCDF1CWQCA
2004-09-03 13:36:27 +00:00
!uv da308fb631 Inline macros that are only used once.
(Logical change 1.524)
2004-09-03 13:36:27 +00:00
!uv d8b93c47e1 Fix a segfault that crept in to win32_io.c due to being too rush.
BKrev: 4138669biw5Z_adTsaNlO8WFZr2IBg
2004-09-03 12:42:03 +00:00
!uv 76236c5916 Fix a segfault that crept in to win32_io.c due to being too rush.
(Logical change 1.523)
2004-09-03 12:42:03 +00:00
!uv 56bb2ea35d Rewrite win32_io.c in order to allow device level write support.
All utilities now work on file/volume/disk.

BKrev: 41385ee5IGredfw4jYoNtaB7fY606g
2004-09-03 12:09:09 +00:00
!uv afa5afcb06 Rewrite in order to overcome the following limitations:
ReadFile/WriteFile/SetPointer require aligned inputs (sector/memort wise)
A volume does not have to cover the entire partition.
While a volume is locked, its contents are not accessible via the disk handle.

(Logical change 1.522)
2004-09-03 12:09:09 +00:00
cantab.net!aia21 3b51248789 Bump libntfs version number.
BKrev: 41383c7em-gK_WYeuG5nP8ApcBDpzQ
2004-09-03 09:42:22 +00:00
cantab.net!aia21 434d799fc9 Bump libntfs version number.
(Logical change 1.521)
2004-09-03 09:42:22 +00:00
cantab.net!aia21 aa6067c107 Updates for 1.9.3 release.
BKrev: 413839a8TX_rg6uOgYhxKMrR7lU1fw
2004-09-03 09:30:16 +00:00
cantab.net!aia21 453d87b43f Update for 1.9.3 release.
(Logical change 1.520)
2004-09-03 09:30:16 +00:00
cantab.net!aia21 a8cd71cdd5 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2004/08/31 16:12:22+01:00 cantab.net!aia21
- Change ntfs_attr_make_non_resident() to only allocate clusters and attempt
  to write out data if the attribute size is not zero.  (Anton)
- Fix ntfs_non_resident_attr_expand() to use ntfs_attr_map_whole_runlist()
  instead of ntfs_attr_map_runlist().  (Anton)
- Change ntfs_get_size_for_mapping_pairs() ntfs_mapping_pairs_build() to
  treat a NULL runlist to mean empty runlist.  (Anton)

BKrev: 41349b21ktJHNZtUqgd35u-5FyqHjQ
2004-08-31 15:37:05 +00:00
cantab.net!aia21 82b45caa4b Change ntfs_get_size_for_mapping_pairs() and ntfs_mapping_pairs_build()
to treat a NULL runlist to mean empty runlist.  (Anton)

(Logical change 1.519)
2004-08-31 15:37:05 +00:00
cantab.net!aia21 f9209a456e Auto merged
2004/08/31 16:12:21+01:00 cantab.net!aia21
Update

(Logical change 1.519)
2004-08-31 15:37:05 +00:00
cantab.net!aia21 128d9a1001 Auto merged
2004/08/31 16:12:21+01:00 cantab.net!aia21
- Change ntfs_attr_make_non_resident() to only allocate clusters and attempt
  to write out data if the attribute size is not zero.  (Anton)
- Fix ntfs_non_resident_attr_expand() to use ntfs_attr_map_whole_runlist()
  instead of ntfs_attr_map_runlist().  (Anton)

(Logical change 1.519)
2004-08-31 15:37:05 +00:00
cantab.net!aia21 fcdb401959 Exclude
(Logical change 1.518)
2004-08-31 15:33:48 +00:00
cantab.net!aia21 c562d1fdf5 Cset exclude: yura@chaos.(none)|ChangeSet|20040831140519|18684
BKrev: 41349a5cUoYhLl-p3gdHTq9lQzcaaA
2004-08-31 15:33:48 +00:00
(none)!yura 1c50574595 libntfs/attrib.c
improvement to ntfs_non_resident_attr_expand:
    expand multi extent attributes if we don't need to allocate new mft records to perform this.


BKrev: 4134859f0ox7qtuKOA84xKqkC4LPCg
2004-08-31 14:05:19 +00:00
(none)!yura cd3f2379db improvement to ntfs_non_resident_attr_expand:
expand multi extent attributes if we don't need to allocate new mft records to perform this.

(Logical change 1.517)
2004-08-31 14:05:19 +00:00
(none)!yura eade09d2e5 Update and move "ntfsls -R" changing to proper place.
(Logical change 1.517)
2004-08-31 14:05:19 +00:00
cantab.net!aia21 b1aaf86adf Update
(Logical change 1.516)
2004-08-30 20:41:14 +00:00
cantab.net!aia21 82b34f883a Fix memory leaks in ntfsundelete.c and mkntfs.c. (Christophe)
BKrev: 413390eahD2-vlpayecQSO7iMweeKw
2004-08-30 20:41:14 +00:00
cantab.net!aia21 abe69f1964 Fix memory leaks (Christophe).
(Logical change 1.516)
2004-08-30 20:41:14 +00:00
cantab.net!aia21 377ffc3311 Fix memory leak. (Christophe)
(Logical change 1.516)
2004-08-30 20:41:14 +00:00
cantab.net!aia21 c41f53eeb3 Update
(Logical change 1.515)
2004-08-28 21:26:52 +00:00
cantab.net!aia21 6fb1ec5e6b Fix memory leak. (Christophe Grenier)
(Logical change 1.515)
2004-08-28 21:26:52 +00:00
cantab.net!aia21 c8799644c2 Fix memory leak in libntfs/attrib.c. (Christophe Grenier)
BKrev: 4130f89c5vX-b4ZUiyQQde-7-CW93w
2004-08-28 21:26:52 +00:00
flatcap.org!ntfs c4b43727f0 ntfsundelete: option to name the deleted file's parent (Giang)
BKrev: 412a75bbJ-4RV1F6gvPQRrnJN86OEA
2004-08-23 22:54:51 +00:00
flatcap.org!ntfs 75c90dd7a0 keep track of the deleted file's parent
(Logical change 1.514)
2004-08-23 22:54:51 +00:00
flatcap.org!ntfs 02745a21f1 identify the deleted file's parent
(Logical change 1.514)
2004-08-23 22:54:51 +00:00
!uv 60c6241ac8 Refactor ntfsdump_logfile.c: split main() into multiple functions.
BKrev: 41263a02PHvxMZ6pqzP7ppTZvEhblg
2004-08-20 17:50:58 +00:00
!uv 5a4b6c9eaa Refactor ntfsdump_logfile.c: split main() into multiple functions.
(Logical change 1.513)
2004-08-20 17:50:58 +00:00
flatcap.org!ntfs 6de75e1f2b keep track of $Bitmap and $MFT/$BITMAP
(Logical change 1.512)
2004-08-20 17:27:24 +00:00
flatcap.org!ntfs ff87d56b58 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/19 23:37:18+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/18 20:00:16+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/18 19:59:43+01:00 flatcap.org!ntfs
ntfsrm: track memory usage

2004/08/18 19:58:56+01:00 flatcap.org!ntfs
ntfsrm: commit/rollback started

2004/08/18 08:39:07+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/16 13:31:29+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/15 23:53:29+01:00 flatcap.org!ntfs
ntfsrm: start reassembling

2004/08/15 23:04:56+01:00 flatcap.org!ntfs
ntfsrm: change the owner of the bitmaps

2004/08/15 21:12:16+01:00 flatcap.org!ntfs
ntfsrm: point vol at root directory

2004/08/15 18:32:36+01:00 flatcap.org!ntfs
ntfsrm: fix memory leak

2004/08/14 17:03:02+01:00 flatcap.org!ntfs
ntfsrm: extract file details from dir tree

BKrev: 4126347cjrtb560Fkeux8OVIk4pQfg
2004-08-20 17:27:24 +00:00
flatcap.org!ntfs 813fd36687 Auto merged
2004/08/18 19:59:42+01:00 flatcap.org!ntfs
track memory usage

2004/08/18 19:58:56+01:00 flatcap.org!ntfs
commit/rollback filled out a bit

2004/08/15 23:53:28+01:00 flatcap.org!ntfs
start reassembling remove

2004/08/15 23:04:56+01:00 flatcap.org!ntfs
keep the bitmap info on the volume

2004/08/15 21:12:15+01:00 flatcap.org!ntfs
vol's private data now points to the root directory

2004/08/15 18:32:35+01:00 flatcap.org!ntfs
fix memory leak

2004/08/14 17:03:01+01:00 flatcap.org!ntfs
extract file details

(Logical change 1.512)
2004-08-20 17:27:24 +00:00
flatcap.org!ntfs f49c5bc704 Auto merged
2004/08/18 19:59:42+01:00 flatcap.org!ntfs
track memory usage

2004/08/18 19:58:56+01:00 flatcap.org!ntfs
a cache for a non-altered bitmap

2004/08/15 23:53:28+01:00 flatcap.org!ntfs
not needed

2004/08/15 21:12:15+01:00 flatcap.org!ntfs
typo

(Logical change 1.512)
2004-08-20 17:27:24 +00:00
cantab.net!aia21 ec25948835 Revert some of Yuval's changes and fix the putative warnings differently.
BKrev: 4126181adm8g6cikgmOs2SJIxIMz1A
2004-08-20 15:26:18 +00:00
cantab.net!aia21 388972a4bb Revert some of Yuval's changes and fix the putative warnings differently.
(Logical change 1.511)
2004-08-20 15:26:18 +00:00
cantab.net!aia21 8aafc99eef Reapply changes that apparently got lost in Yuval's merge.
BKrev: 412615c5ZmeUUOEahNkZ4Teg1u0Zfg
2004-08-20 15:16:21 +00:00
cantab.net!aia21 627bd9686f Reapply changes that apparently got lost in Yuval's merge.
(Logical change 1.510)
2004-08-20 15:16:21 +00:00
cantab.net!aia21 ace60ce206 Revert a change from Yuval where a bitfield was converted to a char.
BKrev: 41260f86XYe5YNbsWcvb_-H1ek9HaA
2004-08-20 14:49:42 +00:00
cantab.net!aia21 4341f051c4 Revert a change from Yuval where a bitfield was converted to a char.
(Logical change 1.509)
2004-08-20 14:49:42 +00:00
!uv 067797a112 Warning fixes: variable type changeses.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv d1b5859785 Warning fixes: shadowing variables.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv 9747580a05 Warning fixes: printf complains, so add a cast.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv 5ffea94d8d Warning fixes: mixing declerations with code.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv 2e082893fe Warning fixes: missing const and mixing declerations with code.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv 7a64dc8159 Warning fixes: change variable to unsigned.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv c8dd770817 Warning fixes: change of variable type and no need to inline.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv 43b262ad58 Warning fix: shadowing a global variable.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv c9ff3e38e6 Janitor work: Various warning fixes all around the place.
BKrev: 4125eeeaD80jP_6gGnVxxRkCaP7QNg
2004-08-20 12:30:34 +00:00
!uv 912044e09a printf format fixes.
(Logical change 1.507)
2004-08-20 12:18:22 +00:00
!uv ae80043076 printf format fix.
Reformattion a recent debug output change into a common style.

(Logical change 1.507)
2004-08-20 12:18:22 +00:00
!uv 0106f54ff0 printf format fix.
(Logical change 1.507)
2004-08-20 12:18:22 +00:00
!uv b43a5b9051 Various bugfixes related to printf format and incorrect variable types.
BKrev: 4125ec0eaPUcCp2J1JUn4O0JkY0x-g
2004-08-20 12:18:22 +00:00
!uv d9f119eef3 Variable type fix.
(Logical change 1.507)
2004-08-20 12:18:22 +00:00
!uv cb04792793 A printf format fix and a warnning fix.
(Logical change 1.507)
2004-08-20 12:18:22 +00:00
!uv 868e8aa002 A printf format fix and Variable type fixes.
(Logical change 1.507)
2004-08-20 12:18:22 +00:00
!uv 89fee71920 Wrap macro definition with matching #ifndef.
(Logical change 1.506)
2004-08-20 12:04:47 +00:00
!uv 9db879431b Various fixes and enchancments using preprocessor directives.
BKrev: 4125e8dfxH8Gj7E-MUVTJM7a6LA0QQ
2004-08-20 12:04:47 +00:00
!uv fee4dcb145 Restore compile time dependencies at the appropriate level.
(Logical change 1.506)
2004-08-20 12:04:47 +00:00
!uv 083aac380c Resolve #include collusions by using #ifndef.
(Logical change 1.506)
2004-08-20 12:04:47 +00:00
!uv dc9c44c798 Reduce compile time dependencies.
(Logical change 1.506)
2004-08-20 12:04:47 +00:00
!uv b01733f10a Comment unused code with #if 0
(Logical change 1.506)
2004-08-20 12:04:47 +00:00
!uv 86323fac66 Comment #includes by configure's #ifdef HAVE_*
(Logical change 1.506)
2004-08-20 12:04:47 +00:00
!uv 682b8dab6b Use simpler C syntax for aligning a struct.
(Logical change 1.505)
2004-08-20 12:01:17 +00:00
!uv b96c236869 Reorder/pad struct members in order to align to 32 and 64 bit bounderies.
As long as the library ABI is left intact.

BKrev: 4125e80d2nOicvgcLMFurHkoyPsXbA
2004-08-20 12:01:17 +00:00
!uv e7545d7e24 Reorder/pad struct members in order to align to 32 and 64 bit bounderies.
(Logical change 1.505)
2004-08-20 12:01:17 +00:00
!uv 97df123793 Reorder struct members in order to align to 32 and 64 bit bounderies.
(Logical change 1.505)
2004-08-20 12:01:17 +00:00
!uv b15ad70b99 When <mntent.h> does not exist, some parameters may not be used.
(Logical change 1.504)
2004-08-20 11:58:24 +00:00
!uv c73b9f1c8f Usr __attribute__((unused/format/noreturn)) when applicable.
BKrev: 4125e760u6VXpLk2c2DwwJxLj1vinA
2004-08-20 11:58:24 +00:00
!uv c3f683c497 Allow better error checking.
(Logical change 1.504)
2004-08-20 11:58:24 +00:00
!uv 27bf9c0ea0 Allow better compiler optimization/error checking.
(Logical change 1.504)
2004-08-20 11:58:24 +00:00
cantab.net!aia21 d0bae867a2 Move Sprintf,Dputs,Dprintf,Dperror to be defines and call proper
non-inlined functions which are now in debug.c.  (Anton)

BKrev: 41251517UtmWQKKDw-lgyaWFGJ-yFw
2004-08-19 21:01:11 +00:00
cantab.net!aia21 39b62e050e Move Sprintf,Dputs,Dprintf,Dperror to be defines and call proper
non-inlined functions which are now in debug.c.

(Logical change 1.503)
2004-08-19 21:01:11 +00:00
cantab.net!aia21 d33e7eaae4 Fix fallout from previous error output changes.
(Logical change 1.503)
2004-08-19 21:01:11 +00:00
cantab.net!aia21 930e056c02 Use Sprintf instead of doing it by hand.
(Logical change 1.502)
2004-08-18 10:27:49 +00:00
cantab.net!aia21 3c32bde90c Update
(Logical change 1.502)
2004-08-18 10:27:49 +00:00
cantab.net!aia21 380f4f1ce1 Silence compiler warnings.
(Logical change 1.502)
2004-08-18 10:27:49 +00:00
cantab.net!aia21 4910ed561c Change all output to only appear if configure with --enable-debug by
using Dputs/Dprintf instead of fprintf(stderr,.

(Logical change 1.502)
2004-08-18 10:27:49 +00:00
cantab.net!aia21 df05fa02ef Add Sprintf().
(Logical change 1.502)
2004-08-18 10:27:49 +00:00
cantab.net!aia21 5c8a6b2a03 - Fix some warnings. (Anton)
- Make all of libntfs only output anything if configured with
  --enable-debug.  The only exception is ntfs_boot_sector_is_ntfs()
  which now uses a new function Sprintf(), provided by debug.h which
  can be #ifdef-ed out if people want it to be truly silent.  (Anton)

BKrev: 41232f25oIqaTZeJo9wp522TvGh4SQ
2004-08-18 10:27:49 +00:00
cantab.net!aia21 11fa3eb6a9 lcnalloc.c:
Only need two spare runlist elements when realocating memory,
  not three since we no longer add a starting element.

BKrev: 41227374ygcn71Q3qM3GOQLEmm6uAw
2004-08-17 21:07:00 +00:00
cantab.net!aia21 183985792c Only need two spare runlist elements when realocating memory,
not three since we no longer add a starting element.

(Logical change 1.501)
2004-08-17 21:07:00 +00:00
cantab.net!aia21 bd32a5f43a lcnalloc.c:
Fix ntfs_cluster_alloc() to use LCN_RL_NOT_MAPPED rather
  than LCN_ENOENT as runlist terminator.
  Also, make it not create a LCN_RL_NOT_MAPPED element at
  the beginning.

BKrev: 41226e5el_B6t-KN0L2ScPvul_APng
2004-08-17 20:45:18 +00:00
cantab.net!aia21 129a7f0399 Fix ntfs_cluster_alloc() to use LCN_RL_NOT_MAPPED rather
than LCN_ENOENT as runlist terminator.
Also, make it not create a LCN_RL_NOT_MAPPED element at
the beginning.

(Logical change 1.500)
2004-08-17 20:45:18 +00:00
flatcap.org!ntfs 7c9405a388 ntfsundelete: Recover in-use clusters as well (Giang,Carmelo)
BKrev: 412115c3vasFNkvLcttTWHzyGCGW3Q
2004-08-16 20:14:59 +00:00
flatcap.org!ntfs 9fd1edce61 Undelete in-use clusters as well
(Logical change 1.499)
2004-08-16 20:14:59 +00:00
cantab.net!aia21 9b7a86bd3a lcnalloc.c:
Fix some bugs in error recovery code path of ntfs_cluster_alloc() (runlist
  unterminated and one bit was not recovered).  (Anton)

BKrev: 411fcfd6wPnfWQ29VNvZlJPWpdFVDQ
2004-08-15 21:04:22 +00:00
cantab.net!aia21 ddd4ce7688 Update
(Logical change 1.498)
2004-08-15 21:04:22 +00:00
cantab.net!aia21 24d811c682 Fix some bugs in error recovery code path (runlist unterminated and one bit was not recovered).
(Logical change 1.498)
2004-08-15 21:04:22 +00:00
flatcap.org!ntfs a78b1c7b03 use the directory objects to lookup files
(Logical change 1.497)
2004-08-14 15:27:00 +00:00
flatcap.org!ntfs e5e3454756 ntfsrm: find files using the directory objects
BKrev: 411e2f44QF_CHFafkAjVH8dOgw2Dbw
2004-08-14 15:27:00 +00:00
flatcap.org!ntfs 78e3bdfd76 find diverse objects
(Logical change 1.497)
2004-08-14 15:27:00 +00:00
flatcap.org!ntfs fd4d5985b3 ntfsrm: clear up on umount
BKrev: 411cadda9iP2vopE8GNHWB2UTVYo_w
2004-08-13 12:02:34 +00:00
flatcap.org!ntfs 7b752dceda clear up everything on umount
(Logical change 1.496)
2004-08-13 12:02:34 +00:00
flatcap.org!ntfs ae162587c7 ntfsrm: start integrating ntfs_dir, ntfs_volume and ntfs_inode
BKrev: 411ca812qSAkPEyM4gOWgfXKeqkLaA
2004-08-13 11:37:54 +00:00
flatcap.org!ntfs 552a8e42be keep track of inodes
(Logical change 1.495)
2004-08-13 11:37:54 +00:00
flatcap.org!ntfs d25fa0b7c1 integrate ntfs_dir's into the volume and inodes
(Logical change 1.495)
2004-08-13 11:37:54 +00:00
flatcap.org!ntfs bd39196073 minor build fixes
BKrev: 411b71a5FBfxr2wsHWzV_ZxGVzUHIA
2004-08-12 13:33:25 +00:00
flatcap.org!ntfs a61808707f minor build fix
(Logical change 1.494)
2004-08-12 13:33:25 +00:00
flatcap.org!ntfs bd8a6667cf ref count inodes
2004/08/10 16:19:44+01:00 flatcap.org!ntfs
add private data to ntfs inode

(Logical change 1.493)
2004-08-12 09:23:53 +00:00
flatcap.org!ntfs d05efe5a75 add private data to ntfs volume
(Logical change 1.493)
2004-08-12 09:23:53 +00:00
flatcap.org!ntfs e8e0e16320 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/11 15:50:44+01:00 flatcap.org!ntfs
ref count inodes

2004/08/11 10:11:42+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/10 16:19:44+01:00 flatcap.org!ntfs
start attaching directory handling to ntfs objects

BKrev: 411b3729ege_TYjYm__n1l46scvHRg
2004-08-12 09:23:53 +00:00
flatcap.org!ntfs 9b94d609cd default to -a so the user always gets some output
(Logical change 1.492)
2004-08-12 09:22:54 +00:00
flatcap.org!ntfs 3353669e7e Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into flatcap.org:/home/flatcap/ntfsprogs

2004/08/12 10:22:15+01:00 flatcap.org!ntfs
ntfsls: default to -a so the user always gets some output (Giang,Carmelo)

BKrev: 411b36eebNHBjcB_fQ7e9qyOESJzwg
2004-08-12 09:22:54 +00:00
cantab.net!aia21 38cd3a05f1 win32_io.c:
The long waited device-level write support on
  windows.  (Yuval)
ChangeLog:
  Update

BKrev: 411b289eZ822m3BucdRHzIBM8182ag
2004-08-12 08:21:50 +00:00
cantab.net!aia21 d85cb21fed Update
(Logical change 1.491)
2004-08-12 08:21:50 +00:00
cantab.net!aia21 aa85d7a8b1 The long waited device-level write support on
windows.  (Yuval)

(Logical change 1.491)
2004-08-12 08:21:50 +00:00
cantab.net!aia21 96354474b0 ntfslabel.c:
make ntfslabel pay attention to the --no-action
  command line switch. (Yuval)
ChangeLog:
  Update

BKrev: 411b271d1itYZmirsQctsuYf6S8W-A
2004-08-12 08:15:25 +00:00
cantab.net!aia21 4da9583aad make ntfslabel pay attention to the --no-action
command line switch. (Yuval)

(Logical change 1.490)
2004-08-12 08:15:25 +00:00
cantab.net!aia21 9df3149c48 Update
(Logical change 1.490)
2004-08-12 08:15:25 +00:00
cantab.net!aia21 133a40dc61 win32_io.c:
Use the NDev* macros in win32_io.c too. (Yuval)

BKrev: 411b2579qqd3b1_KsbvtsIej9TizsQ
2004-08-12 08:08:25 +00:00
cantab.net!aia21 98b3b601cf Use the NDev* macros in win32_io.c too. (Yuval)
(Logical change 1.489)
2004-08-12 08:08:25 +00:00
cantab.net!aia21 ed6cc32435 win32_io.c:
Change the win32_open function to open volumes
  instead of partitions when possible, and use the windows volume
  locking/dismounting mechanism on R/W open to prevent data corruption. (Yuval)

BKrev: 411b2501nK6U8EqDaO8GMsVOtXL1rg
2004-08-12 08:06:25 +00:00
cantab.net!aia21 1fd33a1326 Change the win32_open function to open volumes
instead of partitions when possible, and use the windows volume
locking/dismounting mechanism on R/W open to prevent data corruption. (Yuval)

(Logical change 1.488)
2004-08-12 08:06:25 +00:00
cantab.net!aia21 1329505fd2 win32_io.c:
Fix debug output issues in win32_io.c (Yuval)

BKrev: 411b232euvRzL1btwwOIenRU5-jGHg
2004-08-12 07:58:38 +00:00
cantab.net!aia21 5038a7e1b9 Fix debug output issues in win32_io.c (Yuval)
(Logical change 1.487)
2004-08-12 07:58:38 +00:00
flatcap.org!ntfs 0f45b52eb2 ntfsls: fixes to recursive option
BKrev: 4119e264yC9_p7aKp49fGEQVEHrVgg
2004-08-11 09:09:56 +00:00
flatcap.org!ntfs 95fc34e169 ntfsls recursive option
(Logical change 1.486)
2004-08-11 09:09:56 +00:00
flatcap.org!ntfs ac81ff1e9f fixes to recursion
(Logical change 1.486)
2004-08-11 09:09:56 +00:00
flatcap.org!ntfs 3e205017a0 Add Carmelo and Giang: ntfsls
(Logical change 1.486)
2004-08-11 09:09:56 +00:00
flatcap.org!ntfs 5fa69ca6eb runlist.c: another fix
BKrev: 4118a733SAjbZc53SMzzw7a4V22Zsg
2004-08-10 10:45:07 +00:00
flatcap.org!ntfs 1be6deedaf deltaxcn will only go as high as (max_cluster-1) so the comparisons below were off by one
(Logical change 1.485)
2004-08-10 10:45:07 +00:00
flatcap.org!ntfs 6646895a63 move structs from .c
(Logical change 1.484)
2004-08-09 16:36:18 +00:00
flatcap.org!ntfs 62d954e92c move out structs
regroup functions

2004/08/04 22:08:05+01:00 flatcap.org!ntfs
rebuild children list after alloc/root add
rearrange pointers and ascend in add2

2004/07/17 01:09:42+01:00 flatcap.org!ntfs
split node

2004/07/17 01:07:06+01:00 flatcap.org!ntfs
some add stuff: freespace, transfer

2004/07/14 23:59:50+01:00 flatcap.org!ntfs
start add file

2004/07/14 23:48:16+01:00 flatcap.org!ntfs
fix corruption in dt_root_remove

(Logical change 1.484)
2004-08-09 16:36:18 +00:00
flatcap.org!ntfs 3d1afab562 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/09 17:36:05+01:00 flatcap.org!ntfs
ntfsrm: reorganise code

2004/08/06 08:30:58+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/05 21:07:18+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/05 13:40:21+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/04 22:08:22+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/04 22:08:05+01:00 flatcap.org!ntfs
ntfsrm: more add code

2004/08/02 20:43:31+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/08/01 10:11:07+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/07/17 01:09:43+01:00 flatcap.org!ntfs
ntfsrm: split node if too full

2004/07/17 01:07:06+01:00 flatcap.org!ntfs
ntfsrm: add file progress

2004/07/16 01:16:29+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/07/14 23:59:50+01:00 flatcap.org!ntfs
ntfsrm: start add file

2004/07/14 23:48:30+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/07/14 23:48:17+01:00 flatcap.org!ntfs
ntfsrm: fix corruption in root remove

BKrev: 4117a802_0N9v03pTUQdwkgueVBKmQ
2004-08-09 16:36:18 +00:00
cantab.net!aia21 c828da77d1 runlist.c:
Refix the fix to the fix in runlist.c highest_vcn == 0 handling.

BKrev: 41177c9es9wZxd3eCLNqH-4OG6oYbg
2004-08-09 13:31:10 +00:00
cantab.net!aia21 c6d73395e4 Refix the fix to the fix in runlist.c highest_vcn == 0 handling.
(Logical change 1.483)
2004-08-09 13:31:10 +00:00
cantab.net!aia21 22166e0ac3 ntfsls.c:
Change include from <> to "" for list.h

BKrev: 411779cfjxM3uZAuZtaqHWWMxpOG2w
2004-08-09 13:19:11 +00:00
cantab.net!aia21 95a799559c Change include from <> to "" for list.h
(Logical change 1.482)
2004-08-09 13:19:11 +00:00
flatcap.org!ntfs 10bccd1eb5 ntfsls: minor code tidy up (Yuval)
BKrev: 4117598fFx9fgXDXlFx1C28flnnukg
2004-08-09 11:01:35 +00:00
flatcap.org!ntfs acc1ae3a46 minor code tidy up
(Logical change 1.481)
2004-08-09 11:01:35 +00:00
flatcap.org!ntfs 6caaf1eb50 ntfsls: Add a recursive option to ntfsls (Giang Nguyen)
BKrev: 4116ad92iCP4TXMgUOeCit9QFGWBDA
2004-08-08 22:47:46 +00:00
flatcap.org!ntfs 82e5f43087 Giang: Add a recursive option to ls
(Logical change 1.480)
2004-08-08 22:47:46 +00:00
cantab.net!aia21 9859b897ba runlist.c:
Improve fix for ntfs_mapping_pairs_decompress for highest_vcn == 0.

BKrev: 4112a66e9-nGkEBiKGdoeghonacW7w
2004-08-05 21:28:14 +00:00
cantab.net!aia21 01e060874b ntfs_mapping_pairs_decompress for highest_vcn == 0.
(Logical change 1.479)
2004-08-05 21:28:14 +00:00
(none)!yura 4dce86efe3 libntfs/attrib.c:
* bugfix ntfs_attr_truncate: determine what we need to do with attribute (expand or shrink) from
      na->data_size not from na->initialized_size
    * revert code and comment update about highest in ntfs_non_resident_attr_{shrink,expand}, because
      I fixed that bug
libntfs/runlist.c:
    * bugfix for ntfs_mapping_pairs_decompress for highest_vcn == 0



BKrev: 41128c175AdXDfELeiTnDXhk1Jgnyw
2004-08-05 19:35:51 +00:00
(none)!yura d3178859aa bugfix for ntfs_mapping_pairs_decompress for highest_vcn == 0
(Logical change 1.478)
2004-08-05 19:35:51 +00:00
(none)!yura a40f1c30b6 * bugfix ntfs_attr_truncate: determine what we need to do with attribute (expand or shrink) from
na->data_size not from na->initialized_size
* revert code and comment update about highest in ntfs_non_resident_attr_{shrink,expand}, because
  I fixed that bug

(Logical change 1.478)
2004-08-05 19:35:51 +00:00
(none)!yura 99517ab2b8 attrib.c:
Restructure of error handling in ntfs_non_resident_attr_expand
	Comments update

BKrev: 41127f4fDBazJmYyQ1nxPm5vlgvIGA
2004-08-05 18:41:19 +00:00
(none)!yura 9be1951a31 Restructure of error handling in ntfs_non_resident_attr_expand
Comments update

(Logical change 1.477)
2004-08-05 18:41:19 +00:00
(none)!yura d99c39d980 fixing bugs in ntfs_non_resident_attr_{shrink,expand} that caused not updating highest_vcn,
if it was equal to 0

(Logical change 1.476)
2004-08-05 13:20:11 +00:00
(none)!yura fc76c7e845 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into chaos.(none):/home/yura/NTFS/ntfsprogs

2004/08/05 15:57:36+03:00 (none)!yura
fixing bugs in ntfs_non_resident_attr_{shrink,expand} that caused not updating highest_vcn,
if it was equal to 0

BKrev: 4112340bqNZehO9Yo83sZ21MLGmlug
2004-08-05 13:20:11 +00:00
cantab.net!aia21 7187d79b3e Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2004/08/05 11:15:42+01:00 cantab.net!aia21
lcnalloc.c:
  Fix a bug in the cluster allocator.
  Also several debug output bugs.

BKrev: 411208davNaKQTr7rT7HL93wATj-hQ
2004-08-05 10:15:54 +00:00
cantab.net!aia21 5ece0477c8 Fix a bug in the cluster allocator.
Also several debug output bugs.

(Logical change 1.475)
2004-08-05 10:15:54 +00:00
(none)!yura ff09004d56 attrib.c::ntfs_non_resident_attr_expand
added code to restore mft record, if we failed build mapping pairs

BKrev: 4111feabADwC3Ey0jZPA9USuK-MtJA
2004-08-05 09:32:27 +00:00
(none)!yura b2b13a1856 attrib.c::ntfs_non_resident_attr_expand
added code to restore mft record, if we failed build mapping pairs

(Logical change 1.474)
2004-08-05 09:32:27 +00:00
cantab.net!aia21 0be5a0a185 attrib.c:
Fix error code paths in ntfs_non_resident_attr_expand() and also
  fix starting lcn determination and set it to -1 if
  there are no valid lcns in the attribute, i.e. let the
  allocator choose in this case.

BKrev: 411148aeLaS0UHZJlYx3McVAMakLSA
2004-08-04 20:35:58 +00:00
cantab.net!aia21 bde8048cac Fix error code paths in ntfs_non_resident_attr_expand() and also
fix starting lcn determination and set it to -1 if
there are no valid lcns in the attribute, i.e. let the
allocator choose in this case.

(Logical change 1.473)
2004-08-04 20:35:58 +00:00
cantab.net!aia21 561e2958cb attrib.c:
Move variable declaration to top of statement block.

BKrev: 4111365eg2C5VznWtbJqwbo6SlDmTA
2004-08-04 19:17:50 +00:00
cantab.net!aia21 c1427ce9c9 Move variable declaration to top of statement block.
(Logical change 1.472)
2004-08-04 19:17:50 +00:00
(none)!yura 37350877c5 small updates to attrib.c
BKrev: 4110b0bdCrpjAxyOBsm5mfUABJqv9w
2004-08-04 09:47:41 +00:00
(none)!yura bb8ee06cad small updates
(Logical change 1.471)
2004-08-04 09:47:41 +00:00
(none)!yura ba508305e3 update
(Logical change 1.470)
2004-08-03 17:53:48 +00:00
(none)!yura 0c92486d08 make ntfs_cluster_free not fail if ntfs_attr_find_vcn returned ENOENT
(Logical change 1.470)
2004-08-03 17:53:48 +00:00
(none)!yura b996e483e3 libntfs/attrib.c
bugfix in ntfs_attr_map{_whole_,_}runlist: make it not fail if runlist already mapped
libntfs/lcnalloc.c
    make ntfs_cluster_free not fail if ntfs_attr_find_vcn returned ENOENT

BKrev: 410fd12cx3EaAt8BOE-J5zqvaGExBA
2004-08-03 17:53:48 +00:00
(none)!yura 73c333a681 bugfix in ntfs_attr_map{_whole_,_}runlist: make it not fail if runlist already mapped
(Logical change 1.470)
2004-08-03 17:53:48 +00:00
(none)!yura 32f14d38a7 update ChangeLog
BKrev: 410e7540KrFfaWTKb9yoAL0NBusB3A
2004-08-02 17:09:20 +00:00
(none)!yura d2743d4216 update
(Logical change 1.469)
2004-08-02 17:09:20 +00:00
(none)!yura ad91c15528 various updates and fixes
(Logical change 1.468)
2004-08-02 16:56:34 +00:00
(none)!yura bf6f920115 libntfs/attrib.c
* various updates and fixes
libntfs/lcnalloc.c
    * bugfix for ntfs_cluster_alloc when @count = 0.
    * add ntfs_clster_free_from_rl and make ntfs_cluster_alloc use it

BKrev: 410e7242eGKUorRYb_6nagFZRimo9A
2004-08-02 16:56:34 +00:00
(none)!yura 3abf487908 add ntfs_clster_free_from_rl prototype
(Logical change 1.468)
2004-08-02 16:56:34 +00:00
(none)!yura 910855a174 * bugfix for ntfs_cluster_alloc when @count = 0.
* add ntfs_clster_free_from_rl and make ntfs_cluster_alloc use it

(Logical change 1.468)
2004-08-02 16:56:34 +00:00
(none)!yura 931b78f491 add ntfscp to build
BKrev: 410e2e01FrtLB9jtLEOrAbifdUbXzw
2004-08-02 12:05:21 +00:00
(none)!yura 03f1839241 add ntfscp to build
(Logical change 1.467)
2004-08-02 12:05:21 +00:00
(none)!yura e6702c50e8 include/ntfs/lcnalloc.[ch]
Add a @start_vcn parameter to lcnalloc.[ch]::ntfs_cluster_alloc

libntfs/attrib.c
    Add new function attrib.c::ntfs_non_resident_attr_expand, thus we can expand non resident attributes

BKrev: 410cce8arlxZNdQ2OY5Oisg_nANE3w
2004-08-01 11:05:46 +00:00
(none)!yura f81543dbc9 Update
(Logical change 1.466)
2004-08-01 11:05:46 +00:00
(none)!yura d1ecde1e2d Fix spelling
(Logical change 1.466)
2004-08-01 11:05:46 +00:00
(none)!yura 70bfea1080 Add new function attrib.c::ntfs_non_resident_attr_expand, thus we can expand non resident attributes
(Logical change 1.466)
2004-08-01 11:05:46 +00:00
(none)!yura 50b9026628 Add a @start_vcn parameter to lcnalloc.[ch]::ntfs_cluster_alloc
(Logical change 1.466)
2004-08-01 11:05:46 +00:00
(none)!yura ebeac904ba add ntfscp to ignore list
(Logical change 1.465)
2004-07-30 13:00:24 +00:00
(none)!yura b92c24f0ae New utility - ntfscp.
libntfs/attrib.c: bugfix for ntfs_attr_size_bounds_check

BKrev: 410a4668fcSXLpwrIJvgGhdNXGsEYQ
2004-07-30 13:00:24 +00:00
(none)!yura 1ce46a27b1 Initial revision 2004-07-30 13:00:24 +00:00
(none)!yura d2fd32b481 Fix bug in ntfs_attr_size_bounds_check that caused it always fail if no maximum limit for attribute size
(Logical change 1.465)
2004-07-30 13:00:24 +00:00
(none)!yura 6c71138294 (Logical change 1.465) 2004-07-30 13:00:24 +00:00
flatcap.org!ntfs 6968c5bc66 truncate option
(Logical change 1.464)
2004-07-15 18:28:05 +00:00
flatcap.org!ntfs f76bf5b5fa SCCS merged
2004/07/15 19:21:58+01:00 flatcap.org!ntfs
ntfsundelete truncate option

(Logical change 1.464)
2004-07-15 18:28:05 +00:00
flatcap.org!ntfs 387bb6c5cd Merge
2004/07/15 19:21:58+01:00 flatcap.org!ntfs
ntfsundelete: Thanks to mabs.  If undelete is confident about the size of a deleted file, the "--truncate" option will recover exactly that amount of data.  The default is to round up the size to the nearest cluster.

BKrev: 40f6ccb5SCzucLc1iVaA_LGMf1eQiw
2004-07-15 18:28:05 +00:00
cantab.net!aia21 bb757d9012 Update for Yuval's win32 changes.
(Logical change 1.463)
2004-07-15 09:50:08 +00:00
cantab.net!aia21 3297e348b1 Update ChangeLog for Yuval's win32 changes.
BKrev: 40f65350NKnTsE3Pjtb1qytVuZIE0g
2004-07-15 09:50:08 +00:00
cantab.net!aia21 faa7f82c0c Remove 2 unused functions.
(Logical change 1.462)
2004-07-15 09:43:09 +00:00
cantab.net!aia21 51c0cb5fcd Remove 2 unused functions (libntfs/win32_io.c). (Yuval)
BKrev: 40f651adkTKbejCDRqQyXl-Ea41k2A
2004-07-15 09:43:09 +00:00
cantab.net!aia21 d3007d5542 Add nice comments to functions.
(Logical change 1.461)
2004-07-15 09:41:47 +00:00
cantab.net!aia21 203365d140 Add nice comments to functions (libntfs/win32_io.c). (Yuval)
BKrev: 40f6515bNFnQbSXIq8-3D1RzbGMoVA
2004-07-15 09:41:47 +00:00
cantab.net!aia21 e2b3e1c7e2 Implement ntfs_device_win32_stat(). (Yuval)
BKrev: 40f65112kzadGJ_BNlusLftSdMvvNg
2004-07-15 09:40:34 +00:00
cantab.net!aia21 2604474716 Implement ntfs_device_win32_stat().
(Logical change 1.460)
2004-07-15 09:40:34 +00:00
cantab.net!aia21 09ffab4224 Implement ntfs_device_win32_sync(). (Yuval)
BKrev: 40f6503fWhRVQKdnM9a8qiThOT56Bg
2004-07-15 09:37:03 +00:00
cantab.net!aia21 40d7371812 Implement ntfs_device_win32_sync().
(Logical change 1.459)
2004-07-15 09:37:03 +00:00
cantab.net!aia21 0d5f1fdb3e Re-factor the existing ntfs_device_win32_open(). (Yuval)
BKrev: 40f64fceuQ22VqwuFd2azoFK3yjgtA
2004-07-15 09:35:10 +00:00
cantab.net!aia21 0dfe86e663 Re-factor the existing ntfs_device_win32_open().
(Logical change 1.458)
2004-07-15 09:35:10 +00:00
cantab.net!aia21 8b5ea751ef Implement ntfs_device_win32_ioctl(). (Yuval)
BKrev: 40f64e69VLLHdZ7_i-b8AHMcTd-duw
2004-07-15 09:29:13 +00:00
cantab.net!aia21 3b3ac7b234 Implement ntfs_device_win32_ioctl().
(Logical change 1.457)
2004-07-15 09:29:13 +00:00
cantab.net!aia21 47d78b7197 Fix Yuval's last patch: runlist_element is not a struct it is a typedef
so renamed it to the struct name which is _runlist_element. (Anton)

BKrev: 40f3fce98cr9Bx9kKnLFaGFVqi4S8Q
2004-07-13 15:16:57 +00:00
cantab.net!aia21 aa4542d8f4 Fix Yuval's last patch: runlist_element is not a struct it is a typedef
so renamed it to the struct name which is _runlist_element.

(Logical change 1.456)
2004-07-13 15:16:57 +00:00
cantab.net!aia21 2198f29e89 include/ntfs/debug.h
Remote attrib.h include so win32_io.c can include debug.h. (Yuval)
libntfs/debug.c
    Include attrib.h before debug.h as debug.h no longer includes attrib.h. (Yuval)
libntfs/win32_io.c
    Include debug.h and remove duplicated code. (Yuval)

BKrev: 40f3fa2bfK8Ztgw7LQX8xD6Kptf63Q
2004-07-13 15:05:15 +00:00
cantab.net!aia21 41121112e5 Remote attrib.h include so win32_io.c can include debug.h. (Yuval)
(Logical change 1.455)
2004-07-13 15:05:15 +00:00
cantab.net!aia21 a93c3f9549 Include debug.h and remove duplicated code. (Yuval)
(Logical change 1.455)
2004-07-13 15:05:15 +00:00
cantab.net!aia21 ae0653cc18 Include attrib.h before debug.h as debug.h no longer includes attrib.h. (Yuval)
(Logical change 1.455)
2004-07-13 15:05:15 +00:00
cantab.net!aia21 38314bb499 Fix compiler warning. (Yuval)
(Logical change 1.454)
2004-07-13 13:06:05 +00:00
cantab.net!aia21 be1c64d294 Fix compiler warning in ntfsundelete. (Yuval)
BKrev: 40f3de3dbPCmd1IDAxo292xi7xzQ_Q
2004-07-13 13:06:05 +00:00
cantab.net!aia21 315c8b395e Add noreturn attribute to mkntfs.c::err_exit function. (Yuval)
BKrev: 40f3ddc2b9iEp7OUY_0XOtP9Pr9FSg
2004-07-13 13:04:02 +00:00
cantab.net!aia21 dfde7adfd4 Add noreturn attribute to err_exit function. (Yuval)
(Logical change 1.453)
2004-07-13 13:04:02 +00:00
cantab.net!aia21 c649d2b570 Update CREDITS and AUTHORS.
BKrev: 40f3dd36bnyP43RPFTBg3W3H1QvT8A
2004-07-13 13:01:42 +00:00
cantab.net!aia21 ca998f6fc5 Update
(Logical change 1.452)
2004-07-13 13:01:42 +00:00
elisa-laajakaista.fi!szaka 87a2d1bfef added special image format support (Per Olofsson)
(Logical change 1.451)
2004-07-10 20:01:17 +00:00
elisa-laajakaista.fi!szaka 3b20fca911 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into a80-186-119-178.elisa-laajakaista.fi:/home/szaka/ntfs/bk/ntfsprogs

2004/07/10 23:00:28+03:00 elisa-laajakaista.fi!szaka
ntfsclone manual: enhancements, fixes, emphasize new imaging feature better

2004/07/10 17:40:52+03:00 elisa-laajakaista.fi!szaka
ntfsclone: added special image format support  (Per Olofsson)

BKrev: 40f04b0dmMY8xPiYFH0hHw2NqKRk_A
2004-07-10 20:01:17 +00:00
elisa-laajakaista.fi!szaka c329cb8c65 Enhancements, fixes, emphasize new imaging feature better
2004/07/10 17:40:52+03:00 elisa-laajakaista.fi!szaka
added special image format support  (Per Olofsson)

(Logical change 1.451)
2004-07-10 20:01:17 +00:00
elisa-laajakaista.fi!szaka 50395bd881 Auto merged
2004/07/10 17:40:52+03:00 elisa-laajakaista.fi!szaka
ntfsclone: added special image format support  (Per Olofsson)

(Logical change 1.451)
2004-07-10 20:01:17 +00:00
(none)!yura b22fc80ae4 ntfsprogs/cluster.c
More quietly cluster_find

BKrev: 40eeb04fCq8_tJ-JD3K8PlQKVWT-ng
2004-07-09 14:48:47 +00:00
(none)!yura d47c77cd32 More quietly cluster_find
(Logical change 1.450)
2004-07-09 14:48:47 +00:00
flatcap.org!ntfs e58d93fac0 ntfsrm: finish off remove
BKrev: 40eddd1epcj6wt703yQ7f_AB4jF1ng
2004-07-08 23:47:42 +00:00
flatcap.org!ntfs 31b8e1ecd4 fix root_replace
finish off remove

(Logical change 1.449)
2004-07-08 23:47:42 +00:00
flatcap.org!ntfs 8e0635f403 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/07/08 14:39:16+03:00 (none)!yura
fixes to ntfs_attr_p{read,write} and ntfs_rl_p{read,write}

2004/07/08 12:25:16+03:00 (none)!yura
ntfswipe: Added code to determine INDX record size from $INDEX_ROOT

BKrev: 40edac68ZLTHCGIRDg8U9IA77omIug
2004-07-08 20:19:52 +00:00
(none)!yura 9576429f7f ntfs_rl_p{read,write}: "* vol->cluster_size" replaced with faster and more compatible "<< vol->cluster_size_bits"
(Logical change 1.448)
2004-07-08 20:19:52 +00:00
(none)!yura 5d43e167d5 Fixed bug that cause ntfs_attr_p{read,write} fail on resident encrypted attribute
(Logical change 1.448)
2004-07-08 20:19:52 +00:00
(none)!yura 631668c253 Added code to determine INDX record size from $INDEX_ROOT
(Logical change 1.448)
2004-07-08 20:19:52 +00:00
flatcap.org!ntfs 4ea006cda2 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/07/07 09:25:39+01:00 cantab.net!aia21
Fix potential corruption due to journal replay in ntfswipe.c by always
calling libntfs/volume.c::ntfs_logfile_reset() (unless act == act_info)
at the end of ntfswipe.c.  This also ensures Windows is able to boot this
partition.

BKrev: 40ebf169zTpbWwoYaiqOhzNr8yBuJg
2004-07-07 12:49:45 +00:00
cantab.net!aia21 82a284b4ab Use libntfs/volume.c::ntfs_logfile_reset() instead of wipe_logfile() at the
end of ntfswipe.c.  Also, always do the reset (unless act == act_info) to
ensure windows can boot and so journal replay does not cause corruption.

(Logical change 1.447)
2004-07-07 12:49:45 +00:00
flatcap.org!ntfs 2ff36e8634 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/07/06 21:46:22+03:00 (none)!yura
ntfswipe:
 * wipe_directory implementation
 * don't force overwrite logfile with 0xFF for ntfs v3.1
 * bugfix in wipe_tails
 * cleanups
ntfswipe and ntfsinfo:
 * endian fixes
 * indention fixes

BKrev: 40eb0321Dbr8VlYY1kzajoFrbO1XzA
2004-07-06 19:53:05 +00:00
(none)!yura 3145f17897 update for wipe_directory
(Logical change 1.446)
2004-07-06 19:53:05 +00:00
(none)!yura b8c2ec25b6 fix comment
(Logical change 1.446)
2004-07-06 19:53:05 +00:00
(none)!yura 5286770d63 * wipe_directory implementation
* don't force overwrite logfile with 0xFF for ntfs v3.1
* endian fix
* indention fixes
* cleanups
* bugfix ntfswipe_tail for compressed blocks followed by >1 sparse blocks

(Logical change 1.446)
2004-07-06 19:53:05 +00:00
(none)!yura 5435e5faef * endian fix
* indention fixes

(Logical change 1.446)
2004-07-06 19:53:05 +00:00
flatcap.org!ntfs 84d3535216 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/07/02 20:17:23+03:00 (none)!yura
ntfswipe: various cleanups and fixes

BKrev: 40e83334I0ihCAUeHz5hQDaixH0NQw
2004-07-04 16:41:24 +00:00
(none)!yura 3a41564173 Various cleanups and fixes
(Logical change 1.445)
2004-07-04 16:41:24 +00:00
flatcap.org!ntfs 5ec44c6f68 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/28 16:13:42+03:00 (none)!yura
ntfswipe: fixes to wipe_tails
wipe_tails looks pretty complete!

BKrev: 40e0a44eP8B1Ua-nl0-sL2jD-Msswg
2004-06-28 23:05:50 +00:00
(none)!yura 07ef30bdf6 wipe_tails:
* proper implementation of wipe_compressed_attribute
* various fixes

(Logical change 1.444)
2004-06-28 23:05:50 +00:00
flatcap.org!ntfs 2e579e14a7 ntfsrm: make mft modifications in memory
BKrev: 40de1d6cdb3V3VSrY1zusTN1vCbBnQ
2004-06-27 01:05:48 +00:00
flatcap.org!ntfs a1805f9212 make mft modifications in memory
(Logical change 1.443)
2004-06-27 01:05:48 +00:00
flatcap.org!ntfs 6b1670837c make bitmap alterations in memory
(Logical change 1.442)
2004-06-26 10:35:23 +00:00
flatcap.org!ntfs 26d2ca28d0 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/26 11:31:19+01:00 flatcap.org!ntfs
make bitmap alterations in memory

BKrev: 40dd516bI19f8h5aJ50809UbhoPqUA
2004-06-26 10:35:23 +00:00
(none)!yura 9d0b3d8069 wipe_tails:
* disable of handling compressed DATA attribute (it isn't safe now), until I implement it properly
* fixed bug in handling very fragmented files

(Logical change 1.441)
2004-06-25 17:08:20 +00:00
(none)!yura 97b67d3f67 fixes to ntfswipe in wipe_tails
BKrev: 40dc5c04W-4bdfUDbnLCmL4fD-SUuA
2004-06-25 17:08:20 +00:00
flatcap.org!ntfs 3c13c55f5a tidier version of add_root/alloc
BKrev: 40db1779OuoVusPELJp67N1zDGHXVQ
2004-06-24 18:03:37 +00:00
flatcap.org!ntfs f961d41277 tidier version of add_root/alloc
(Logical change 1.440)
2004-06-24 18:03:37 +00:00
flatcap.org!ntfs 2adcb49e33 jazzed up dump mem
(Logical change 1.439)
2004-06-24 13:08:28 +00:00
flatcap.org!ntfs 4f7f3e7dc6 cleaner versions of remove root/alloc
BKrev: 40dad24c7r47g_o02XmY_galSxLCYA
2004-06-24 13:08:28 +00:00
flatcap.org!ntfs 9b00923dd5 cleaner versions of remove root/alloc
(Logical change 1.439)
2004-06-24 13:08:28 +00:00
flatcap.org!ntfs ac0ec2a817 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/24 01:14:45+03:00 (none)!yura
ntfswipe: improvments to the wipe_tails

BKrev: 40da1055QaPciTfD8UaGoy9lNgSB4g
2004-06-23 23:20:53 +00:00
(none)!yura 0f0a8013fc wipe_tails:
* Support of very fragmented files (runlist don't fit one mft record)
* Code restructure
* Minor bugfixes

(Logical change 1.438)
2004-06-23 23:20:53 +00:00
flatcap.org!ntfs da6b6d8a9a Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/23 02:42:46+03:00 elisa-laajakaista.fi!szaka
ntfsresize: make fsck related functions reusable: exit -> return conversations [ongoing]

BKrev: 40d99145HbPsmQ2qiAspzG--Xko39g
2004-06-23 14:18:45 +00:00
elisa-laajakaista.fi!szaka be6c3651f6 make fsck related functions reusable: exit -> return conversations [ongoing]
(Logical change 1.437)
2004-06-23 14:18:45 +00:00
flatcap.org!ntfs 46559d925e replace non-leaf node with its successor
BKrev: 40d8af20IqGULXH7BuLi0TlIrXkS0w
2004-06-22 22:13:52 +00:00
flatcap.org!ntfs a18ae8d3c4 replace non-leaf node with its successor
(Logical change 1.436)
2004-06-22 22:13:52 +00:00
flatcap.org!ntfs 9c8df3da55 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/22 19:49:17+03:00 (none)!yura
ntfswipe: wipe_tails implementation for compressed, encrypted and sparce files.
ntfsinfo: Output runlist for DATA attribute in verbose mode

BKrev: 40d8729a9cx9Vmle0BP4mUEGsAbWVg
2004-06-22 17:55:38 +00:00
(none)!yura d09e6a7f4a wipe_tails implementation for compressed, encrypted and sparce files.
(Logical change 1.435)
2004-06-22 17:55:38 +00:00
(none)!yura ff0334f3c5 Output runlist for DATA attribute in verbose mode
(Logical change 1.435)
2004-06-22 17:55:38 +00:00
flatcap.org!ntfs d0c18bfb7d restore the grouping.
ignore temporary files (*~) wherever they are.

(Logical change 1.434)
2004-06-21 23:09:35 +00:00
flatcap.org!ntfs e1ed723ee5 Merge flatcap.org:/home/flatcap/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/22 00:08:36+01:00 flatcap.org!ntfs
tidy up ignore file

BKrev: 40d76aafmOYduSUD_uUNJMZ5HvI6mw
2004-06-21 23:09:35 +00:00
flatcap.org!ntfs 0819e9f073 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/21 21:04:44+03:00 (none)!yura
Fixed small memleak

BKrev: 40d764dfmqMOFKvlL0l--W0PwqYbAQ
2004-06-21 22:44:47 +00:00
(none)!yura c6f44798eb Free runlist after use
(Logical change 1.433)
2004-06-21 22:44:47 +00:00
(none)!yura 09bb4cf775 Added ntfsprogs/ntfsinfo.c~ to the ignore list
(Logical change 1.433)
2004-06-21 22:44:47 +00:00
flatcap.org!ntfs efbd356702 start manipulating keys on delete
BKrev: 40d7647buGMrRiPGeRhMTKSTfykRtQ
2004-06-21 22:43:07 +00:00
flatcap.org!ntfs 4764e7ad65 start manipulating keys on delete
(Logical change 1.432)
2004-06-21 22:43:07 +00:00
flatcap.org!ntfs 6e698185ad add an index entry to an index root
BKrev: 40d730302ZpzTo7rSo0tbXrtmq8zjg
2004-06-21 19:00:00 +00:00
flatcap.org!ntfs 546750a4f5 add an index entry to an index root
(Logical change 1.431)
2004-06-21 19:00:00 +00:00
flatcap.org!ntfs fe45c2b834 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/21 10:21:16+01:00 cantab.net!aia21
Fix Yura's fix to libntfs/runlist.c::ntfs_rl_p{read,write}(). (Anton)

BKrev: 40d6af8bM0FSGat4Xl-6TA59eMSM5A
2004-06-21 09:51:07 +00:00
cantab.net!aia21 66c60d9659 Fix Yura's fix.
(Logical change 1.430)
2004-06-21 09:51:07 +00:00
flatcap.org!ntfs 34ec6052e2 add an index entry to an index
BKrev: 40d61aa9U92h3kKVzRTIXS4Euy3XlQ
2004-06-20 23:15:53 +00:00
flatcap.org!ntfs 2bd3dc1596 add an index entry to an index
(Logical change 1.429)
2004-06-20 23:15:53 +00:00
flatcap.org!ntfs fb1cdc8825 wipe file tails
(Logical change 1.428)
2004-06-20 16:47:19 +00:00
flatcap.org!ntfs c90bc03ffd missing credit
(Logical change 1.428)
2004-06-20 16:47:19 +00:00
flatcap.org!ntfs def9a888b6 credits for Yura
(Logical change 1.428)
2004-06-20 16:47:19 +00:00
flatcap.org!ntfs b429c1fc69 bugfix for ntfs_rl_pread,pwrite for pos > 0
(Logical change 1.428)
2004-06-20 16:47:19 +00:00
flatcap.org!ntfs 715d0aa024 Yura: ntfswipe - wipe file tails
BKrev: 40d5bf976wEWiVQkeCAsYVeEPC1CnA
2004-06-20 16:47:19 +00:00
flatcap.org!ntfs d74632353d Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into flatcap.org:/home/flatcap/ntfsprogs

2004/06/18 16:24:16+01:00 cantab.net!aia21
Cset exclude: aia21@cantab.net|ChangeSet|20040617200338|20487

BKrev: 40d32c61oc6gmDs0r26TIwzaHych5A
2004-06-18 17:54:41 +00:00
flatcap.org!ntfs 3f9850d4cf Auto merged
2004/06/18 16:24:15+01:00 cantab.net!aia21
Exclude

(Logical change 1.427)
2004-06-18 17:54:41 +00:00
flatcap.org!ntfs acef9d58b3 routines to add/remove a name and add/remove a vcn
(Logical change 1.426)
2004-06-18 17:51:59 +00:00
flatcap.org!ntfs 5bc3824d85 index entry code
BKrev: 40d32bbf2EZ82ncb-xQ9sOWUgbjzzQ
2004-06-18 17:51:59 +00:00
flatcap.org!ntfs 32c0424f26 create an index entry from scratch
BKrev: 40d227c4Oi4CmLKIatH7-cb81AZAiA
2004-06-17 23:22:44 +00:00
flatcap.org!ntfs 9847ef4fcc create an index entry from scratch
(Logical change 1.425)
2004-06-17 23:22:44 +00:00
flatcap.org!ntfs fadd3d0d2b start some index entry manipulation routines
BKrev: 40d211f6CHTVuCsvBAiJc72rwEpS4g
2004-06-17 21:49:42 +00:00
flatcap.org!ntfs 6219eecc7b start some index entry manipulation routines
(Logical change 1.424)
2004-06-17 21:49:42 +00:00
flatcap.org!ntfs aa69ba08e4 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/17 21:03:45+01:00 cantab.net!aia21
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2004/06/17 21:03:38+01:00 cantab.net!aia21
ntfsinfo.c:
  Endianness fix.

BKrev: 40d1fa7cM0elyrDoCCQoAF2ByDI0-w
2004-06-17 20:09:32 +00:00
flatcap.org!ntfs 4a82a887c3 Auto merged
2004/06/17 21:03:45+01:00 cantab.net!aia21
Auto merged

2004/06/17 21:03:28+01:00 cantab.net!aia21
Endianness fix.

(Logical change 1.423)
2004-06-17 20:09:32 +00:00
flatcap.org!ntfs 395cf1b994 sort out the folding after a botched merge
(Logical change 1.422)
2004-06-16 22:51:38 +00:00
flatcap.org!ntfs 514d5bb3b5 more folding
BKrev: 40d0cefasqUEwWMx6-mOoS2CqbH2WA
2004-06-16 22:51:38 +00:00
flatcap.org!ntfs 53cdde3dda dump an index
2004/06/06 19:47:06+01:00 flatcap.org!ntfs
make the find's more similar.
stop crash if file not found.
stop reading entire index.

(Logical change 1.421)
2004-06-16 22:44:00 +00:00
flatcap.org!ntfs 08285f5f82 SCCS merged
2004/06/07 23:00:44+01:00 flatcap.org!ntfs
add size to index alloc,
change comments slightly to allow vim to fold

(Logical change 1.421)
2004-06-16 22:44:00 +00:00
flatcap.org!ntfs f5d428139c Merge
2004/06/07 23:00:44+01:00 flatcap.org!ntfs
index alloc size

2004/06/06 21:18:20+01:00 flatcap.org!ntfs
dump an index

2004/06/06 19:47:07+01:00 flatcap.org!ntfs
minor fixes

BKrev: 40d0cd30AobgjXrgpe9aTSV3Km_MTA
2004-06-16 22:44:00 +00:00
flatcap.org!ntfs 2099f9392c stop info crashing when it encounters a non-resident security attribute
(Logical change 1.420)
2004-06-16 22:16:30 +00:00
flatcap.org!ntfs b9bb3745e3 bugfix for ntfsinfo
(Logical change 1.420)
2004-06-16 22:16:30 +00:00
flatcap.org!ntfs e7ccf6839f bug fix for ntfsinfo
BKrev: 40d0c6beqBaSBMTZHMPS7kZRk_dU6w
2004-06-16 22:16:30 +00:00
flatcap.org!ntfs 4b697efed2 Add Yura
(Logical change 1.420)
2004-06-16 22:16:30 +00:00
cantab.net!aia21 cce8965893 Update changelog.
BKrev: 40c5e8b1a4cXIRt_2gEVC6tyPq-U4A
2004-06-08 16:26:25 +00:00
cantab.net!aia21 8ad9c17322 Update
(Logical change 1.419)
2004-06-08 16:26:25 +00:00
cantab.net!aia21 3a429c0bc8 ntfsinfo patch from Yuval:
Remove compiler warnings about unused parameters by adding the
__attribute__((unused))
Note: these functions are still in the todo list at the top of the file,
so removing the warnings will not make it forgotten.

BKrev: 40c5e85dMT0bnsF_IUd35AdHDVGclg
2004-06-08 16:25:01 +00:00
cantab.net!aia21 49b10c0f61 Remove compiler warnings about unused parameters by adding the
__attribute__((unused))
Note: these functions are still in the todo list at the top of the file,
so removing the warnings will not make it forgotten.

(Logical change 1.418)
2004-06-08 16:25:01 +00:00
cantab.net!aia21 53b60abae5 global miscellaneous cleanup.
(Logical change 1.417)
2004-06-08 16:17:51 +00:00
cantab.net!aia21 2f2a306dec global miscellaneous cleanup to ntfsinfo. (Yuval, some fixes from Anton)
BKrev: 40c5e6af5cN5vKogU8PtIGDM6EJQLw
2004-06-08 16:17:51 +00:00
cantab.net!aia21 2dafbdd602 Remove irrelevant whitespace from output.
(Logical change 1.416)
2004-06-08 15:58:32 +00:00
cantab.net!aia21 d7f280873f Remove irrelevant whitespace from output of ntfsinfo. (Yuval)
BKrev: 40c5e228HVlB1Zi1psKzTT7-uSCBYg
2004-06-08 15:58:32 +00:00
cantab.net!aia21 0e46071eb0 Dump unknown attributes.
(Logical change 1.415)
2004-06-08 15:57:09 +00:00
cantab.net!aia21 137edfd5c1 Dump unknown attributes in ntfsinfo. (Yuval)
BKrev: 40c5e1d5trTFOKfbko-MOA-ThT9EFg
2004-06-08 15:57:09 +00:00
cantab.net!aia21 99f61bb374 Indentation fixes.
(Logical change 1.414)
2004-06-08 15:55:55 +00:00
cantab.net!aia21 8ebc4d57e7 Indentation fixes to ntfsinfo. (Yuval)
BKrev: 40c5e18bQCP6G7--UdSQaatl4mUt4Q
2004-06-08 15:55:55 +00:00
flatcap.org!ntfs 698d98ed16 minor tidy
BKrev: 40c32776a6FfvfqJXLcKsiefXRXuhw
2004-06-06 14:17:26 +00:00
flatcap.org!ntfs 1649de2d46 Change mode to -rw-rw-r--
(Logical change 1.413)
2004-06-06 14:17:26 +00:00
flatcap.org!ntfs 309c26e588 split remove into remove_alloc and remove_root,
added function to resize an attribute,
now it can delete root entries

BKrev: 40c3217aQYwMqLcZyWaqyXCccKtGQw
2004-06-06 13:51:54 +00:00
flatcap.org!ntfs 8c3a38b818 split remove into remove_alloc and remove_root,
added function to resize an attribute,
now it can delete root entries

(Logical change 1.412)
2004-06-06 13:51:54 +00:00
elisa-laajakaista.fi!szaka 3588a1c649 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into a80-186-119-178.elisa-laajakaista.fi:/home/szaka/ntfs/bk/ntfsprogs

2004/06/04 11:55:55+03:00 elisa-laajakaista.fi!szaka
ntfsclone: fix message, mount -t smbfs doesn't understand 'lfs', only smbmount

BKrev: 40c039eeZDGvvf4B4StIZ4zgNNsWVg
2004-06-04 08:59:26 +00:00
elisa-laajakaista.fi!szaka b6d50b08ad Fix message, mount -t smbfs doesn't understand 'lfs', only smbmount
(Logical change 1.411)
2004-06-04 08:59:26 +00:00
flatcap.org!ntfs f6b3aff863 delete non-resident files too
BKrev: 40be4f96HV24jYEymG7uNisVU30GRg
2004-06-02 22:07:18 +00:00
flatcap.org!ntfs f550ce88fe delete non-resident files too
(Logical change 1.410)
2004-06-02 22:07:18 +00:00
flatcap.org!ntfs d840a80df9 start working on non-resident files
(Logical change 1.409)
2004-06-01 20:21:57 +00:00
flatcap.org!ntfs 23586780a0 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/01 19:31:51+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfs.rm

2004/06/01 00:44:06+01:00 flatcap.org!ntfs
start working on non-resident files

BKrev: 40bce565GnWbDXC8l2vrmZzjnb0fbA
2004-06-01 20:21:57 +00:00
flatcap.org!ntfs 05e1a11b9d Holger Ohmacht: Allow undelete to recover a set / range of inodes.
BKrev: 40bce5089J-tTCmZv2oFAsemX2ACCQ
2004-06-01 20:20:24 +00:00
flatcap.org!ntfs 6995b610d3 Allow undelete to recover a set / range of inodes
(Logical change 1.408)
2004-06-01 20:20:24 +00:00
flatcap.org!ntfs 24ac354062 Added Holger for modifications to undelete
(Logical change 1.408)
2004-06-01 20:20:24 +00:00
flatcap.org!ntfs 1f5cbb78fd remove my email address
BKrev: 40bce207cdxiYtpmjIz1VO-ZFv2s4A
2004-06-01 20:07:35 +00:00
flatcap.org!ntfs a892a133ee remove my email address
(Logical change 1.407)
2004-06-01 20:07:35 +00:00
cantab.net!aia21 b2ce5e087c Update a forgotten comment.
(Logical change 1.406)
2004-06-01 16:29:45 +00:00
cantab.net!aia21 90548737d5 Update a forgotten comment in mkntfs.c.
BKrev: 40bcaef9VMTdNc4Zq4fZSlilTrFmOw
2004-06-01 16:29:45 +00:00
flatcap.org!ntfs b5a43f6b8d refuse any resident attributes,
commit changes to mft record, mft bitmap and index record.
Delete works!

BKrev: 40bb84bb49uQyn1I7d9DqWzHx94KeA
2004-05-31 19:17:15 +00:00
flatcap.org!ntfs 1782b0a8cb refuse any resident attributes,
commit changes to mft record, mft bitmap and index record.
Delete works!

(Logical change 1.405)
2004-05-31 19:17:15 +00:00
flatcap.org!ntfs 2d238ffee3 another case to ignore,
remove unused code,
mark mft rec as unused

BKrev: 40bb2f1biprXLRnVGV-ZyYaBwBoubg
2004-05-31 13:11:55 +00:00
flatcap.org!ntfs 489ceda90f another case to ignore,
remove unused code,
mark mft rec as unused

(Logical change 1.404)
2004-05-31 13:11:55 +00:00
flatcap.org!ntfs a1b0b84208 tidy warnings
BKrev: 40ba195aaQXW3ABkUmOipbukhlaQnw
2004-05-30 17:26:50 +00:00
flatcap.org!ntfs 79b403acca tidy warnings
(Logical change 1.403)
2004-05-30 17:26:50 +00:00
flatcap.org!ntfs a9d8a962a9 fix non-res check
BKrev: 40ba11301-Wz03L_1TQM_blOIhCUpg
2004-05-30 16:52:00 +00:00
flatcap.org!ntfs 9886424982 fix non-res check
(Logical change 1.402)
2004-05-30 16:52:00 +00:00
flatcap.org!ntfs ef75cd263f make output human-readable
(Logical change 1.401)
2004-05-29 14:21:50 +00:00
flatcap.org!ntfs cb41d62d72 fix rest of mem problems,
remove debug code

BKrev: 40b89c7eniLYsktrRlULFIDTJntH_Q
2004-05-29 14:21:50 +00:00
flatcap.org!ntfs e9008c8617 fix rest of mem problems,
remove debug code

(Logical change 1.401)
2004-05-29 14:21:50 +00:00
flatcap.org!ntfs a522a0437f uchar_t -> ntfschar
2004/05/12 00:29:05+01:00 flatcap.org!ntfs
actually remove the entry from the index alloc

2004/05/10 22:59:11+01:00 flatcap.org!ntfs
cope with variable sized indexes,
recurse directories,
ignore things that are hard to delete

2004/05/10 16:34:57+01:00 flatcap.org!ntfs
find the dt that needs and entry deleting

2004/05/10 00:01:11+01:00 flatcap.org!ntfs
recursively descend a directory tree

2004/05/09 22:02:10+01:00 flatcap.org!ntfs
fix mem leaks

2004/05/09 21:21:13+01:00 flatcap.org!ntfs
recursive mapping of one directory's index

2004/05/09 13:01:51+01:00 flatcap.org!ntfs
mapping of dir and first-level dt work

2004/05/08 11:45:27+01:00 flatcap.org!ntfs
happy with structures

2004/02/16 00:25:33+00:00 flatcap.org!ntfs

(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs c55f859808 ignore ntfsrm
(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs 0916464b20 build process changes from the main line
2004/03/11 00:03:56+00:00 flatcap.org!flatcap
Auto merged

2004/03/11 00:03:55+00:00 flatcap.org!flatcap
Merge rename: include/Makefile.in -> include/ntfs/Makefile.in

(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs 1dbe2802c6 build process changes from the main line
2004/03/11 00:03:56+00:00 flatcap.org!flatcap
Auto merged

2004/02/16 00:25:33+00:00 flatcap.org!ntfs
add ntfsrm to the build

(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs 52957ad843 build process changes from the main line
2004/03/11 00:03:55+00:00 flatcap.org!flatcap
Auto merged

2004/02/16 00:25:33+00:00 flatcap.org!ntfs
add ntfsrm to the build

(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs ab15c2b4a1 build process changes from the main line
2004/02/16 00:25:33+00:00 flatcap.org!ntfs
add ntfsrm to the build

(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs c05355e711 alloc freeing of a null inode
(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs b69d1980b3 Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfsprogs.rm

2004/05/24 13:33:48+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/backup/old/home/ntfsprogs.rm

2004/05/14 15:48:36+01:00 flatcap.org!ntfs
uchar_t -> ntfschar

2004/05/14 14:36:34+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfsprogs.rm

2004/05/12 00:29:05+01:00 flatcap.org!ntfs
actually remove the entry from the index alloc

2004/05/11 17:50:50+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfsprogs.rm

2004/05/10 22:59:12+01:00 flatcap.org!ntfs
cope with variable sized indexes,
recurse directories,
ignore things that are hard to delete

2004/05/10 16:35:32+01:00 flatcap.org!ntfs
ntfsrm.c:
  find the dt that needs and entry deleting

2004/05/10 00:03:29+01:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/backup/bk/ntfsprogs
into flatcap.org:/home/flatcap/ntfsprogs.rm

2004/05/10 00:01:11+01:00 flatcap.org!ntfs
recursively descend a directory tree

2004/05/10 00:00:44+01:00 flatcap.org!ntfs
alloc freeing of a null inode

2004/05/09 22:02:10+01:00 flatcap.org!ntfs
fix mem leaks

2004/05/09 21:21:14+01:00 flatcap.org!ntfs
recursive mapping of one directory's index

2004/05/09 13:01:52+01:00 flatcap.org!ntfs
mapping of dir and first-level dt work

2004/05/08 11:45:28+01:00 flatcap.org!ntfs
happy with structures

2004/05/03 15:42:34+01:00 flatcap.org!ntfs
put ntfsrm back in the build

2004/05/03 15:41:19+01:00 flatcap.org!ntfs
build process changes from the main line

2004/03/11 00:03:57+00:00 flatcap.org!flatcap
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs-devel
into flatcap.org:/home/flatcap/ntfs.rm

2004/02/16 00:27:27+00:00 flatcap.org!ntfs
added ntfsrm - just some hacked together code for now

BKrev: 40b44a0cMBq66htcV3V9x1KVCHxxng
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs 1938117fd0 Initial revision 2004-05-26 07:41:00 +00:00
flatcap.org!ntfs fe07034fc3 Auto merged
2004/05/03 15:42:34+01:00 flatcap.org!ntfs
put ntfsrm back in the build

2004/05/03 15:41:18+01:00 flatcap.org!ntfs
build process changes from the main line

2004/03/11 00:03:56+00:00 flatcap.org!flatcap
Auto merged

2004/02/16 00:25:33+00:00 flatcap.org!ntfs
add ntfsrm to the build

(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs 2bb3b959a1 Auto merged
2004/05/03 15:41:18+01:00 flatcap.org!ntfs
build process changes from the main line

2004/03/11 00:03:56+00:00 flatcap.org!flatcap
Auto merged

2004/02/16 00:25:33+00:00 flatcap.org!ntfs
add ntfsrm to the build

(Logical change 1.400)
2004-05-26 07:41:00 +00:00
flatcap.org!ntfs 7d26680bff (Logical change 1.400) 2004-05-26 07:41:00 +00:00
elisa-laajakaista.fi!szaka 9410d1297a ntfsresize: rename ntfs_fsck_t to ntfsck_t
BKrev: 40b41b0dyDZcxF6PrpZTkiayyR4ufA
2004-05-26 04:20:29 +00:00
elisa-laajakaista.fi!szaka 75fe0ab100 Rename ntfs_fsck_t to ntfsck_t
(Logical change 1.399)
2004-05-26 04:20:29 +00:00
elisa-laajakaista.fi!szaka a85d57bb14 ntfsresize: eliminate the global opt.show_progress from progress_update() for code resuse
BKrev: 40b41a2215ZbjgH-KptyRYhoiQDwAQ
2004-05-26 04:16:34 +00:00
elisa-laajakaista.fi!szaka 0e3341d916 Eliminate the global opt.show_progress from progress_update() for code reuse
(Logical change 1.398)
2004-05-26 04:16:34 +00:00
cantab.net!aia21 3528535640 Update ChangeLog for the previous commit.
BKrev: 40b200e3lp3ldlWwXtG6kqsCAdAHPA
2004-05-24 14:04:19 +00:00
cantab.net!aia21 c55508d4b0 Update
(Logical change 1.397)
2004-05-24 14:04:19 +00:00
cantab.net!aia21 bc60f44a05 Add detection for <sys/byteorder.h>.
(Logical change 1.396)
2004-05-24 13:54:07 +00:00
cantab.net!aia21 b803a16d8c - Add detection for <sys/byteorder.h> and make endianness detection
work on Solaris 2.6 (Yuval) and Solaris 9 (Anton).
- Emulate bswap_{16,32,64}() if not available/we cannot find them.

BKrev: 40b1fe7f9xCV9vUK6-MKQa-OweY4HA
2004-05-24 13:54:07 +00:00
cantab.net!aia21 7d0ecd9832 - Add detection for <sys/byteorder.h> and make endianness detection
work on Solaris 2.6 (Yuval) and Solaris 9 (Anton).
- Emulate bswap_{16,32,64}() if not available/we cannot find them.

(Logical change 1.396)
2004-05-24 13:54:07 +00:00
cantab.net!aia21 68b1426c28 Update
(Logical change 1.395)
2004-05-23 20:10:46 +00:00
cantab.net!aia21 3d4c6f8bf7 Dump general info about an inode.
(Logical change 1.395)
2004-05-23 20:10:46 +00:00
cantab.net!aia21 25737058b1 Dump general info about an inode in ntfsinfo. (Yuval)
BKrev: 40b10546n7D7kynT0KptuJFiejdZrQ
2004-05-23 20:10:46 +00:00
cantab.net!aia21 37dab5f6a5 Update
(Logical change 1.394)
2004-05-21 22:01:03 +00:00
cantab.net!aia21 eec6764612 Fix out of source tree build of utilities by changing $top_srcdir to
$top_builddir in the references to the build library in the makefile
template ntfsprogs/Makefile.am.  (Yuval)

BKrev: 40ae7c1fPDtB679KdjaXSP8IkcJUFA
2004-05-21 22:01:03 +00:00
cantab.net!aia21 31a22bc88f Fix out of source tree build of utilities by changing $top_srcdir to
$top_builddir in the references to the build library in the makefile
template ntfsprogs/Makefile.am.  (Yuval)

(Logical change 1.394)
2004-05-21 22:01:03 +00:00
cantab.net!aia21 1f49d8348f Update
(Logical change 1.393)
2004-05-21 21:21:38 +00:00
cantab.net!aia21 1a33cda57d Do not use the ++ operator on a variable when it is being passed as a
parameter to a macro in libntfs/unistr.c.  (Pete Curran, Yuval)

BKrev: 40ae72e2mwIsTYOwnS_fi0I7Wj0mnQ
2004-05-21 21:21:38 +00:00
cantab.net!aia21 a6cd1084c3 Do not use the ++ operator on a variable when it is being passed as a
parameter to a macro in libntfs/unistr.c.  (Pete Curran, Yuval)

(Logical change 1.393)
2004-05-21 21:21:38 +00:00
cantab.net!aia21 cca66954fd Rename uchar_t to ntfschar.
BKrev: 40a4c369hyg4ewkGdCJVFJ2VRdqzJQ
2004-05-14 13:02:33 +00:00
cantab.net!aia21 3423a8a909 Rename uchar_t to ntfschar.
(Logical change 1.392)
2004-05-14 13:02:33 +00:00
cantab.net!aia21 ab8db675c6 Update
(Logical change 1.391)
2004-05-14 08:07:19 +00:00
cantab.net!aia21 94e687a5b4 Fix access of MFT_RECORD->bytes_in_use to use le32_to_cpu() instead
of le16_to_cpu() in libntfs/volume.c.  (Pete Curran)

BKrev: 40a47e3742mktSpbpcOe-OlQLGX-Pg
2004-05-14 08:07:19 +00:00
cantab.net!aia21 9ae1b7306a Fix access of MFT_RECORD->bytes_in_use to use le32_to_cpu() instead
of le16_to_cpu() in libntfs/volume.c.  (Pete Curran)

(Logical change 1.391)
2004-05-14 08:07:19 +00:00
cantab.net!aia21 153114e5fd Bump version to 1.9.3-WIP.
(Logical change 1.391)
2004-05-14 08:07:19 +00:00
cantab.net!aia21 5e1b0ba260 Add Pete Curran.
(Logical change 1.391)
2004-05-14 08:07:19 +00:00
cantab.net!aia21 de1aea149c Use UTF8 instead of iso8859-1.
(Logical change 1.390)
2004-05-11 09:21:24 +00:00
cantab.net!aia21 c03f0bf6fb Use UTF8 instead of iso8859-1 and update for 1.9.2 release.
(Logical change 1.390)
2004-05-11 09:21:24 +00:00
cantab.net!aia21 ac67e7dce2 Use UTF8 instead of iso8859-1 and add Marcin Gibuła.
(Logical change 1.390)
2004-05-11 09:21:24 +00:00
cantab.net!aia21 e9f7c11227 Update for 1.9.2 release.
(Logical change 1.390)
2004-05-11 09:21:24 +00:00
cantab.net!aia21 1ab9841661 Update a little for the new ntfsinfo functionality.
(Logical change 1.390)
2004-05-11 09:21:24 +00:00
cantab.net!aia21 2b4b259c1b Three bug fixes in the decompression code and
preparation for the 1.9.2 release.

BKrev: 40a09b14pk0uZYBZiU5ckxpPyfj6Bg
2004-05-11 09:21:24 +00:00
cantab.net!aia21 13538af029 Remove trailing whitespace.
(Logical change 1.390)
2004-05-11 09:21:24 +00:00
cantab.net!aia21 dd001233ff Minor off by one bug fix.
(Logical change 1.390)
2004-05-11 09:21:24 +00:00
cantab.net!aia21 7ecb829f8f Cleanup.
(Logical change 1.390)
2004-05-11 09:21:24 +00:00
cantab.net!aia21 da742f48da - Fix a bug where we would not always detect that we have reached the
end of a compression block because we were ending at minus one byte
  which is effectively the same as being at the end.  The fix is to
  check whether the uncompressed buffer has been fully filled and if so
  we assume we have reached the end of the compression block.  A big
  thank you to Marcin Gibuła for the bug report, the assistance in
  tracking down the bug and testing the fix.
- Fix a bug where we forgot to reset the data_size and initialized_size
  in two error code paths.
- Fix a bug where an uncompressed block could be misdetected as a
  compressed one if it was made up of multiple runs.

(Logical change 1.390)
2004-05-11 09:21:24 +00:00
elisa-laajakaista.fi!szaka 0649be9d8e ntfsresize: eliminated the global ntfs_volume variable
BKrev: 409d8cd17YSZ_BMSluvSHbLdZBuo_A
2004-05-09 01:43:45 +00:00
elisa-laajakaista.fi!szaka aadb68f43e eliminated the global ntfs_volume variable
(Logical change 1.389)
2004-05-09 01:43:45 +00:00
elisa-laajakaista.fi!szaka 771f8fdc3b remove not-used-anymore last_unsafe member from ntfs_resize_t
BKrev: 409d6d72e47fpMOIjLwcPmLkr61ULA
2004-05-08 23:29:54 +00:00
elisa-laajakaista.fi!szaka 6e0b4d5d32 remove not-used-anymore last_unsafe member from ntfs_resize_t
(Logical change 1.388)
2004-05-08 23:29:54 +00:00
elisa-laajakaista.fi!szaka bc92ae57e8 prepare truncate_badclust_file() for global variables elimination
BKrev: 409d6c7aNA96eKy22m5q3_oD85pgsQ
2004-05-08 23:25:46 +00:00
elisa-laajakaista.fi!szaka 0d541c6791 prepare truncate_badclust_file() for global variables elimination
(Logical change 1.387)
2004-05-08 23:25:46 +00:00
cantab.net!aia21 f44bad1d4b Update
(Logical change 1.386)
2004-05-02 08:46:37 +00:00
cantab.net!aia21 10c1677809 Add inode selection by path/filename to ntfsinfo. (Yuval)
BKrev: 4094b56d2tX48ocjmzBlFHtJ0aRnpw
2004-05-02 08:46:37 +00:00
cantab.net!aia21 eb6c561683 Add inode selection by path/filename to ntfsinfo. (Yuval)
(Logical change 1.386)
2004-05-02 08:46:37 +00:00
cantab.net!aia21 159d3a1a74 Update
(Logical change 1.385)
2004-04-28 08:06:17 +00:00
cantab.net!aia21 653cfec1ca Add SetFilePointerEx() emulation. (Lode)
(Logical change 1.385)
2004-04-28 08:06:17 +00:00
cantab.net!aia21 cc4526d757 Add SetFilePointerEx() emulation to win32_io.c. (Lode)
BKrev: 408f65f9pKdstEq-2epH-_isfXv2FQ
2004-04-28 08:06:17 +00:00
cantab.net!aia21 301a541ffc Work around mbstowcs() bug in DJGPP and update workaround for bug in
mbsrtowcs() on Cygwin.  (Lode, Christophe, Anton)

BKrev: 408e568evEe4T1xjSmokvu-9Z0X-Tg
2004-04-27 12:48:14 +00:00
cantab.net!aia21 03a99a7ece Work around mbstowcs() bug in DJGPP and update workaround for bug in
mbsrtowcs() on Cygwin.  (Lode, Christophe, Anton)

(Logical change 1.384)
2004-04-27 12:48:14 +00:00
cantab.net!aia21 9de9d6bdf1 Update
(Logical change 1.384)
2004-04-27 12:48:14 +00:00
cantab.net!aia21 cd4f9980d5 ntfsundelete.c:
Fix warnings by renaming some variables.  (Yuval)

BKrev: 408accfcGEjiouL-pbBaHsodx5W-zg
2004-04-24 20:24:28 +00:00
cantab.net!aia21 411835bca3 Fix warnings by renaming some variables. (Yuval)
(Logical change 1.383)
2004-04-24 20:24:28 +00:00
cantab.net!aia21 b3cf768990 Update.
(Logical change 1.382)
2004-04-23 14:27:09 +00:00
cantab.net!aia21 75b4efb807 Remove global rl as it was used only in one place. (Yuval, Anton)
BKrev: 408927bdPoZ_d1bJ1owjOEOKOPpfZA
2004-04-23 14:27:09 +00:00
cantab.net!aia21 1e637d3709 Remove global rl as it was used only in one place. (Yuval, Anton)
(Logical change 1.382)
2004-04-23 14:27:09 +00:00
cantab.net!aia21 82d7cbd7b2 Fix lots of warnings about no prototypes by adding
the 'static' keyword.  (Yuval)

BKrev: 40892065jZ32rETJZyE3l8gnVveYJA
2004-04-23 13:55:49 +00:00
cantab.net!aia21 123b1028ec Fix lots of warnings about no prototypes by adding
the 'static' keyword.  (Yuval)

(Logical change 1.381)
2004-04-23 13:55:49 +00:00
cantab.net!aia21 1cc0d3146a libntfs/security.c::
- Fix silly bug where j is used to store the error code
  but i is later expected to be storing it.  (Yuval)
- Fix some warnings.  (Yuval, me)

BKrev: 4088f601g-KiCcRTsoOr9TFHUkHc4g
2004-04-23 10:54:57 +00:00
cantab.net!aia21 14449e4e00 - Fix silly bug where j is used to store the error code
but i is later expected to be storing it.  (Yuval)
- Fix some warnings.  (Yuval, me)

(Logical change 1.380)
2004-04-23 10:54:57 +00:00
cantab.net!aia21 4ab2a0a694 Update
(Logical change 1.379)
2004-04-23 10:12:49 +00:00
cantab.net!aia21 f90c2cd5b9 Fix some compiler warnings. (Yuval)
(Logical change 1.379)
2004-04-23 10:12:49 +00:00
cantab.net!aia21 38cebf3309 - Make ntfsclone and ntfsresize endian safe. (Anton)
- Fix some compiler warnings.  (Yuval)

BKrev: 4088ec2110GxrRbxWNWsgYKzC6qg7Q
2004-04-23 10:12:49 +00:00
cantab.net!aia21 d990c89479 - Make endian safe. (Anton)
- Fix some compiler warnings.  (Yuval)

(Logical change 1.379)
2004-04-23 10:12:49 +00:00
elisa-laajakaista.fi!szaka 54fd7ad8f5 ntfsprogs.8.in: Renamed the last ntfstools reference to ntfsprogs
BKrev: 408593f1AogxtKddQORMYbP1efSOyg
2004-04-20 21:19:45 +00:00
elisa-laajakaista.fi!szaka 62a4991b9a Renamed the last ntfstools reference to ntfsprogs
(Logical change 1.378)
2004-04-20 21:19:45 +00:00
elisa-laajakaista.fi!szaka 1b6c7d679d Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into a80-186-119-178.elisa-laajakaista.fi:/home/szaka/ntfs/bk/ntfsprogs

2004/04/17 04:01:47+03:00 elisa-laajakaista.fi!szaka
ntfsresize: Detached ntfs_fsck_t from ntfs_resize_t and use it for check_allocation_bitmap() [in progress]

BKrev: 408082327nIgMzQiTZNjVb2zleFMCg
2004-04-17 01:02:42 +00:00
elisa-laajakaista.fi!szaka fbd9efac4e Auto merged
2004/04/17 04:01:46+03:00 elisa-laajakaista.fi!szaka
Detached ntfs_fsck_t from ntfs_resize_t and use it for check_allocation_bitmap() [in progress]

(Logical change 1.377)
2004-04-17 01:02:42 +00:00
cantab.net!aia21 b87c41cea4 ntfstruncate.c:
Update

BKrev: 4080496bkAV5bFMuLX9HKBRatOcoGw
2004-04-16 21:00:27 +00:00
cantab.net!aia21 12639f64b7 Update
(Logical change 1.376)
2004-04-16 21:00:27 +00:00
cantab.net!aia21 21712a814f Update
BKrev: 408048ecMR8YadNs1cmk4qbJDsoo1Q
2004-04-16 20:58:20 +00:00
cantab.net!aia21 b1a398abfb Update
(Logical change 1.375)
2004-04-16 20:58:20 +00:00
cantab.net!aia21 71c1fe3af8 Update
(Logical change 1.374)
2004-04-16 20:54:34 +00:00
cantab.net!aia21 16ca8d0253 Compiler warning fixes in utilities mostly due to GEN_PRINTF stuff. (Yuval)
BKrev: 4080480aB67Npmg7VhPx4tp1cOTmBA
2004-04-16 20:54:34 +00:00
cantab.net!aia21 86c68c96e1 Update
(Logical change 1.373)
2004-04-16 20:43:28 +00:00
cantab.net!aia21 4d47eca841 Split up mkntfs into multiple functions. (Yuval)
BKrev: 40804570EIWBfhtZCP1Yi0VNasOh7g
2004-04-16 20:43:28 +00:00
cantab.net!aia21 4a5abe3242 Split up into multiple functions. (Yuval)
(Logical change 1.373)
2004-04-16 20:43:28 +00:00
elisa-laajakaista.fi!szaka 49bc22ac54 split walk_inodes() into check_allocation_bitmap() and set_resize_constrains() [in progress]
(Logical change 1.372)
2004-04-16 19:25:24 +00:00
elisa-laajakaista.fi!szaka 510540736b ntfsresize: split walk_inodes() into check_allocation_bitmap() and set_resize_constrains() [in progress]
BKrev: 40803324Ufc5i_8jR0P9PSNH-Rw8Yw
2004-04-16 19:25:24 +00:00
elisa-laajakaista.fi!szaka 0d75e309a9 ntfsresize updated, ntfsclone added
(Logical change 1.371)
2004-04-15 21:10:18 +00:00
elisa-laajakaista.fi!szaka d636e24835 TODO.ntfsprogs changes: ntfsresize updated, ntfsclone added
BKrev: 407efa3aZaN1izFLDNxMgQYVZOcVnQ
2004-04-15 21:10:18 +00:00
cantab.net!aia21 8ff4b87536 Update ChangeLog
BKrev: 407e9c931wa9uYbh8AC46yOE97oR7w
2004-04-15 14:30:43 +00:00
cantab.net!aia21 ac5a6513c2 Update
(Logical change 1.370)
2004-04-15 14:30:43 +00:00
cantab.net!aia21 cd0bb098d9 Fix silly typo/bug.
(Logical change 1.369)
2004-04-15 11:55:46 +00:00
cantab.net!aia21 52889ba7a6 Big update from Yuval with some bits modified by me.
BKrev: 407e7842gn6IZECpDvcO77hHVfzn_w
2004-04-15 11:55:46 +00:00
cantab.net!aia21 e39688c9ab Big update from Yuval with some bits modified by me.
(Logical change 1.369)
2004-04-15 11:55:46 +00:00
cantab.net!aia21 9b931dc4f6 Update
(Logical change 1.368)
2004-04-15 11:10:40 +00:00
cantab.net!aia21 385c9deeec Fix SID_IDENTIFIER_AUTHORITY. It is big endian.
(Logical change 1.368)
2004-04-15 11:10:40 +00:00
cantab.net!aia21 8d9353c062 Add ntfs_sid_to_mbs_size() and ntfs_sid_to_mbs().
(Logical change 1.368)
2004-04-15 11:10:40 +00:00
cantab.net!aia21 e44d450539 Add ntfs_sid_is_valid() and exports for ntfs_sid_to_mbs_size() and
ntfs_sid_to_mbs().

(Logical change 1.368)
2004-04-15 11:10:40 +00:00
cantab.net!aia21 7fa7b339af Add new API to security.[hc]: ntfs_sid_is_valid(), ntfs_sid_to_mbs(), and
ntfs_sid_to_mbs_size().

BKrev: 407e6db0U33Qo46DqIBjsMBhV7oxeA
2004-04-15 11:10:40 +00:00
cantab.net!aia21 5107604fff Minor typo fix.
(Logical change 1.367)
2004-04-15 08:10:14 +00:00
cantab.net!aia21 46530a95ba Minor typo fix in layout.h.
BKrev: 407e4366W5B4BKUVuSaJ_2kSRUjv7A
2004-04-15 08:10:14 +00:00
cantab.net!aia21 204a58e75e Add export for ntfs_sid_to_mbs().
(Logical change 1.367)
2004-04-15 08:10:14 +00:00
elisa-laajakaista.fi!szaka 11b90db25b Fix incorrect getopt_long() usage: converted argv[optind-1] to optarg
so utilities won't do bogus and unexpected things

BKrev: 407dda7949vKnweBtGT2RPpJHDVnkA
2004-04-15 00:42:33 +00:00
elisa-laajakaista.fi!szaka 8c67ce1c36 Fix incorrect getopt_long() usage: converted argv[optind-1] to optarg
so utilities won't do bogus and unexpected things

(Logical change 1.366)
2004-04-15 00:42:33 +00:00
elisa-laajakaista.fi!szaka 8d343b3eec ntfsclone --metadata also saves at least the first 8 KiB of the $LogFile
BKrev: 407dc9bfW-z6bxJFdFoBxq7Ryxq7vA
2004-04-14 23:31:11 +00:00
elisa-laajakaista.fi!szaka 61ea0f59d8 ntfsclone --metadata also saves at least the first 8 KiB of the $LogFile
(Logical change 1.365)
2004-04-14 23:31:11 +00:00
elisa-laajakaista.fi!szaka 04c554b927 ntfsresize: got rid of the global struct bitmap lcn_bitmap (some work towards code reuse)
BKrev: 407c929888CoOtrBfDIarP3QUIlVvQ
2004-04-14 01:23:36 +00:00
elisa-laajakaista.fi!szaka cb7d91eb16 got rid of the global struct bitmap lcn_bitmap (some work towards code reuse)
(Logical change 1.364)
2004-04-14 01:23:36 +00:00
elisa-laajakaista.fi!szaka 443662a5d6 destination device must be opened O_RDWR because device_size_get() might need to read()
(Logical change 1.363)
2004-04-13 22:56:11 +00:00
elisa-laajakaista.fi!szaka c7f948d554 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into a80-186-119-178.elisa-laajakaista.fi:/home/szaka/ntfs/bk/ntfsprogs

2004/04/14 01:54:36+03:00 elisa-laajakaista.fi!szaka
ntfsclone: destination device must be opened O_RDWR because device_size_get() might need to read()

BKrev: 407c700buw8CD3qUrtauDjlQyEYIIQ
2004-04-13 22:56:11 +00:00
cantab.net!aia21 57e46f6cb8 - Move constant bswap macros out of the ifdefs in endians.h so they are
always available.  (Yuval)
- Add conditional include of sys/param.h in endians.h which provides
  endianness support on Cygwin.  (Yuval)

BKrev: 4076b804GVCAi2kLXcE2S1lz2KSfzQ
2004-04-09 14:49:40 +00:00
cantab.net!aia21 58c28e0f78 - Move constant bswap macros out of the ifdefs in endians.h so they are
always available.  (Yuval)
- Add conditional include of sys/param.h in endians.h which provides
  endianness support on Cygwin.  (Yuval)

(Logical change 1.362)
2004-04-09 14:49:40 +00:00
cantab.net!aia21 62d47d085e (Logical change 1.362) 2004-04-09 14:49:40 +00:00
cantab.net!aia21 56fd4cd70d Yuval:
A few compiler warnings I found using 'configure -enable-warnings'
Mostly trivial.
- 'char *' changed to 'const char *'
- prototypes
- unsigned/signed comparison
- duplicate extern declerations

(Logical change 1.361)
2004-04-09 12:55:19 +00:00
cantab.net!aia21 61a416121e Update
(Logical change 1.361)
2004-04-09 12:55:19 +00:00
cantab.net!aia21 62910c57ab Fix a few compiler warnings in win32_io.c found using 'configure --enable-warnings'. Mostly trivial. (Yuval)
- 'char *' changed to 'const char *'
  - prototypes
  - unsigned/signed comparison
  - duplicate extern declerations

BKrev: 40769d37XoUwSQMV7nYNPnaRllccRw
2004-04-09 12:55:19 +00:00
elisa-laajakaista.fi!szaka 70e0ef757a Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into a80-186-119-178.elisa-laajakaista.fi:/home/szaka/ntfs/bk/ntfsprogs

2004/04/08 11:00:32+03:00 elisa-laajakaista.fi!szaka
Fix the incorrect ntfsclone usage example.

BKrev: 407506b5n4tl-PUOu0gPBNwYnNXbSw
2004-04-08 08:00:53 +00:00
elisa-laajakaista.fi!szaka 2a97938898 Fix the incorrect usage example.
(Logical change 1.360)
2004-04-08 08:00:53 +00:00
cantab.net!aia21 f92f0e8bad Update
(Logical change 1.359)
2004-04-05 21:29:35 +00:00
cantab.net!aia21 ee1bd34696 Hopefully fix the autogen.sh problems using the --force and touch
config.h.in sledge hammers.

BKrev: 4071cfbfS-HvNfIj3mnOzQf5nX-lUg
2004-04-05 21:29:35 +00:00
cantab.net!aia21 5fb435e10c Hopefully fix the autogen.sh problems using the --force and touch
config.h.in sledge hammers.

(Logical change 1.359)
2004-04-05 21:29:35 +00:00
cantab.net!aia21 b4f854016c Update date stamp...
BKrev: 407122b8r-BrXlZq4GS-hpgNX0F5HQ
2004-04-05 09:11:20 +00:00
cantab.net!aia21 fe28604410 Update date stamp...
(Logical change 1.358)
2004-04-05 09:11:20 +00:00
cantab.net!aia21 dd71d5915a Remove last line of file.
(Logical change 1.357)
2004-04-05 09:08:35 +00:00
cantab.net!aia21 3005df0091 Move some news items to older news section.
(Logical change 1.357)
2004-04-05 09:08:35 +00:00
cantab.net!aia21 efe99ebfe2 Minor updates for 1.9.1 release.
BKrev: 40712213SbujRyapcq_SZ8hB-PnyTQ
2004-04-05 09:08:35 +00:00
cantab.net!aia21 0027b876bc Add Yuval Fledel.
(Logical change 1.357)
2004-04-05 09:08:35 +00:00
cantab.net!aia21 11cf412fda Update
(Logical change 1.356)
2004-04-05 08:44:32 +00:00
cantab.net!aia21 863655fc9e Mostly rewrite ntfsinfo. (Yuval Fledel and some fixes by me)
BKrev: 40711c70z36gU_0s-QFvzwueUwapyA
2004-04-05 08:44:32 +00:00
cantab.net!aia21 5e56debf45 Mostly rewrite ntfsinfo. (Yuval Fledel and some fixes by me)
(Logical change 1.356)
2004-04-05 08:44:32 +00:00
cantab.net!aia21 f94ee6946f Update
(Logical change 1.355)
2004-04-05 08:42:10 +00:00
cantab.net!aia21 2f3d8287a5 More ntfsdump_logfile updates.
BKrev: 40711be2YTBdRjjYNs9TQv2eXuPGTQ
2004-04-05 08:42:10 +00:00
cantab.net!aia21 80cb606d36 Big update. (Not finished yet.)
(Logical change 1.355)
2004-04-05 08:42:10 +00:00
omakaista.fi!szaka 1d17c6e429 Update, corrections and removed all mentions of the buggy cp --sparse=always that could corrupt data
if the destination is block device (though GNU cp was fixed after we reported the problem).

(Logical change 1.354)
2004-04-01 21:30:42 +00:00
omakaista.fi!szaka 37cf1d9b38 Added some diagnostic and explanatory messages to ntfsclone.
(Logical change 1.354)
2004-04-01 21:30:42 +00:00
omakaista.fi!szaka 1bfe7eeb00 - Updated ntfsclone manual.
- Added some diagnostic and explanatory messages to ntfsclone.

BKrev: 406c8a027Nr8NJF6iOSXHsU0YE8iIg
2004-04-01 21:30:42 +00:00
omakaista.fi!szaka 6c3d525963 - Updated ntfsclone manual.
- Added some diagnostic and explanatory messages to ntfsclone.

(Logical change 1.354)
2004-04-01 21:30:42 +00:00
cantab.net!aia21 f569675d00 Update
(Logical change 1.353)
2004-03-31 15:01:05 +00:00
cantab.net!aia21 97c8324339 Make ntfsdump_logfile.c compile again.
BKrev: 406add31gzcllyWek4ivS7RChe-Y6A
2004-03-31 15:01:05 +00:00
cantab.net!aia21 527d7780cb Make it compile...
(Logical change 1.353)
2004-03-31 15:01:05 +00:00
cantab.net!aia21 a40f3db9db ntfsdump_logfile: Add ability to use a file as the logfile source rather
than a ntfs volume containing device, i.e. you can now grab a copy of
$LogFile and use ntfsdump_logfile -f mylogfilecopy.

BKrev: 406ad9ecUoJa0FH6sQ9bAAPLNrD-Gg
2004-03-31 14:47:08 +00:00
cantab.net!aia21 8ed1a0e96e Update
(Logical change 1.352)
2004-03-31 14:47:08 +00:00
cantab.net!aia21 8a80625a4b More updates.
(Logical change 1.352)
2004-03-31 14:47:08 +00:00
cantab.net!aia21 a111528d7c Add ability to use a file as the logfile source rather than a ntfs volume
containing device, i.e. you can now grab a copy of $LogFile and use
ntfsdump_logfile -f mylogfilecopy.

(Logical change 1.352)
2004-03-31 14:47:08 +00:00
cantab.net!aia21 ec359479a3 Update
(Logical change 1.351)
2004-03-30 14:02:26 +00:00
cantab.net!aia21 9b58b899e7 Add Alexei Alexandrov to CREDITS and update ChangeLog.
BKrev: 40697df2Ot845FC5gSspdXNqCz_bmQ
2004-03-30 14:02:26 +00:00
cantab.net!aia21 465aed1efd Add Alexei Alexandrov
(Logical change 1.351)
2004-03-30 14:02:26 +00:00
cantab.net!aia21 e0ccb034ea Update.
(Logical change 1.350)
2004-03-30 14:00:35 +00:00
cantab.net!aia21 16629ca38c Move declaration of variable to beginning of block. Thanks to Alexei Alexandrov for the fix.
BKrev: 40697d83jIaaAhVDixRVnIRIvZ8ksA
2004-03-30 14:00:35 +00:00
cantab.net!aia21 7e2b0aad08 Move declaration of variable to beginning of block. Thanks to Alexei Alexandrov for the fix.
(Logical change 1.350)
2004-03-30 14:00:35 +00:00
cantab.net!aia21 3cef28ae30 Update to automake 1.8.3.
BKrev: 40644339QDxS5Fv6k4eX8OvUGyXuDQ
2004-03-26 14:50:33 +00:00
cantab.net!aia21 78922e89fa Update to automake 1.8.3.
(Logical change 1.349)
2004-03-26 14:50:33 +00:00
cantab.net!aia21 3eaf28ead2 Update
(Logical change 1.348)
2004-03-26 14:42:21 +00:00
cantab.net!aia21 89698664fe Move all the magic_* stuff into one place in layout.h.
(Logical change 1.348)
2004-03-26 14:42:21 +00:00
cantab.net!aia21 d224481da9 Make it compile with changes in logfile.h.
(Logical change 1.348)
2004-03-26 14:42:21 +00:00
cantab.net!aia21 a8c7b62ffc Fix some compiler warnings.
(Logical change 1.348)
2004-03-26 14:42:21 +00:00
cantab.net!aia21 e3fbfe6b96 Correct typo.
(Logical change 1.348)
2004-03-26 14:42:21 +00:00
cantab.net!aia21 17f7990e20 - Move all the magic_* stuff into one place in layout.h.
- Sanitize the structure comments to make a little more sense (I hope).

(Logical change 1.348)
2004-03-26 14:42:21 +00:00
cantab.net!aia21 5ba8738cfb - Fix some compiler warnings with latest gcc from SUSE 9.1 beta 3.
- Sanitize logfile.h somewhat and adapt ntfsdump_logfile so it compiles.

BKrev: 4064414dPMOGUVja5hokYTjuLIhJEA
2004-03-26 14:42:21 +00:00
cantab.net!aia21 59c98d3fb1 Use the new LSN data type.
(Logical change 1.347)
2004-03-25 18:55:44 +00:00
cantab.net!aia21 31c61d3404 Use new type LSN.
(Logical change 1.347)
2004-03-25 18:55:44 +00:00
cantab.net!aia21 6a511403dd Initial revision 2004-03-25 18:55:44 +00:00
cantab.net!aia21 80fda79683 Add typedef for LSN.
(Logical change 1.347)
2004-03-25 18:55:44 +00:00
cantab.net!aia21 22bf6511af - Define a new tpydef LSN for log sequence numbers and use it.
- Add some random notes on encryption in doc/encryption.txt.

BKrev: 40632b30sU2O4kWOrRB_ChkUYqc-XQ
2004-03-25 18:55:44 +00:00
cantab.net!aia21 d65ee1a07a (Logical change 1.347) 2004-03-25 18:55:44 +00:00
cantab.net!aia21 61fe186d21 Use more libntfs APIs and other cleanups.
(Logical change 1.346)
2004-03-24 17:38:31 +00:00
cantab.net!aia21 3cc9f21016 Update comments.
(Logical change 1.346)
2004-03-24 17:38:31 +00:00
cantab.net!aia21 ad18c0bac9 Update
(Logical change 1.346)
2004-03-24 17:38:31 +00:00
cantab.net!aia21 163f9002b7 Remove dumplog utility as it was unnecessary and duplicated the
functionality of ntfsdump_logfile.

(Logical change 1.346)
2004-03-24 17:38:31 +00:00
cantab.net!aia21 d37f75cfde Delete: ntfsprogs/dumplog.c
}(Logical change 1.346)
2004-03-24 17:38:31 +00:00
cantab.net!aia21 dfab5d3816 - Make ntfsdump_logfile.c use more libntfs APIs and other cleanups.
- Remove dumplog utility as it was unnecessary and duplicated the
  functionality of ntfsdump_logfile.

BKrev: 4061c797bAjIEeVlFZkuQQpkN2Zdgw
2004-03-24 17:38:31 +00:00
cantab.net!aia21 59fb52eff1 Update
(Logical change 1.345)
2004-03-24 10:36:31 +00:00
cantab.net!aia21 3e63b65e23 Add placeholder for ntfs_attrlist_entry_rm(). -- Not implemented yet.
(Logical change 1.345)
2004-03-24 10:36:31 +00:00
cantab.net!aia21 d2ea0b8741 Add exports for ntfs_device_heads_get() and
ntfs_device_sectors_per_track_get().

(Logical change 1.345)
2004-03-24 10:36:31 +00:00
cantab.net!aia21 c15c7b19a6 Add export for ntfs_attrlist_entry_rm(). -- Not implemented yet.
(Logical change 1.345)
2004-03-24 10:36:31 +00:00
cantab.net!aia21 16bc6199a6 - Provide a new command line option "-H" to mkntfs to allow the user to
specify the number of heads manually.
- Provide a new command line option "-S" to mkntfs to allow the user to
  specify the number of sectors per track manually.

(Logical change 1.345)
2004-03-24 10:36:31 +00:00
cantab.net!aia21 559786d6c9 - Add new API ntfs_device_heads_get() and
ntfs_device_sectors_per_track_get().

(Logical change 1.345)
2004-03-24 10:36:31 +00:00
cantab.net!aia21 b8c685fcc5 - Add new API device.[hc]::ntfs_device_heads_get() and make mkntfs use it.
- Provide a new command line option "-H" to mkntfs to allow the user to
  specify the number of heads manually.
- Add new API device.[hc]::ntfs_device_sectors_per_track_get() and make
  mkntfs use it.
- Provide a new command line option "-S" to mkntfs to allow the user to
  specify the number of sectors per track manually.

BKrev: 406164afQ_1Kz39PXlQ36g3TtdL3dw
2004-03-24 10:36:31 +00:00
cantab.net!aia21 c5a065d048 - Add new API device.[hc]::ntfs_device_heads_get() and make mkntfs use it.
- Provide a new command line option "-H" to mkntfs to allow the user to
  specify the number of heads manually.
- Add new API device.[hc]::ntfs_device_sectors_per_track_get() and make
  mkntfs use it.
- Provide a new command line option "-S" to mkntfs to allow the user to
  specify the number of sectors per track manually.

(Logical change 1.345)
2004-03-24 10:36:31 +00:00
omakaista.fi!szaka 2ef925e0fe - Check the mount state of the output device in ntfsclone.
- Correct a too strong sanity check in ntfsclone that prevented
  cloning from larger device to a smaller one but the NTFS image
  could have fit fully.
- ChangeLog update

BKrev: 405f9a58_jCkCGrW1BbZ2Ynhw8S22Q
2004-03-23 02:00:56 +00:00
omakaista.fi!szaka c6ad3f570d - Check the mount state of the output device in ntfsclone.
- Correct a too strong sanity check in ntfsclone that prevented
  cloning from larger device to a smaller one but the NTFS image
  could have fit fully.
- Added a few (hopefully) better explanatory messages to ntfsresize.

(Logical change 1.344)
2004-03-23 02:00:56 +00:00
omakaista.fi!szaka 5154256c62 - Check the mount state of the output device in ntfsclone.
- Correct a too strong sanity check in ntfsclone that prevented
  cloning from larger device to a smaller one but the NTFS image
  could have fit fully.

(Logical change 1.344)
2004-03-23 02:00:56 +00:00
cantab.net!aia21 9661074cdb Update
(Logical change 1.343)
2004-03-22 10:42:38 +00:00
cantab.net!aia21 785e4e2c63 Remove the FIXME in ntfs_attr_lookup() and complete the
implementation of ntfs_external_attr_find() so it now returns the
attribute list attribute position at which the attribute should be
inserted in @ctx->al_entry (see descritpion for ntfs_attr_lookup() in
attrib.c for details).

BKrev: 405ec31eBCw-_Ae0uZ9LjtFRYtH3XA
2004-03-22 10:42:38 +00:00
cantab.net!aia21 b1f8254930 Remove the FIXME in ntfs_attr_lookup() and complete the
implementation of ntfs_external_attr_find() so it now returns the
attribute list attribute position at which the attribute should be
inserted in @ctx->al_entry (see descritpion for ntfs_attr_lookup() in
attrib.c for details).

(Logical change 1.343)
2004-03-22 10:42:38 +00:00
omakaista.fi!szaka 8f77300f3a - recommend chkdsk /f if mapping pairs decoding fails with EIO (Kent B. Larsen)
- use corrupt_volume_msg in all relevant cases
- explain "bad sectors" a bit better

(Logical change 1.342)
2004-03-22 09:09:44 +00:00
cantab.net!aia21 f6fa31b6b0 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/src/ntfsprogs

2004/03/21 20:28:25+02:00 omakaista.fi!szaka
- recommend chkdsk /f if mapping pairs decoding fails with EIO (Kent B. Larsen)
- use corrupt_volume_msg in all relevant cases
- explain "bad sectors" a bit better

BKrev: 405ead58OtBH8eBBOL8HUmZ9Q9fliw
2004-03-22 09:09:44 +00:00
cantab.net!aia21 822fb42c74 Add a TODO item for mkntfs.
BKrev: 405ead4cIyLuzJW0wHsmA8LqDP8qgg
2004-03-22 09:09:32 +00:00
cantab.net!aia21 6b5861e6b4 Add a TODO item for mkntfs.
(Logical change 1.341)
2004-03-22 09:09:32 +00:00
cantab.net!aia21 1500287b1c Update
(Logical change 1.340)
2004-03-19 17:36:45 +00:00
cantab.net!aia21 6507533a0a (Logical change 1.340) 2004-03-19 17:36:45 +00:00
cantab.net!aia21 1c970228e2 Initial revision 2004-03-19 17:36:45 +00:00
cantab.net!aia21 5da4ab55e0 Add new files include/ntfs/attrlist.h and libntfs/attrlist.c for the
upcoming attribute list attribute handling code.

BKrev: 405b2fadc8Po3t37cxgqA7hdUI_wBQ
2004-03-19 17:36:45 +00:00
cantab.net!aia21 1a9faf5ae8 Add attrlist.h to list of headers.
(Logical change 1.340)
2004-03-19 17:36:45 +00:00
cantab.net!aia21 592b4662db Add attrlist.c to build.
(Logical change 1.340)
2004-03-19 17:36:45 +00:00
cantab.net!aia21 0a9fe97b85 Update
(Logical change 1.339)
2004-03-19 10:21:05 +00:00
cantab.net!aia21 ed9f46c349 Support the case where $Volume does not have a $VOLUME_NAME
attribute in ntfs_device_mount() and let ntfslabel create the
attribute when it is not present.

BKrev: 405ac991tgthsWAgze2t2_BVuQLrog
2004-03-19 10:21:05 +00:00
cantab.net!aia21 ae7789dcd0 Support the case where $Volume does not have a $VOLUME_NAME
attribute in ntfs_device_mount() and let ntfslabel create the
attribute when it is not present.

(Logical change 1.339)
2004-03-19 10:21:05 +00:00
cantab.net!aia21 93acd345a7 Update
(Logical change 1.338)
2004-03-17 16:53:29 +00:00
cantab.net!aia21 be3bd771e1 Do not specify maintainer mode or enable compiler warnings.
(Logical change 1.338)
2004-03-17 16:53:29 +00:00
cantab.net!aia21 8f51b1fdcd - Remove AM_MAINTAINER_MODE.
- Add configure option --enable-warnings and make that enable all the
  compiler warnings (this used to be done in maintainer mode).
- Do not specify maintainer mode or enable compiler warnings in
  autogen.sh.

BKrev: 40588289PkOte4KVeOlh70tKAhrf1A
2004-03-17 16:53:29 +00:00
cantab.net!aia21 9c6906ed48 - Remove AM_MAINTAINER_MODE.
- Add configure option --enable-warnings and make that enable all the
  compiler warnings (this used to be done in maintainer mode).

(Logical change 1.338)
2004-03-17 16:53:29 +00:00
cantab.net!aia21 4e71d24e13 Update for 1.9.1 release.
BKrev: 405863abL5s3YuyRFNDfryHum801XQ
2004-03-17 14:41:47 +00:00
cantab.net!aia21 e5f05c8401 Update for 1.9.1 release.
(Logical change 1.337)
2004-03-17 14:41:47 +00:00
cantab.net!aia21 f33bdf28a5 Update comment for hidden_sectors in BIOS_PARAMETER_BLOCK.
(Logical change 1.336)
2004-03-17 12:22:03 +00:00
cantab.net!aia21 0719c9de02 Update
(Logical change 1.336)
2004-03-17 12:22:03 +00:00
cantab.net!aia21 08bd36ca62 Provide a new command line option "-p" to allow the user to specify
the partition start sector manually.

(Logical change 1.336)
2004-03-17 12:22:03 +00:00
cantab.net!aia21 117c16ec74 Fix a compiler warning.
(Logical change 1.336)
2004-03-17 12:22:03 +00:00
cantab.net!aia21 9318887cd5 Add new API device.[hc]::ntfs_device_partition_start_sector_get() and
make mkntfs use it.

(Logical change 1.336)
2004-03-17 12:22:03 +00:00
cantab.net!aia21 78a57841cb Add detection of linux/hdreg.h needed for HDIO_GETGEO.
(Logical change 1.336)
2004-03-17 12:22:03 +00:00
cantab.net!aia21 60231ba412 - Fix to include sys/ioctl.h.
- Define the ioctls we use if they are not defined, as it is done
  in device.c.

(Logical change 1.336)
2004-03-17 12:22:03 +00:00
cantab.net!aia21 ba5eb0d651 - Add new API device.[hc]::ntfs_device_partition_start_sector_get() and
make mkntfs use it.
- Provide a new command line option "-p" to allow the user to specify
  the partition start sector manually.
- Fix mkntfs and ntfsclone to include sys/ioctl.h.
- Define the ioctls we use in ntfsclone if they are not defined, as it
  is done in device.c.

BKrev: 405842ebQ8PDL9eZ6O_KykKk2YKyQA
2004-03-17 12:22:03 +00:00
cantab.net!aia21 d05932849c - Add new API device.[hc]::ntfs_device_partition_start_sector_get() and
make mkntfs use it.
- Provide a new command line option "-p" to allow the user to specify
  the partition start sector manually.
- Add include sys/ioctl.h to fix sector size detection.

(Logical change 1.336)
2004-03-17 12:22:03 +00:00
cantab.net!aia21 52aeada355 Update.
(Logical change 1.335)
2004-03-15 12:50:18 +00:00
cantab.net!aia21 adcfb23551 Add new API mft.[hc]::ntfs_mft_record_{layout,format}() and make
mkntfs use it.

BKrev: 4055a68a3-bSTZZ2kpX4ycLLgNqYuA
2004-03-15 12:50:18 +00:00
cantab.net!aia21 2bd298bc2d Add new API mft.[hc]::ntfs_mft_record_{layout,format}() and make
mkntfs use it.

(Logical change 1.335)
2004-03-15 12:50:18 +00:00
cantab.net!aia21 b5af3df4b8 Ooops, forgot to test make extra when changing ntfs_get_attribute_value().
BKrev: 40559535JUFzt7wNIK2dsvgx6mIeZQ
2004-03-15 11:36:21 +00:00
cantab.net!aia21 9bb30a0601 Ooops, forgot to test make extra when changing ntfs_get_attribute_value().
(Logical change 1.334)
2004-03-15 11:36:21 +00:00
cantab.net!aia21 ab2da48e25 Use sizeof(MFT_RECORD_OLD) instead of sizeof(MFT_RECORD) as MFT_RECORD now
includes the NTFS 3.1+ specific fields.

(Logical change 1.333)
2004-03-15 11:34:30 +00:00
cantab.net!aia21 cf419787bd Use sizeof(MFT_RECORD) instead of sizeof(MFT_RECORD) + 6 as MFT_RECORD now
includes the NTFS 3.1+ specific fields.

(Logical change 1.333)
2004-03-15 11:34:30 +00:00
cantab.net!aia21 c6dbf75a46 Copy MFT_RECORD typedef to MFT_RECORD_OLD and modify MFT_RECORD to
contain the NTFS 3.1+ specific fields.  Also, update mkntfs and
ntfsclone appropriately.

BKrev: 405594c6XwAKWIBiXSo4fZGQMBN9oQ
2004-03-15 11:34:30 +00:00
cantab.net!aia21 14658c8c43 Copy MFT_RECORD typedef to MFT_RECORD_OLD and modify MFT_RECORD to
contain the NTFS 3.1+ specific fields.  Also, update mkntfs and
ntfsclone appropriately.

(Logical change 1.333)
2004-03-15 11:34:30 +00:00
cantab.net!aia21 a8ce4055be Update comment for ntfs_mft_record_get_data_size().
(Logical change 1.332)
2004-03-15 10:54:47 +00:00
cantab.net!aia21 011ba54358 Change ntfs_get_attribute_value syntax to not have the MFT_RECORD as it
wasn't used anyway and the function is headed for death anyway...

BKrev: 40558b77Sl9p5QUBbikMJW929228Sg
2004-03-15 10:54:47 +00:00
cantab.net!aia21 481241602c Change ntfs_get_attribute_value syntax to not have the MFT_RECORD as it
wasn't used anyway and the function is headed for death anyway...

(Logical change 1.332)
2004-03-15 10:54:47 +00:00
cantab.net!aia21 161768d205 Update
(Logical change 1.331)
2004-03-14 18:29:21 +00:00
cantab.net!aia21 fb5ceff176 Implement dumping of object id attribute in ntfsinfo. (Yuval Fledel, me)
BKrev: 4054a481GkSbppqwY-UO-BMCdp7nRw
2004-03-14 18:29:21 +00:00
cantab.net!aia21 95ab07c823 Forgot to include security.h...
2004/03/14 18:22:33+00:00 cantab.net!aia21
Implement dumping of object id attribute.  (Yuval Fledel, me)

(Logical change 1.331)
2004-03-14 18:29:21 +00:00
cantab.net!aia21 8eca7085ec Update.
(Logical change 1.330)
2004-03-14 18:04:17 +00:00
cantab.net!aia21 90cc6f8e73 New files: security.[hc] include new API ntfs_guid_is_zero() and
ntfs_guid_to_mbs().

BKrev: 40549ea1_tPbB3_FU1heEkOBr9qhKw
2004-03-14 18:04:17 +00:00
cantab.net!aia21 802ed33475 New file: security.c includes new API ntfs_guid_is_zero() and
ntfs_guid_to_mbs().

2004/03/14 17:38:29+00:00 cantab.net!aia21

(Logical change 1.330)
2004-03-14 18:04:17 +00:00
cantab.net!aia21 84db0e8dfb Initial revision 2004-03-14 18:04:17 +00:00
cantab.net!aia21 2324aa8e3f Add security.h to Makefile.*.
(Logical change 1.330)
2004-03-14 18:04:17 +00:00
cantab.net!aia21 a8f5ab126d Add security.c to build.
(Logical change 1.330)
2004-03-14 18:04:17 +00:00
cantab.net!aia21 a0fdf1985f (Logical change 1.330) 2004-03-14 18:04:17 +00:00
cantab.net!aia21 205b4dc359 Update.
(Logical change 1.329)
2004-03-13 19:30:28 +00:00
cantab.net!aia21 980d0b4c5c Fix validation of STANDARD_INFORMATION attribute size in ntfsinfo.c
and remove relevant FIXME comments.  (Yuval Fledel)

BKrev: 40536154-GAlc187fpX39WPxOgj9LQ
2004-03-13 19:30:28 +00:00
cantab.net!aia21 49f8d5e364 Fix validation of STANDARD_INFORMATION attribute size in ntfsinfo.c
and remove relevant FIXME comments.  (Yuval Fledel)

(Logical change 1.329)
2004-03-13 19:30:28 +00:00
cantab.net!aia21 abd576179f Update
(Logical change 1.328)
2004-03-13 19:22:57 +00:00
cantab.net!aia21 68b214894a Fix layout.h STANDARD_INFORMATION and FILE_ATTR_FLAGS typedefs by
adding the packed attribute where it was missing causing havoc due
to 64 bit alignment.  (Yuval Fledel)

BKrev: 40535f91lvgJaVPl6zIe8HGKEBt6UQ
2004-03-13 19:22:57 +00:00
cantab.net!aia21 a06a326959 Fix layout.h STANDARD_INFORMATION and FILE_ATTR_FLAGS typedefs by
adding the packed attribute where it was missing causing havoc due
to 64 bit alignment.  (Yuval Fledel)

(Logical change 1.328)
2004-03-13 19:22:57 +00:00
cantab.net!aia21 63ecb1990c Update
(Logical change 1.327)
2004-03-12 17:25:04 +00:00
cantab.net!aia21 8b7d1e9934 Provide new API functions: ntfs_bitmap_{set,clear}_bit().
BKrev: 4051f270fGW0jp1WetRiozD-lMAA7Q
2004-03-12 17:25:04 +00:00
cantab.net!aia21 3cfb4590eb Provide new API functions: ntfs_bitmap_{set,clear}_bit().
(Logical change 1.327)
2004-03-12 17:25:04 +00:00
cantab.net!aia21 a9d3049ded Update
(Logical change 1.326)
2004-03-12 15:50:52 +00:00
cantab.net!aia21 6276a27b77 Modify meaning of ntfs_volume->nr_mft_records to be the number of
initialized mft records, not total mft records.  This makes far more
sense and in fact reflects how nr_mft_records is being used in both
libntfs and the utilities.

BKrev: 4051dc5cII9Ej77Nwtp5gvjahGMMyA
2004-03-12 15:50:52 +00:00
cantab.net!aia21 cb3b41894a Modify meaning of ntfs_volume->nr_mft_records to be the number of
initialized mft records, not total mft records.  This makes far more
sense and in fact reflects how nr_mft_records is being used in both
libntfs and the utilities.

(Logical change 1.326)
2004-03-12 15:50:52 +00:00
cantab.net!aia21 e09b28c9b3 Update to SuSE 9.1 pkgconfig.
BKrev: 405185aeyVTIis9_wEhv_rY8MKxUJw
2004-03-12 09:41:02 +00:00
cantab.net!aia21 c70036ff30 Update to SuSE 9.1 pkgconfig.
(Logical change 1.325)
2004-03-12 09:41:02 +00:00
cantab.net!aia21 54fddf28aa Update
Fix warnings on powerpc architecture where it would seem char is
unsigned so comparisons with -1 cause a warning that comparison is
always true/wrong.  (Thanks to Ender for reporting.)

BKrev: 4051831bqIU4RTqyE7g6tqfLL1lm1Q
2004-03-12 09:30:03 +00:00
cantab.net!aia21 9193cb6298 Update
Fix warnings on powerpc architecture where it would seem char is
unsigned so comparisons with -1 cause a warning that comparison is
always true/wrong.  (Thanks to Ender for reporting.)

(Logical change 1.324)
2004-03-12 09:30:03 +00:00
cantab.net!aia21 e14c9479ce Update
(Logical change 1.324)
2004-03-12 09:30:03 +00:00
cantab.net!aia21 c553f49977 Update
(Logical change 1.323)
2004-03-11 15:38:01 +00:00
cantab.net!aia21 08d8066f75 Start 1.9.1-WIP.
BKrev: 405087d9hHp4JUJh1WQ25b7T_eobZw
2004-03-11 15:38:01 +00:00
cantab.net!aia21 ce30981fae Start 1.9.1-WIP.
(Logical change 1.323)
2004-03-11 15:38:01 +00:00
cantab.net!aia21 2612bb6d23 Update with SuSE 9.1 beta 1 versions of GNU build system.
BKrev: 405086cewPVETii5P8vmSiUjZLvjcw
2004-03-11 15:33:34 +00:00
cantab.net!aia21 9b3652469c Update with SuSE 9.1 beta 1 versions of GNU build system.
(Logical change 1.322)
2004-03-11 15:33:34 +00:00
cantab.net!aia21 d7f7475b58 Update
(Logical change 1.321)
2004-03-10 23:41:00 +00:00
cantab.net!aia21 0db6071738 Makefile.in:
Update

BKrev: 404fa78cDRjGrJHTDvBAo_zu3CvzZQ
2004-03-10 23:41:00 +00:00
cantab.net!aia21 83beb9f65c Update some man pages with Linux-NTFS -> ntfsprogs.
BKrev: 404fa6d2TclZRnzaGDCUibAwEau3Sw
2004-03-10 23:37:54 +00:00
cantab.net!aia21 c446b5b7c0 Update
(Logical change 1.320)
2004-03-10 23:37:54 +00:00
cantab.net!aia21 12b9f913c3 Update for 1.9.0 release.
(Logical change 1.319)
2004-03-10 23:32:43 +00:00
cantab.net!aia21 94036606c8 Update
(Logical change 1.319)
2004-03-10 23:32:43 +00:00
cantab.net!aia21 b1346afec1 Final updates for 1.9.0 release.
BKrev: 404fa59bWX4Q72O9J3E-aku-FuG2IQ
2004-03-10 23:32:43 +00:00
cantab.net!aia21 f62ab8a60a Update
(Logical change 1.318)
2004-03-10 22:53:49 +00:00
cantab.net!aia21 1318c07ee5 Provide our own byteswap constant versions in endians.h so we avoid
the mess that some architectures define only some of them.

BKrev: 404f9c7dbVXwMn4i_lRRR-VBVHrTOg
2004-03-10 22:53:49 +00:00
cantab.net!aia21 a0cbfc4ce4 Provide our own __ntfs_bswap_constant_xx functions so we completely
avoid the mess that some architectures define only some of the
constant bswap functions.

(Logical change 1.318)
2004-03-10 22:53:49 +00:00
cantab.net!aia21 491d7096ca Update for 1.9.0 release.
2004/03/10 21:53:05+00:00 cantab.net!aia21
Update

(Logical change 1.317)
2004-03-10 22:03:54 +00:00
cantab.net!aia21 a8ec7f16af Update Ender's email address.
(Logical change 1.317)
2004-03-10 22:03:54 +00:00
cantab.net!aia21 56dd09715a Typo fixes (Ender)
(Logical change 1.317)
2004-03-10 22:03:54 +00:00
cantab.net!aia21 217ac9678f Merge
2004/03/10 21:58:46+00:00 cantab.net!aia21
- A few replacements of Linux-NTFS package by ntfsprogs package. (me)
Updates from Ender:
- Updates config.guess and config.sub to the latest ones.
- Fixes several typos spreaded along all the docs.
- Added several glitches to the manpages for the sake of compliance.
- Updates my address to the Debian one.

BKrev: 404f90ca-_pDJ68w1glaRYVn8De63g
2004-03-10 22:03:54 +00:00
cantab.net!aia21 c86e4174a9 Manual merge.
2004/03/10 21:54:24+00:00 cantab.net!aia21
 Typo fixes (Ender)

(Logical change 1.317)
2004-03-10 22:03:54 +00:00
cantab.net!aia21 03dfcd6614 Latest one (Ender)
(Logical change 1.317)
2004-03-10 22:03:54 +00:00
cantab.net!aia21 41c90506c5 Auto merged
2004/03/10 21:54:27+00:00 cantab.net!aia21
 Typo fixes (Ender)

(Logical change 1.317)
2004-03-10 22:03:54 +00:00
cantab.net!aia21 5dda848553 Auto merged
2004/03/10 21:54:13+00:00 cantab.net!aia21
 Typo fixes (Ender)

(Logical change 1.317)
2004-03-10 22:03:54 +00:00
cantab.net!aia21 3c429be664 Typo fixes (Ender)
(Logical change 1.317)
2004-03-10 22:03:54 +00:00
cantab.net!aia21 60917570fa Update for 1.9.0 release.
BKrev: 404f8e23O6wo6eTEywk8tlV_8rvkuw
2004-03-10 21:52:35 +00:00
cantab.net!aia21 f19081ab43 Update for 1.9.0 release.
(Logical change 1.316)
2004-03-10 21:52:35 +00:00
cantab.net!aia21 77c794f202 Try the SuSE patch.
(Logical change 1.315)
2004-03-10 15:17:51 +00:00
cantab.net!aia21 a259a69c8d Remove the bswap constant detection from configure.ac again to try out
the SuSE patch for fixing the problem.

(Logical change 1.315)
2004-03-10 15:17:51 +00:00
cantab.net!aia21 b207b80f62 Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/10 15:17:29+00:00 cantab.net!aia21
Try the SuSE patch for fixing the constant bswap absence on some arch problem.

BKrev: 404f319fX7YIicfmWB5TDur9Pd5WFg
2004-03-10 15:17:51 +00:00
cantab.net!aia21 1c984054e8 Auto merged
2004/03/10 15:17:28+00:00 cantab.net!aia21
Remove the bswap constant detection from configure.ac again to try out
the SuSE patch for fixing the problem.

(Logical change 1.315)
2004-03-10 15:17:51 +00:00
cantab.net!aia21 0dd38ddd7d Use AC_CHECK_DECLS in configure.ac to determine if the constant bswap
functions are defined/declared and define them to the non-constant ones
in endians.h if not.

(Logical change 1.314)
2004-03-10 10:22:03 +00:00
cantab.net!aia21 aa0398ea0e Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/10 10:21:36+00:00 cantab.net!aia21
Use AC_CHECK_DECLS in configure.ac to determine if the constant bswap
functions are defined/declared and define them to the non-constant ones
in endians.h if not.

BKrev: 404eec4bHP7cgSgBv1XkbN3OUz3fGQ
2004-03-10 10:22:03 +00:00
cantab.net!aia21 525f6519fb Auto merged
2004/03/10 10:21:35+00:00 cantab.net!aia21
Use AC_CHECK_DECLS in configure.ac to determine if the constant bswap
functions are defined/declared and define them to the non-constant ones
in endians.h if not.

(Logical change 1.314)
2004-03-10 10:22:03 +00:00
cantab.net!aia21 c89452b85a Auto merged
2004/03/10 10:21:34+00:00 cantab.net!aia21
Use AC_CHECK_DECLS in configure.ac to determine if the constant bswap
functions are defined/declared and define them to the non-constant ones
in endians.h if not.

(Logical change 1.314)
2004-03-10 10:22:03 +00:00
cantab.net!aia21 c5847ae8cf Fix two bugs, a->name_length is 8 bit not 16 bit...
(Logical change 1.313)
2004-03-10 09:36:44 +00:00
cantab.net!aia21 05592a6c07 Fix two bugs in ntfsresize, a->name_length is 8 bit not 16 bit...
BKrev: 404ee1acERCAJRHEsYyTCejD6vS_gQ
2004-03-10 09:36:44 +00:00
omakaista.fi!szaka c90976e023 hand merged
2004/03/10 10:13:38+02:00 omakaista.fi!szaka
- Added warnings about not modifying text messages external tools use
- Options -i -s together aren't supported anymore, if needed use -n -v -s instead
- Usage() cleanup
- Some endianness fixes
- Suggest chkdsk /f if mount fails with EIO (Paul A. Steckler)
- Removed BETA and STABLE hints, now there is only one STABLE
- The --info option estimates the theoretically smallest shrunken size   thus the message changed from "You ccould resize ..." to   "You might resize ...".

(Logical change 1.312)
2004-03-10 09:28:44 +00:00
omakaista.fi!szaka bf67069b3f Spelling fixes and update
(Logical change 1.312)
2004-03-10 09:28:44 +00:00
cantab.net!aia21 9bf03159a3 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs-devel
into cantab.net:/home/src/ntfsprogs-devel

2004/03/10 11:08:29+02:00 omakaista.fi!szaka
hand merged

2004/03/10 10:20:07+02:00 omakaista.fi!szaka
- Added warnings about not modifying text messages external tools use
- Options -i -s together aren't supported, if needed use -n -v -s instead
- Usage() cleanup
- Some endianness fixes
- Suggests chkdsk /f if mount fails with EIO (Paul A. Steckler)
- Removed BETA and STABLE hints, now there is only one STABLE
- The --info option estimates the theoretically smallest shrunken size   thus the message changed from "You ccould resize ..." to   "You might resize ...".
- Manual update

BKrev: 404edfcc7Y3OUv1fPIlkj_nB4-MkBQ
2004-03-10 09:28:44 +00:00
cantab.net!aia21 a054b16571 Update
BKrev: 404edfbfciwhHQrmrQUc42PBbCNrww
2004-03-10 09:28:31 +00:00
cantab.net!aia21 6b7c265ea8 Update
(Logical change 1.311)
2004-03-10 09:28:31 +00:00
cantab.net!aia21 2e1295c6b2 Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/10 09:26:25+00:00 cantab.net!aia21
Move AC_GNU_SOURCE before AC_PROG_CC...

BKrev: 404edf5bvVU0AYST1k-t4Ooaw4pr5A
2004-03-10 09:26:51 +00:00
cantab.net!aia21 95d653045f Auto merged
2004/03/10 09:26:25+00:00 cantab.net!aia21
Move AC_GNU_SOURCE before AC_PROG_CC...

(Logical change 1.310)
2004-03-10 09:26:51 +00:00
cantab.net!aia21 0098e55da3 Auto merged
2004/03/10 09:26:24+00:00 cantab.net!aia21
Move AC_GNU_SOURCE before AC_PROG_CC...

(Logical change 1.310)
2004-03-10 09:26:51 +00:00
cantab.net!aia21 3d757997b0 Use AC_GNU_SOURCE instead of doing it manually.
(Logical change 1.309)
2004-03-10 09:21:53 +00:00
cantab.net!aia21 255305ee93 Update.
(Logical change 1.309)
2004-03-10 09:21:53 +00:00
cantab.net!aia21 9f277af3d8 Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/10 09:20:51+00:00 cantab.net!aia21
Use AC_GNU_SOURCE instead of doing it manually.

BKrev: 404ede31HIgRE3BpmQv_DLWjL-aQzg
2004-03-10 09:21:53 +00:00
cantab.net!aia21 e325efce76 Auto merged
2004/03/10 09:20:50+00:00 cantab.net!aia21
Use AC_GNU_SOURCE instead of doing it manually.

(Logical change 1.309)
2004-03-10 09:21:53 +00:00
cantab.net!aia21 728eff0614 Auto merged
2004/03/10 09:20:50+00:00 cantab.net!aia21
Update.

(Logical change 1.309)
2004-03-10 09:21:53 +00:00
cantab.net!aia21 b57d8e84bc A few missed.
BKrev: 404dea0del9O_HdQcM0damCtpyAP7w
2004-03-09 16:00:13 +00:00
cantab.net!aia21 0acde67dde A few missed.
(Logical change 1.308)
2004-03-09 16:00:13 +00:00
cantab.net!aia21 717484f223 Missed this one.
(Logical change 1.307)
2004-03-09 15:27:10 +00:00
cantab.net!aia21 b36be2a790 Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/09 15:26:54+00:00 cantab.net!aia21
Missed a few one.

BKrev: 404de24eZCHx5oI4jEh1CqfDELPQSQ
2004-03-09 15:27:10 +00:00
cantab.net!aia21 91249ad352 Merge
2004/03/09 14:38:52+00:00 cantab.net!aia21
Fix all occurences of printf with %ll length modifiers but 64 bit
arguments to typecast the arguments to (unsigned) long long to avoid
the warnings when compiling on 64 bit architectures.

BKrev: 404dd906ZnIHBbTe4bIWl40WThcnkA
2004-03-09 14:47:34 +00:00
cantab.net!aia21 8b9213603f Manual merge.
2004/03/09 14:38:50+00:00 cantab.net!aia21
Fix all occurences of printf with %ll length modifiers but 64 bit
arguments to typecast the arguments to (unsigned) long long to avoid
the warnings when compiling on 64 bit architectures.

(Logical change 1.306)
2004-03-09 14:47:34 +00:00
cantab.net!aia21 ddeee65b8d Fix all occurences of printf with %ll length modifiers but 64 bit
arguments to typecast the arguments to (unsigned) long long to avoid
the warnings when compiling on 64 bit architectures.

(Logical change 1.306)
2004-03-09 14:47:34 +00:00
cantab.net!aia21 6dea839252 Auto merged
2004/03/09 14:38:51+00:00 cantab.net!aia21
Fix all occurences of printf with %ll length modifiers but 64 bit
arguments to typecast the arguments to (unsigned) long long to avoid
the warnings when compiling on 64 bit architectures.

(Logical change 1.306)
2004-03-09 14:47:34 +00:00
cantab.net!aia21 43280fed03 Auto merged
2004/03/09 14:38:50+00:00 cantab.net!aia21
Fix all occurences of printf with %ll length modifiers but 64 bit
arguments to typecast the arguments to (unsigned) long long to avoid
the warnings when compiling on 64 bit architectures.

(Logical change 1.306)
2004-03-09 14:47:34 +00:00
cantab.net!aia21 43d2c583cc Auto merged
2004/03/09 14:38:49+00:00 cantab.net!aia21
Fix all occurences of printf with %ll length modifiers but 64 bit
arguments to typecast the arguments to (unsigned) long long to avoid
the warnings when compiling on 64 bit architectures.

(Logical change 1.306)
2004-03-09 14:47:34 +00:00
cantab.net!aia21 74a1a8f8d1 Update
(Logical change 1.305)
2004-03-09 12:38:51 +00:00
cantab.net!aia21 9cdb31ec2d Typo fixes.
(Logical change 1.305)
2004-03-09 12:38:51 +00:00
cantab.net!aia21 0003d039bd Start using the default INSTALL so our changes don't keep getting lost
when anyone does autoreconf -f or autoupdate.  The Linux-NTFS specific
content has been moved to the README file.

(Logical change 1.305)
2004-03-09 12:38:51 +00:00
cantab.net!aia21 a0e310c4c6 Start using the default INSTALL and COPYING so our changes don't keep
getting lost when anyone does autoreconf -f or autoupdate.  The
Linux-NTFS specific content has been moved to the README file.

(Logical change 1.305)
2004-03-09 12:38:51 +00:00
cantab.net!aia21 140f32650e Start using the default COPYING so our changes don't keep getting lost
when anyone does autoreconf -f or autoupdate.  The Linux-NTFS specific
content has been moved to the README file.

(Logical change 1.305)
2004-03-09 12:38:51 +00:00
cantab.net!aia21 c5b58a7e5a Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/09 12:38:19+00:00 cantab.net!aia21
- Start using the default INSTALL and COPYING so our changes don't keep
  getting lost when anyone does autoreconf -f or autoupdate.  The
  Linux-NTFS specific content has been moved to the README file.
- Several typo fixes in the documentation/text files.

BKrev: 404dbadbYldROfH6sHtUQhqEmoHu_w
2004-03-09 12:38:51 +00:00
cantab.net!aia21 8a26e04bb3 Auto merged
2004/03/09 12:38:19+00:00 cantab.net!aia21
Update.

(Logical change 1.305)
2004-03-09 12:38:51 +00:00
cantab.net!aia21 15e437c9d4 update
(Logical change 1.304)
2004-03-09 11:06:54 +00:00
cantab.net!aia21 f83f7b5f9c Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/09 10:52:14+00:00 cantab.net!aia21
Make the device fd in unix_io.c be stored in malloc()ed space pointed
to by the d_private pointer instead of inside the d_private pointer
itself.  Makes the warnings on 64 bit architectures go away.

BKrev: 404da54egDOFADYrwrjwiUnZsoj6Jw
2004-03-09 11:06:54 +00:00
cantab.net!aia21 f5bb3c333f Make the device fd in unix_io.c be stored in malloc()ed space pointed
to by the d_private pointer instead of inside the d_private pointer
itself.  Makes the warnings on 64 bit architectures go away.

(Logical change 1.304)
2004-03-09 11:06:54 +00:00
cantab.net!aia21 02376d0592 Auto merged
2004/03/09 10:52:14+00:00 cantab.net!aia21
update

(Logical change 1.304)
2004-03-09 11:06:54 +00:00
cantab.net!aia21 d5c044de1b Use head -n 1 instead of -1. (From SUSE LINUX)
(Logical change 1.303)
2004-03-08 17:04:17 +00:00
cantab.net!aia21 96557cde6c Update
(Logical change 1.303)
2004-03-08 17:04:17 +00:00
cantab.net!aia21 bdfeae1d31 Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/08 17:03:22+00:00 cantab.net!aia21
- Use head -n 1 instead of -1 in getgccver script.  (From SUSE LINUX)
- Fix typo in ntfsinfo.c.  (From SUSE LINUX)

BKrev: 404ca791aIIJT3whYPFDuwIGakLxCw
2004-03-08 17:04:17 +00:00
cantab.net!aia21 6c4c7b1721 Fix typo. (From SUSE LINUX)
(Logical change 1.303)
2004-03-08 17:04:17 +00:00
cantab.net!aia21 232af61717 Use bswap_xx instead of __bswap_constant_xx when the constant version
is not available as is the case on some architectures.  (Thanks to
David Martnez Moreno for the bug report.)

(Logical change 1.302)
2004-03-08 12:19:08 +00:00
cantab.net!aia21 60877615e6 Update
(Logical change 1.302)
2004-03-08 12:19:08 +00:00
cantab.net!aia21 904af325b1 Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/08 12:13:28+00:00 cantab.net!aia21
Use bswap_xx instead of __bswap_constant_xx when the constant version
is not available as is the case on some architectures.  (Thanks to
David Martnez Moreno for the bug report.)

BKrev: 404c64bcSW2HoY3r5wE2bVlkCpOKEA
2004-03-08 12:19:08 +00:00
cantab.net!aia21 04ef0428b3 Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/03/07 20:23:09+00:00 cantab.net!aia21
Move djgpp support stuff to above AC_PROG_CC in configure.ac

BKrev: 404b84ca2fXKnA6cCdErYO_gv_pJlQ
2004-03-07 20:23:38 +00:00
cantab.net!aia21 23f26f360a Auto merged
2004/03/07 20:22:08+00:00 cantab.net!aia21
Move djgpp support stuff to above AC_PROG_CC.

(Logical change 1.301)
2004-03-07 20:23:38 +00:00
cantab.net!aia21 eb6e78a185 Auto merged
2004/03/07 20:22:03+00:00 cantab.net!aia21

(Logical change 1.301)
2004-03-07 20:23:38 +00:00
cantab.net!aia21 3a520c42ae update build file
BKrev: 404a138e8Ih8CK5NDwba0buv6ArGbg
2004-03-06 18:08:14 +00:00
cantab.net!aia21 7e83a08c1e update
(Logical change 1.300)
2004-03-06 18:08:14 +00:00
omakaista.fi!szaka fa02ef73bf Almost completely rewritten, extended with the data relocation
related issues.

2003/11/04 13:06:21+00:00 cantab.net!aia21
Auto merged

2003/10/29 13:34:28+00:00 cantab.net!aia21
Auto merged

2003/10/29 13:30:17+00:00 flatcap.org!ntfs
updates from Szaka

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
omakaista.fi!szaka 278d707401 Added some related utils to "SEE ALSO".
2003/11/12 18:16:17+00:00 flatcap.org!ntfs
Auto merged

2003/11/04 13:06:21+00:00 cantab.net!aia21
Auto merged

2003/10/29 13:34:28+00:00 cantab.net!aia21
Auto merged

2003/10/29 13:30:17+00:00 flatcap.org!ntfs
updates from Szaka

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
omakaista.fi!szaka 7d763a6b29 Added relocation support with the continuous help of Miguel Lastra
and his collegues at the University of Granada, Dewey M. Sasser,
Erik Meade, Martin Fick, Sandro Hawke, Dave Croal, Lorrin Nelson,
Geert Hendrickx, Robert Bjorkman and Richard Burdick.

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
flatcap.org!ntfs 0e41f6aab1 remove unnecessary values for enum
struct for saving last used cluster

2003/10/29 10:25:42+00:00 flatcap.org!ntfs
display cluster info about a file / inode

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
flatcap.org!ntfs 3a6065e753 one more sign problem
2003/11/02 23:22:27+00:00 flatcap.org!ntfs

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
flatcap.org!ntfs e4f970bfc1 no changes
2003/11/02 23:22:27+00:00 flatcap.org!ntfs
move cluster_find to separate source module
implement last option

2003/10/29 10:25:42+00:00 flatcap.org!ntfs
display cluster info about a file / inode

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
flatcap.org!ntfs 100d6d7deb extra options
2003/10/28 15:48:10+00:00 flatcap.org!ntfs

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
flatcap.org!ntfs 86716d6d62 Initial revision 2004-03-06 17:42:28 +00:00
flatcap.org!ntfs 65182be272 Auto merged
2003/10/28 15:50:53+00:00 flatcap.org!ntfs
some cut'n'pasted code to wipe the pagefile and logfile

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
flatcap.org!ntfs c6b229f6d4 (Logical change 1.299) 2004-03-06 17:42:28 +00:00
cantab.net!aia21 7f95c1db70 auto-union
2003/11/06 16:34:37+00:00 cantab.net!aia21
Fix etc/ignore again...

2003/11/06 16:33:04+00:00 cantab.net!aia21
auto-union

2003/11/04 13:13:01+00:00 cantab.net!aia21
Update ignore file back to sanity.

2003/11/04 13:06:20+00:00 cantab.net!aia21
auto-union

2003/10/28 15:48:10+00:00 flatcap.org!ntfs
ignore new build target

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 584bf82ed7 Merge
2004/03/04 17:05:36+00:00 cantab.net!aia21
manual merge fallout.

2004/03/04 17:04:38+00:00 cantab.net!aia21
merge

2004/02/27 17:41:05+00:00 cantab.net!aia21
merge fallout

2004/02/27 17:37:06+00:00 cantab.net!aia21
merge

2004/02/26 15:01:44+00:00 cantab.net!aia21
Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/02/26 13:48:29+00:00 cantab.net!aia21
Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/02/26 12:08:38+00:00 cantab.net!aia21
Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/02/26 11:42:15+00:00 cantab.net!aia21
Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/02/25 17:15:05+00:00 cantab.net!aia21
Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/02/25 14:46:10+00:00 cantab.net!aia21
Makefile.in:
  update

2004/02/25 14:43:32+00:00 cantab.net!aia21
Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/02/20 14:44:48+00:00 cantab.net!aia21
Merge cantab.net:/home/src/ntfsprogs
into cantab.net:/home/src/ntfsprogs-devel

2004/02/17 18:14:49+00:00 cantab.net!aia21
Merge

2004/02/17 06:22:34+02:00 omakaista.fi!szaka
BLKGETSIZE ioctl uses unsigned long, not long for the size parameter.
Thus the maximum supported device is 2 TB on 32 bit platforms now
instead of only 1 TB.

2004/02/09 09:25:34+02:00 omakaista.fi!szaka
Added some related utils to ntfsclone manual's "SEE ALSO" section.

2004/02/09 09:13:04+02:00 omakaista.fi!szaka
Almost completely rewritten ntfsresize manual, extended with
the data relocation related issues.

2004/02/05 16:51:32+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/30 11:40:10+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/27 02:13:09+02:00 omakaista.fi!szaka
Added relocation support with the continuous help of Miguel Lastra
and his collegues at the University of Granada, Dewey M. Sasser,
Erik Meade, Martin Fick, Sandro Hawke, Dave Croal, Lorrin Nelson,
Geert Hendrickx, Robert Bjorkman and Richard Burdick.

2004/01/26 11:20:16+00:00 cantab.net!aia21
merge

2004/01/26 11:19:22+00:00 cantab.net!aia21
manual merge

2004/01/22 23:57:01+00:00 cantab.net!aia21
Merge

2004/01/22 14:56:58+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/21 12:38:43+00:00 cantab.net!aia21
Fallout from merge.

2004/01/21 12:37:28+00:00 cantab.net!aia21
merge

2004/01/19 15:58:17+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/19 09:10:18+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/15 17:08:16+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/15 17:02:31+00:00 cantab.net!aia21
Run ./autogen.sh on SuSE 9.0.

2004/01/15 16:58:49+00:00 cantab.net!aia21
merge

2004/01/13 11:26:54+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/13 11:25:24+00:00 cantab.net!aia21
Remove conflicting ntfs_attr_pread_compressed prototype.  Nothing like a bit of duplicated work.  Oh well, never mind.

2004/01/13 11:21:09+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/11 18:02:45+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/09 12:40:52+00:00 cantab.net!aia21
merge

2004/01/07 15:51:43+00:00 cantab.net!aia21
update configure

2004/01/07 15:49:24+00:00 cantab.net!aia21
merge

2004/01/06 16:52:55+00:00 cantab.net!aia21
manual merge

2004/01/06 14:43:22+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/06 11:59:00+00:00 cantab.net!aia21
Fix signed/unsigned warnings.

2004/01/06 11:56:52+00:00 cantab.net!aia21
Add attribute and inode options to ntfscat (Szaka, modified by me).

2004/01/06 11:55:15+00:00 cantab.net!aia21
Manual merge

2004/01/06 11:04:48+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2004/01/05 12:39:36+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/12/09 17:36:24+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/12/05 18:09:01+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/12/03 18:27:21+00:00 flatcap.org!ntfs
Merge bk://add/ntfsprogs-devel
into flatcap.org:/home/flatcap/work/ntfsprogs-devel

2003/12/03 18:23:31+00:00 flatcap.org!ntfs
fix: output option was being ignored

2003/12/03 15:39:34+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/12/03 12:41:54+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/11/19 16:38:21+00:00 cantab.net!aia21
Update after merge.

2003/11/19 16:07:11+00:00 cantab.net!aia21
merge

2003/11/19 00:49:13+00:00 flatcap.org!ntfs
one more sign problem

2003/11/19 00:42:29+00:00 flatcap.org!ntfs
fix minor build warnings

2003/11/13 14:52:41+00:00 cantab.net!aia21
Merge

2003/11/12 18:16:17+00:00 flatcap.org!ntfs
Merge flatcap.org:/home/flatcap/work/ntfsprogs
into flatcap.org:/home/flatcap/work/ntfsprogs-devel

2003/11/10 22:17:19+00:00 cantab.net!aia21
Merge

2003/11/07 18:26:20+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/11/07 10:16:24+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/11/06 17:35:37+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/11/06 16:34:37+00:00 cantab.net!aia21
Fix etc/ignore again...

2003/11/06 16:33:05+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/11/06 12:32:42+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/11/06 11:31:07+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/11/04 13:14:19+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/11/04 13:13:01+00:00 cantab.net!aia21
Update ignore file back to sanity.

2003/11/04 13:10:10+00:00 cantab.net!aia21
Update build

2003/11/04 13:08:37+00:00 cantab.net!aia21
Merge

2003/11/03 19:39:29+00:00 flatcap.org!ntfs
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs-devel
into flatcap.org:/root/web/bk/ntfsprogs-devel

2003/11/03 09:35:39+00:00 cantab.net!aia21
ntfsmove.c: Fix what seems to be a cut'n'paste error... bitmap_alloc instead of bitmap_free

2003/11/02 23:22:28+00:00 flatcap.org!ntfs
move cluster_find into a separate module
(so others can use it)
make it use a callback

2003/10/31 18:12:04+00:00 flatcap.org!ntfs
Merge bk://add/ntfsprogs-devel
into flatcap.org:/mnt/work/ntfsprogs-devel

2003/10/31 18:10:18+00:00 flatcap.org!ntfs
move is more generic, not much safer yet

2003/10/29 19:19:05+00:00 flatcap.org!ntfs
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs-devel
into flatcap.org:/root/web/bk/ntfsprogs-devel

2003/10/29 18:13:43+00:00 flatcap.org!ntfs
move dump_mem

2003/10/29 17:44:01+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/10/29 14:46:14+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/10/29 13:34:28+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/10/29 14:32:00+00:00 flatcap.org!ntfs
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs-devel
into flatcap.org:/root/web/bk/ntfsprogs-devel

2003/10/29 13:30:18+00:00 flatcap.org!ntfs
updates from Szaka

2003/10/29 13:15:54+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/10/29 10:25:42+00:00 flatcap.org!ntfs
display cluster info about a file / inode

2003/10/28 15:56:43+00:00 flatcap.org!ntfs
Merge bk://add/ntfsprogs-devel-rich
into flatcap.org:/mnt/work/ntfsprogs-devel-rich

2003/10/28 15:55:31+00:00 flatcap.org!ntfs
minor tidyups

2003/10/28 15:50:53+00:00 flatcap.org!ntfs
minor tool updates

2003/10/28 15:49:33+00:00 flatcap.org!ntfs
port compression code from the new driver
(it compiles, it isn't plumbed in yet)

2003/10/28 15:48:10+00:00 flatcap.org!ntfs
new tool ntfsmove - relocate a file

2003/10/27 15:30:05+00:00 cantab.net!aia21
Update version to 1.9-devel.

BKrev: 404a0d84YklPbJxsrcWBSkX5OjqvSQ
2004-03-06 17:42:28 +00:00
cantab.net!aia21 06ed41eb5f Manual merge.
2004/03/04 17:04:37+00:00 cantab.net!aia21
merge

2004/02/27 17:37:06+00:00 cantab.net!aia21
merge

2004/02/26 11:42:14+00:00 cantab.net!aia21
Auto merged

2004/02/25 14:43:30+00:00 cantab.net!aia21
Auto merged

2004/02/20 14:44:45+00:00 cantab.net!aia21
Auto merged

2004/01/26 11:19:22+00:00 cantab.net!aia21
manual merge

2004/01/22 23:56:16+00:00 cantab.net!aia21
merge

2004/01/21 12:37:28+00:00 cantab.net!aia21
merge

2004/01/09 12:40:52+00:00 cantab.net!aia21
merge

2004/01/07 15:49:24+00:00 cantab.net!aia21
manual merger

2004/01/06 16:52:55+00:00 cantab.net!aia21
manual merge

2004/01/06 14:43:22+00:00 cantab.net!aia21
Auto merged

2004/01/06 11:55:15+00:00 cantab.net!aia21
Manual merge

2004/01/06 11:04:48+00:00 cantab.net!aia21
Auto merged

2003/11/19 16:07:10+00:00 cantab.net!aia21
merge

2003/11/10 22:17:15+00:00 cantab.net!aia21
merge

2003/11/07 18:26:20+00:00 cantab.net!aia21
Auto merged

2003/11/07 10:16:23+00:00 cantab.net!aia21
Auto merged

2003/11/06 16:33:05+00:00 cantab.net!aia21
Auto merged

2003/11/04 13:08:37+00:00 cantab.net!aia21
Merge

2003/10/27 15:30:05+00:00 cantab.net!aia21
Update version to 1.9-devel.

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 e37d6644b2 Fix what seems to be a cut'n'paste error... bitmap_alloc instead of bitmap_free
2003/10/31 18:10:18+00:00 flatcap.org!ntfs
big reorganisation
extra options
will move any attributes now, including dirs
(prevented it touching metadata)

2003/10/29 18:13:30+00:00 flatcap.org!ntfs
move dump_mem to utils

2003/10/28 15:48:10+00:00 flatcap.org!ntfs

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 76364af60e Initial revision 2004-03-06 17:42:28 +00:00
cantab.net!aia21 6636c33a6d Fix signed/unsigned warnings.
2004/01/06 11:56:52+00:00 cantab.net!aia21
Add attribute and inode options to ntfscat (Szaka, modified by me).

2003/11/13 14:52:41+00:00 cantab.net!aia21
Merge

2003/10/28 15:50:53+00:00 flatcap.org!ntfs
prepare to cat other attributes

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 476ec32ef8 Auto merged
2004/03/04 17:05:35+00:00 cantab.net!aia21
manual merge fallout.

2004/03/04 17:04:08+00:00 cantab.net!aia21
Auto merged

2004/02/27 17:41:05+00:00 cantab.net!aia21
merge fall out

2004/02/27 17:36:16+00:00 cantab.net!aia21
Auto merged

2004/02/26 11:42:15+00:00 cantab.net!aia21
Auto merged

2004/02/25 14:45:54+00:00 cantab.net!aia21
update

2004/02/25 14:43:31+00:00 cantab.net!aia21
Auto merged

2004/01/26 11:20:15+00:00 cantab.net!aia21
merge

2004/01/26 11:18:38+00:00 cantab.net!aia21
Auto merged

2004/01/22 23:55:32+00:00 cantab.net!aia21
Auto merged

2004/01/21 12:36:41+00:00 cantab.net!aia21
Auto merged

2004/01/15 17:02:30+00:00 cantab.net!aia21
Run ./autogen.sh on SuSE 9.0.

2004/01/15 16:58:19+00:00 cantab.net!aia21
Auto merged

2003/11/19 16:05:20+00:00 cantab.net!aia21
Auto merged

2003/11/07 18:26:20+00:00 cantab.net!aia21
Auto merged

2003/11/07 10:16:23+00:00 cantab.net!aia21
Auto merged

2003/11/04 13:06:21+00:00 cantab.net!aia21
Auto merged

2003/11/02 23:22:27+00:00 flatcap.org!ntfs
add cluster to the build

2003/10/28 15:48:10+00:00 flatcap.org!ntfs
add ntfsmove to the build

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 b37c412671 Auto merged
2004/03/04 17:04:37+00:00 cantab.net!aia21
merge

2004/02/27 17:37:05+00:00 cantab.net!aia21
merge

2004/02/26 11:42:14+00:00 cantab.net!aia21
Auto merged

2004/02/25 14:43:30+00:00 cantab.net!aia21
Auto merged

2004/02/20 14:44:45+00:00 cantab.net!aia21
Auto merged

2004/01/26 11:20:15+00:00 cantab.net!aia21
merge

2004/01/26 11:19:22+00:00 cantab.net!aia21
manual merge

2004/01/22 23:55:45+00:00 cantab.net!aia21
merge

2004/01/21 12:38:43+00:00 cantab.net!aia21
Fallout from merge.

2004/01/21 12:37:28+00:00 cantab.net!aia21
merge

2004/01/15 17:02:30+00:00 cantab.net!aia21
Run ./autogen.sh on SuSE 9.0.

2004/01/15 16:58:48+00:00 cantab.net!aia21
merge

2004/01/09 12:40:52+00:00 cantab.net!aia21
merge

2004/01/07 15:51:43+00:00 cantab.net!aia21
update configure

2004/01/07 15:49:24+00:00 cantab.net!aia21
manual merger

2004/01/06 16:52:55+00:00 cantab.net!aia21
manual merge

2004/01/06 14:43:22+00:00 cantab.net!aia21
Auto merged

2004/01/06 11:55:15+00:00 cantab.net!aia21
Manual merge

2004/01/06 11:04:48+00:00 cantab.net!aia21
Auto merged

2003/11/19 16:38:20+00:00 cantab.net!aia21
Update after merge.

2003/11/19 16:07:10+00:00 cantab.net!aia21
merge

2003/11/10 22:16:26+00:00 cantab.net!aia21
SCCS merged

2003/11/07 18:26:20+00:00 cantab.net!aia21
Auto merged

2003/11/07 10:16:23+00:00 cantab.net!aia21
Auto merged

2003/11/06 16:33:05+00:00 cantab.net!aia21
Auto merged

2003/11/04 13:10:10+00:00 cantab.net!aia21
Update configure.

2003/11/04 13:08:37+00:00 cantab.net!aia21
Ignore this.  Will fix in a moment by running ./autogen.sh

2003/10/27 15:30:05+00:00 cantab.net!aia21
Update version to 1.9-devel.

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 9351c4b168 Auto merged
2004/03/04 17:04:07+00:00 cantab.net!aia21
Auto merged

2004/02/20 14:44:46+00:00 cantab.net!aia21
Auto merged

2004/01/22 23:55:32+00:00 cantab.net!aia21
Auto merged

2004/01/21 12:36:41+00:00 cantab.net!aia21
Auto merged

2004/01/19 09:10:18+00:00 cantab.net!aia21
Auto merged

2004/01/15 16:58:18+00:00 cantab.net!aia21
Auto merged

2004/01/13 11:25:24+00:00 cantab.net!aia21
Remove conflicting ntfs_attr_pread_compressed prototype.

2004/01/11 18:02:45+00:00 cantab.net!aia21
Auto merged

2004/01/09 12:40:52+00:00 cantab.net!aia21
merge

2004/01/07 15:48:41+00:00 cantab.net!aia21
Auto merged

2003/12/09 17:36:24+00:00 cantab.net!aia21
Auto merged

2003/12/03 15:39:34+00:00 cantab.net!aia21
Auto merged

2003/11/19 16:05:20+00:00 cantab.net!aia21
Auto merged

2003/11/04 13:06:21+00:00 cantab.net!aia21
Auto merged

2003/10/29 17:44:01+00:00 cantab.net!aia21
Auto merged

2003/10/28 15:49:32+00:00 flatcap.org!ntfs
port compression code from the new driver

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 7569534a3e Auto merged
2004/02/27 17:36:16+00:00 cantab.net!aia21
Auto merged

2004/02/17 18:14:14+00:00 cantab.net!aia21
Manual merge

2004/02/17 06:22:34+02:00 omakaista.fi!szaka
BLKGETSIZE ioctl uses unsigned long, not long for the size parameter.
Thus the maximum supported device is 2 TB on 32 bit platforms now
instead of only 1 TB.

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 799ae39165 Auto merged
2004/02/25 14:43:31+00:00 cantab.net!aia21
Auto merged

2004/02/25 14:43:30+00:00 cantab.net!aia21
Merge rename: include/attrib.h -> include/ntfs/attrib.h

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 8140d928d7 Auto merged
2004/02/25 14:43:31+00:00 cantab.net!aia21
Auto merged

2004/02/25 14:43:29+00:00 cantab.net!aia21
Merge rename: include/support.h -> include/ntfs/support.h

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 7cad421d40 Auto merged
2004/02/25 14:43:31+00:00 cantab.net!aia21
Auto merged

2004/01/26 11:18:38+00:00 cantab.net!aia21
Auto merged

2004/01/15 16:58:18+00:00 cantab.net!aia21
Auto merged

2004/01/09 12:39:22+00:00 cantab.net!aia21
Auto merged

2004/01/06 16:51:51+00:00 cantab.net!aia21
Auto merged

2003/11/19 16:38:20+00:00 cantab.net!aia21
Update after merge.

2003/11/19 00:40:18+00:00 flatcap.org!ntfs
Auto merged

2003/11/07 18:26:20+00:00 cantab.net!aia21
Auto merged

2003/11/07 10:16:23+00:00 cantab.net!aia21
Auto merged

2003/11/06 16:33:05+00:00 cantab.net!aia21
Auto merged

2003/11/06 11:31:07+00:00 cantab.net!aia21
Auto merged

2003/11/04 13:14:19+00:00 cantab.net!aia21
Auto merged

2003/11/04 13:10:10+00:00 cantab.net!aia21
Update build

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 d55b3f83c5 Auto merged
2004/02/25 14:43:31+00:00 cantab.net!aia21
Auto merged

2003/11/19 16:05:20+00:00 cantab.net!aia21
Auto merged

2003/11/02 23:22:27+00:00 flatcap.org!ntfs
add cluster to the build

2003/10/28 15:48:10+00:00 flatcap.org!ntfs
add ntfsmove to the build

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 b0fa32a8e7 Auto merged
2004/02/25 14:43:29+00:00 cantab.net!aia21
Merge rename: include/Makefile.in -> include/ntfs/Makefile.in

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 402df7a21e Auto merged
2004/02/20 14:44:47+00:00 cantab.net!aia21
Auto merged

2004/01/15 16:58:19+00:00 cantab.net!aia21
Auto merged

2004/01/07 15:48:41+00:00 cantab.net!aia21
Auto merged

2004/01/05 12:39:36+00:00 cantab.net!aia21
Auto merged

2003/12/05 18:09:00+00:00 cantab.net!aia21
Auto merged

2003/12/03 12:41:54+00:00 cantab.net!aia21
Auto merged

2003/11/04 13:06:21+00:00 cantab.net!aia21
Auto merged

2003/10/28 15:55:31+00:00 flatcap.org!ntfs
a few tweaks to help folding

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 5205fae60f Auto merged
2004/02/17 18:14:43+00:00 cantab.net!aia21
Manual merge

2004/02/17 06:22:34+02:00 omakaista.fi!szaka
BLKGETSIZE ioctl uses unsigned long, not long for the size parameter.
Thus the maximum supported device is 2 TB on 32 bit platforms now
instead of only 1 TB.

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 1564a5b72e Auto merged
2004/01/15 16:58:19+00:00 cantab.net!aia21
Auto merged

2004/01/07 15:48:41+00:00 cantab.net!aia21
Auto merged

2003/11/04 13:06:21+00:00 cantab.net!aia21
Auto merged

2003/10/28 15:55:31+00:00 flatcap.org!ntfs
move comment to help folding

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 001054baa9 Auto merged
2004/01/15 16:58:19+00:00 cantab.net!aia21
Auto merged

2003/10/28 15:55:31+00:00 flatcap.org!ntfs
typo

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 c4105e54e7 Auto merged
2004/01/07 15:48:41+00:00 cantab.net!aia21
Auto merged

2004/01/06 14:43:22+00:00 cantab.net!aia21
Auto merged

2003/11/19 00:40:18+00:00 flatcap.org!ntfs
Auto merged

2003/10/29 18:13:30+00:00 flatcap.org!ntfs
add dump_mem
remove junk that wasn't being used

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 d6c51bf64c Auto merged
2004/01/07 15:48:41+00:00 cantab.net!aia21
Auto merged

2003/11/02 23:22:27+00:00 flatcap.org!ntfs
declare [EQV]printf

2003/10/29 18:13:30+00:00 flatcap.org!ntfs
added dump_mem

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 2da888cefe Auto merged
2003/12/03 18:23:31+00:00 flatcap.org!ntfs
fix: output option was being ignored

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 fdacd99518 Add attribute and inode options to ntfscat (Szaka, modified by me).
(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21 71943895e4 Update
(Logical change 1.298)
2004-03-05 23:19:25 +00:00
cantab.net!aia21 4c58805dbf Add AC_CANONICAL_HOST([]) to configure.ac and after AC_PROG_CC add
manual provision of CC=gcc, AR=ar, and LD=ld if they are not set and
the target is *-*-*djgpp.  (Requested by Christophe Grenier)

BKrev: 40490afdVA7BUL7-q11Cv7hRLr9Sxg
2004-03-05 23:19:25 +00:00
cantab.net!aia21 2658aaa398 Add AC_CANONICAL_HOST([]) to configure.ac and after AC_PROG_CC add
manual provision of CC=gcc, AR=ar, and LD=ld if they are not set and
the target is *-*-*djgpp.  (Requested by Christophe Grenier)

(Logical change 1.298)
2004-03-05 23:19:25 +00:00
cantab.net!aia21 0260c6db9c Update
(Logical change 1.297)
2004-03-05 11:41:37 +00:00
cantab.net!aia21 88609677fd Make ntfs_attrs_walk() use AT_UNUSED and CASE_SENSITIVE instead of
zero when calling ntfs_lookup() for type checking correctness.  (Yuval
Fledel)
In attribute lookup code in libntfs/attrib.c, check type against
AT_UNUSED and not zero.

BKrev: 40486771LHDy46YxgQ1hvUUpK2k5ow
2004-03-05 11:41:37 +00:00
cantab.net!aia21 4de7c6fde0 Make ntfs_attrs_walk() use AT_UNUSED and CASE_SENSITIVE instead of
zero when calling ntfs_lookup() for type checking correctness.  (Yuval
Fledel)

(Logical change 1.297)
2004-03-05 11:41:37 +00:00
cantab.net!aia21 3c69e66ff8 In attribute lookup code in libntfs/attrib.c, check type against
AT_UNUSED and not zero.

(Logical change 1.297)
2004-03-05 11:41:37 +00:00
cantab.net!aia21 c5543c6049 Update
(Logical change 1.296)
2004-03-05 11:27:01 +00:00
cantab.net!aia21 5729164fad Rename 'opt' struct member stdout to std_out in ntfsclone.c because
stdout is a macro on Cygwin and compilation fails. (Yuval Fledel)

BKrev: 40486405bIKlyf0vdHiK_Tpx867NxA
2004-03-05 11:27:01 +00:00
cantab.net!aia21 654f3b7721 Rename 'opt' struct member stdout to std_out because stdout is a
macro on Cygwin and compilation fails. (Yuval Fledel)

(Logical change 1.296)
2004-03-05 11:27:01 +00:00
cantab.net!aia21 9d70153483 Update.
(Logical change 1.295)
2004-03-05 11:23:42 +00:00
cantab.net!aia21 0905db9495 Rename private to priv_data in ntfs_device_alloc() to avoid name
space clashes with C++.  (Yuval Fledel, modified fix by me)

BKrev: 4048633eFq7vztAr7U8Kibj34d15Uw
2004-03-05 11:23:42 +00:00
cantab.net!aia21 607036db7d Rename private to priv_data in ntfs_device_alloc() to avoid name
space clashes with C++.  (Yuval Fledel, modified fix by me)

(Logical change 1.295)
2004-03-05 11:23:42 +00:00
cantab.net!aia21 61115edf14 Update/modernise build system: autogen.sh now uses autoreconf; run
autoupdate && autoreconf --force and fixup the fallout damage; rename
INCLUDES to AM_CPPFLAGS; add $srcdir to getgccver invocation.

BKrev: 40485ec8_gVMUo34wsOoiNQoLmoq4g
2004-03-05 11:04:40 +00:00
cantab.net!aia21 a2a03c63b3 Update.
(Logical change 1.294)
2004-03-05 11:04:40 +00:00
cantab.net!aia21 73fdc0ebd9 Update to use autoreconf.
(Logical change 1.294)
2004-03-05 11:04:40 +00:00
cantab.net!aia21 589f5ec22f Update so getggcver is always found (make distcheck used to fail because
of this for example).

(Logical change 1.294)
2004-03-05 11:04:40 +00:00
cantab.net!aia21 a2e4ff7cb6 Rename INCLUDES to AM_CPPFLAGS.
(Logical change 1.294)
2004-03-05 11:04:40 +00:00
cantab.net!aia21 7bd2f3f8d5 Update.
(Logical change 1.293)
2004-03-05 09:45:14 +00:00
cantab.net!aia21 a7e6f2acb5 Modify layout.h and logfile.h expanding/naming annonymous structs
and unions (much like I did earlier in the kernel driver) so that
the -fms-extensions switch is no longer required.  Also, removed
the -fms-extensions switch and associated autodetection from
./configure.ac.  (Yuval Fledel with small fixes from me)

BKrev: 40484c2asRC1SlQMVfhDhHkULzq0Ew
2004-03-05 09:45:14 +00:00
cantab.net!aia21 260305c102 Modify layout.h and logfile.h expanding/naming annonymous structs
and unions (much like I did earlier in the kernel driver) so that
the -fms-extensions switch is no longer required.  Also, removed
the -fms-extensions switch and associated autodetection from
./configure.ac.  (Yuval Fledel with small fixes from me)

(Logical change 1.293)
2004-03-05 09:45:14 +00:00
cantab.net!aia21 e749fdc229 Add Yuval Fledel.
(Logical change 1.293)
2004-03-05 09:45:14 +00:00
cantab.net!aia21 b87932368a Minor update.
(Logical change 1.292)
2004-03-04 17:03:27 +00:00
cantab.net!aia21 32ee437ae4 Minor update and fix another compiler warning.
BKrev: 4047615fP5BnfzxqixCA3rxSshEqjQ
2004-03-04 17:03:27 +00:00
cantab.net!aia21 a6629ede03 And another compiler warning.
(Logical change 1.292)
2004-03-04 17:03:27 +00:00
cantab.net!aia21 6b66bce89d update
(Logical change 1.291)
2004-03-04 16:59:58 +00:00
cantab.net!aia21 852af74c58 Fix mkntfs for large volumes where the number of clusters would
exceed the maximum of 32 bits and mkntfs would segfault.  Now we
increase the cluster size until the number of clusters no longer
exceeds 32 bits or the maximum cluster size is reached.  We then
exit with an appropriate error message.  (Thanks to Szaka for the
bug report.)
Also fix some compiler warnings in mkntfs with --enable-maintainer-mode.

(Logical change 1.291)
2004-03-04 16:59:58 +00:00
cantab.net!aia21 743f2c3632 Fix compiler warning with --enable-maintainer-mode.
(Logical change 1.291)
2004-03-04 16:59:58 +00:00
cantab.net!aia21 863a98f704 - Fix mkntfs for large volumes where the number of clusters would
exceed the maximum of 32 bits and mkntfs would segfault.  Now we
  increase the cluster size until the number of clusters no longer
  exceeds 32 bits or the maximum cluster size is reached.  We then
  exit with an appropriate error message.  (Thanks to Szaka for the
  bug report.)
- Also fix some compiler warnings in mkntfs with --enable-maintainer-mode.

BKrev: 4047608erW-8wtmrh6ySSD3kjzZB4Q
2004-03-04 16:59:58 +00:00
cantab.net!aia21 b99d045075 Update doc/CodingStyle
(Logical change 1.290)
2004-03-01 12:47:17 +00:00
cantab.net!aia21 42d06b623c Update CodingStyle as suggested by Szaka.
BKrev: 404330d5HTRnMqOaDr6XDbTFv6IVwA
2004-03-01 12:47:17 +00:00
cantab.net!aia21 4460ccc41a Update ChangeLog
(Logical change 1.290)
2004-03-01 12:47:17 +00:00
cantab.net!aia21 5f2ae1a245 Update to 1.8.6-WIP.
BKrev: 4041f513kMym4zqrJcnjdh3JzFrbMg
2004-02-29 14:20:03 +00:00
cantab.net!aia21 ddc702a582 Update to 1.8.6-WIP.
(Logical change 1.289)
2004-02-29 14:20:03 +00:00
cantab.net!aia21 989f4ad69f Update.
(Logical change 1.288)
2004-02-29 14:09:45 +00:00
cantab.net!aia21 089a45c625 Guard config.h inclusiong with ifdef HAVE_CONFIG_H. Suggested by Christophe Grenier.
BKrev: 4041f2a9ad7n_rWxn-oYtMdMPYYHHA
2004-02-29 14:09:45 +00:00
cantab.net!aia21 f64410dbb7 Guard config.h inclusiong with ifdef HAVE_CONFIG_H
(Logical change 1.288)
2004-02-29 14:09:45 +00:00
cantab.net!aia21 40261dcd62 Update.
(Logical change 1.287)
2004-02-27 16:44:10 +00:00
cantab.net!aia21 9c38c54864 Update for 1.8.5 relelase.
(Logical change 1.287)
2004-02-27 16:44:10 +00:00
cantab.net!aia21 a619085383 Update for 1.8.5 release.
(Logical change 1.287)
2004-02-27 16:44:10 +00:00
cantab.net!aia21 acbe4ec1e7 Update
(Logical change 1.287)
2004-02-27 16:44:10 +00:00
cantab.net!aia21 3f12891c07 Remove compiler warning by rearranging code a bit in ntfs_mount().
(Logical change 1.287)
2004-02-27 16:44:10 +00:00
cantab.net!aia21 7239c1f42b Adapt BLKGETSIZE64 definition to the one found in 2.6 kernels.
(Logical change 1.287)
2004-02-27 16:44:10 +00:00
cantab.net!aia21 25766b3757 - Update for 1.8.5 relelase.
- Adapt BLKGETSIZE64 definition to the one found in 2.6 kernels.
- Remove compiler warning by rearranging code a bit in ntfs_mount().

BKrev: 403f73daa9iktClfg6W-4WlIYJmjhA
2004-02-27 16:44:10 +00:00
cantab.net!aia21 f5090dc763 Fix typo in Andra's email address.
BKrev: 403e0a3fQB-9CgbOXwJCCW7SZqwdfw
2004-02-26 15:01:19 +00:00
cantab.net!aia21 1002bad82c Fix typo in Andra's email address.
(Logical change 1.286)
2004-02-26 15:01:19 +00:00
cantab.net!aia21 dfa5c497f7 - Fix a duplicated free() in mkntfs. (Andras Erdei)
- Fix option display in mkntfs. (Andras Erdei)

BKrev: 403df9200bFP9MajDeL2uvp59lrN2Q
2004-02-26 13:48:16 +00:00
cantab.net!aia21 6eb9812220 - Fix a duplicated free() in mkntfs. (Andras Erdei)
- Fix option display in mkntfs. (Andras Erdei)

(Logical change 1.285)
2004-02-26 13:48:16 +00:00
cantab.net!aia21 a16c548e71 Fix the fix. (-:
BKrev: 403de1b7iPcmIN33bXzNithwVtCgAA
2004-02-26 12:08:23 +00:00
cantab.net!aia21 42e3faba21 Fix the fix. (-:
(Logical change 1.284)
2004-02-26 12:08:23 +00:00
cantab.net!aia21 3949cb41a6 Update.
(Logical change 1.283)
2004-02-26 11:41:48 +00:00
cantab.net!aia21 f0ad8c7ed0 Update
(Logical change 1.283)
2004-02-26 11:41:48 +00:00
cantab.net!aia21 6cecd0e726 Detect NO_NTFS_DEVICE_DEFAULT_IO_OPS and #error appropriately.
(Logical change 1.283)
2004-02-26 11:41:48 +00:00
cantab.net!aia21 4b12f1bfce Add NO_NTFS_DEVICE_DEFAULT_IO_OPS.
(Logical change 1.283)
2004-02-26 11:41:48 +00:00
cantab.net!aia21 e48ba0d47f - Small cleanup of ./configure.ac to show better formatted option help text
and other little bits.
- Add --disable-default-device-io-ops option to ./configure which makes
  for a smaller libntfs but results in ntfs_mount() always returning
  error with errno set to ENOTSUP.  You need to use ntfs_device_mount()
  instead.  This only makes sense with "make libs" and when an
  application linking statically against libntfs provides its own
  device io operations.  (Feature requested by Christophe Grenier.)

BKrev: 403ddb7cbi9vmQs-n7i-pGYWYNnXVQ
2004-02-26 11:41:48 +00:00
cantab.net!aia21 f0fd6cce62 - Small cleanup of ./configure.ac to show better formatted option help text
and other little bits.
- Add --disable-default-device-io-ops option to ./configure which makes
  for a smaller libntfs but results in ntfs_mount() always returning
  error with errno set to ENOTSUP.  You need to use ntfs_device_mount()
  instead.  This only makes sense with "make libs" and when an
  application linking statically against libntfs provides its own
  device io operations.  (Feature requested by Christophe Grenier.)

(Logical change 1.283)
2004-02-26 11:41:48 +00:00
cantab.net!aia21 ca8aa8a4fc Update
(Logical change 1.282)
2004-02-26 09:18:49 +00:00
cantab.net!aia21 4c3e523e8a Add Andras Erdei to CREDITS and update ChangeLog with mkntfs fix.
BKrev: 403db9f9OWitdTv1Znwg3Y-1S7vFGw
2004-02-26 09:18:49 +00:00
cantab.net!aia21 eb3974ae34 Add Andras Erdei
(Logical change 1.282)
2004-02-26 09:18:49 +00:00
cantab.net!aia21 d9c6c0bb70 Fix bug in stoucs(). Thanks to Andras Erdei.
BKrev: 403cd800pyF0NHzgs0Lnz9Vp_dN7FA
2004-02-25 17:14:40 +00:00
cantab.net!aia21 536b80cb56 Fix bug in stoucs(). Thanks to Andras Erdei.
(Logical change 1.281)
2004-02-25 17:14:40 +00:00
cantab.net!aia21 83a577b1e5 Update for move of include files.
2004/02/25 13:57:19+00:00 cantab.net!aia21
Rename: include/Makefile.in -> include/ntfs/Makefile.in

(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 1f2547829c Update for move of include files.
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 2e94e0d4ca Update
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 6a2d6277e9 Rename: include/volume.h -> include/ntfs/volume.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 96d9f30e1a Rename: include/volume.h -> include/ntfs/volume.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 1cfb7cb780 Rename: include/unistr.h -> include/ntfs/unistr.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 2de41afeb0 Rename: include/unistr.h -> include/ntfs/unistr.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 9c545b1a67 Rename: include/types.h -> include/ntfs/types.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 450e974e53 Rename: include/types.h -> include/ntfs/types.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 307edb606f Rename: include/support.h -> include/ntfs/support.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 8e46abe9bb Rename: include/support.h -> include/ntfs/support.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 c01551305f Rename: include/runlist.h -> include/ntfs/runlist.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 ea202b473f Rename: include/runlist.h -> include/ntfs/runlist.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 d9b62e0a62 Rename: include/mst.h -> include/ntfs/mst.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 1e61d4ca7d Rename: include/mst.h -> include/ntfs/mst.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 fc58f7f637 Rename: include/mft.h -> include/ntfs/mft.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 bafd0f97bc Rename: include/mft.h -> include/ntfs/mft.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 d281afae83 Rename: include/logfile.h -> include/ntfs/logfile.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 1ce0bb34b1 Rename: include/logfile.h -> include/ntfs/logfile.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 51e1b94660 Rename: include/list.h -> include/ntfs/list.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 f23548e88f Rename: include/list.h -> include/ntfs/list.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 f0a07eee9f Rename: include/lcnalloc.h -> include/ntfs/lcnalloc.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 1b5fbcee9a Rename: include/lcnalloc.h -> include/ntfs/lcnalloc.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 44b052d5ff Rename: include/layout.h -> include/ntfs/layout.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 28ddffc9ca Rename: include/layout.h -> include/ntfs/layout.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 fe48419140 Rename: include/inode.h -> include/ntfs/inode.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 2661b1d8fb Rename: include/inode.h -> include/ntfs/inode.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 982c071d0e Rename: include/gnome-vfs-module.h -> include/ntfs/gnome-vfs-module.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 7d26c4c57e Rename: include/gnome-vfs-module.h -> include/ntfs/gnome-vfs-module.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 baf0188ac5 Rename: include/gnome-vfs-method.h -> include/ntfs/gnome-vfs-method.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 ad03d832e5 Rename: include/gnome-vfs-method.h -> include/ntfs/gnome-vfs-method.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 e7d3d0e420 Rename: include/endians.h -> include/ntfs/endians.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 c1e3dc03be Rename: include/endians.h -> include/ntfs/endians.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 7be2dcc70e Rename: include/dir.h -> include/ntfs/dir.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 00fa855ac7 Rename: include/dir.h -> include/ntfs/dir.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 4c0f3b21d0 Rename: include/device_io.h -> include/ntfs/device_io.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 52ff000fe9 Rename: include/device_io.h -> include/ntfs/device_io.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 9d1e7a0987 Rename: include/device.h -> include/ntfs/device.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 bb8f192c25 Rename: include/device.h -> include/ntfs/device.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 14e54a2347 Rename: include/debug.h -> include/ntfs/debug.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 dc727b8307 Rename: include/debug.h -> include/ntfs/debug.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 9ffd8007b6 Rename: include/compress.h -> include/ntfs/compress.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 508ce7ac22 Rename: include/compress.h -> include/ntfs/compress.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 49455232ba Rename: include/compat.h -> include/ntfs/compat.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 9cd9e1edf9 Rename: include/compat.h -> include/ntfs/compat.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 1904c8d118 Rename: include/bootsect.h -> include/ntfs/bootsect.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 5f77178020 Rename: include/bootsect.h -> include/ntfs/bootsect.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 38c6220836 Rename: include/bitmap.h -> include/ntfs/bitmap.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 d87fde8436 Rename: include/bitmap.h -> include/ntfs/bitmap.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 37b43614ab Rename: include/attrib.h -> include/ntfs/attrib.h
}(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 f2c1a93bc8 Rename: include/attrib.h -> include/ntfs/attrib.h
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 1f65bb86c0 Rename: include/Makefile.am -> include/ntfs/Makefile.am
(Logical change 1.280)
2004-02-25 14:21:14 +00:00
cantab.net!aia21 335c60d7ed Move include files from ntfsprogs/include to ntfsprogs/include/ntfs
and adapt build system.  (Requested by Christophe Grenier.)

BKrev: 403caf5aJJ6atbJ5xXxqsnnX8lEl4w
2004-02-25 14:21:14 +00:00
cantab.net!aia21 b1c59d1796 Initial revision 2004-02-25 14:21:14 +00:00
cantab.net!aia21 44d6eb9704 (Logical change 1.280) 2004-02-25 14:21:14 +00:00
cantab.net!aia21 876c19e268 update
(Logical change 1.279)
2004-02-20 14:44:16 +00:00
cantab.net!aia21 4fc6296c76 Update.
(Logical change 1.279)
2004-02-20 14:44:16 +00:00
cantab.net!aia21 441947337e Include config.h before any other non-ntfs headers.
(Logical change 1.279)
2004-02-20 14:44:16 +00:00
cantab.net!aia21 c0cfabf990 Enable GNU extensions on systems that have them.
Use AC_SYS_LARGEFILE instead of manually defining _FILE_OFFSET_BITS=64 in CFLAGS.

(Logical change 1.279)
2004-02-20 14:44:16 +00:00
cantab.net!aia21 31045b8034 - Enable GNU extensions on systems that have them.
- Use AC_SYS_LARGEFILE instead of manually defining _FILE_OFFSET_BITS=64 in CFLAGS.
- Include config.h before any other non-ntfs headers.

BKrev: 40361d40VWmNboUAiybe3q0bFu-4oA
2004-02-20 14:44:16 +00:00
cantab.net!aia21 3be519245c Update
(Logical change 1.278)
2004-02-17 14:01:22 +00:00
cantab.net!aia21 d4f756e709 Add use of BLKGETSIZE64 and fix typos in debug output.
BKrev: 40321eb2dA-eXMZxm2jGslXWDl2o0Q
2004-02-17 14:01:22 +00:00
cantab.net!aia21 a033e9dfa0 Add use of BLKGETSIZE64 and fix typos in debug output.
(Logical change 1.278)
2004-02-17 14:01:22 +00:00
omakaista.fi!szaka 5f20b21ef8 BLKGETSIZE ioctl uses unsigned long, not long for the size parameter.
Thus the maximum supported device is 2 TB on 32 bit platforms
instead of only 1 TB.

(Logical change 1.277)
2004-02-17 03:40:22 +00:00
omakaista.fi!szaka 7e89018759 BLKGETSIZE ioctl uses unsigned long, not long for the size parameter.
Thus the maximum supported device is 2 TB on 32 bit platforms
instead of only 1 TB.


BKrev: 40318d26G8SNg1gN6OC0_Rlo6FFULg
2004-02-17 03:40:22 +00:00
omakaista.fi!szaka 46f0709d29 BLKGETSIZE ioctl uses unsigned long, not long for the size parameter.
Thus the maximum supported device is 2 TB on 32 bit platforms
instead of only 1 TB.


(Logical change 1.277)
2004-02-17 03:40:22 +00:00
cantab.net!aia21 9a18a4a5ed Fixup ntfsinfo a little bit and give its manpage a small update to
reflect reality a little better.

BKrev: 4022747ejCBjdMGlBS2n9jruCpQSLQ
2004-02-05 16:51:10 +00:00
cantab.net!aia21 5fd2457c54 Fixup ntfsinfo a little bit and give its manpage a small update to
reflect reality a little better.

(Logical change 1.276)
2004-02-05 16:51:10 +00:00
cantab.net!aia21 315c5d150d update TODO.libntfs; several points have been implemented already! (-:
BKrev: 401994376dZqMgrANWGWZCFvPileuQ
2004-01-29 23:16:07 +00:00
cantab.net!aia21 8a6020472c update TODO.libntfs; several points have been implemented already! (-:
(Logical change 1.275)
2004-01-29 23:16:07 +00:00
cantab.net!aia21 613bd563d2 Start 1.8.5-WIP.
BKrev: 4014e9b7riK7Am3U9sPq0y5I0L0fqA
2004-01-26 10:19:35 +00:00
cantab.net!aia21 0dc21e3d77 Start 1.8.5-WIP.
(Logical change 1.274)
2004-01-26 10:19:35 +00:00
cantab.net!aia21 3921f01f2e Updates for latest libtool and 1.8.4 release.
BKrev: 4014e3b5i190HbH6WLsoG7N0CeBSQA
2004-01-26 09:53:57 +00:00
cantab.net!aia21 f6e26b3fed Update with latest libtoolize.
(Logical change 1.273)
2004-01-26 09:53:57 +00:00
cantab.net!aia21 743a352c60 Update spec file change log.
(Logical change 1.273)
2004-01-26 09:53:57 +00:00
cantab.net!aia21 26fbe3a101 Update for latest libtool/autoconf/automake.
(Logical change 1.273)
2004-01-26 09:53:57 +00:00
cantab.net!aia21 b3f275dccd Update for 1.8.4 release.
(Logical change 1.273)
2004-01-26 09:53:57 +00:00
cantab.net!aia21 85bc7db098 Update
(Logical change 1.272)
2004-01-22 23:53:36 +00:00
cantab.net!aia21 e14583bed7 Fix memory leek in error code path ntfs_attr_open(). Thanks to Christophe Grenier who used Valgrind to find it.
(Logical change 1.272)
2004-01-22 23:53:36 +00:00
cantab.net!aia21 cba63740ae Fix memory leaks in ntfs_readdir(), ntfs_inode_lookup_by_name(), and ntfs_attr_open(). Thanks to Christophe Grenier who used Valgrind to find them.
BKrev: 40106280zigSMMr2Lc0yRFCTOIPrnw
2004-01-22 23:53:36 +00:00
cantab.net!aia21 b19215d1ed Fix memory leaks in ntfs_readdir() and ntfs_inode_lookup_by_name(). Thanks to Christophe Grenier who used Valgrind to find them.
(Logical change 1.272)
2004-01-22 23:53:36 +00:00
cantab.net!aia21 825338e866 Start 1.8.4-WIP
BKrev: 400fefbaoXAmT5RgX-X5jjPdCcX8Gg
2004-01-22 15:43:54 +00:00
cantab.net!aia21 cf2c13e079 Start 1.8.4-WIP
(Logical change 1.271)
2004-01-22 15:43:54 +00:00
cantab.net!aia21 c84d4b91f1 Change Lode's email address.
BKrev: 400fe4a72b5oFQ38QRKA08JdHR_7OA
2004-01-22 14:56:39 +00:00
cantab.net!aia21 892f097d8c Change Lode's email address.
(Logical change 1.270)
2004-01-22 14:56:39 +00:00
cantab.net!aia21 eec41c0b5c Build update.
BKrev: 400e719bWmViheo6BrIZRm8xXL4wfQ
2004-01-21 12:33:31 +00:00
cantab.net!aia21 b260aaa7fc Build update.
(Logical change 1.269)
2004-01-21 12:33:31 +00:00
cantab.net!aia21 6b87731c2a Make decompression work in all test cases I tried.
(Logical change 1.268)
2004-01-21 12:30:18 +00:00
cantab.net!aia21 c0454867e2 Fix decompression code. Hopefully for good... Famous last words. (-;
BKrev: 400e70dab-fkLB2Wh74ySoAsE82zug
2004-01-21 12:30:18 +00:00
cantab.net!aia21 6c7b8a6ef6 Fix a debug printf.
(Logical change 1.268)
2004-01-21 12:30:18 +00:00
cantab.net!aia21 2e726fff11 Add support for compressed, resident attributes.
(Logical change 1.268)
2004-01-21 12:30:18 +00:00
cantab.net!aia21 824af63818 update for 1.8.3 release.
(Logical change 1.267)
2004-01-19 16:28:03 +00:00
cantab.net!aia21 7aa67cb5bf Update.
(Logical change 1.267)
2004-01-19 16:28:03 +00:00
cantab.net!aia21 e5bcdf5752 Update for 1.8.3 release.
(Logical change 1.267)
2004-01-19 16:28:03 +00:00
cantab.net!aia21 eef1eaf641 Add %config to tell rpm that libntfs.conf is a config file.
(Logical change 1.267)
2004-01-19 16:28:03 +00:00
cantab.net!aia21 bcc8d79797 - spec file: Add %config to tell rpm that libntfs.conf is a config file.
- Fix ./configure for SuSE 9.0.
- Update for 1.8.3 release.

BKrev: 400c0593lGSNZXSAJ7OHa1IoiB6_Dg
2004-01-19 16:28:03 +00:00
cantab.net!aia21 474c5bc370 - Update for 1.8.3 release.
- Fix ./configure for SuSE 9.0.

(Logical change 1.267)
2004-01-19 16:28:03 +00:00
cantab.net!aia21 af643aef59 Work around broken mbstowcs() implementation on Cygwin. (Lode Leroy)
(Logical change 1.266)
2004-01-19 15:58:00 +00:00
cantab.net!aia21 55a4a34097 Update changelog.
(Logical change 1.266)
2004-01-19 15:58:00 +00:00
cantab.net!aia21 4b57fb71ea Partition handling update from Lode Leroy.
(Logical change 1.266)
2004-01-19 15:58:00 +00:00
cantab.net!aia21 0f80e6b1d7 - Work around broken mbstowcs() implementation on Cygwin. (Lode Leroy)
- Partition handling update from Lode Leroy.

BKrev: 400bfe88wlgIpgJIaurprW1u5mSNtg
2004-01-19 15:58:00 +00:00
cantab.net!aia21 205a5db037 Fix range checking error spotted by Szaka.
(Logical change 1.265)
2004-01-19 09:09:56 +00:00
cantab.net!aia21 4ef67c7247 Fix compiler warning.
(Logical change 1.265)
2004-01-19 09:09:56 +00:00
cantab.net!aia21 fd1bb1db7f - Fix range checking error spotted by Szaka.
- Fix compiler warning.

BKrev: 400b9ee4AsLqshoZcvZQpFohSqeE-A
2004-01-19 09:09:56 +00:00
cantab.net!aia21 2f2363872f apply patch from Szaka:
- all warnings fixed for maintainer mode for ntfsresize and ntfsclone
- added 'const' to ntfs_ucstombs()'s first parameter
- 'fsync' also after metadata-only cloning
- fixed forced metadata-only, dirty ntfs cloning (only one -f needed)

BKrev: 4006c8edpiMxBmaYFD8M7ZCBgDf2DA
2004-01-15 17:07:57 +00:00
cantab.net!aia21 401c8ebf7d apply patch from Szaka:
- all warnings fixed for maintainer mode for ntfsresize and ntfsclone
- added 'const' to ntfs_ucstombs()'s first parameter
- 'fsync' also after metadata-only cloning
- fixed forced metadata-only, dirty ntfs cloning (only one -f needed)

(Logical change 1.264)
2004-01-15 17:07:57 +00:00
cantab.net!aia21 f67f495e28 - Apply patch from Szaka to fix all %L to %ll.
- Fix remaining %L ti %ll (compress.c).
- Run ./autogen.sh on SuSE 9.0.

BKrev: 4006c666HDSXMa7CjSIBa9JQsMhuvQ
2004-01-15 16:57:10 +00:00
cantab.net!aia21 c9076ef627 - Apply patch from Szaka to fix all %L to %ll.
- Fix remaining %L ti %ll (compress.c).
- Run ./autogen.sh on SuSE 9.0.

(Logical change 1.263)
2004-01-15 16:57:10 +00:00
cantab.net!aia21 cb2bace779 Add include to provice prototype.
BKrev: 4003d5f6Sc6YIspmPz5UIGOmRe1AiA
2004-01-13 11:26:46 +00:00
cantab.net!aia21 1a926436f9 Add include to provice prototype.
(Logical change 1.262)
2004-01-13 11:26:46 +00:00
cantab.net!aia21 22707a7895 Update
(Logical change 1.261)
2004-01-13 11:05:18 +00:00
cantab.net!aia21 2ff2fa7af9 Finish attribute decompression code. (Completely untested!)
BKrev: 4003d0eempNZYviEmx1MB-aCdvbjbw
2004-01-13 11:05:18 +00:00
cantab.net!aia21 e13713fd27 Finish attribute decompression code. (Completely untested!)
(Logical change 1.261)
2004-01-13 11:05:18 +00:00
cantab.net!aia21 a73943388a Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs

2004/01/11 18:01:32+00:00 cantab.net!aia21
update comment

BKrev: 40018f8acK7XwNuwC6iipD4bQ-I5qQ
2004-01-11 18:01:46 +00:00
cantab.net!aia21 57041e1a94 Auto merged
2004/01/11 18:01:31+00:00 cantab.net!aia21
update comment

(Logical change 1.260)
2004-01-11 18:01:46 +00:00
cantab.net!aia21 9bb5b63cce Update version to 1.8.3-WIP
(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 cabb6dc25b Update Matthew's email address.
(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 3318f33a0b Update
2004/01/08 17:13:00+00:00 cantab.net!aia21
Update version to 1.8.3-WIP

(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 cd99a42e34 Update
2004/01/08 17:13:00+00:00 cantab.net!aia21
Fill in documentation gaps for ntfs_attr structure.

(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 29e697f63a Update
2004/01/08 17:13:00+00:00 cantab.net!aia21
Add reading of compressed attributes.

(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 dff4154577 Update
2004/01/08 17:13:00+00:00 cantab.net!aia21

(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 5aa2088a95 Update
(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 4d7f189a9d Started on compressed attribute reading.
Update Matthew Fanto's email address.
Apply patch to ntfsinfo from Matthew Fanto (plus some fixes from me).
Update mkntfs linux/major.h support for more recent glibc.

BKrev: 3ffea0e0wnDv67NJFKIqsvGAAoE9dg
2004-01-09 12:38:56 +00:00
cantab.net!aia21 aa3c49bc5b Patch from Matthew Fanto with fixups from me.
(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 010e735129 Initial revision 2004-01-09 12:38:56 +00:00
cantab.net!aia21 a7a6c5cfe5 Fix the previous update...
2004/01/09 10:50:25+00:00 cantab.net!aia21
Update for newer glibc.

(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 9c78a8bf4f Add compress.h to the build system.
(Logical change 1.259)
2004-01-09 12:38:56 +00:00
cantab.net!aia21 0636632d5a (Logical change 1.259) 2004-01-09 12:38:56 +00:00
cantab.net!aia21 8999f2dc1d Update changelog
BKrev: 3ffc2a10tUSDwASBlNq8j0JIOqLOkA
2004-01-07 15:47:28 +00:00
cantab.net!aia21 d8ece48a50 Update
(Logical change 1.258)
2004-01-07 15:47:28 +00:00
cantab.net!aia21 f123fba30e Update
(Logical change 1.257)
2004-01-07 15:03:17 +00:00
cantab.net!aia21 fc3ed9769b Enable lots of compiler warnings and fix warning from libntfs.
BKrev: 3ffc1fb5hkq-c8Eolw5fyJTv_Um40w
2004-01-07 15:03:17 +00:00
cantab.net!aia21 3244f17522 Enable lots of compiler warnings and fix warning from libntfs.
(Logical change 1.257)
2004-01-07 15:03:17 +00:00
cantab.net!aia21 8d166264dc Update NEWS.
BKrev: 3ffbe4feNlEOwOUjsGPk1zTAw3q1hw
2004-01-07 10:52:46 +00:00
cantab.net!aia21 ee06bb014f Update NEWS.
(Logical change 1.256)
2004-01-07 10:52:46 +00:00
cantab.net!aia21 dacd601b9f Update
(Logical change 1.255)
2004-01-07 10:48:24 +00:00
cantab.net!aia21 e691e34ae7 Missed a bit from Christophe's patch.
(Logical change 1.255)
2004-01-07 10:48:24 +00:00
cantab.net!aia21 5d03514991 Change version to 1.8.2.
Missed a bit from Christophe's patch.

BKrev: 3ffbe3f84rB-JHR_BspVf0YYXCcj4Q
2004-01-07 10:48:24 +00:00
cantab.net!aia21 5cb1228eef Change version to 1.8.2.
(Logical change 1.255)
2004-01-07 10:48:24 +00:00
cantab.net!aia21 d88ac0c313 Update ignore.
BKrev: 3ffbde325p76KZmQ_SAB1etPmOUz8Q
2004-01-07 10:23:46 +00:00
cantab.net!aia21 79af991c34 Update ignore.
(Logical change 1.254)
2004-01-07 10:23:46 +00:00
cantab.net!aia21 3d4837f9de More updates from Christophe Grenier for DJGPP and FreeBSD.
BKrev: 3ffbddfbuXB9MpKECu4fQfTgP7h7dg
2004-01-07 10:22:51 +00:00
cantab.net!aia21 6651abe322 More updates from Christophe Grenier for DJGPP and FreeBSD.
(Logical change 1.253)
2004-01-07 10:22:51 +00:00
cantab.net!aia21 029782c0c1 Remove duplicate redeclaration from device.h. (Christophe Grenier)
BKrev: 3ffbd925XbLw39CZC1oZPU918GXF_A
2004-01-07 10:02:13 +00:00
cantab.net!aia21 3eaa5c327f Remove duplicate redeclaration from device.h. (Christophe Grenier)
(Logical change 1.252)
2004-01-07 10:02:13 +00:00
cantab.net!aia21 7b29b11dc1 Add new compile target "make libs" which only compiles libntfs.
BKrev: 3ffae4d42-rCajOh4VPNfCaO9x2j1g
2004-01-06 16:39:48 +00:00
cantab.net!aia21 652b1e554d Add new compile target "make libs" which only compiles libntfs.
(Logical change 1.251)
2004-01-06 16:39:48 +00:00
cantab.net!aia21 33082d51a9 Update version to 1.8.2-WIP
BKrev: 3ffaca31YvMfSgGxzpxoEF8r3GbR0g
2004-01-06 14:46:09 +00:00
cantab.net!aia21 f70fc867a5 Update version to 1.8.2-WIP
(Logical change 1.250)
2004-01-06 14:46:09 +00:00
cantab.net!aia21 48d9569249 - Compile fixes for DJGPP. (Chrisophe Grenier, me)
- Add compatibility for building on FreeBSD. (Christophe Grenier)

BKrev: 3ffac6b91lyqS8qjV6Cy56QJKaNIUQ
2004-01-06 14:31:21 +00:00
cantab.net!aia21 3fea49b48c - Compile fixes for DJGPP. (Chrisophe Grenier, me)
- Add compatibility for building on FreeBSD. (Christophe Grenier)

(Logical change 1.249)
2004-01-06 14:31:21 +00:00
cantab.net!aia21 cf7384da43 Update for 1.8.1 release.
BKrev: 3ffaa1610jphpcTM2CgjvAySX_t11Q
2004-01-06 11:52:01 +00:00
cantab.net!aia21 be273eddc8 Update for 1.8.1 release.
(Logical change 1.248)
2004-01-06 11:52:01 +00:00
cantab.net!aia21 38e8b16253 Add compatibility for building with DJGPP under DOS. (Christophe
Grenier, slightly modified by me)

BKrev: 3ffa963dzLxmiCQdY1CZZjrICqdXGQ
2004-01-06 11:04:29 +00:00
cantab.net!aia21 1226d98038 Add compatibility for building with DJGPP under DOS. (Christophe
Grenier, slightly modified by me)

(Logical change 1.247)
2004-01-06 11:04:29 +00:00
cantab.net!aia21 388a10109f Fix bug in run list encoding functions that hit sparse and compressed
files with holes. (Szabolcs Szakacsits)

BKrev: 3ff95aeeIdV7cV6-u9IuUUVQizEmaw
2004-01-05 12:39:10 +00:00
cantab.net!aia21 9bd88a7d39 Fix bug in run list encoding functions that hit sparse and compressed
files with holes. (Szabolcs Szakacsits)

(Logical change 1.246)
2004-01-05 12:39:10 +00:00
cantab.net!aia21 f7b862b7d1 finish off initial implementation of ntfs_attr_make_resident().
BKrev: 3fd60800Qz640YAR8FNqszPwCvqbtg
2003-12-09 17:36:00 +00:00
cantab.net!aia21 549393080e finish off initial implementation of ntfs_attr_make_resident().
(Logical change 1.245)
2003-12-09 17:36:00 +00:00
cantab.net!aia21 fb54204cc7 Add ntfs_rl_pread().
BKrev: 3fd0c93aC9FUR9kieGfYbDSEarDghQ
2003-12-05 18:06:50 +00:00
cantab.net!aia21 608669d564 Add ntfs_rl_pread().
(Logical change 1.244)
2003-12-05 18:06:50 +00:00
cantab.net!aia21 012e9b8cfc Add ntfs_attr_map_whole_runlist().
BKrev: 3fce038c-F_KqoT-7I4uIvaBYH7HUg
2003-12-03 15:38:52 +00:00
cantab.net!aia21 19fcf9b688 Add ntfs_attr_map_whole_runlist().
(Logical change 1.243)
2003-12-03 15:38:52 +00:00
cantab.net!aia21 09ec84d205 fix small error handling bug.
(Logical change 1.242)
2003-12-02 17:16:21 +00:00
cantab.net!aia21 9789e0f753 Fix small error handling bug.
BKrev: 3fccc8e5fcc3m9uE2oXIGA6vJ7hMNg
2003-12-02 17:16:21 +00:00
cantab.net!aia21 756aff8f50 Fix nasty buffer overflow bug in ntfs_get_attribute_value() which we use to get
the attribute list attribute.  This is the same bug that was biting us in the
ntfs driver 2.1.4 and was fixed in 2.1.5.  Windows XP creates files where an
attribute's data size is more than one run list run shorter than the allocated
size which causes us to crash out as we assumed this would never happen.

BKrev: 3fbb5f02obDK9CzE6fg_L0KTjqWWww
2003-11-19 12:16:02 +00:00
cantab.net!aia21 33918ceae9 Fix nasty buffer overflow bug in ntfs_get_attribute_value() which we use to get
the attribute list attribute.  This is the same bug that was biting us in the
ntfs driver 2.1.4 and was fixed in 2.1.5.  Windows XP creates files where an
attribute's data size is more than one run list run shorter than the allocated
size which causes us to crash out as we assumed this would never happen.

(Logical change 1.241)
2003-11-19 12:16:02 +00:00
cantab.net!aia21 12971872b4 Update changelog for 1.8.0 release.
BKrev: 3fbb47b6xXnnoTS9akyKU38AXDGbfA
2003-11-19 10:36:38 +00:00
cantab.net!aia21 93fcefa1de Update changelog for 1.8.0 release.
(Logical change 1.240)
2003-11-19 10:36:38 +00:00
cantab.net!aia21 a3531f9fbe Cleanup build system with respect to CFLAGS so they are consistent throughout and
the right flags get added for the right things and move all of this in one place in
configure.ac removing everything from the Makefile.am files.

BKrev: 3fbb4679qk81uhUM7ZUm-PiyWQ607w
2003-11-19 10:31:21 +00:00
cantab.net!aia21 e92992ed63 Cleanup build system with respect to CFLAGS so they are consistent throughout and
the right flags get added for the right things and move all of this in one place in
configure.ac removing everything from the Makefile.am files.

(Logical change 1.239)
2003-11-19 10:31:21 +00:00
flatcap.org!ntfs fafd832996 clear up a few minor build warnings
(Logical change 1.238)
2003-11-19 00:05:30 +00:00
flatcap.org!ntfs dde45c851e clear up a few build warnings - sign problems, function declarations
BKrev: 3fbab3ca0yZa5kiSgnSQ76p6YRVKyQ
2003-11-19 00:05:30 +00:00
flatcap.org!ntfs 05af63dc9b remove the dependency on <asm/byteorder.h> in favour of <endian.h> and <byteswap.h>
(Logical change 1.237)
2003-11-18 21:17:57 +00:00
flatcap.org!ntfs d6f2ca4a62 remove a non-portable compilation dependency
BKrev: 3fba8c85yj5qeUjnJlEcIVUczJgx2g
2003-11-18 21:17:57 +00:00
flatcap.org!ntfs f2b687549b force the constant to the 64 bit
(Logical change 1.237)
2003-11-18 21:17:57 +00:00
cantab.net!aia21 88a9b54dc4 Add -fms-extensions to libntfs_gnomevfs compilation, too.
BKrev: 3fba629eJhZiBUNdnkRuzyb18GVNIQ
2003-11-18 18:19:10 +00:00
cantab.net!aia21 4e2220d018 Add -fms-extensions to libntfs_gnomevfs compilation, too.
(Logical change 1.236)
2003-11-18 18:19:10 +00:00
cantab.net!aia21 fb04ff3893 Fix warnings.
BKrev: 3fba5e3fGesOj6Diq9IZT-Epy0l3Xw
2003-11-18 18:00:31 +00:00
cantab.net!aia21 0803017bb6 Fix warnings.
(Logical change 1.235)
2003-11-18 18:00:31 +00:00
cantab.net!aia21 7a3e8fdeb5 Make ntfscat show all messages to stderr so output (on stdout) isn't corrupted. (Szaka)
BKrev: 3fb39a7fieCny0qVgdFuAs457LgbTw
2003-11-13 14:51:43 +00:00
cantab.net!aia21 0cef8dcd86 Make ntfscat show all messages to stderr so output (on stdout) isn't corrupted. (Szaka)
(Logical change 1.234)
2003-11-13 14:51:43 +00:00
flatcap.org!ntfs 12317ec4a8 s/sf/sourceforge/g
(Logical change 1.233)
2003-11-12 18:05:56 +00:00
flatcap.org!ntfs 03bde61ab1 replace sf with sourceforge in the man pages
when they are html-ified, they cause warnings in the link checker

BKrev: 3fb27684yhwz3L2knQ62UcZ62gCl1Q
2003-11-12 18:05:56 +00:00
cantab.net!aia21 84f4b4857e Release 1.8.0beta2
BKrev: 3faf6e80po6nK1q_-jxlk8BkjXqpvQ
2003-11-10 10:54:56 +00:00
cantab.net!aia21 eb0e4f664f Release 1.8.0beta2
(Logical change 1.232)
2003-11-10 10:54:56 +00:00
cantab.net!aia21 d9bf0f8f6e Make building of libntfs-gnomevfs optional. (Jan Kratochvil)
(Logical change 1.231)
2003-11-07 18:25:26 +00:00
cantab.net!aia21 f318004b7a Make building of libntfs-gnomevfs optional and autodetect it in configure. (Jan Kratochvil)
BKrev: 3fabe396nEF9oUufRSC76HSt02-Log
2003-11-07 18:25:26 +00:00
cantab.net!aia21 6006b1a2b3 Split off ntfsprogs-gnomevfs in separate rpm and move glib/gnome
dependencies to it.

BKrev: 3fab70e0uvOPZszZl4bUlPl27hmsNQ
2003-11-07 10:16:00 +00:00
cantab.net!aia21 912e86e813 Split off ntfsprogs-gnomevfs in separate rpm and move glib/gnome
dependencies to it.

(Logical change 1.230)
2003-11-07 10:16:00 +00:00
cantab.net!aia21 6f459a9a64 (Logical change 1.230) 2003-11-07 10:16:00 +00:00
cantab.net!aia21 d8f45af56f Initial revision 2003-11-07 10:16:00 +00:00
cantab.net!aia21 fee7837427 Split off libntfs-gnomevfs into its own rpm ntfsprogs-gnomevfs.*.rpm
BKrev: 3faa8620Jp83TXajnUFpa3AN3XJf1Q
2003-11-06 17:34:24 +00:00
cantab.net!aia21 6d8ad66256 Split off libntfs-gnomevfs into its own rpm ntfsprogs-gnomevfs.*.rpm
(Logical change 1.229)
2003-11-06 17:34:24 +00:00
cantab.net!aia21 a087baf3b9 Add man pages in libntfs directory to the ignore list.
BKrev: 3faa779cicTVVBfYrii5RL6bXKinOA
2003-11-06 16:32:28 +00:00
cantab.net!aia21 644be9f595 Add man pages in libntfs directory to the ignore list.
(Logical change 1.228)
2003-11-06 16:32:28 +00:00
cantab.net!aia21 c26497232e (Logical change 1.227) 2003-11-06 16:30:56 +00:00
cantab.net!aia21 2f42ed8d72 Initial revision 2003-11-06 16:30:56 +00:00
cantab.net!aia21 86424d0660 Add man page for libntfs-gnomevfs and other man page updates.
BKrev: 3faa7740Nr0XjOC3wqCcLN-coVRU-Q
2003-11-06 16:30:56 +00:00
cantab.net!aia21 50fb15960e Add man page for libntfs-gnomevfs and other man page updates.
(Logical change 1.227)
2003-11-06 16:30:56 +00:00
cantab.net!aia21 6092a909ca Update spec file for libntfs-gnomevfs merge.
FIXME: Do we want ntfsprogs rpm to install libntfs-gnomevfs, too
or do we want to keep it as a separate rpm for non-gnome users?

BKrev: 3faa3f5bUBp7C7CQ2CbVr2UPggcDUg
2003-11-06 12:32:27 +00:00
cantab.net!aia21 025498f337 Merge libntfs-gnomevfs and other cleanups.
(Logical change 1.226)
2003-11-06 12:32:27 +00:00
cantab.net!aia21 3e9b8dc09c Add Jan Kratochvil.
(Logical change 1.226)
2003-11-06 12:32:27 +00:00
cantab.net!aia21 60845e45cc Fix build process so that libntfs-gnomevfs is linked against libntfs properly using libtool.
BKrev: 3faa2c5cRAidzL55nS3mE753I_nkfw
2003-11-06 11:11:24 +00:00
cantab.net!aia21 0edb229552 Fix build process so that libntfs-gnomevfs is linked against libntfs properly using libtool.
(Logical change 1.225)
2003-11-06 11:11:24 +00:00
cantab.net!aia21 8851638b84 Update build. Note noticed by citool before...
BKrev: 3fa7a60cCXT89jXQ04WH6DwRfRAX1w
2003-11-04 13:13:48 +00:00
cantab.net!aia21 ef164c7184 Update build. Note noticed by citool before...
(Logical change 1.224)
2003-11-04 13:13:48 +00:00
cantab.net!aia21 a69cd32d72 update build
2003/11/04 12:26:49+00:00 cantab.net!aia21
Update build for ntfs gnome vfs

(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 03f2e201fe ignore libntfs.conf
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 7712504582 fix signed warnings
2003/11/03 16:11:36+00:00 cantab.net!aia21
Update what is to do to finish non-resident to resident attribute conversion.

(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 9dec022b81 fix signed warnings
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 99d25b2120 fix signed warning
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 20e3e64065 eeek! return MREFs not integers
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 541450856b attrdef_len is now signed
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 2103b57235 Update for ntfs gnomevfs.
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 37f1235091 Update change log.
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 51931fd51d Update build.
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 aecda4e488 Update build for ntfs gnome vfs
2003/11/04 11:46:06+00:00 cantab.net!aia21
Fix typo.

2003/11/04 11:44:39+00:00 cantab.net!aia21
Add ntfs gnome vfs library.

(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 205c79accf Update build for ntfs gnome vfs
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 083dca6a18 Update attr_def min and max size to be s64 not unsigned.
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 0f24a6c105 Typo...
2003/11/03 17:21:37+00:00 cantab.net!aia21

(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 973e11099b The big mean merge of NTFS Gnome VFS by Jan Kratochvil. This caused several bugfixes
in the library and utilities as well due to the signed warnings compiler switch added
to the maintainer mode build.

Still to do to complete the merge / before the 1.8.0beta 2 release:
- Update .spec.in file for ntfs gnome vfs
- Write man page "ntfsgnomevfs.8" with examples of usage
- Fix all the signed compiler warnings that aren't fixed yet in the utilities.
- Clean up the build as we now have CFLAGS modified in both configure AND in local makefiles.
  Move all of this to configure.

BKrev: 3fa7a3c7xL9-9O9E4RZSKunxRs1CvA
2003-11-04 13:04:07 +00:00
cantab.net!aia21 05bf546cb0 Now file_size is signed.
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 80b57b880d Initial revision 2003-11-04 13:04:07 +00:00
cantab.net!aia21 3b25f96395 Fix signed warnings.
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 3618c4b8f7 Add ntfs gnome vfs header files.
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 e216063558 Add Jan Kratochvil to authors.
(Logical change 1.223)
2003-11-04 13:04:07 +00:00
cantab.net!aia21 2a4f72d834 (Logical change 1.223) 2003-11-04 13:04:07 +00:00
flatcap.org!ntfs 49002f504f Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into flatcap.org:/root/web/bk/ntfsprogs

2003/10/29 16:17:56+00:00 flatcap.org!ntfs
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into flatcap.org:/root/web/bk/ntfsprogs

2003/10/29 14:36:52+00:00 flatcap.org!ntfs
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into flatcap.org:/root/web/bk/ntfsprogs

2003/10/29 13:33:59+00:00 flatcap.org!ntfs
updates from Szaka

BKrev: 3fa012d97TxRLQT1yV0B5GI_HlHK9A
2003-10-29 19:19:53 +00:00
flatcap.org!ntfs 46a7f90e14 Auto merged
2003/10/29 13:33:58+00:00 flatcap.org!ntfs
updates from Szaka

(Logical change 1.222)
2003-10-29 19:19:53 +00:00
cantab.net!aia21 316fb4f6db attrib.c:
Ooops.  Make it compile...

BKrev: 3f9ffc15SDTXIustGMyY_iq3c5xYZg
2003-10-29 17:42:45 +00:00
cantab.net!aia21 3088f60dc3 Ooops. Make it compile...
(Logical change 1.221)
2003-10-29 17:42:45 +00:00
cantab.net!aia21 d4d4557ed3 attrib.c:
Make ntfs_attr_make_non_resident() return error EPERM if
  it is called for an attribute that cannot be non-resident.
  Implement ntfs_attr_can_be_resident().
  Start working on ntfs_attr_make_resident().

BKrev: 3f9ffb731gg594AWzF_6XAc1KD2PfQ
2003-10-29 17:40:03 +00:00
cantab.net!aia21 8f310e5bf2 Make ntfs_attr_make_non_resident() return error EPERM if
it is called for an attribute that cannot be non-resident.
Implement ntfs_attr_can_be_resident().
Start working on ntfs_attr_make_resident().

(Logical change 1.220)
2003-10-29 17:40:03 +00:00
cantab.net!aia21 34a712077d mft.c:
Implement rollback in ntfs_mft_record_free().

BKrev: 3f9ffa53BHsDTqMVHN9BU459RtuXTw
2003-10-29 17:35:15 +00:00
cantab.net!aia21 d993588f0c Implement rollback in ntfs_mft_record_free().
(Logical change 1.219)
2003-10-29 17:35:15 +00:00
cantab.net!aia21 a0010c53b9 layout.h:
Update comments.

BKrev: 3f9fd2a5nlzYmNm052jCfL-xn6X7AA
2003-10-29 14:45:57 +00:00
cantab.net!aia21 86f747e673 Update comments.
(Logical change 1.218)
2003-10-29 14:45:57 +00:00
cantab.net!aia21 39a75b5f61 ntfsresize.8.in, ntfsclone.8.in:
Update from Szaka

BKrev: 3f9fc1b6yY_L5e3AsI700wYtB6rrDg
2003-10-29 13:33:42 +00:00
cantab.net!aia21 75519695ef Update from Szaka
(Logical change 1.217)
2003-10-29 13:33:42 +00:00
cantab.net!aia21 94cf62642f Leave inodes dirty if ntfs_inode_sync() fails.
BKrev: 3f9d50edaxznDgbmQz0qELluUnzm3A
2003-10-27 17:07:57 +00:00
cantab.net!aia21 1ef194e7ae (Logical change 1.216) 2003-10-27 17:07:57 +00:00
cantab.net!aia21 2e4af91cd1 Fix what must be a logic inverting typo...
BKrev: 3f9d36fdIdeqeMfyEj0dgKRNWsXaHA
2003-10-27 15:17:17 +00:00
cantab.net!aia21 4ddd73798c Fix what must be a logic inverting typo...
(Logical change 1.215)
2003-10-27 15:17:17 +00:00
flatcap.org!ntfs 5587fe0549 make ntfs_attr_close a bit safer
(Logical change 1.214)
2003-10-26 12:40:40 +00:00
flatcap.org!ntfs 50df3a4189 adding errnos for bad calling
(Logical change 1.214)
2003-10-26 12:40:40 +00:00
flatcap.org!ntfs 9312550eaa add reference to ntfscat
(Logical change 1.214)
2003-10-26 12:40:40 +00:00
flatcap.org!ntfs 5af8e6ac63 Lots of trivial tidyups - mostly bulletproofing
BKrev: 3f9bc0c8bnGUGioYz_g-2BY7CjnvOA
2003-10-26 12:40:40 +00:00
cantab.net!aia21 aa09c472c5 update
BKrev: 3f97cfa84KpzLme3gD-ZJNEGLdM0MQ
2003-10-23 12:55:04 +00:00
cantab.net!aia21 a98c6029ef update
(Logical change 1.213)
2003-10-23 12:55:04 +00:00
cantab.net!aia21 37fdc85536 Update with ntfscat.
(Logical change 1.212)
2003-10-23 12:41:17 +00:00
cantab.net!aia21 ac308c5503 Some fixes.
BKrev: 3f97cc6dCaxkaw8v4qGGTl8Yv9y_0Q
2003-10-23 12:41:17 +00:00
cantab.net!aia21 3b2953e8c4 Ooops. It's an ENUM not a DEFINE. Hopte this always works...
(Logical change 1.212)
2003-10-23 12:41:17 +00:00
cantab.net!aia21 80d5e408c6 Fixes from Lode to make it work on Cygwin.
BKrev: 3f97c97czD3v7yuUzrkXnsbomw3kgA
2003-10-23 12:28:44 +00:00
cantab.net!aia21 9f07090763 Fixes from Lode to make it work on Cygwin.
(Logical change 1.211)
2003-10-23 12:28:44 +00:00
cantab.net!aia21 91d3027eb2 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/10/01 10:15:31+01:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs-devel
into cantab.net:/home/aia21/ntfsprogs

2003/10/01 10:12:26+01:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs-devel
into cantab.net:/home/aia21/ntfsprogs

2003/09/28 14:03:11+01:00 flatcap.org!ntfs
utils.c:
  typo which made ntfslabel read only

BKrev: 3f97c7bdaB8Rg14tULiSzeQJoqzv2w
2003-10-23 12:21:17 +00:00
cantab.net!aia21 edbeeb397f Auto merged
2003/10/01 10:12:26+01:00 cantab.net!aia21
Auto merged

2003/09/28 14:02:46+01:00 flatcap.org!ntfs
typo which made ntfslabel read only

(Logical change 1.210)
2003-10-23 12:21:17 +00:00
cantab.net!aia21 67591d0256 update
(Logical change 1.209)
2003-10-17 15:43:14 +00:00
cantab.net!aia21 7b7e3a7ed6 Add -quiet and -verbose options to ntfscat.
Update changelog.

BKrev: 3f900e12HF3XPYgygxw6DM7EtqVrVw
2003-10-17 15:43:14 +00:00
cantab.net!aia21 b44276e3f1 Add -quiet and -verbose options to ntfscat.
(Logical change 1.209)
2003-10-17 15:43:14 +00:00
flatcap.org!ntfs 6913945435 extra/extras target
(Logical change 1.208)
2003-10-16 21:11:12 +00:00
flatcap.org!ntfs f1f109d219 add "extras" target (alias extra) to build extra programs
BKrev: 3f8f0970wRQUWN3E3KNl4nqK3eXaDA
2003-10-16 21:11:12 +00:00
flatcap.org!ntfs fbc51eacb0 extra target to make extra programs
BKrev: 3f8f084bO6HkPre6qMN_fXud7wbcpw
2003-10-16 21:06:19 +00:00
flatcap.org!ntfs 9cc93c1479 extra target to make extra programs
(Logical change 1.207)
2003-10-16 21:06:19 +00:00
flatcap.org!ntfs a1e1de5c23 wipe the tails of mft records that are in use
BKrev: 3f89df87Xt3EkBKm9bWoGisB_r8hpg
2003-10-12 23:11:03 +00:00
flatcap.org!ntfs 3234ada8a2 wipe the tails of mft records that are in use
(Logical change 1.206)
2003-10-12 23:11:03 +00:00
flatcap.org!ntfs 6f0ffca0c0 wipe the mft slack space
BKrev: 3f89917doi0v0qZS8lISZ_y1LHuifg
2003-10-12 17:38:05 +00:00
flatcap.org!ntfs 6be430ea08 wipe the mft slack space
(Logical change 1.205)
2003-10-12 17:38:05 +00:00
flatcap.org!ntfs cc4f8fccbd typo
(Logical change 1.205)
2003-10-12 17:38:05 +00:00
flatcap.org!ntfs 7c7dd07807 new man page
(Logical change 1.204)
2003-10-12 17:22:04 +00:00
flatcap.org!ntfs a3338b7ec2 Updates from Szaka
BKrev: 3f898dbcmP0NFtngexGwpYJHjmnv7w
2003-10-12 17:22:04 +00:00
flatcap.org!ntfs ff9c58f35e typo
(Logical change 1.203)
2003-10-12 12:48:46 +00:00
flatcap.org!ntfs ea789ac0e2 ntfswipe.c:
typo

BKrev: 3f894daeuwKPTwtDA5ZWkFYu9tXXoA
2003-10-12 12:48:46 +00:00
flatcap.org!ntfs 5420628b1d wipe unused space seems to work
(Logical change 1.202)
2003-10-12 12:45:23 +00:00
flatcap.org!ntfs a241416f44 first draft of ntfswipe
BKrev: 3f894ce3go_56GpMy2qN3sLIUMzLpQ
2003-10-12 12:45:23 +00:00
flatcap.org!ntfs c111faac87 ntfscat.c:
mem leak in error path

BKrev: 3f887a7a5FVGZLFZe4o60DNEWK4Cbg
2003-10-11 21:47:38 +00:00
flatcap.org!ntfs 9e26482dd5 mem leak in error path
(Logical change 1.201)
2003-10-11 21:47:38 +00:00
flatcap.org!ntfs def94f5b0c typo
(Logical change 1.200)
2003-10-11 15:36:14 +00:00
flatcap.org!ntfs 177ad3b693 slight rearrangement to group standard options
(Logical change 1.200)
2003-10-11 15:36:14 +00:00
flatcap.org!ntfs 1bd078c21a gather info using mft search contexts
(Logical change 1.200)
2003-10-11 15:36:14 +00:00
flatcap.org!ntfs 740b9f98a4 added info to cluster
BKrev: 3f88236eh8dxdQM-2Q0DXxejZX3meA
2003-10-11 15:36:14 +00:00
flatcap.org!ntfs da7c9dd404 first draft of mft search contexts
BKrev: 3f88224dTLrNVxEryLY6fNIw5gLUIg
2003-10-11 15:31:25 +00:00
flatcap.org!ntfs ecbe65ac6b first draft of mft search contexts
(Logical change 1.199)
2003-10-11 15:31:25 +00:00
flatcap.org!ntfs a4f7f86a7b ignore ntfscat
(Logical change 1.198)
2003-10-11 15:30:47 +00:00
flatcap.org!ntfs 20cc34942a extras for cat
BKrev: 3f882227mv5TgXoddRLna9ViQPAZ1g
2003-10-11 15:30:47 +00:00
flatcap.org!ntfs ecfbb6ba20 add ntfscat to news
(Logical change 1.198)
2003-10-11 15:30:47 +00:00
flatcap.org!ntfs 64a627283d typo
(Logical change 1.197)
2003-10-11 15:23:42 +00:00
flatcap.org!ntfs 210c470c0b Change from Szaka
BKrev: 3f88207es3ugCbsEJLGpsBx_CVmT8Q
2003-10-11 15:23:42 +00:00
flatcap.org!ntfs 765d4c6b68 add ntfscat to the build
BKrev: 3f874b1dot_rME-X7XkPubMOGMUX0A
2003-10-11 00:13:17 +00:00
flatcap.org!ntfs 2fe2986b6e add ntfscat to the build
(Logical change 1.196)
2003-10-11 00:13:17 +00:00
flatcap.org!ntfs 8f1f232253 add ntfscat to the build
(Logical change 1.195)
2003-10-10 23:22:23 +00:00
flatcap.org!ntfs f28338e40c Initial revision 2003-10-10 23:22:23 +00:00
flatcap.org!ntfs 25509ed087 Added ntfscat to the build
It's only a quick draft

BKrev: 3f873f2fbg4v3nRZGsDndAfrqrMCBw
2003-10-10 23:22:23 +00:00
flatcap.org!ntfs cfacfc10a5 (Logical change 1.195) 2003-10-10 23:22:23 +00:00
flatcap.org!ntfs 038982bb62 ntfsls.c:
minor bugfix

BKrev: 3f872a5c8WEXnrkYhwKGNLGrIBc0hA
2003-10-10 21:53:32 +00:00
flatcap.org!ntfs c536fe31da minor bugfix
(Logical change 1.194)
2003-10-10 21:53:32 +00:00
flatcap.org!ntfs 6a9c6ada8f replace ucstos with ntfs_ucstombs
replace stoucs with ntfs_mbstoucs
adapt routine to convert a path to an inode (now in utils)
fix memory leaks in error paths

(Logical change 1.193)
2003-10-10 21:50:49 +00:00
flatcap.org!ntfs 4b15bb47ee big tidy up
BKrev: 3f8729b9NQN89dnTicydt2f6cFR54g
2003-10-10 21:50:49 +00:00
flatcap.org!ntfs 904b95f03d added utils_pathname_to_inode based on Lode's version from ntfsls
in __metadata
  the root directory is definitely metadata now (rationale: stuff the user cannot delete)
  check for extent inodes of metadata files

(Logical change 1.192)
2003-10-10 21:42:48 +00:00
flatcap.org!ntfs 127d183ef8 added MAX_PATH (for ntfsls)
(Logical change 1.192)
2003-10-10 21:42:48 +00:00
flatcap.org!ntfs 77a57862f4 Merge bk://add/ntfsprogs-devel
into flatcap.org:/mnt/work/ntfsprogs-devel

2003/10/10 22:41:37+01:00 flatcap.org!ntfs
more shared code added to utils: path_to_inode
minor fixes to __metadata

BKrev: 3f8727d8fSnivOHkXxuFMzcAFv8bhg
2003-10-10 21:42:48 +00:00
flatcap.org!ntfs b04468288e Updates from Szaka.
ntfsresize changes:
 - replaced .NET references to Windows Server 2003 (also everywhere in
   ntfsprogs)
 - ntfsresize manual update
 - more verbose ntfsresize error messages, with hints, explanations
 - handle backup boot sector in the middle
 - existance of bad block list check moved to the "collect resize
   constrains" part of the code from the "resize in-progress" part.
 - replace chkdsk references to chkdsk /f
 - other minor cleanups

BKrev: 3f851496osUfNsqWsYwDH1sUbydJow
2003-10-09 07:56:06 +00:00
flatcap.org!ntfs d0cc759878 Updates from Szaka
(Logical change 1.191)
2003-10-09 07:56:06 +00:00
flatcap.org!ntfs b9d2243a6b Fix the build
BKrev: 3f81c0c6Fg2edhSiIPI8m4jgU3m9Sg
2003-10-06 19:21:42 +00:00
flatcap.org!ntfs 47df17cb17 Fix the build
(Logical change 1.190)
2003-10-06 19:21:42 +00:00
flatcap.org!ntfs fcd4a314f3 add a helper to determine if an inode represents metadata
(Logical change 1.189)
2003-10-06 18:52:00 +00:00
flatcap.org!ntfs ebb1404359 Merge bk://add/ntfsprogs-devel
into flatcap.org:/mnt/work/ntfsprogs-devel

2003/10/06 19:51:48+01:00 flatcap.org!ntfs
bits'n'pieces

BKrev: 3f81b9d0GKWfbeQK3rW5PC3087afpQ
2003-10-06 18:52:00 +00:00
flatcap.org!ntfs ecb1673d0e Auto merged
2003/09/28 14:57:05+01:00 flatcap.org!ntfs
add a helper to determine if an inode represents metadata

(Logical change 1.189)
2003-10-06 18:52:00 +00:00
flatcap.org!flatcap f0c141023b display more info
(Logical change 1.189)
2003-10-06 18:52:00 +00:00
cantab.net!aia21 f49930c0f4 ntfs_device_disk_io_ops is now ntfs_device_default_io_ops.
(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 a34d218e90 merge common functions from disk_io.c into device.c
(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 14b8a9bab6 disk_io is gone. device_io appears.
(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 7af52becdd common functions moved from diks_io.h to device.h
(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 ae8d6bf9d6 Update
(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 786a34f1a2 New export: ntfs_device_default_io_ops
2003/10/06 10:49:55+01:00 cantab.net!aia21
Rename: BitKeeper/deleted/.del-device.h~47409fbdf050222e -> include/device.h

(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 0e6dac03b6 Moved from disk_io.c. All functions specific to unix style device operations.
}(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 d999304a70 Moved from disk_io.c. All functions specific to unix style device operations.
2003/10/06 10:37:38+01:00 cantab.net!aia21
Rename: libntfs/disk_io.c -> libntfs/unix_io.c

(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 e21db3b3a7 Make work on Cygwin. There is no 1 == non-option argument so have to use -d option instead.
(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 68fc3c2642 Make stat and ioctl return error instead of silently succeeding.
This probably breaks Cygwin but never mind...

(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 aa247f5101 Make it work on Cygwin.
(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 3d3b853379 Initial revision 2003-10-06 11:38:25 +00:00
cantab.net!aia21 b8872ed7ad FIXME: utils_valid_device() doesn't work on Cygwin. For now just don't do it.
(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 bfd37171ab Delete: include/disk_io.h
}(Logical change 1.188)
2003-10-06 11:38:25 +00:00
cantab.net!aia21 b07f4f6d3c - Integrate win32 io ops (by Lode Leroy) into build process (if building on Cygwin
win32 ops are automatically used and otherwise the usual unix style ops are used).
- Apply some fixes to make things work on Cygwin.  These changes are based on a
  patch from Lode Leroy.

BKrev: 3f815431R2ENXhAguodfndFht5ynKw
2003-10-06 11:38:25 +00:00
cantab.net!aia21 9a0c63f302 (Logical change 1.188) 2003-10-06 11:38:25 +00:00
cantab.net!aia21 f051b6dbe7 update to ignore the tar ball.
BKrev: 3f7a9b23-eqKLR7qt3RI2cebPZJKiw
2003-10-01 09:15:15 +00:00
cantab.net!aia21 54f1d89ba0 update to ignore the tar ball.
(Logical change 1.187)
2003-10-01 09:15:15 +00:00
cantab.net!aia21 dbace28a51 Updates for 1.8.0beta
BKrev: 3f7a9af5koznpz6MFcNp2-82iuXflQ
2003-10-01 09:14:29 +00:00
cantab.net!aia21 a2bc391192 Update
(Logical change 1.186)
2003-10-01 09:14:29 +00:00
cantab.net!aia21 433801118e Add win32_io.c to be distributed.
(Logical change 1.185)
2003-09-30 10:32:09 +00:00
cantab.net!aia21 9016aed815 Add -i parameter to syntax output of ntfsls.
(Logical change 1.185)
2003-09-30 10:32:09 +00:00
cantab.net!aia21 ef0d5ec250 - Add win32_io.c to be distributed.
- Add -i parameter to syntax output of ntfsls.

BKrev: 3f795ba9XnmsR5Pzf-1lXCmvL3ydoQ
2003-09-30 10:32:09 +00:00
cantab.net!aia21 7075668849 Update for 1.8.0beta release.
BKrev: 3f79500e9hSElbbl0H0NQBQebHebUQ
2003-09-30 09:42:38 +00:00
cantab.net!aia21 335659c0df Update
(Logical change 1.184)
2003-09-30 09:42:38 +00:00
flatcap.org!flatcap 565d25f0b6 typo which made ntfslabel read only
BKrev: 3f76db76At8T1xCVInkD1fwxf3FUCA
2003-09-28 13:00:38 +00:00
flatcap.org!flatcap f433b68d83 typo which made ntfslabel read only
(Logical change 1.183)
2003-09-28 13:00:38 +00:00
cantab.net!aia21 a139e15ddd SCCS merged
2003/09/24 14:13:09+01:00 cantab.net!aia21
update

(Logical change 1.182)
2003-09-24 13:16:33 +00:00
cantab.net!aia21 f70fc8cb92 Merge
2003/09/24 14:13:09+01:00 cantab.net!aia21
Fix a silly bug in attrib.c::ntfs_external_attr_find() which caused
us to always return the same attribute during an enumeration as soon
as the end of the attributes to be enumerated was reached thus
causing the program doing the enumeration to hang in a tight loop.
NOTE: There is still work to do as ctx->al_entry is set to NULL
instead of to the position in the attribute list at which to insert.

BKrev: 3f719931_JoFmx_aIArUmYzEq5TzCQ
2003-09-24 13:16:33 +00:00
cantab.net!aia21 f7c342dafe Auto merged
2003/09/24 14:13:09+01:00 cantab.net!aia21
The workaround for the bug in ntfs_attr_lookup() no longer needed as the bug should be fixed.

(Logical change 1.182)
2003-09-24 13:16:33 +00:00
cantab.net!aia21 e9bce127fa Auto merged
2003/09/24 14:13:09+01:00 cantab.net!aia21
Fix a silly bug in attrib.c::ntfs_external_attr_find() which caused
us to always return the same attribute during an enumeration as soon
as the end of the attributes to be enumerated was reached thus
causing the program doing the enumeration to hang in a tight loop.
NOTE: There is still work to do as ctx->al_entry is set to NULL
instead of to the position in the attribute list at which to insert.

(Logical change 1.182)
2003-09-24 13:16:33 +00:00
cantab.net!aia21 2bd3a2dd44 Update build (fix fallout from merge)
BKrev: 3f684b68QHaB2GXrHKkAw84H0wRJBg
2003-09-17 11:54:16 +00:00
cantab.net!aia21 9d296e3dc6 Update
(Logical change 1.181)
2003-09-17 11:54:16 +00:00
flatcap.org!flatcap 0d33099fdb (Logical change 1.180) 2003-09-17 11:51:25 +00:00
cantab.net!aia21 74a1764f65 Merge
2003/09/06 00:05:08+01:00 flatcap.org!flatcap
makefile tweak

2003/09/05 23:58:16+01:00 flatcap.org!flatcap
stop ntfscluster hanging on certain extent inodes
add ntfscluster man page to the build

BKrev: 3f684abd5PGCl2Z6OOWpmfb3AOPDvQ
2003-09-17 11:51:25 +00:00
cantab.net!aia21 94230f694e Manual merge
2003/09/06 00:05:07+01:00 flatcap.org!flatcap
makefile wasn't cleaning up ntfscluster.8

2003/09/05 23:58:15+01:00 flatcap.org!flatcap
added ntfscluster.8 to the build

(Logical change 1.180)
2003-09-17 11:51:25 +00:00
cantab.net!aia21 95e6b7b929 Manual merge
2003/09/05 23:58:15+01:00 flatcap.org!flatcap
added ntfscluster.8 to the build

(Logical change 1.180)
2003-09-17 11:51:25 +00:00
cantab.net!aia21 dad8bebb43 Auto merged
2003/09/05 23:58:15+01:00 flatcap.org!flatcap
work around what's probably a bug in ntfs_attr_lookup
(with some extent inodes, ntfs_attr_lookup keeps returning the same attribute)
need more time to investigate

(Logical change 1.180)
2003-09-17 11:51:25 +00:00
cantab.net!aia21 b18a48dc1e Auto merged
2003/09/05 23:58:15+01:00 flatcap.org!flatcap
added ntfscluster.8 to the build

(Logical change 1.180)
2003-09-17 11:51:25 +00:00
cantab.net!aia21 78257028b9 Auto merged
2003/09/05 23:58:15+01:00 flatcap.org!flatcap
added comment to help folding

(Logical change 1.180)
2003-09-17 11:51:25 +00:00
cantab.net!aia21 de41b39f13 Auto merged
2003/09/05 23:58:15+01:00 flatcap.org!flatcap
a couple of bugfixes
start on info

(Logical change 1.180)
2003-09-17 11:51:25 +00:00
flatcap.org!flatcap a688307452 typo
(Logical change 1.179)
2003-09-07 18:20:00 +00:00
flatcap.org!flatcap 982e358711 draft man page for clone
(Logical change 1.179)
2003-09-07 18:20:00 +00:00
flatcap.org!flatcap cabab37a87 document clone
BKrev: 3f5b76d0ETrBP2p8hsKmOdOKmj4ezQ
2003-09-07 18:20:00 +00:00
flatcap.org!flatcap 12fccd7990 makefile wasn't cleaning up ntfsls.8, ntfsclone.8 or ntfscluster.8
(Logical change 1.178)
2003-09-05 21:55:12 +00:00
flatcap.org!flatcap 64e90382d3 makefile tweak
BKrev: 3f590640snYf7J7f2a0NGXjRWVabXw
2003-09-05 21:55:12 +00:00
flatcap.org!flatcap 74d5b2a492 work around what's probably a bug in ntfs_attr_lookup
(with some extent inodes, ntfs_attr_lookup keeps returning the same attribute)
need more time to investigate

(Logical change 1.177)
2003-09-05 21:37:08 +00:00
flatcap.org!flatcap 17c3d0be6f stop ntfscluster hanging on certain extent inodes
BKrev: 3f590204b0L4ufaNHzQZHXt39eeYsQ
2003-09-05 21:37:08 +00:00
flatcap.org!flatcap 9f0d02f8ea start documenting things
(Logical change 1.177)
2003-09-05 21:37:08 +00:00
flatcap.org!flatcap cd9e3ed970 comment to help folding
(Logical change 1.177)
2003-09-05 21:37:08 +00:00
flatcap.org!flatcap 72ac9ba05b a couple of bugfixes
start on info

(Logical change 1.177)
2003-09-05 21:37:08 +00:00
cantab.net!aia21 3e00ceca93 Update for ntfsclone and ntfscluster man pages.
(Logical change 1.176)
2003-08-29 16:17:15 +00:00
cantab.net!aia21 11ba8d2060 Update for ntfsclone and ntfscluster man pages (currently these are blank!).
BKrev: 3f4f7c8bZ6SCgzdyJ48eosOieHPuKw
2003-08-29 16:17:15 +00:00
cantab.net!aia21 c5b2c4eaed (Logical change 1.176) 2003-08-29 16:17:15 +00:00
cantab.net!aia21 0d4c8d197b Initial revision 2003-08-29 16:17:15 +00:00
cantab.net!aia21 d0dc48fce8 update
(Logical change 1.175)
2003-08-29 13:01:46 +00:00
cantab.net!aia21 644142fbe7 Fix a bug with the display of mft reference numbers.
Update display to match /bin/ls.

(Logical change 1.175)
2003-08-29 13:01:46 +00:00
cantab.net!aia21 c606599117 Finish the manpage for ntfsls.
(Logical change 1.175)
2003-08-29 13:01:46 +00:00
cantab.net!aia21 d1929b01f2 - Finish the ntfsls man page.
- Fix mft reference display bug in ntfsls.
- Update display in ntfsls to match /bin/ls.

BKrev: 3f4f4eba7GrcC4fO6ZB2fcuFGrrYkw
2003-08-29 13:01:46 +00:00
flatcap.org!flatcap 90eafc8faf an extra note for undelete
(Logical change 1.174)
2003-08-28 09:36:26 +00:00
cantab.net!aia21 68be3e6f3f Manual merge
2003/08/27 20:32:44+01:00 flatcap.org!flatcap
minor tweaks

BKrev: 3f4dcd1a46XiXzFZwsKqONXha63Mtw
2003-08-28 09:36:26 +00:00
cantab.net!aia21 3f4226ebb7 Manual merge
2003/08/27 20:32:43+01:00 flatcap.org!flatcap
add ntfscluster to the main build

(Logical change 1.174)
2003-08-28 09:36:26 +00:00
cantab.net!aia21 745ce5a141 Update configure to generate ntfsls man page.
(Logical change 1.173)
2003-08-26 13:05:16 +00:00
cantab.net!aia21 e16ad7372f (Logical change 1.173) 2003-08-26 13:05:16 +00:00
cantab.net!aia21 d17ac3693e Initial revision 2003-08-26 13:05:16 +00:00
cantab.net!aia21 66d9310d87 Cleanup option parsing, help text, etc so they are all consistent with each other.
Also remove unused options.

(Logical change 1.173)
2003-08-26 13:05:16 +00:00
cantab.net!aia21 73e0cb25b2 Add ntfsls man page.
(Logical change 1.173)
2003-08-26 13:05:16 +00:00
cantab.net!aia21 5384e35cce Add ntfsls man page (not finished yet but a good start - it still needs descriptions for most of the options)...
BKrev: 3f4b5b0cLTx0BYSxy3weBZRPYQGwNA
2003-08-26 13:05:16 +00:00
flatcap.org!flatcap 515eab7cfb mem leak
typo

(Logical change 1.172)
2003-08-12 10:17:18 +00:00
cantab.net!aia21 e9ccaa1a31 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/08/11 22:56:10+01:00 flatcap.org!flatcap
minor bugfixes

BKrev: 3f38beaemGod6cfI9vSIMMC8aHmV_Q
2003-08-12 10:17:18 +00:00
cantab.net!aia21 03918d9878 Auto merged
2003/08/11 22:56:10+01:00 flatcap.org!flatcap
make default fillbyte 0
flags logic bug

(Logical change 1.172)
2003-08-12 10:17:18 +00:00
cantab.net!aia21 e117a302f3 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/08/08 12:32:11+01:00 cantab.net!aia21
Linux/types.h no longer needed.

BKrev: 3f338a49sIePPv1DscY044JRfWe86Q
2003-08-08 11:32:25 +00:00
cantab.net!aia21 9ef4f62665 Auto merged
2003/08/08 12:32:08+01:00 cantab.net!aia21
Linux/types.h no longer needed.

(Logical change 1.171)
2003-08-08 11:32:25 +00:00
cantab.net!aia21 83bd769b7e No longer need linux/types.h.
(Logical change 1.170)
2003-08-08 11:29:04 +00:00
cantab.net!aia21 1e9ef6afae Build ntfscluster and ntfsls as /bin programs by default and ntfsclone as /sbin
program by default.

(Logical change 1.170)
2003-08-08 11:29:04 +00:00
cantab.net!aia21 6334ed5056 - Configure no longer needs to check for linux/types.h.
- Build ntfscluster and ntfsls as /bin programs by default and ntfsclone as /sbin
program by default.

BKrev: 3f338980CwrJ7NfekCDcIgmIPoeOEg
2003-08-08 11:29:04 +00:00
cantab.net!aia21 020e2d769e Update.
2003/08/03 15:52:54+01:00 cantab.net!aia21
Update changelog

(Logical change 1.169)
2003-08-03 14:56:03 +00:00
cantab.net!aia21 a51e921e91 Manual merge and Changelog update for ntfsls.
2003/08/03 15:53:25+01:00 cantab.net!aia21
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/usr/src/ntfsprogs

2003/08/03 15:52:54+01:00 cantab.net!aia21
dir.c:
- Return ENOTDIR errno if inode is not a directory.
- Fix stupid bug where we attempt to close ia_na when it is null.

BKrev: 3f2d2283bIRV0rbcO6qYcidkcF2BmQ
2003-08-03 14:56:03 +00:00
cantab.net!aia21 f2dd1f454f Auto merged
2003/08/03 15:52:54+01:00 cantab.net!aia21
- Return ENOTDIR errno if inode is not a directory.
- Fix stupid bug where we attempt to close ia_na when it is null.

(Logical change 1.169)
2003-08-03 14:56:03 +00:00
cantab.net!aia21 67c8cd67fd Merge ssh://linux-ntfs@bkbits.net/ntfsprogs-devel
into cantab.net:/usr/src/ntfsprogs-devel

2003/08/03 15:47:56+01:00 cantab.net!aia21
libntfs/dir.c
    - Return ENOTDIR errno if inode is not a directory.
    - Fix stupid bug where we attempt to close ia_na when it is null.
ntfsprogs/ntfsls.c
    - Some code tidyups.
    - Display file when the specified path includes a file name
      at the end rather than a directory.

BKrev: 3f2d220eHAoK4dOsZ64pllX-kkJGvg
2003-08-03 14:54:06 +00:00
cantab.net!aia21 7130beb807 - Some code tidyups.
- Display file when the specified path includes a file name
  at the end rather than a directory.

(Logical change 1.168)
2003-08-03 14:54:06 +00:00
cantab.net!aia21 8b9987bf4d - Return ENOTDIR errno if inode is not a directory.
- Fix stupid bug where we attempt to close ia_na when it is null.

(Logical change 1.168)
2003-08-03 14:54:06 +00:00
cantab.net!aia21 fb2833bef3 Copy over ignore from ntfsprogs.
BKrev: 3f292424whyjk_5b8aSI4XrEhtkBDA
2003-07-31 14:13:56 +00:00
cantab.net!aia21 f554268a08 Copy over from ntfsprogs.
(Logical change 1.167)
2003-07-31 14:13:56 +00:00
cantab.net!aia21 bef4012b5e sys/ioctl.h always needed.
__LINUX__ no longer works.  Use linux instead.

(Logical change 1.166)
2003-07-31 14:12:36 +00:00
cantab.net!aia21 066303c4c6 auto-union
2003/07/31 15:10:10+01:00 cantab.net!aia21
Update ignore file.

(Logical change 1.166)
2003-07-31 14:12:36 +00:00
cantab.net!aia21 c4c50f1270 __LINUX__ no longer works. Use linux instead.
(Logical change 1.166)
2003-07-31 14:12:36 +00:00
cantab.net!aia21 951bacc20b Use hasmntopt only if it exists.
(Logical change 1.166)
2003-07-31 14:12:36 +00:00
cantab.net!aia21 255abc11b2 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/07/31 15:10:10+01:00 cantab.net!aia21
Linux/types.h no longer needed at all.
stdint.h only include if present.
Update ignore file.
Use hasmntopt only if it exists.
__LINUX__ no longer works.  Use linux instead.
Include stdio.h from volume.h.  Needed by Cygwin.
sys/ioctl.h always needed in disk_io.c.

BKrev: 3f2923d4T-fcpWTgUyvL5O0T2ZP7-g
2003-07-31 14:12:36 +00:00
cantab.net!aia21 bbde93dacf Linux/types.h no longer needed at all.
stdint.h only include if present.

(Logical change 1.166)
2003-07-31 14:12:36 +00:00
cantab.net!aia21 2c391fce0b Linux/types.h no longer needed at all.
(Logical change 1.166)
2003-07-31 14:12:36 +00:00
cantab.net!aia21 85f9732874 Include stdio.h. Needed by Cygwin.
(Logical change 1.166)
2003-07-31 14:12:36 +00:00
cantab.net!aia21 75c3fe2009 Auto merged
2003/07/31 15:10:10+01:00 cantab.net!aia21
Linux/types.h no longer needed at all.

(Logical change 1.166)
2003-07-31 14:12:36 +00:00
cantab.net!aia21 9fd2d6d51b Cleanup ntfsls:
- formatting
- some error checking
- memory leaks (close inodes and release search contexts)
- add lots of FIXMEs where work is needed
Also add ntfsls and autom4te.cache to ignore list of bitkeeper.

BKrev: 3f27cc01jv8BQp4YMpffBQM2LPWauQ
2003-07-30 13:45:37 +00:00
cantab.net!aia21 af45ca7579 Cleanup ntfsls:
- formatting
- some error checking
- memory leaks (close inodes and release search contexts)
- add lots of FIXMEs where work is needed

(Logical change 1.165)
2003-07-30 13:45:37 +00:00
cantab.net!aia21 c15a40f649 Add autom4te.cache to ignore as well as ntfsls.
(Logical change 1.165)
2003-07-30 13:45:37 +00:00
cantab.net!aia21 5968bd4d06 Lode Leroy: Fix typo in win32_io.c.
BKrev: 3f26a099xPGhBL0OzJ1wpLVLOsJQLQ
2003-07-29 16:28:09 +00:00
cantab.net!aia21 162c1b9161 Lode Leroy: Fix typo in win32_io.c.
(Logical change 1.164)
2003-07-29 16:28:09 +00:00
cantab.net!aia21 02f6f8349b tidy up win32_io.c, especially error returns. I hope this works on windows...
BKrev: 3f26489bJo8Buvqdg-S5_yd1XRrVGw
2003-07-29 10:12:43 +00:00
cantab.net!aia21 18341d53b0 tidy up win32_io.c, especially error returns. I hope this works on windows...
(Logical change 1.163)
2003-07-29 10:12:43 +00:00
cantab.net!aia21 8c6751d9ad auto-union
2003/07/29 10:12:42+01:00 cantab.net!aia21
Update ignore

(Logical change 1.162)
2003-07-29 09:12:55 +00:00
cantab.net!aia21 8fb8844f11 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/07/29 10:12:42+01:00 cantab.net!aia21
Update ignore

BKrev: 3f263a97iXqiJp9yS1oPUUJpOIzavQ
2003-07-29 09:12:55 +00:00
cantab.net!aia21 19c21b1faf Add stamp-h1 to ignore file.
BKrev: 3f1e59916MeebAuUVmjNafyoQ_TChA
2003-07-23 09:46:57 +00:00
cantab.net!aia21 58f51f36e0 Add stamp-h1 to ignore file.
(Logical change 1.161)
2003-07-23 09:46:57 +00:00
cantab.net!aia21 bc021293a0 Add right character.
BKrev: 3f1e59439I-K0CfzRErSW96rHZrrEA
2003-07-23 09:45:39 +00:00
cantab.net!aia21 5f82dd8d27 Add right character.
(Logical change 1.160)
2003-07-23 09:45:39 +00:00
cantab.net!aia21 7411e15d6a Remove unused line.
(Logical change 1.159)
2003-07-23 09:33:40 +00:00
cantab.net!aia21 8a4288ed10 Fix a typo when I was Cifying the code. (Thanks to Lode for telling me what I did wrong.)
(Logical change 1.159)
2003-07-23 09:33:40 +00:00
cantab.net!aia21 f49595b08b Add Leonard to the Authors file.
(Logical change 1.159)
2003-07-23 09:33:40 +00:00
cantab.net!aia21 369ed9174f AUTHORS
Add Leonard to the Authors file.
libntfs/win32_io.c
    Fix a typo when I was Cifying the code. (Thanks to Lode for telling me what I did wrong.)
ntfsprogs/ntfsls.c
    Remove unused line.

BKrev: 3f1e5674OnYy8FvP4hSIcOKe5MKtqw
2003-07-23 09:33:40 +00:00
flatcap.org!flatcap e5bc8a6c1d Leonard: modify ntfsinfo output to help diff'ing
BKrev: 3f1da7c6H8Q_4ztyWf6tkK0iT4EQ9w
2003-07-22 21:08:22 +00:00
flatcap.org!flatcap 550e506f29 Add -t (display all timestamps as Epoch) and -T (don't display timestamps at all). Usable for ignoring timestamps when diff'ing.
(Logical change 1.158)
2003-07-22 21:08:22 +00:00
flatcap.org!flatcap d836725248 added ntfsls
(Logical change 1.157)
2003-07-22 20:41:19 +00:00
flatcap.org!flatcap 334c06a182 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs-devel
into flatcap.org:/home/flatcap/ntfsprogs-devel.ls

2003/07/22 21:35:49+01:00 flatcap.org!flatcap
Lode Leroy's ntfsls
This utility will list a directory's files.

BKrev: 3f1da16fOz8HJFYaTT9nisKt8PEEAA
2003-07-22 20:41:19 +00:00
flatcap.org!flatcap 6820c2d110 Lode: smarter way to get the filesize
2003/07/22 21:28:05+01:00 flatcap.org!flatcap
Lode: find the file size from the data attribute

2003/07/22 21:08:43+01:00 flatcap.org!flatcap

(Logical change 1.157)
2003-07-22 20:41:19 +00:00
flatcap.org!flatcap 7f4c7ac959 Initial revision 2003-07-22 20:41:19 +00:00
cantab.net!aia21 1073902242 Ignore ntfsclone.
BKrev: 3f1d2c7bOCcZ9hMqZnUb2apZyxHxKw
2003-07-22 12:22:19 +00:00
cantab.net!aia21 ee2c0170e1 Ignore ntfsclone.
(Logical change 1.156)
2003-07-22 12:22:19 +00:00
cantab.net!aia21 4b02e7606e Initial revision 2003-07-22 12:20:41 +00:00
cantab.net!aia21 6f7f181057 Add Lode Leroy.
BKrev: 3f1d2c19zPwx201EbjDPSMpRqwtC-Q
2003-07-22 12:20:41 +00:00
cantab.net!aia21 fef971a454 Add Lode Leroy.
(Logical change 1.155)
2003-07-22 12:20:41 +00:00
cantab.net!aia21 8ea36f6e84 (Logical change 1.155) 2003-07-22 12:20:41 +00:00
cantab.net!aia21 53340e947e Two little typo fixes.
(Logical change 1.154)
2003-07-16 15:01:54 +00:00
cantab.net!aia21 9cb71a5008 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/07/16 16:01:32+01:00 cantab.net!aia21
Two little typo fixes.

BKrev: 3f1568e23_YOjbTwJszgJx6GgX9AkQ
2003-07-16 15:01:54 +00:00
cantab.net!aia21 37dd8d0f2b Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/07/12 16:45:15+01:00 cantab.net!aia21
Fix the O_RDONLY vs O_RDWR check.  It was failing because
O_RDONLY is zero and hence the old check was always successful.

BKrev: 3f102d44X0_3CQSe-sCX0tn53xdcoQ
2003-07-12 15:46:12 +00:00
cantab.net!aia21 c6069336f8 Improve the MS_RDONLY check.
(Logical change 1.153)
2003-07-12 15:46:12 +00:00
cantab.net!aia21 993640ad31 Fix the O_RDONLY vs O_RDWR check. It was failing because
O_RDONLY is zero and hence the old check was always successful.

(Logical change 1.153)
2003-07-12 15:46:12 +00:00
cantab.net!aia21 c11d307758 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/07/11 15:35:39+01:00 cantab.net!aia21
Can't use vol->dev->d_name before it is allocated! D'oh!
Thanks to Szaka for reporting this.

BKrev: 3f0ecb45JqUPoTxXdPPT21ldt2-dEQ
2003-07-11 14:35:49 +00:00
cantab.net!aia21 163d414c9f Can't use vol->dev->d_name before it is allocated! D'oh!
Thanks to Szaka for reporting this.

(Logical change 1.152)
2003-07-11 14:35:49 +00:00
cantab.net!aia21 622901527f ntfsclone patch from Szaka:
This fixes all known issues I knew about or wanted to add to ntfsclone.
So it's declared ready and basically works for me for half a year. Future
work is only based on requests/needs. I only want to write the manual, if
ever have time.

Changes:
 - support block device as output file
 - handle partial read/write
 - show progress bar during cloning
 - significant cloning performance improvement
 - detect ReiserFS & warn about its extremely poor ftruncate performance
 - no error if fsync() gives EINVAL (pipe)
 - several sanity checks added
 - some cleanup, spelling corrections

BKrev: 3f0eaef9WUptDWJa7L-xMYco5QF4bQ
2003-07-11 12:35:05 +00:00
cantab.net!aia21 05befe33eb ntfsclone patch from Szaka:
This fixes all known issues I knew about or wanted to add to ntfsclone.
So it's declared ready and basically works for me for half a year. Future
work is only based on requests/needs. I only want to write the manual, if
ever have time.

Changes:
 - support block device as output file
 - handle partial read/write
 - show progress bar during cloning
 - significant cloning performance improvement
 - detect ReiserFS & warn about its extremely poor ftruncate performance
 - no error if fsync() gives EINVAL (pipe)
 - several sanity checks added
 - some cleanup, spelling corrections

(Logical change 1.151)
2003-07-11 12:35:05 +00:00
flatcap.org!flatcap a7f036134b A few typos - thanks to Pete Ware for spotting them
BKrev: 3ee2211broHJbEoQMwE35Zwf3QJ8Dw
2003-06-07 17:30:03 +00:00
flatcap.org!flatcap 302c627270 A few typos - thanks to Pete Ware for spotting them
(Logical change 1.150)
2003-06-07 17:30:03 +00:00
flatcap.org!flatcap 589e274b2c eveything's in place..
BKrev: 3ee2200ak0iQY1s6_NlLluRFKJonEg
2003-06-07 17:25:30 +00:00
flatcap.org!flatcap 98b83eea2b eveything's in place..
(Logical change 1.149)
2003-06-07 17:25:30 +00:00
flatcap.org!flatcap 6fbac539bd Delete: BitKeeper/triggers/post-incoming.testing
}(Logical change 1.148)
2003-06-06 17:37:58 +00:00
flatcap.org!flatcap 7e8d8ab0d3 .del-post-incoming.testing~85f0ca2656c104e3:
Delete: BitKeeper/triggers/post-incoming.testing

BKrev: 3ee0d176gSLmBoILNig_OZ7Yanl_3A
2003-06-06 17:37:58 +00:00
flatcap.org!flatcap 4ff28c5d7f post-outgoing.ciabot:
Change mode to -rwxrwxr-x
  new file

BKrev: 3ee0c70fVioM0QPh4S5x68KKnZ_5bw
2003-06-06 16:53:35 +00:00
flatcap.org!flatcap 74ff0320cd Change mode to -rwxrwxr-x
2003/06/06 17:53:14+01:00 flatcap.org!flatcap

(Logical change 1.147)
2003-06-06 16:53:35 +00:00
flatcap.org!flatcap 8d6e8b9b0d Initial revision 2003-06-06 16:53:35 +00:00
flatcap.org!flatcap ad5158a2f9 token change to test a trigger
BKrev: 3edfbc82fKCFWEMmwTxCf6IvC-aFcw
2003-06-05 21:56:18 +00:00
flatcap.org!flatcap 3c256015a2 token change to test a trigger
(Logical change 1.146)
2003-06-05 21:56:18 +00:00
flatcap.org!flatcap a1d7f81ced changed perms slightly
BKrev: 3edfb9dbvBH2DtbS3Mt-g7lqyPnyRQ
2003-06-05 21:44:59 +00:00
flatcap.org!flatcap 64c7352a24 Change mode to -rwxrwxr-x
(Logical change 1.145)
2003-06-05 21:44:59 +00:00
flatcap.org!flatcap 07795f1f22 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs-devel
into flatcap.org:/mnt/work/bk/ntfsprogs-devel

2003/06/05 22:41:13+01:00 flatcap.org!flatcap
Leonard's checkin trigger

BKrev: 3edfb91aFh-yIHmNqAMLoB8evNPNkg
2003-06-05 21:41:46 +00:00
flatcap.org!flatcap 26fa8ed657 Change mode to -rwxr-xr-x
2003/06/05 22:39:15+01:00 flatcap.org!flatcap

(Logical change 1.144)
2003-06-05 21:41:46 +00:00
flatcap.org!flatcap d921c961ad Initial revision 2003-06-05 21:41:46 +00:00
cantab.net!aia21 6a48a5fdf2 Update.
BKrev: 3edc96e1Iqbx74tAzdX8lMY0oExx8g
2003-06-03 12:38:57 +00:00
cantab.net!aia21 207a314fab Update.
(Logical change 1.143)
2003-06-03 12:38:57 +00:00
cantab.net!aia21 eb26fb6aeb Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/06/03 13:37:01+01:00 cantab.net!aia21
Bump LTVERSION by one because the library interfaces have changed.

BKrev: 3edc9681Q8tTjk-DFV0YCbnmwoCDTg
2003-06-03 12:37:21 +00:00
cantab.net!aia21 5c2ff2283b Bump LTVERSION by one because the library interfaces have changed.
(Logical change 1.142)
2003-06-03 12:37:21 +00:00
cantab.net!aia21 d1708bbea2 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/06/03 13:28:39+01:00 cantab.net!aia21
Remove obsolete make process file.

BKrev: 3edc9490_lVsQWXZhqQB8RNI8WJrEQ
2003-06-03 12:29:04 +00:00
cantab.net!aia21 bbede46c0b Delete: acconfig.h
}(Logical change 1.141)
2003-06-03 12:29:04 +00:00
cantab.net!aia21 cc9c0f3153 Adapt to library changes.
(Logical change 1.140)
2003-06-03 11:10:57 +00:00
cantab.net!aia21 46fd21a9bb Adapt ntfsclone to library changes.
BKrev: 3edc8241Q6hpRkIbrpXbujO_DNqCWQ
2003-06-03 11:10:57 +00:00
cantab.net!aia21 b5d94d76cb SCCS merged
2003/06/03 12:06:46+01:00 cantab.net!aia21
Update.

(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 476ec77963 Merge
2003/06/03 12:06:46+01:00 cantab.net!aia21
Adapt to utilities to changes in library.

2003/06/03 11:55:11+01:00 cantab.net!aia21
Cleanups in library.
Add mandatory locking to default disk_io open/close functions.
Adapt mkntfs to library changes.

2003/06/03 10:35:17+01:00 cantab.net!aia21
Library cleanups and adapt ntfsfix to library changes.

BKrev: 3edc818a7VAB82zPLPPMMjAOzFhXcQ
2003-06-03 11:07:54 +00:00
cantab.net!aia21 f78cfd42a1 Export the default opearations so the low level utilities can use them.
(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 7c5b6a5d15 Auto merged
2003/06/03 12:06:46+01:00 cantab.net!aia21
Adapt to changes in library.

(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 fc30058a95 Add stat to ntfs_device_operations.
(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 75d44c72a0 Add stat to ntfs_device_operations and implement mandatory locking when
opening / closing the device (in the default disk_io functions).

2003/06/03 10:35:17+01:00 cantab.net!aia21
Add Dirty bit setting/clearing.

(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 137b10dca8 Add ntfs_volume_alloc() for low level utilities.
2003/06/03 10:35:17+01:00 cantab.net!aia21
Cleanup and do not destroy the ntfs device structure when unmounting a volume.

(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 ed8e3db271 Add ntfs_volume_alloc() for low level utilities.
(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 e94dd2e634 Adapt to library changes.
(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 33c6acd353 Adapt to changes in library.
(Logical change 1.139)
2003-06-03 11:07:54 +00:00
cantab.net!aia21 980387655f Update build.
(Logical change 1.138)
2003-06-02 08:53:04 +00:00
cantab.net!aia21 f9a71ac4d4 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/06/02 09:52:25+01:00 cantab.net!aia21
Hopefully finished device io abstraction layer in the library.
Utilities still not done...

BKrev: 3edb107082KdM0axHG5iXLNJyW0UOw
2003-06-02 08:53:04 +00:00
cantab.net!aia21 f0628dd514 Hopefully finished device io abstraction layer in the library.
(Logical change 1.138)
2003-06-02 08:53:04 +00:00
cantab.net!aia21 d1e19dcd82 Auto merged
2003/06/02 09:52:24+01:00 cantab.net!aia21
Update build.

(Logical change 1.138)
2003-06-02 08:53:04 +00:00
cantab.net!aia21 9fe6a7f51c Update.
BKrev: 3ed20ff4QLRkiSyPymITaFbNuNUF6Q
2003-05-26 13:00:36 +00:00
cantab.net!aia21 6d9dd71bbc Update.
(Logical change 1.137)
2003-05-26 13:00:36 +00:00
cantab.net!aia21 15ed630289 Update.
2003/05/25 20:40:26+01:00 cantab.net!aia21
Add -fms-extensions when compiling with gcc-3.2+.

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 dac5ebd480 Update.
(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 b928688153 Typo fix.
2003/05/25 21:04:53+01:00 cantab.net!aia21
Add allocation and deallocation of devices.

2003/05/25 20:40:26+01:00 cantab.net!aia21
fix typos.

2003/05/25 15:40:47+01:00 cantab.net!aia21

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 497caee13a Manual merge.
}(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 49f21f5d34 Manual merge.
2003/05/26 13:51:54+01:00 cantab.net!aia21
Merge rename: configure.in -> configure.ac

2003/05/26 13:49:47+01:00 cantab.net!aia21
Make it really work this time...

2003/05/25 20:40:26+01:00 cantab.net!aia21
Add -fms-extensions when compiling with gcc-3.2+.

2003/05/25 12:23:06+01:00 cantab.net!aia21
Rename: configure.in -> configure.ac

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 4d4aa57937 Manual merge.
2003/05/26 13:49:48+01:00 cantab.net!aia21
Fixes and start of low level device io abstraction.

2003/05/25 20:40:27+01:00 cantab.net!aia21
- Add -fms-extensions for gcc-3.2+ to fix compilations.
- Update to newer autoconf/automake.

BKrev: 3ed20f81yfmhtLiIzXaTuGL9i8yhqw
2003-05-26 12:58:41 +00:00
cantab.net!aia21 d0e6abc340 Manual merge.
2003/05/26 13:49:47+01:00 cantab.net!aia21
Make it really work this time...

2003/05/25 21:07:10+01:00 cantab.net!aia21
Update.

2003/05/25 20:40:25+01:00 cantab.net!aia21
Update.

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 a65b9e26f9 Manual merge.
2003/05/25 21:07:10+01:00 cantab.net!aia21
Update.

2003/05/25 20:40:25+01:00 cantab.net!aia21
Update.

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 b1e0c54b44 Manual merge.
2003/05/25 20:40:26+01:00 cantab.net!aia21
Add -fms-extensions when compiling with gcc-3.2+.

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 b38ca6c1d0 Make it really work this time...
2003/05/25 20:40:26+01:00 cantab.net!aia21

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 c161a9b33e Just so it compiles for now until we finish the switch to *dev.
2003/05/25 21:04:53+01:00 cantab.net!aia21
Abstract low level device operations.

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 9f64f96ee9 Initial revision 2003-05-26 12:58:41 +00:00
cantab.net!aia21 6aef27ab97 Auto merged
2003/05/25 20:40:26+01:00 cantab.net!aia21
Add -fms-extensions when compiling with gcc-3.2+.

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 bd71015de1 Add device.h to list of headers.
(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 3d929125fa Add device.c.
2003/05/25 20:40:26+01:00 cantab.net!aia21
Add -fms-extensions when compiling with gcc-3.2+.

(Logical change 1.136)
2003-05-26 12:58:41 +00:00
cantab.net!aia21 5389b4d556 (Logical change 1.136) 2003-05-26 12:58:41 +00:00
cantab.net!aia21 be79b3a34a SCCS merged
2003/05/06 23:01:51+01:00 cantab.net!aia21
Update.

(Logical change 1.135)
2003-05-06 22:03:28 +00:00
cantab.net!aia21 96e670b8bc Merge
2003/05/06 23:02:27+01:00 cantab.net!aia21
Fix off-by-one error in disk_io.c::ntfs_cluster_{read,write}(). (Ian Jackson)

BKrev: 3eb83130YNfWULNe96LG63b7et2FOw
2003-05-06 22:03:28 +00:00
cantab.net!aia21 80487422f7 Fix off-by-one error in ntfs_cluster_{read,write}(). (Ian Jackson)
(Logical change 1.135)
2003-05-06 22:03:28 +00:00
cantab.net!aia21 7599028d3e Add Ian Jackson.
(Logical change 1.135)
2003-05-06 22:03:28 +00:00
cantab.net!aia21 abea868da4 update
(Logical change 1.134)
2003-04-11 13:08:52 +00:00
cantab.net!aia21 44c49c55e5 Initial revision 2003-04-11 13:08:52 +00:00
cantab.net!aia21 d701a635bc Add ntfsclone to build. (Written by Szaka)
BKrev: 3e96be64BTFegLfn_6RpDiEI8NG3KQ
2003-04-11 13:08:52 +00:00
cantab.net!aia21 f6f76eb44d Add ntfsclone to build.
(Logical change 1.134)
2003-04-11 13:08:52 +00:00
cantab.net!aia21 f1ff1790ea (Logical change 1.134) 2003-04-11 13:08:52 +00:00
cantab.net!aia21 bd65b7e569 patch from Szaka:
- Shrink contrains refactored for incremental cluster relocation
  support and to get closer for parted integration
  (ped_file_system_get_resize_constraint)

BKrev: 3e91591dzVYrGC7IIc5i26h-O__Jlw
2003-04-07 10:55:25 +00:00
cantab.net!aia21 969a7bcc0d patch from Szaka:
- Shrink contrains refactored for incremental cluster relocation
  support and to get closer for parted integration
  (ped_file_system_get_resize_constraint)

(Logical change 1.133)
2003-04-07 10:55:25 +00:00
cantab.net!aia21 549751634a patch from Szaka:
This is needed, otherwise ntfsimage outputs libntfs messages in debug
mode if stdout specified thus confusing e.g. compressing tools reading
from pipe.  E.g. 'ntfsimage -o - device | bzip2 ...' creates a
corrupted, unusable ntfs image.

I've looked through libntfs and apparently no other places with this
problem.

	Szaka

(Logical change 1.132)
2003-03-24 13:51:37 +00:00
cantab.net!aia21 dd765db660 Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/03/24 13:51:17+00:00 cantab.net!aia21
patch from Szaka:

This is needed, otherwise ntfsimage outputs libntfs messages in debug
mode if stdout specified thus confusing e.g. compressing tools reading
from pipe.  E.g. 'ntfsimage -o - device | bzip2 ...' creates a
corrupted, unusable ntfs image.

I've looked through libntfs and apparently no other places with this
problem.

	Szaka

BKrev: 3e7f0d6917LFxykbD_IeOwj5JDl5qg
2003-03-24 13:51:37 +00:00
cantab.net!aia21 a41a833397 ntfsresize patch from Szaka:
- option -i collects info about resizing conditions
- if options -i and -s are used together then show needed relocations
- option -P added to disable progress bars
- walk_inodes(): delete redundant MFT_RECORD_IN_USE check
- code refactorings, preparations to move relevant codes to library

BKrev: 3e7f09d3FlxaBCV0mIGFF10QuZ0eeA
2003-03-24 13:36:19 +00:00
cantab.net!aia21 5f681b6ca0 ntfsresize patch from Szaka:
- option -i collects info about resizing conditions
- if options -i and -s are used together then show needed relocations
- option -P added to disable progress bars
- walk_inodes(): delete redundant MFT_RECORD_IN_USE check
- code refactorings, preparations to move relevant codes to library

(Logical change 1.131)
2003-03-24 13:36:19 +00:00
cantab.net!aia21 65d283efc9 Update version.
(Logical change 1.130)
2003-03-24 13:34:05 +00:00
cantab.net!aia21 c41ac4c1dc Update config.
(Logical change 1.130)
2003-03-24 13:34:05 +00:00
cantab.net!aia21 2d68f8c5df Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/03/11 00:06:50+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/03/07 17:33:04+00:00 cantab.net!aia21
Merge cantab.net:/home/aia21/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs-devel

2003/02/26 12:28:17+00:00 cantab.net!aia21
Update version/config for 1.8.0-devel status.

BKrev: 3e7f094dsDWrctRuJxrHG4m7r5mn-g
2003-03-24 13:34:05 +00:00
cantab.net!aia21 191cc750cf Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into cantab.net:/home/aia21/ntfsprogs

2003/03/18 16:54:33+00:00 cantab.net!aia21
fix typo

BKrev: 3e774f4f1s23DSANKd3pXQKcfTejew
2003-03-18 16:54:39 +00:00
cantab.net!aia21 640b2c164b Auto merged
2003/03/18 16:54:33+00:00 cantab.net!aia21
fix typo

(Logical change 1.129)
2003-03-18 16:54:39 +00:00
cantab.net!aia21 d60f84d88a Update.
(Logical change 1.128)
2003-03-14 00:53:28 +00:00
cantab.net!aia21 e2bef765d0 Add Russ Christensen to CREDITS.
BKrev: 3e7128084do5R9fyPkVglGODhI40Bg
2003-03-14 00:53:28 +00:00
cantab.net!aia21 847a856340 Add Russ Christensen to CREDITS.
(Logical change 1.128)
2003-03-14 00:53:28 +00:00
cantab.net!aia21 958a75b6cd Fix multi string literal typo.
(Logical change 1.127)
2003-03-14 00:48:50 +00:00
cantab.net!aia21 abe2990069 Fix attempt to release I30 constant.
BKrev: 3e7126f2xSoI4tCByjRmVQy7asyyuQ
2003-03-14 00:48:50 +00:00
cantab.net!aia21 7e14335b3f Fix attempt to release I30 constant.
(Logical change 1.127)
2003-03-14 00:48:50 +00:00
cantab.net!aia21 6f221ba794 More work on attribute resizing.
BKrev: 3e6d287dUyv6h8hddUCIKrL3VcYDYQ
2003-03-11 00:06:21 +00:00
cantab.net!aia21 726999e691 More work on attribute resizing.
(Logical change 1.126)
2003-03-11 00:06:21 +00:00
cantab.net!aia21 565f90e5e6 update
(Logical change 1.125)
2003-03-07 17:31:47 +00:00
cantab.net!aia21 20c360bdf1 Fix logic inversion bugs. Thanks to Russ Christensen for finding the
first one.

(Logical change 1.125)
2003-03-07 17:31:47 +00:00
cantab.net!aia21 0a0b027611 Fix logic inversion bugs in dir.c. Thanks to Russ Christensen for
finding the first one.

BKrev: 3e68d783DHUtY9ak186V1CIk_XY5pA
2003-03-07 17:31:47 +00:00
cantab.net!aia21 fb7a94516e Typo fix...
(Logical change 1.124)
2003-02-25 18:57:15 +00:00
cantab.net!aia21 13d37ddb07 More work on attribute resizing...
BKrev: 3e5bbc8bGDlvnZ20woLu4MtNQs34jw
2003-02-25 18:57:15 +00:00
cantab.net!aia21 1247d0e2ea More work on attribute resizing...
(Logical change 1.124)
2003-02-25 18:57:15 +00:00
cantab.net!aia21 c28402cc41 Update version to 1.7.2-WIP to show it is work in progress.
BKrev: 3e54b9deB5qe1jzFWpJ2pxr5dFcf0A
2003-02-20 11:19:58 +00:00
cantab.net!aia21 114478185e Update version
(Logical change 1.123)
2003-02-20 11:19:58 +00:00
cantab.net!aia21 791a3fa5a3 Update changelog for development release.
(Logical change 1.123)
2003-02-20 11:19:58 +00:00
cantab.net!aia21 df6d1a2ca9 libntfs/attrib.c: Endian fix and attribute resize code cleanup.
BKrev: 3e52a84axp6pptEAlMMf9avQCc7uNg
2003-02-18 21:40:26 +00:00
cantab.net!aia21 8314ab1f9d Endian fix and attribute resize code cleanup.
(Logical change 1.122)
2003-02-18 21:40:26 +00:00
cantab.net!aia21 b42dc41d6a ntfs_mft_records_write(): stupid buffer overflow bug (ouch!)
(Logical change 1.121)
2003-02-13 10:27:33 +00:00
cantab.net!aia21 7103d67341 ntfs_external_attr_find(): broken error detection
(Logical change 1.121)
2003-02-13 10:27:33 +00:00
cantab.net!aia21 bddf42cd8b Update version
(Logical change 1.121)
2003-02-13 10:27:33 +00:00
cantab.net!aia21 4d9974e979 Update for
(Logical change 1.121)
2003-02-13 10:27:33 +00:00
cantab.net!aia21 8813a2c2aa 1.7.1 release: Urgent bug fixes!
- Urgent bug fixes in libntfs (thanks to Szaka for bug reports):
  - attrib.c::ntfs_external_attr_find(): broken error detection
  - mft.c::ntfs_mft_records_write(): stupid buffer overflow bug (ouch!)

BKrev: 3e4b7315moUIEYyeChY_JUZ-0X5mzg
2003-02-13 10:27:33 +00:00
cantab.net!aia21 fb6a425cad urgent bug fixes to ntfsresize from Szaka:
- compare_bitmaps(): fix another bug reporting the correct cluster mismatch
- walk_inodes(): fix leaking ntfs_inode in certain cases
- delete redundant and unused MFT_RECORD *mrec from ntfs_resize_t

BKrev: 3e4b6882jdyeekJZqcOJWiT27L9FVA
2003-02-13 09:42:26 +00:00
cantab.net!aia21 46225e5bdb urgent bug fixes to ntfsresize from Szaka:
- compare_bitmaps(): fix another bug reporting the correct cluster mismatch
- walk_inodes(): fix leaking ntfs_inode in certain cases
- delete redundant and unused MFT_RECORD *mrec from ntfs_resize_t

(Logical change 1.120)
2003-02-13 09:42:26 +00:00
cantab.net!aia21 781e0e9c27 Updates for 1.7.0 release.
BKrev: 3e4a78c4Kh7nyFQZjySerKp7y6eOAg
2003-02-12 16:39:32 +00:00
cantab.net!aia21 63f4498e3c Update for 1.7.0 release.
(Logical change 1.119)
2003-02-12 16:39:32 +00:00
cantab.net!aia21 f109f735c4 ntfsresize bugfix from Szaka:
- if a corresponding byte differed in the two cluster bitmaps then the
  matching ones were reported as mismatches and vice versa.

BKrev: 3e47950ca5AvDvY3Ck-LLRkTx5c1Cg
2003-02-10 12:03:24 +00:00
cantab.net!aia21 a95864329a ntfsresize bugfix from Szaka:
- if a corresponding byte differed in the two cluster bitmaps then the
  matching ones were reported as mismatches and vice versa.

(Logical change 1.118)
2003-02-10 12:03:24 +00:00
flatcap.org!flatcap 3987a55edd minor tidyup
(Logical change 1.117)
2003-02-09 22:55:20 +00:00
flatcap.org!flatcap d163ebf596 endian fixes
minor tidyups

BKrev: 3e46dc58ZGDI6pQpaxE-EkCLE4pMow
2003-02-09 22:55:20 +00:00
flatcap.org!flatcap 4a3d5ec325 endian fixes
(Logical change 1.117)
2003-02-09 22:55:20 +00:00
flatcap.org!flatcap 582b8303be endian fix
minor tidyup

(Logical change 1.117)
2003-02-09 22:55:20 +00:00
cantab.net!aia21 701ff83ee9 ntfsresize patch from Szaka: Cluster account reporting fix
BKrev: 3e429546C0JnrbxunDTFkFvW8oyl3Q
2003-02-06 17:03:02 +00:00
cantab.net!aia21 73b5b028ca ntfsresize patch from Szaka: Cluster account reporting fix
(Logical change 1.116)
2003-02-06 17:03:02 +00:00
cantab.net!aia21 f404774ea9 ntfsresize patch from Szaka to allow binary prefixes.
BKrev: 3e42918aJeo35pPMN-WN3E4Wp1qHPA
2003-02-06 16:47:06 +00:00
cantab.net!aia21 cf2d62f84a ntfsresize patch from Szaka to allow binary prefixes.
(Logical change 1.115)
2003-02-06 16:47:06 +00:00
cantab.net!aia21 922fea02f5 ntfsresize update from Szaka:
- fix mapping pairs generation with multiply extents
- support volume enlargement with multiply extents in $Bitmap
- support volume shrinking with multiply extents in $Bitmap
- more verbose multiply referenced clusters reporting
- better hints when filesystem is inconsistent

BKrev: 3e427d91T82d2fBbUZA_XMz8A8EOGA
2003-02-06 15:21:53 +00:00
cantab.net!aia21 e8fccbf21b ntfsresize update from Szaka:
- fix mapping pairs generation with multiply extents
- support volume enlargement with multiply extents in $Bitmap
- support volume shrinking with multiply extents in $Bitmap
- more verbose multiply referenced clusters reporting
- better hints when filesystem is inconsistent

(Logical change 1.114)
2003-02-06 15:21:53 +00:00
cantab.net!aia21 215471b309 Fix stupid bug in ntfs_mapping_pairs_build() (thanks to Szaka!) and
a simillar bug in ntfs_get_size_for_mapping_pairs().

BKrev: 3e427d58e29fPaocHZM9xaP2eWOtOg
2003-02-06 15:20:56 +00:00
cantab.net!aia21 d650fb065b Fix stupid bug in ntfs_mapping_pairs_build() (thanks to Szaka!) and
a simillar bug in ntfs_get_size_for_mapping_pairs().

(Logical change 1.113)
2003-02-06 15:20:56 +00:00
cantab.net!aia21 54c576be6c remove unnecessary FIXME
BKrev: 3e36a477FPlolsLJrnqBA-0OnEyx1A
2003-01-28 15:40:39 +00:00
cantab.net!aia21 82d9438cb9 remove unnecessary FIXME
(Logical change 1.112)
2003-01-28 15:40:39 +00:00
cantab.net!aia21 201442e81b update
(Logical change 1.111)
2003-01-26 16:47:16 +00:00
cantab.net!aia21 e772d632e2 libntfs/lcnalloc.c
Implementation of ntfs_cluster_alloc(). (Some fixme's remaining
    and note this is _completely_ untested code!!! DANGEROUS!!!)
include/debug.h
    New function NTFS_BUG() which prints an error message and then causes
    a segmentation fault. Only to be used for critical bug catches...

BKrev: 3e341114gYEYsQFncagPzjIW-aYTXw
2003-01-26 16:47:16 +00:00
cantab.net!aia21 acc8aa6f05 New function NTFS_BUG() which prints an error message and then causes
a segmentation fault. Only to be used for critical bug catches...

(Logical change 1.111)
2003-01-26 16:47:16 +00:00
cantab.net!aia21 b37b14e014 Implementation of ntfs_cluster_alloc(). (Some fixme's remaining
and note this is _completely_ untested code!!! DANGEROUS!!!)

(Logical change 1.111)
2003-01-26 16:47:16 +00:00
cantab.net!aia21 f4db4b6cb7 small tidyup
BKrev: 3e32c327XL9YSh4AHXpmTSZ_jnbE2g
2003-01-25 17:02:31 +00:00
cantab.net!aia21 05c32a26e1 small tidyup
(Logical change 1.110)
2003-01-25 17:02:31 +00:00
cantab.net!aia21 6826dc9238 Update
(Logical change 1.109)
2003-01-25 15:26:56 +00:00
cantab.net!aia21 cde0777685 Add new function ntfs_bitmap_set_run() to complement the existing
ntfs_bitmap_clear_run().

BKrev: 3e32acc0-_V9roWAi3eAksTeiNfiCw
2003-01-25 15:26:56 +00:00
cantab.net!aia21 0bda9e5cda Add new function ntfs_bitmap_set_run() to complement the existing
ntfs_bitmap_clear_run().

(Logical change 1.109)
2003-01-25 15:26:56 +00:00
cantab.net!aia21 6f0025bf50 ntfsresize patch from Szaka:
- calling fdatasync when appropriate
- always print program version
- uncommented not yet used program options

BKrev: 3e2d16ebKXfmh3kqkUwSityYkr6kfw
2003-01-21 09:46:19 +00:00
cantab.net!aia21 d7b23b6494 ntfsresize patch from Szaka:
- calling fdatasync when appropriate
- always print program version
- uncommented not yet used program options

(Logical change 1.108)
2003-01-21 09:46:19 +00:00
cantab.net!aia21 18279d0c4c cleanup flatcaps changes (reverting a few) as well as add new option
and a new little endian version of mk_ref

BKrev: 3e2bd89esUUHa4fnVmnVQqKc_FYZiA
2003-01-20 11:08:14 +00:00
cantab.net!aia21 c8dae5156c cleanup flatcaps changes (reverting a few) as well as add new option
(Logical change 1.107)
2003-01-20 11:08:14 +00:00
cantab.net!aia21 daae2d00c5 add new options
(Logical change 1.107)
2003-01-20 11:08:14 +00:00
cantab.net!aia21 edaa66643a Add a little endian mk_mref
(Logical change 1.107)
2003-01-20 11:08:14 +00:00
flatcap.org!flatcap ea7b422e70 use the utils
standardise usage and version info

(Logical change 1.106)
2003-01-19 23:45:17 +00:00
flatcap.org!flatcap 94efdfe222 reformat the usage output
(Logical change 1.106)
2003-01-19 23:45:17 +00:00
flatcap.org!flatcap 5fd45f8c76 ntfsresize now uses the utils
(Logical change 1.106)
2003-01-19 23:45:17 +00:00
flatcap.org!flatcap 6dc846c628 change resize to use utils
BKrev: 3e2b388dccs8XrWSQD7sU5v12FW9gQ
2003-01-19 23:45:17 +00:00
flatcap.org!flatcap b6cfa71e8f whitespace tweak
(Logical change 1.105)
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap 1f2fc42fa2 whitespace tidyup
(Logical change 1.105)
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap 3d4314d7cd standardise usage and version info
more tools using utils
comment blocks for all
general tidyup

BKrev: 3e2b202eT8-dE2WqCRDZ_qDLFSDzNQ
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap fad40b9b78 standardise usage and version info
comment blocks

(Logical change 1.105)
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap 3769e91274 standardise usage and version info
(Logical change 1.105)
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap 327bd2b2bc mkntfs and ntfstruncate now use the utils
(Logical change 1.105)
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap ad1e482a7b minor layout tweaks
(Logical change 1.105)
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap b016aef2ba ignore the new spec file
(Logical change 1.105)
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap 4fb575b3cc comment blocks
standardise usage and version info

(Logical change 1.105)
2003-01-19 22:01:18 +00:00
flatcap.org!flatcap e5b14ce5b6 use the utils
rearranged code a bit

(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap 31cb10fb23 three strings: ntfs_bugs, ntfs_home and ntfs_gpl
2003/01/14 23:44:46+00:00 flatcap.org!flatcap
Change mode to -rw-rw-r--

(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap 7f2714f906 three strings: ntfs_bugs, ntfs_home and ntfs_gpl
(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap 563fc17118 start using utils
(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap bfb9a428eb start using the utils
(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap ee6765096d standardise the tools a bit
BKrev: 3e2a9076I8wI_d597pYW-D11x93_lA
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap 070c787a27 standardise on Qprintf for Quietable output
2003/01/14 23:44:46+00:00 flatcap.org!flatcap
Change mode to -rw-rw-r--

(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap 9b24931503 standardise on Qprintf for Quietable output
(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap 1cf51ca7fb ntfslabel now uses the utils
(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap 84947d2fa0 added a few standard command line options
used the utils

(Logical change 1.104)
2003-01-19 11:48:06 +00:00
flatcap.org!flatcap 1d72ba4c99 use global Dprintf
(Logical change 1.103)
2003-01-19 11:32:24 +00:00
flatcap.org!flatcap 41854fb250 include our dependencies
(Logical change 1.103)
2003-01-19 11:32:24 +00:00
flatcap.org!flatcap 24e2109296 Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into flatcap.org:/mnt/work/bk/ntfsprogs

2003/01/18 11:11:03+00:00 flatcap.org!flatcap
Merge ssh://linux-ntfs@bkbits.net/ntfsprogs
into flatcap.org:/mnt/work/bk/ntfsprogs

2003/01/14 23:41:17+00:00 flatcap.org!flatcap
more tidying
a few bug fixes

BKrev: 3e2a8cc8V_hscGaMokgyIuZ-nHOU3A
2003-01-19 11:32:24 +00:00
flatcap.org!flatcap bbca55075c Change mode to -rw-rw-r--
(Logical change 1.103)
2003-01-19 11:32:24 +00:00
flatcap.org!flatcap be23ca327d Auto merged
2003/01/14 23:41:16+00:00 flatcap.org!flatcap
fix a few endian problems
add a few comment blocks

(Logical change 1.103)
2003-01-19 11:32:24 +00:00
cantab.net!aia21 057114848b really final tidyings
BKrev: 3e297a9dTB9XQsIOmBc1F6xBqB2C_Q
2003-01-18 16:02:37 +00:00
cantab.net!aia21 ef273e8804 really final tidyings
(Logical change 1.102)
2003-01-18 16:02:37 +00:00
cantab.net!aia21 4071c57671 final tidyings
}(Logical change 1.101)
2003-01-18 15:54:32 +00:00
cantab.net!aia21 8c6978e909 final tidyings
BKrev: 3e2978b8m3LMR4961MAQMv9dDXeXMg
2003-01-18 15:54:32 +00:00
cantab.net!aia21 eba5d05c2b final tidyings
2003/01/18 15:35:40+00:00 cantab.net!aia21
Rename: linux-ntfs.spec.in -> ntfsprogs.spec.in

(Logical change 1.101)
2003-01-18 15:54:32 +00:00
cantab.net!aia21 2208c7cc62 final tidyings
(Logical change 1.101)
2003-01-18 15:54:32 +00:00
cantab.net!aia21 2845e1a538 Initial revision 2003-01-18 15:54:32 +00:00
cantab.net!aia21 9045e8fa4c add compat.h to distribution
BKrev: 3e2972ddaw-XEWtrubl--32MGpY0QQ
2003-01-18 15:29:33 +00:00
cantab.net!aia21 7bf411786e add compat.h to distribution
(Logical change 1.100)
2003-01-18 15:29:33 +00:00
cantab.net!aia21 82c7120af4 update for 1.7.0beta release
BKrev: 3e297217NYCW9PC-7lPTb5troL147w
2003-01-18 15:26:15 +00:00
cantab.net!aia21 63dcac1575 update for 1.7.0beta release
(Logical change 1.99)
2003-01-18 15:26:15 +00:00
cantab.net!aia21 eb2140a9da fix compilation of ntfswipe
BKrev: 3e26ebb4779L2CwMjU0wwIk3rc1Org
2003-01-16 17:28:20 +00:00
cantab.net!aia21 e56f73d5ed fix compilation of ntfswipe
(Logical change 1.98)
2003-01-16 17:28:20 +00:00
cantab.net!aia21 f82a3dcd5d Remove fdatasync() calls from ntfs_pwrite(). We purely rely on
ntfs_umount() to do the syncing and this results in a massive
speed up when running io intensive libntfs based applications.

BKrev: 3e26eba4jHgdICWsUeKIpYMf84bVgA
2003-01-16 17:28:04 +00:00
cantab.net!aia21 e8430e5dea Remove fdatasync() calls from ntfs_pwrite(). We purely rely on
ntfs_umount() to do the syncing and this results in a massive
speed up when running io intensive libntfs based applications.

(Logical change 1.97)
2003-01-16 17:28:04 +00:00
cantab.net!aia21 47f8702fdd typo fix
(Logical change 1.96)
2003-01-16 17:20:46 +00:00
cantab.net!aia21 857b27e6b5 ntfsresize update by Szaka:
- eliminated get_bitmap_data ()
- eliminated struct bitmap on_disk_lcn_bitmap
- speeded up compare_bitmaps()
- speeded up advise_on_resize()
- ntfs_mapping_pairs_build() prints reason if error happens
- print cluster size, device size and more onging operations
- spelling fix in ntfsresize man page

BKrev: 3e26e9eeZhUDNhOmmm7S7l0hnFTw7g
2003-01-16 17:20:46 +00:00
cantab.net!aia21 5fb3e94ccb - eliminated get_bitmap_data ()
- eliminated struct bitmap on_disk_lcn_bitmap
- speeded up compare_bitmaps()
- speeded up advise_on_resize()
- ntfs_mapping_pairs_build() prints reason if error happens
- print cluster size, device size and more onging operations

(Logical change 1.96)
2003-01-16 17:20:46 +00:00
flatcap.org!flatcap fe038bd2dc move code to utils
check that at least one cluster is in use, before starting

(Logical change 1.95)
2003-01-14 20:48:15 +00:00
flatcap.org!flatcap fa39b3f421 more stuff moved to utils
(Logical change 1.95)
2003-01-14 20:48:15 +00:00
flatcap.org!flatcap ec9bc05735 more rearranging
BKrev: 3e24778fqzgBiAzn9glOBihpYPVlEQ
2003-01-14 20:48:15 +00:00
flatcap.org!flatcap 54d3f226c6 more migrated code
(Logical change 1.95)
2003-01-14 20:48:15 +00:00
flatcap.org!flatcap be92ff1b40 ignore vim temp files
(Logical change 1.95)
2003-01-14 20:48:15 +00:00
flatcap.org!flatcap 68150c114e hmm, so _that's_ what the ignore button does :-)
BKrev: 3e246f5fL-04BF-5tl2MbShUXjezLA
2003-01-14 20:13:19 +00:00
flatcap.org!flatcap 4a44473948 hmm, so _that's_ what the ignore button does :-)
(Logical change 1.94)
2003-01-14 20:13:19 +00:00
flatcap.org!flatcap c6dcb0afee moved get_inode_name and get_attr_name to utils
(Logical change 1.93)
2003-01-13 20:05:15 +00:00
flatcap.org!flatcap 379692221b get_inode_name & get_attr_name moved from ntfscluster
(Logical change 1.93)
2003-01-13 20:05:15 +00:00
flatcap.org!flatcap f387921c31 export find_in_attrdef
(Logical change 1.93)
2003-01-13 20:05:15 +00:00
flatcap.org!flatcap d159396b8e a few minor tweaks
moved two more functions to utils

BKrev: 3e231bfbPEVpy-dHpyt9cnO9HCMvrw
2003-01-13 20:05:15 +00:00
flatcap.org!flatcap f00076764a Added ntfsprogs/extra/printf.c ntfsprogs/extra/spinner.c ntfsprogs/extra/time.c ntfsprogs/extra/todo ntfsprogs/s ntfsprogs/todo to the ignore list
(Logical change 1.93)
2003-01-13 20:05:15 +00:00
cantab.net!aia21 6087f46b67 update
(Logical change 1.92)
2003-01-13 17:17:52 +00:00
cantab.net!aia21 f90a3b85ca fix by Szaka (logic inversion in ntfs_device_size_get())
BKrev: 3e22f4c0uR2kAGrz6-z9NbZqByPahw
2003-01-13 17:17:52 +00:00
cantab.net!aia21 f84e1e7a1c fix by Szaka (logic inversion in ntfs_device_size_get())
(Logical change 1.92)
2003-01-13 17:17:52 +00:00
cantab.net!aia21 416ce477d3 Szaka:
- more manual update
- read-only checks are pushed down to the library
- checking ntfs_get_size_for_mapping_pairs return values
- relaxing/fixing mapping_pairs overflow conditions
Szaka:
- more manual update
- read-only checks are pushed down to the library
- checking ntfs_get_size_for_mapping_pairs return values
- relaxing/fixing mapping_pairs overflow conditions

(Logical change 1.91)
2003-01-12 19:21:06 +00:00
cantab.net!aia21 a188fd67d7 Szaka:
- more manual update
- read-only checks are pushed down to the library
- checking ntfs_get_size_for_mapping_pairs return values
- relaxing/fixing mapping_pairs overflow conditions

BKrev: 3e21c022pbtkHeY0dqKb8l2YoNLuMQ
2003-01-12 19:21:06 +00:00
cantab.net!aia21 b171354223 Szaka:
- more manual update
- read-only checks are pushed down to the library
- checking ntfs_get_size_for_mapping_pairs return values
- relaxing/fixing mapping_pairs overflow conditions

(Logical change 1.91)
2003-01-12 19:21:06 +00:00
cantab.net!aia21 dbd2bc132e (Logical change 1.91) 2003-01-12 19:21:06 +00:00
cantab.net!aia21 84ea1fab57 configure:
change source package name in configure.in to ntfsprogs. (Szaka)

BKrev: 3e21bbf89mLxzjr5Yc9B7EvHFjMdKg
2003-01-12 19:03:20 +00:00
cantab.net!aia21 b57e04f615 change source package name in configure.in to ntfsprogs. (Szaka)
(Logical change 1.90)
2003-01-12 19:03:20 +00:00
cantab.net!aia21 d5c4014168 (Logical change 1.90) 2003-01-12 19:03:20 +00:00
cantab.net!aia21 264d6af6d8 man page update from Szaka
BKrev: 3e1fff1dfArknG2t6lZwqS9LTvzZ7A
2003-01-11 11:25:17 +00:00
cantab.net!aia21 3580d984fb man page update from Szaka
(Logical change 1.89)
2003-01-11 11:25:17 +00:00
flatcap.org!flatcap 4633bcf2de one include and 256 lines shed
(Logical change 1.88)
2003-01-11 02:09:53 +00:00
flatcap.org!flatcap 986c523c33 make undelete use the utils
(Logical change 1.88)
2003-01-11 02:09:53 +00:00
flatcap.org!flatcap fd4f5e41ca convert undelete to use the shared utils
BKrev: 3e1f7cf1jhLnYtonoEJ4h2wiCn1Qjw
2003-01-11 02:09:53 +00:00
flatcap.org!flatcap a82c2638b5 two new helpers, one to generate pathnames, the other for attribute names
BKrev: 3e1f64c1bOMCI8Bh7nKfiL-SBtEMjQ
2003-01-11 00:26:41 +00:00
flatcap.org!flatcap 930cf0f712 two new helpers, one to generate pathnames, the other for attribute names
(Logical change 1.87)
2003-01-11 00:26:41 +00:00
cantab.net!aia21 4fa72f72f1 update from Szaka modified by me:
new API disk_io.[hc]: ntfs_device_size_get() ported from mkntfs.c

ntfsinfo.c: mount read-only (Szaka)

ntfsresize.8.in and ntfsresize.c: updates from Szaka hand
applied by me

BKrev: 3e1efc3fD5iR261bB7ryDGqmn20AqQ
2003-01-10 17:00:47 +00:00
cantab.net!aia21 a3e3e66651 update from Szaka modified by me:
new API disk_io.[hc]: ntfs_device_size_get() ported from mkntfs.c

(Logical change 1.86)
2003-01-10 17:00:47 +00:00
cantab.net!aia21 ce45772a9c update from Szaka hand applied by me
(Logical change 1.86)
2003-01-10 17:00:47 +00:00
cantab.net!aia21 aa568dccc0 update from Szaka
(Logical change 1.86)
2003-01-10 17:00:47 +00:00
cantab.net!aia21 de757075f4 mount read-only (Szaka)
(Logical change 1.86)
2003-01-10 17:00:47 +00:00
flatcap.org!flatcap 7d20cb5376 start to work on the program's behaviour
(Logical change 1.85)
2003-01-10 01:06:19 +00:00
flatcap.org!flatcap 6d5ba60378 some functions moved to utils
(Logical change 1.85)
2003-01-10 01:06:19 +00:00
flatcap.org!flatcap bf6cff53f5 more general purpose functions
(Logical change 1.85)
2003-01-10 01:06:19 +00:00
flatcap.org!flatcap 9a1bb80721 a bit of code
some shuffling of code

BKrev: 3e1e1c8bpIzJngp3Ne3F39aUyYuISg
2003-01-10 01:06:19 +00:00
flatcap.org!flatcap 03b74b6a01 ignore ntfscluster
ignore tag files

BKrev: 3e1e1c18EopU12fiYa5fLNGVXCU1Ag
2003-01-10 01:04:24 +00:00
flatcap.org!flatcap 7f2d90a353 ignore ntfscluster
ignore tag files

(Logical change 1.84)
2003-01-10 01:04:24 +00:00
flatcap.org!flatcap f1b764576c missed two
BKrev: 3e1da5dco-a9nzmDWlhX5zcAHwR2Mg
2003-01-09 16:39:56 +00:00
flatcap.org!flatcap 4e5b613d9c missed two
(Logical change 1.83)
2003-01-09 16:39:56 +00:00
flatcap.org!flatcap 96f8b84e55 tidy
(Logical change 1.82)
2003-01-09 16:30:59 +00:00
flatcap.org!flatcap 46d927b4ec sync with Paul
a typos left over from the big rename

BKrev: 3e1da3c3wikzRxWjs9S3xGqil8JTeg
2003-01-09 16:30:59 +00:00
flatcap.org!flatcap 3d4f80ae16 sync with Paul
a typos left over from the big rename

(Logical change 1.82)
2003-01-09 16:30:59 +00:00
flatcap.org!flatcap 953ac4ff86 sync with Paul
(Logical change 1.82)
2003-01-09 16:30:59 +00:00
flatcap.org!flatcap 4a763bc970 a typos left over from the big rename
(Logical change 1.82)
2003-01-09 16:30:59 +00:00
flatcap.org!flatcap b1548158c8 update configure script so it doesn't baulk at gcc 3.*
BKrev: 3e1cdccbPDPWhHlsndqJup2fKlyaEQ
2003-01-09 02:22:03 +00:00
flatcap.org!flatcap 13e52bbfbf horrendous regex to identify gcc 3.*
(Logical change 1.81)
2003-01-09 02:22:03 +00:00
flatcap.org!flatcap e860ea0ed4 three modes
(Logical change 1.80)
2003-01-09 01:42:21 +00:00
flatcap.org!flatcap 87213d0c1c new: ntfscluster.[ch]
locate the owner of a given cluster
  this is just a quick hack, but quite a few bits should be reusable
new: utils.[ch]
  a first attempt to move some common routines into a shared place
  some should end up in the lib, others shouldn't
build updated with the above
code added to wipe
a few typos here and there

BKrev: 3e1cd37dx5Kmw9Eu-qzPoQIf9i1XuQ
2003-01-09 01:42:21 +00:00
flatcap.org!flatcap 6862599a67 minor typos
(Logical change 1.80)
2003-01-09 01:42:21 +00:00
flatcap.org!flatcap 064da66ee4 ideas for undelete
(Logical change 1.80)
2003-01-09 01:42:21 +00:00
flatcap.org!flatcap e7dd03f9a4 add -Wall to normal build (not just debug)
add new files to build

(Logical change 1.80)
2003-01-09 01:42:21 +00:00
flatcap.org!flatcap 679206550b add -Wall to normal build (not just debug)
(Logical change 1.80)
2003-01-09 01:42:21 +00:00
flatcap.org!flatcap 9597186a6b a bit of code added, some moved out into utils
(Logical change 1.80)
2003-01-09 01:42:21 +00:00
flatcap.org!flatcap 9227c23f73 (Logical change 1.80) 2003-01-09 01:42:21 +00:00
flatcap.org!flatcap fde565d504 Initial revision 2003-01-09 01:42:21 +00:00
flatcap.org!flatcap ed1149f0a0 added a version option
simplified get_bitmap_data
added comment blocks

(Logical change 1.79)
2003-01-09 01:24:28 +00:00
flatcap.org!flatcap 60ac38315c A bit of minor tidying and lots of comments for resize
BKrev: 3e1ccf4cXHiCD11ZN0ZRJZfdlJb-Dg
2003-01-09 01:24:28 +00:00
cantab.net!aia21 57f0b7300e update copyright
(Logical change 1.78)
2003-01-08 10:48:09 +00:00
cantab.net!aia21 dc9c8b61e1 update
(Logical change 1.78)
2003-01-08 10:48:09 +00:00
cantab.net!aia21 312e98fd24 New API function: ntfs_attr_can_be_non_resident().
(Logical change 1.78)
2003-01-08 10:48:09 +00:00
cantab.net!aia21 44ed67cfde - New API function: ntfs_attr_can_be_non_resident().
- Check whether the attribute name needs moving when resizing the
  resident part of an attribute record.
- Create internal function ntfs_attr_find_in_attrdef().

BKrev: 3e1c01e9HmWONmXWbv5b3zbLAYdl1g
2003-01-08 10:48:09 +00:00
cantab.net!aia21 ea773ce760 - New API function: ntfs_attr_can_be_non_resident().
- Check whether the attribute name needs moving when resizing the
  resident part of an attribute record.
- Create internal function ntfs_attr_find_in_attrdef().

(Logical change 1.78)
2003-01-08 10:48:09 +00:00
cantab.net!aia21 7ee9338075 BKrev: 3e19feaavPbEuJqUb_dQmLe--jFPdg 2003-01-06 22:09:46 +00:00
cantab.net!aia21 cb8fc1b9e9 (Logical change 1.77) 2003-01-06 22:09:46 +00:00
cantab.net!aia21 cdcc968ac2 mft.c:
fix compile (thanks to Szaka)

BKrev: 3e19fe408ezU1nHbgzxf9oBHR5PcUA
2003-01-06 22:08:00 +00:00
cantab.net!aia21 8a3f5f4c00 fix compile (thanks to Szaka)
(Logical change 1.76)
2003-01-06 22:08:00 +00:00
cantab.net!aia21 75c2ef39f0 (Logical change 1.76) 2003-01-06 22:08:00 +00:00
cantab.net!aia21 09b1e1c2dc - Clear newly allocated space in ntfs_resident_attr_value_resize().
- Rename ntfs_resident_attr_shrink() to ntfs_resident_attr_resize()
  and make it resize upwards as well as downwards.
- Change ntfs_attr_truncate() to allow resizing upwards of resident
  attributes.

BKrev: 3e103aaelA-DbuSxAZOuXF-SqZHIaA
2002-12-30 12:23:10 +00:00
cantab.net!aia21 08ef32703a - Clear newly allocated space in ntfs_resident_attr_value_resize().
- Rename ntfs_resident_attr_shrink() to ntfs_resident_attr_resize()
  and make it resize upwards as well as downwards.
- Change ntfs_attr_truncate() to allow resizing upwards of resident
  attributes.

(Logical change 1.75)
2002-12-30 12:23:10 +00:00
cantab.net!aia21 f7e003fd49 update
(Logical change 1.74)
2002-12-29 21:37:21 +00:00
cantab.net!aia21 be6376f85e New API provided by mft.[hc]:
ntfs_mft_record_alloc(), -- WIP
	ntfs_mft_record_free().

(Logical change 1.74)
2002-12-29 21:37:21 +00:00
cantab.net!aia21 2dbb7c23a5 Fix erroneusly placed err = errno.
(Logical change 1.74)
2002-12-29 21:37:21 +00:00
cantab.net!aia21 3bcc223bfd Change ntfs_inode_close() to disconnect extent inodes from their base
inode when an extent inode is closed. This is needed byt ntfs_mft_record_free()
in order to be able to free extent mft records.

(Logical change 1.74)
2002-12-29 21:37:21 +00:00
cantab.net!aia21 58f750c289 - Change ntfs_inode_close() to disconnect extent inodes from their base
inode when an extent inode is closed. This is needed byt ntfs_mft_record_free()
  in order to be able to free extent mft records.
- New API provided by mft.[hc]:
	ntfs_mft_record_alloc(), -- WIP
	ntfs_mft_record_free().

BKrev: 3e0f6b11PfOsUTFzT98-K2SKWj_qpg
2002-12-29 21:37:21 +00:00
cantab.net!aia21 efe2271a30 - Change ntfs_inode_close() to disconnect extent inodes from their base
inode when an extent inode is closed. This is needed byt ntfs_mft_record_free()
  in order to be able to free extent mft records.
- New API provided by mft.[hc]:
	ntfs_mft_record_alloc(), -- WIP
	ntfs_mft_record_free().

(Logical change 1.74)
2002-12-29 21:37:21 +00:00
cantab.net!aia21 a9f6279e55 update
(Logical change 1.73)
2002-12-29 17:54:10 +00:00
cantab.net!aia21 84b007cf9c add export for ntfs_attr_size_bounds_check().
(Logical change 1.73)
2002-12-29 17:54:10 +00:00
cantab.net!aia21 36ee87eab4 Add new API ntfs_attr_size_bounds_check().
(Logical change 1.73)
2002-12-29 17:54:10 +00:00
cantab.net!aia21 cfa2dc3960 Add new API attrib.[hc]::ntfs_attr_size_bounds_check() to verify a
size against an attribute type for validity. We check the volume's
attribute definitions table to do so.

BKrev: 3e0f36c20ltAQdArVytoyFjeFUgbKA
2002-12-29 17:54:10 +00:00
cantab.net!aia21 d24d73e13c libntfs/attrib.c
Uncomment still unused label.
ntfsprogs/ntfstruncate.c
    Add ability to specify an attribute name in addition to the attribute type.
include/volume.h
    Add attribute definition table to ntfs volume structure.
libntfs/volume.c
    Load the attribute definition table at mount time and free it at umount time.

BKrev: 3e0ee7df1MNHgnJmH-0-5nWouWa6nQ
2002-12-29 12:17:35 +00:00
cantab.net!aia21 7bd63f4186 Uncomment still unused label.
(Logical change 1.72)
2002-12-29 12:17:35 +00:00
cantab.net!aia21 f75d0c5be5 Load the attribute definition table at mount time and free it at umount time.
(Logical change 1.72)
2002-12-29 12:17:35 +00:00
cantab.net!aia21 a86ad90a97 Finish off / fix ability to specify an attribute name.
2002/12/29 12:03:45+00:00 cantab.net!aia21
Add ability to specify an attribute name in addition to the attribute type.

(Logical change 1.72)
2002-12-29 12:17:35 +00:00
cantab.net!aia21 6258afc6dd Add attribute definition table to ntfs volume structure.
(Logical change 1.72)
2002-12-29 12:17:35 +00:00
cantab.net!aia21 0d45f0a690 Forgot the increment in the while loop. Thanks to Szaka for spotting this.
BKrev: 3e0e2572M2bMOll496m961dIX7EGlQ
2002-12-28 22:28:02 +00:00
cantab.net!aia21 998104321b Forgot the increment in the while loop. Thanks to Szaka for spotting this.
(Logical change 1.71)
2002-12-28 22:28:02 +00:00
cantab.net!aia21 ed19c0cf08 Add test and comments for truncation of non-resident attributes to
zero size. We should be converting such an attribute to a resident
one instead of leaving a zero size non-resident attribute.

BKrev: 3e0e21f2-EOnVjpgx9hG0y9AKl047A
2002-12-28 22:13:06 +00:00
cantab.net!aia21 7b2cb8211f Add test and comments for truncation of non-resident attributes to
zero size. We should be converting such an attribute to a resident
one instead of leaving a zero size non-resident attribute.

(Logical change 1.70)
2002-12-28 22:13:06 +00:00
cantab.net!aia21 ff5a0d104d libntfs/attrib.c
Fix stupid typo bug.
libntfs/bitmap.c
    Fix stupid typo bugs.
libntfs/lcnalloc.c
    Remove silly and wrong sanity check.
ntfsprogs/ntfstruncate.c
    Fix debug output for offset.
    Only dump attribute records for attribute being resized.

BKrev: 3e0e054aZ_gETxMSUP_8y3be4ppXRg
2002-12-28 20:10:50 +00:00
cantab.net!aia21 4084c90c93 Remove silly and wrong sanity check.
(Logical change 1.69)
2002-12-28 20:10:50 +00:00
cantab.net!aia21 3d5d045fe4 Fix stupid typo bugs.
(Logical change 1.69)
2002-12-28 20:10:50 +00:00
cantab.net!aia21 722a3eb12f Fix stupid typo bug.
(Logical change 1.69)
2002-12-28 20:10:50 +00:00
cantab.net!aia21 ab8ae59c52 Fix debug output for offset.
Only dump attribute records for attribute being resized.

(Logical change 1.69)
2002-12-28 20:10:50 +00:00
cantab.net!aia21 f8c9d4a61d libntfs/attrib.c
Fix truncation of resident attributes (new attribute length calculation
    was incorrect).
ntfsprogs/ntfstruncate.c
    Fix typos and correct a wrong sanity check which prevented truncation
    to zero size.

BKrev: 3e0df92901GVJpef7R3f7Aya7w0XSg
2002-12-28 19:19:05 +00:00
cantab.net!aia21 844432eeca Fix typos and correct a wrong sanity check which prevented truncation
to zero size.

(Logical change 1.68)
2002-12-28 19:19:05 +00:00
cantab.net!aia21 65f89be321 Fix truncation of resident attributes (new attribute length calculation
was incorrect).

(Logical change 1.68)
2002-12-28 19:19:05 +00:00
cantab.net!aia21 ab04f3489a - Only resize resident attribute records if there is a sufficiently
large change in the length of the attribute value.
- Only deallocate clusters, truncate the runlist, and regenerate the
  mapping pairs array if the change in the non-resident attribute
  value is sufficiently large.

BKrev: 3e0d9337b6ZofcTwHmT1nchXDT5Tkg
2002-12-28 12:04:07 +00:00
cantab.net!aia21 cf827730eb - Only resize resident attribute records if there is a sufficiently
large change in the length of the attribute value.
- Only deallocate clusters, truncate the runlist, and regenerate the
  mapping pairs array if the change in the non-resident attribute
  value is sufficiently large.

(Logical change 1.67)
2002-12-28 12:04:07 +00:00
cantab.net!aia21 42c62cc120 update
(Logical change 1.66)
2002-12-27 23:44:01 +00:00
cantab.net!aia21 27f6b2df8d Force is -f not -F.
(Logical change 1.66)
2002-12-27 23:44:01 +00:00
cantab.net!aia21 9fd4cc17e3 Do not perform the actual write on a read-only volume!
(Logical change 1.66)
2002-12-27 23:44:01 +00:00
cantab.net!aia21 b7270466fe - libntfs: Do not perform the actual write on a read-only volume!
- ntfstruncate: Force is -f not -F.

BKrev: 3e0ce5c1pvIVBQfRxu0k7Sv-iooPOQ
2002-12-27 23:44:01 +00:00
cantab.net!aia21 a447c17337 Add ntfstruncate to the BitKeeper ignore list.
BKrev: 3e0cdf0btJHp8R--GQgaRIqMlrvdaA
2002-12-27 23:15:23 +00:00
cantab.net!aia21 98d1f0f5b3 Add ntfstruncate to the BitKeeper ignore list.
(Logical change 1.65)
2002-12-27 23:15:23 +00:00
cantab.net!aia21 8f80ecb2ba update
(Logical change 1.64)
2002-12-27 23:14:11 +00:00
cantab.net!aia21 19c9c5dff3 ntfs_umount() now also does an fdatasync() on the device before closing it.
(Logical change 1.64)
2002-12-27 23:14:11 +00:00
cantab.net!aia21 a6c464ca4d (Logical change 1.64) 2002-12-27 23:14:11 +00:00
cantab.net!aia21 dafd0eefe3 Initial revision 2002-12-27 23:14:11 +00:00
cantab.net!aia21 43c7dfa6af Add ntfstruncate to manual build process.
(Logical change 1.64)
2002-12-27 23:14:11 +00:00
cantab.net!aia21 216ca068fd - Added new utility ntfstruncate, primarily to be able to test the
new ntfs_attr_truncate() function, it is not compiled by default.
  Note, the library can currently only make attributes smaller and it
  only works on uncompressed, unencrypted inodes which do not contain
  attribute lists, i.e. on simple files, but that was quite a lot of
  new code in itself which needs a lot of testing!
- ntfs_umount() now also does an fdatasync() on the device before closing it.

BKrev: 3e0cdec31tkln57-NXAcN4eNov_nBA
2002-12-27 23:14:11 +00:00
cantab.net!aia21 dd92ef9b61 update
(Logical change 1.63)
2002-12-27 18:53:56 +00:00
cantab.net!aia21 66db0a4f86 Implement ntfs_rl_truncate().
BKrev: 3e0ca1c4sg6ib1Q-gDWoTlzCiv1k0A
2002-12-27 18:53:56 +00:00
cantab.net!aia21 ebe9aa33f3 Implement ntfs_rl_truncate().
(Logical change 1.63)
2002-12-27 18:53:56 +00:00
cantab.net!aia21 a50496eca8 update
(Logical change 1.62)
2002-12-27 17:25:45 +00:00
cantab.net!aia21 ac10aa7709 Setup the cluster and mft allocators.
(Logical change 1.62)
2002-12-27 17:25:45 +00:00
cantab.net!aia21 91597fe050 Add variables used by the cluster and mft allocators.
(Logical change 1.62)
2002-12-27 17:25:45 +00:00
cantab.net!aia21 02a141c9c0 - Add variables used bu the cluster and mft allocators
to the ntfs_volume structure.
- Setup the cluster and mft allocators.

BKrev: 3e0c8d19gy-d4BTZdoMOn6CjRiL11w
2002-12-27 17:25:45 +00:00
cantab.net!aia21 3bc805714e update todo
(Logical change 1.61)
2002-12-27 16:48:52 +00:00
cantab.net!aia21 78e207b2f9 Change ntfs_rl_truncate() to take address of the runlist
rather than the runlist to allow reallocation of the runlist
buffer.

BKrev: 3e0c8474LNHF-sHxrKW2PvR56flIAw
2002-12-27 16:48:52 +00:00
cantab.net!aia21 eb98ae1dca Change ntfs_rl_truncate() to take address of the runlist
rather than the runlist to allow reallocation of the runlist
buffer.

(Logical change 1.61)
2002-12-27 16:48:52 +00:00
cantab.net!aia21 66fb584c1a Update todo.
(Logical change 1.60)
2002-12-27 16:35:17 +00:00
cantab.net!aia21 754a34b869 Update changelog.
(Logical change 1.60)
2002-12-27 16:35:17 +00:00
cantab.net!aia21 928eff2891 Move some run list related functions out of attrib.[hc] into runlist.[hc].
(Logical change 1.60)
2002-12-27 16:35:17 +00:00
cantab.net!aia21 e5d59f00f1 Fix compile.
(Logical change 1.60)
2002-12-27 16:35:17 +00:00
cantab.net!aia21 5fe6d01c92 - Move some run list related functions out of attrib.[hc] into runlist.[hc].
- Fix compile of bitmap.c.

BKrev: 3e0c8145BykcQw0WKZvJrJSaZyfmiQ
2002-12-27 16:35:17 +00:00
cantab.net!aia21 f89206c784 update changelog
(Logical change 1.59)
2002-12-27 16:18:10 +00:00
cantab.net!aia21 ccf8a369a2 Update build process for bitmap.c.
(Logical change 1.59)
2002-12-27 16:18:10 +00:00
cantab.net!aia21 42338a8bee Typo fix.
(Logical change 1.59)
2002-12-27 16:18:10 +00:00
cantab.net!aia21 54cde7ab8e (Logical change 1.59) 2002-12-27 16:18:10 +00:00
cantab.net!aia21 26a99e4db3 Initial revision 2002-12-27 16:18:10 +00:00
cantab.net!aia21 5fe5494e4c Fix prototype.
(Logical change 1.59)
2002-12-27 16:18:10 +00:00
cantab.net!aia21 d761ee8105 Fix compilation.
2002/12/27 16:03:18+00:00 cantab.net!aia21
Implement ntfs_cluster_free().

(Logical change 1.59)
2002-12-27 16:18:10 +00:00
cantab.net!aia21 bccfbfbff4 Add export for ntfs_bitmap_clear_run().
(Logical change 1.59)
2002-12-27 16:18:10 +00:00
cantab.net!aia21 f070801f38 - Implement ntfs_cluster_free().
- New API function provided by bitmap.[hc]: ntfs_bitmap_clear_run().

BKrev: 3e0c7d42HRZG_tWdMiPBwVY6SfiePg
2002-12-27 16:18:10 +00:00
cantab.net!aia21 67ae4b9651 Update comments for ntfs_cluster_free().
(Logical change 1.58)
2002-12-26 20:36:52 +00:00
cantab.net!aia21 57e13d7537 Update changelog.
(Logical change 1.58)
2002-12-26 20:36:52 +00:00
cantab.net!aia21 f8a7ee4a7e Typos.
(Logical change 1.58)
2002-12-26 20:36:52 +00:00
cantab.net!aia21 833db0bc4b Typo
(Logical change 1.58)
2002-12-26 20:36:52 +00:00
cantab.net!aia21 1dd01bf3c7 New API: ntfs_rl_truncate().
(Logical change 1.58)
2002-12-26 20:36:52 +00:00
cantab.net!aia21 c9ca9fd9b7 - lowest_vcn is cpu endian not little endian in ntfs_external_attr_find().
- Implement ntfs_non_resident_attr_shrink() for inodes without extents.

(Logical change 1.58)
2002-12-26 20:36:52 +00:00
cantab.net!aia21 90623ee1a8 - New API: ntfs_rl_truncate().
- lowest_vcn is cpu endian not little endian in ntfs_external_attr_find().
- Implement ntfs_non_resident_attr_shrink() for inodes without extents.

BKrev: 3e0b6864kIQCHxlS8aBwkJRuaMCQfA
2002-12-26 20:36:52 +00:00
cantab.net!aia21 d67cb08072 Correct Bitkeeper/etc/ignore with the renamed ntfstools directory to ntfsprogs.
BKrev: 3e0b0c30hCnFLU5zDAjMi1eexzbjuQ
2002-12-26 14:03:28 +00:00
cantab.net!aia21 6c8e401c53 Correct Bitkeeper/etc/ignore with the renamed ntfstools directory to ntfsprogs.
(Logical change 1.57)
2002-12-26 14:03:28 +00:00
cantab.net!aia21 9920ebfb22 Update TODO.libntfs.
(Logical change 1.56)
2002-12-26 14:00:31 +00:00
cantab.net!aia21 2eddb7228e New bit operations NInoTestAndSetDirty() and NInoTestAndClearDirty().
(Logical change 1.56)
2002-12-26 14:00:31 +00:00
cantab.net!aia21 4ad9d937a6 Implement ntfs_inode_sync().
(Logical change 1.56)
2002-12-26 14:00:31 +00:00
cantab.net!aia21 7781c8f5df Fix test_and_set_bit() as well as test_and_clear_bit().
(Logical change 1.56)
2002-12-26 14:00:31 +00:00
cantab.net!aia21 de1ed338e6 - Implement ntfs_inode_sync().
- New bit operations NInoTestAndSetDirty() and NInoTestAndClearDirty().
- Fix test_and_set_bit() as well as test_and_clear_bit().

BKrev: 3e0b0b7fSCNq47YYpxs3AtmQdIl8yg
2002-12-26 14:00:31 +00:00
cantab.net!aia21 9fd51dde62 New API functions (mostly still WIP):
attrib.[hc]: ntfs_resident_attr_value_resize(), ntfs_attr_truncate()
   inode.[hc]: ntfs_inode_mark_dirty(), ntfs_inode_sync()
   lcnalloc.[hc]: ntfs_cluster_{alloc,free}()
Renamed ntfs_clusters_{read,write}() to ntfs_cluster_{read,write}().

(Logical change 1.55)
2002-12-26 00:44:57 +00:00
cantab.net!aia21 6b5c3e9079 - New API functions (mostly still WIP):
attrib.[hc]: ntfs_resident_attr_value_resize(), ntfs_attr_truncate()
   inode.[hc]: ntfs_inode_mark_dirty(), ntfs_inode_sync()
   lcnalloc.[hc]: ntfs_cluster_{alloc,free}()
- Renamed ntfs_clusters_{read,write}() to ntfs_cluster_{read,write}().
- Adapt mkntfs to use library implementation of ntfs_resident_attr_value_resize()
  instead of its own.
- Minor typo fixes and comment improvements.

BKrev: 3e0a51091Ko5HHKjzCPC-hGmU3mhvQ
2002-12-26 00:44:57 +00:00
cantab.net!aia21 cd92a29ccb Typo.
(Logical change 1.54)
2002-12-25 20:18:29 +00:00
cantab.net!aia21 185a33e214 Sort out compilation.
2002/12/25 19:51:31+00:00 cantab.net!aia21

(Logical change 1.54)
2002-12-25 20:18:29 +00:00
cantab.net!aia21 624000557c Sort out compilation.
2002/12/25 19:48:37+00:00 cantab.net!aia21

(Logical change 1.54)
2002-12-25 20:18:29 +00:00
cantab.net!aia21 4cccbda4fc New files lcnalloc.[ch] to contain the cluster (de)allocator API.
BKrev: 3e0a1295kAoeE-qht6uwYfrV44Z1Yg
2002-12-25 20:18:29 +00:00
cantab.net!aia21 6d3d453c53 Initial revision 2002-12-25 20:18:29 +00:00
cantab.net!aia21 b7857b472b Add lcnalloc to build process.
(Logical change 1.54)
2002-12-25 20:18:29 +00:00
cantab.net!aia21 54a7163926 Typos.
BKrev: 3e0a0633wbqgRrbftLwhIcW9SkayDA
2002-12-25 19:25:39 +00:00
cantab.net!aia21 36635b8fdc Typos.
(Logical change 1.53)
2002-12-25 19:25:39 +00:00
cantab.net!aia21 0e871e83b2 New API function ntfs_ucsnlen().
(Logical change 1.52)
2002-12-25 19:17:56 +00:00
cantab.net!aia21 a8d091270f New API function ntfs_ucsnlen() and removal of mkntfs.c/ucsnlen().
BKrev: 3e0a0464CMIXENqB2zG4SHAW3CjEuw
2002-12-25 19:17:56 +00:00
cantab.net!aia21 16e4e8717a New API function ntfs_ucsnlen() and removal of mkntfs.c/ucsnlen().
(Logical change 1.52)
2002-12-25 19:17:56 +00:00
flatcap.org!flatcap 83cf426360 ignore generated files
BKrev: 3e0694d4J8oRmm_Dms3icfk0zSJl-g
2002-12-23 04:45:08 +00:00
flatcap.org!flatcap 4a70578e20 ignore generated files
(Logical change 1.51)
2002-12-23 04:45:08 +00:00
flatcap.org!flatcap e6c73a5203 [matt] new code
BKrev: 3e06942aA1nErJck4cMQP7gvrGaIbw
2002-12-23 04:42:18 +00:00
flatcap.org!flatcap 787420defe [matt] new code
(Logical change 1.50)
2002-12-23 04:42:18 +00:00
flatcap.org!flatcap e37809b5a9 typo
(Logical change 1.49)
2002-12-23 04:40:25 +00:00
flatcap.org!flatcap 363b1bc4df qualify sf's name
(Logical change 1.49)
2002-12-23 04:40:25 +00:00
flatcap.org!flatcap 06584bb950 minor tweaks to man pages
BKrev: 3e0693b9RzF3qZa5zSkARYha8FZ5pQ
2002-12-23 04:40:25 +00:00
cantab.net!aia21 5f944c5107 Return the attribute list attribute when enumerating attributes, too.
Thanks to Szakacsits Szabolcs for pointing this problem out.

BKrev: 3e005a66e72YZ4loCumJL-oxl1FkJA
2002-12-18 11:22:14 +00:00
cantab.net!aia21 471c5423f5 Return the attribute list attribute when enumerating attributes, too.
Thanks to Szakacsits Szabolcs for pointing this problem out.

(Logical change 1.48)
2002-12-18 11:22:14 +00:00
flatcap.org!flatcap 8ba6c67a1a set the perms on a few new files
BKrev: 3dfa0b6ds5piZEFr7fMcT4aju_mVjQ
2002-12-13 16:31:41 +00:00
flatcap.org!flatcap e84130845f Change mode to -rw-rw-r--
2002/12/13 16:18:18+00:00 flatcap.org!flatcap
Change mode to -rw-r--r--

(Logical change 1.47)
2002-12-13 16:31:41 +00:00
flatcap.org!flatcap dfbfb115b7 Change mode to -rw-rw-r--
(Logical change 1.47)
2002-12-13 16:31:41 +00:00
cantab.net!aia21 0c4dc57cd3 remove comment as requested by Szaka
BKrev: 3dfa056ff5w7KPHa7jeGFHZl6IMmag
2002-12-13 16:06:07 +00:00
cantab.net!aia21 eb9ed096e2 remove comment as requested by Szaka
(Logical change 1.46)
2002-12-13 16:06:07 +00:00
cantab.net!aia21 e39b3a634d Don't free extent inodes in attrib.c! (Szakacsits Szabolcs)
BKrev: 3dfa02c4NTpCL31WQu1SgXCWz-ub9A
2002-12-13 15:54:44 +00:00
cantab.net!aia21 151fa56ec6 Don't free extent inodes in attrib.c! (Szakacsits Szabolcs)
(Logical change 1.45)
2002-12-13 15:54:44 +00:00
cantab.net!aia21 301b3734af update changelog
BKrev: 3df9f79dwrkAluD-D61QdoJWMdwwHg
2002-12-13 15:07:09 +00:00
cantab.net!aia21 cd89d41f06 update changelog
(Logical change 1.44)
2002-12-13 15:07:09 +00:00
cantab.net!aia21 0867325565 Add sanity check to ntfs_inode_close() to detect attempts at closing
extent inodes.

BKrev: 3df9f775oyXk9BpYQQDCAm3TEjiIdA
2002-12-13 15:06:29 +00:00
cantab.net!aia21 ce025a34ea Add sanity check to ntfs_inode_close() to detect attempts at closing
extent inodes.

(Logical change 1.43)
2002-12-13 15:06:29 +00:00
cantab.net!aia21 0ae3f129fc Fix bug where the call to ntfs_attr_{put,reinit}_search_ctx() would
free the extent inode attached to the search context but leave it
attached to the base inode, so this would lead to memory corruption
and worse problems. Thanks to Szakacsits Szabolcs for spotting this.
We now don't close extent inodes any more at all and just leave it
to the closing of the base inode to dispose of all the extent inodes.

BKrev: 3df9f2624EmJyDVR86KJ_OccL998Ug
2002-12-13 14:44:50 +00:00
cantab.net!aia21 9f426c46e5 Fix bug where the call to ntfs_attr_{put,reinit}_search_ctx() would
free the extent inode attached to the search context but leave it
attached to the base inode, so this would lead to memory corruption
and worse problems. Thanks to Szakacsits Szabolcs for spotting this.
We now don't close extent inodes any more at all and just leave it
to the closing of the base inode to dispose of all the extent inodes.

(Logical change 1.42)
2002-12-13 14:44:50 +00:00
cantab.net!aia21 ae5d581a3e updateFix stupid bug in ntfs_ucsncmp().
(Logical change 1.41)
2002-12-12 20:12:16 +00:00
cantab.net!aia21 095881f26d update
(Logical change 1.41)
2002-12-12 20:12:16 +00:00
cantab.net!aia21 b643de455a add Leonard to the credits
(Logical change 1.41)
2002-12-12 20:12:16 +00:00
cantab.net!aia21 e5d3b5bd3d Fix stupid bug in ntfs_ucsncmp(). Thanks to Leonard Norrgrd.
BKrev: 3df8eda0OFdTkdYX2EEcfboRw5NHuA
2002-12-12 20:12:16 +00:00
cantab.net!aia21 237cb68266 update changelog
BKrev: 3df8a9072h-2Cmr6SsDA1R7396FPog
2002-12-12 15:19:35 +00:00
cantab.net!aia21 159fc87229 update changelog
(Logical change 1.40)
2002-12-12 15:19:35 +00:00
cantab.net!aia21 5bd85af041 libntfs/attrib.c
Fix bug in ntfs_external_attr_find(). Spotted and fixed by Szaka.
libntfs/inode.c
    Fix logic inversion bug in ntfs_extent_inode_open().
    Spotted and fixed by Szaka.
    This one was particularly dumb as it has been fixed in the NTFS
    kernel driver for over half a year but the fix was never propagated
    into the library. )-:

BKrev: 3df8a4f3VwxdoIiRFOqkKn5jHd5oQQ
2002-12-12 15:02:11 +00:00
cantab.net!aia21 f34b2fa185 Fix logic inversion bug in ntfs_extent_inode_open().
Spotted and fixed by Szaka.
This one was particularly dumb as it has been fixed in the NTFS
kernel driver for over half a year but the fix was never propagated
into the library. )-:

(Logical change 1.39)
2002-12-12 15:02:11 +00:00
cantab.net!aia21 e1e3e56c54 Fix bug in ntfs_external_attr_find(). Spotted and fixed by Szaka.
(Logical change 1.39)
2002-12-12 15:02:11 +00:00
cantab.net!aia21 3da4b5c088 Update changelog (typos).
BKrev: 3df886dacchgzbpnwnqJskhq497-1g
2002-12-12 12:53:46 +00:00
cantab.net!aia21 acc1dbc0b7 Update changelog (typos).
(Logical change 1.38)
2002-12-12 12:53:46 +00:00
cantab.net!aia21 bb6105b82b bugfix: make ntfs_names_are_equal return true if both names are zero length
thanks to Leonard Norrgrd for the fix.

BKrev: 3df61a52SaOAsdld1Wtl5VlDPAT7iQ
2002-12-10 16:46:10 +00:00
cantab.net!aia21 89c6f610e2 bugfix: make ntfs_names_are_equal return true if both names are zero length
thanks to Leonard Norrgrd for the fix.

(Logical change 1.37)
2002-12-10 16:46:10 +00:00
cantab.net!aia21 bed62087c7 update for ntfsresize and new api
(Logical change 1.36)
2002-12-10 11:53:41 +00:00
cantab.net!aia21 faad618110 update
(Logical change 1.36)
2002-12-10 11:53:41 +00:00
cantab.net!aia21 e4e1caa9f0 remove cvs id tag
(Logical change 1.36)
2002-12-10 11:53:41 +00:00
cantab.net!aia21 14ac4ee8c8 new api renames to ntfs_object_action and other misc updates
BKrev: 3df5d5c5HZ8tN4P990Iqb_TJQ3ljLw
2002-12-10 11:53:41 +00:00
cantab.net!aia21 69306cc493 new api renames to ntfs_object_action
(Logical change 1.36)
2002-12-10 11:53:41 +00:00
cantab.net!aia21 f6171df97b add ntfsresize
(Logical change 1.36)
2002-12-10 11:53:41 +00:00
cantab.net!aia21 7b451e1704 Update changelog for renames
(Logical change 1.36)
2002-12-10 11:53:41 +00:00
cantab.net!aia21 900c3e987b remove cvs id tags
(Logical change 1.35)
2002-12-09 16:09:32 +00:00
cantab.net!aia21 3c45c30f5c ntfsresize.c:
bug fix by Szaka
Many files:
  remove cvs id tags

BKrev: 3df4c03cmaBfo2NpWGkbqdZNacoU8A
2002-12-09 16:09:32 +00:00
cantab.net!aia21 65b72f98e1 bug fix by Szaka
(Logical change 1.35)
2002-12-09 16:09:32 +00:00
cantab.net!aia21 9e79b61437 start of renames to ntfs_object_action() format
(Logical change 1.34)
2002-12-09 09:42:12 +00:00
cantab.net!aia21 e15920920d Many files:
start of renames to ntfs_object_action() format

BKrev: 3df46574XA1Dgsn_YfOlWkpKiHjxsA
2002-12-09 09:42:12 +00:00
cantab.net!aia21 030078ba24 update build
(Logical change 1.33)
2002-12-09 09:23:21 +00:00
cantab.net!aia21 1dcedb04f1 update TODO.
(Logical change 1.33)
2002-12-09 09:23:21 +00:00
cantab.net!aia21 9ff24501b2 remove unused variables
(Logical change 1.33)
2002-12-09 09:23:21 +00:00
cantab.net!aia21 8ad0c0f6b6 ntfsresize.c:
remove unused variables
Makefile.in:
  update build
attrib.c:
  fix warning from compiler
TODO.libntfs:
  update TODO.

BKrev: 3df46109dhqNfiuzQqSY2pMIaxZIBw
2002-12-09 09:23:21 +00:00
cantab.net!aia21 fbfa8d138b fix warning from compiler
(Logical change 1.33)
2002-12-09 09:23:21 +00:00
cantab.net!aia21 82529814be update changelog for renames
(Logical change 1.32)
2002-12-08 20:47:47 +00:00
cantab.net!aia21 8c213b3aef ChangeLog:
update changelog for renames

BKrev: 3df3aff3S8sk6CEcrT2M4L9p5EfLkQ
2002-12-08 20:47:47 +00:00
cantab.net!aia21 c7bcb144b2 rename run{ ,_,-}list to runlist
(Logical change 1.31)
2002-12-08 20:36:02 +00:00
cantab.net!aia21 f7ffcf6445 merge
2002/12/08 20:15:41+00:00 cantab.net!aia21
rename run{ ,_,-}list to runlist

(Logical change 1.31)
2002-12-08 20:36:02 +00:00
cantab.net!aia21 149c17cece Merge
2002/12/08 20:17:12+00:00 cantab.net!aia21
Many files:
  rename run{ ,_,-}list to runlist

BKrev: 3df3ad32oBVI2X8PuiNaDGDXAQcQMw
2002-12-08 20:36:02 +00:00
cantab.net!aia21 2550af241a Auto merged
2002/12/08 20:15:50+00:00 cantab.net!aia21
rename run{ ,_,-}list to runlist

(Logical change 1.31)
2002-12-08 20:36:02 +00:00
cantab.net!aia21 cd61c86aa2 Auto merged
2002/12/08 20:15:41+00:00 cantab.net!aia21
rename run{ ,_,-}list to runlist

(Logical change 1.31)
2002-12-08 20:36:02 +00:00
cantab.net!aia21 c4eb64a730 Auto merged
2002/12/08 20:15:29+00:00 cantab.net!aia21
rename run{ ,_,-}list to runlist

(Logical change 1.31)
2002-12-08 20:36:02 +00:00
cantab.net!aia21 bd25eebb4a runlist.c:
rename run{ ,_,-}list to runlist

BKrev: 3df3ac84seyQltiCW_ijSpt0xjveyQ
2002-12-08 20:33:08 +00:00
cantab.net!aia21 1dc06ead44 rename run{ ,_,-}list to runlist
(Logical change 1.30)
2002-12-08 20:33:08 +00:00
flatcap.org!flatcap ad73902af1 set the recover file's date/time
2002/12/05 13:19:04+00:00 flatcap.org!flatcap
fixed a very silly buffer error
thanks to Martin Pirker

(Logical change 1.29)
2002-12-05 14:22:26 +00:00
flatcap.org!flatcap 1f7c409ca5 minor undelete updates
BKrev: 3def6122IEqtQWR7vReEDrB0yZTkiA
2002-12-05 14:22:26 +00:00
flatcap.org!flatcap e6eec73541 caveat: the filesize and date/time might not be what you expected
(Logical change 1.29)
2002-12-05 14:22:26 +00:00
flatcap.org!flatcap e6d4f5ea45 a few extra comments
(Logical change 1.29)
2002-12-05 14:22:26 +00:00
flatcap.org!flatcap 338989eb4d prepared the ground for the windows port
BKrev: 3deabdfdznknZ-dKrAIhRhXz9lXC0A
2002-12-02 01:57:17 +00:00
flatcap.org!flatcap 589c9b8678 minor build fix
(Logical change 1.28)
2002-12-02 01:57:17 +00:00
flatcap.org!flatcap a7b325ee46 Initial revision 2002-12-02 01:57:17 +00:00
flatcap.org!flatcap 5fa15e2d7e Added compat.c to the build
(Logical change 1.28)
2002-12-02 01:57:17 +00:00
flatcap.org!flatcap fe0c482994 A couple more void * arithmetic issues
(Logical change 1.28)
2002-12-02 01:57:17 +00:00
flatcap.org!flatcap cb5b25e58b (Logical change 1.28) 2002-12-02 01:57:17 +00:00
flatcap.org!flatcap 69d651cec8 tidy whitespace
space tab
  trailing whitespace
  lots of spaces

BKrev: 3dea5ad5CkWvmkJwAGKVQGYNhTxR0Q
2002-12-01 18:54:13 +00:00
flatcap.org!flatcap d789fd8385 tidy whitespace
(Logical change 1.27)
2002-12-01 18:54:13 +00:00
flatcap.org!flatcap 3e1b7a9165 portability:
void * arithmetic is a GNU extension

(Logical change 1.26)
2002-12-01 18:13:20 +00:00
flatcap.org!flatcap 86126fa972 portability
(Logical change 1.26)
2002-12-01 18:13:20 +00:00
flatcap.org!flatcap 778d31d09e A few minor portability issues
BKrev: 3dea514016kZ9vOngpuna8d6vBJlKw
2002-12-01 18:13:20 +00:00
flatcap.org!flatcap 26f337eaec new man page
BKrev: 3de7894f2-986MzYL0eASjnv5icALw
2002-11-29 15:35:43 +00:00
flatcap.org!flatcap d0526f58d7 new man page
(Logical change 1.25)
2002-11-29 15:35:43 +00:00
flatcap.org!flatcap cdff4edf11 tidy up
}(Logical change 1.24)
2002-11-29 15:26:49 +00:00
flatcap.org!flatcap 7e3a966ce8 tidy up
2002/11/29 15:24:42+00:00 flatcap.org!flatcap
Rename: ntfsprogs/ntfstools.8.in -> ntfsprogs/ntfsprogs.8.in

(Logical change 1.24)
2002-11-29 15:26:49 +00:00
flatcap.org!flatcap 4d8a0de290 tidy up
(Logical change 1.24)
2002-11-29 15:26:49 +00:00
flatcap.org!flatcap f4ed5849e2 more man page tidying
BKrev: 3de78739qKxO0YXe_kDj5Xp6XYFAiA
2002-11-29 15:26:49 +00:00
flatcap.org!flatcap f61c96cab6 add new man page
(Logical change 1.24)
2002-11-29 15:26:49 +00:00
flatcap.org!flatcap bbabd73007 Initial revision 2002-11-29 15:26:49 +00:00
cantab.net!aia21 9ae02efb9a update news
(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 8b286d22c0 update build system
}(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 f3c4b8d8ac update build system
2002/11/29 12:07:08+00:00 cantab.net!aia21
mvdir

(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 6b57405c1b update build system
(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 6ee7d748cf ntfstools->ntfsprogs and update build system
BKrev: 3de75aa3a5HJh_zGVUUxc55JRXYW8g
2002-11-29 12:16:35 +00:00
cantab.net!aia21 7bd958a423 ntfstools->ntfsprogs
(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 87ad00d142 mvdir
}(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 cd29ef7745 mvdir
(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 37676411cb Rename: TODO.ntfstools -> TODO.ntfsprogs
}(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 8ef654619f Rename: TODO.ntfstools -> TODO.ntfsprogs
(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 ad913491ed ntfstools->ntfsprogs
}(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 a40fef9bf9 ntfstools->ntfsprogs
2002/11/29 12:07:08+00:00 cantab.net!aia21
mvdir

(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 df7cae02e7 Initial revision 2002-11-29 12:16:35 +00:00
cantab.net!aia21 c282c53742 ntfstools->ntfsprogs
(Logical change 1.23)
2002-11-29 12:16:35 +00:00
cantab.net!aia21 f9037f4025 config:
Rename url to new name

BKrev: 3de751a1RJl5sPQfPFnmjYJLbsnVeg
2002-11-29 11:38:09 +00:00
cantab.net!aia21 e412c06762 Rename url to new name
(Logical change 1.22)
2002-11-29 11:38:09 +00:00
flatcap.org!flatcap 9b185bdd62 man page tidyups
BKrev: 3de651edU6FecRqcMjjfZCUDVBbHFQ
2002-11-28 17:27:09 +00:00
flatcap.org!flatcap a3e0c862c0 Initial revision 2002-11-28 17:27:09 +00:00
flatcap.org!flatcap 3bdc3ed633 Changed formatted text into a proper table
(Logical change 1.21)
2002-11-28 17:27:09 +00:00
flatcap.org!flatcap 41167410fb (Logical change 1.21) 2002-11-28 17:27:09 +00:00
flatcap.org!flatcap c7c18995b1 [Szaka] ntfsresize added to ChangeLog as new tool
(Logical change 1.20)
2002-11-27 16:32:58 +00:00
flatcap.org!flatcap 9ef788b993 [Szaka] minor ntfsresize cleanup
BKrev: 3de4f3bab-BZBFycCGhKWO1YY8i2yQ
2002-11-27 16:32:58 +00:00
flatcap.org!flatcap a2c8cf2ee0 [Szaka] fixed tab/space in ntfsresize man page that messed man2html output
(Logical change 1.20)
2002-11-27 16:32:58 +00:00
flatcap.org!flatcap 9ff1d2d0a3 [Szaka]
use const char * for message strings instead of #define
advise Windows built in defrag if resize needs defragmentation

(Logical change 1.20)
2002-11-27 16:32:58 +00:00
cantab.net!aia21 204ef2c7ed ntfsresize.8.in:
Simplicity rulez, this patch eliminates the "resize by number of
  clusters" feature. It was only used as a temporary helper for
  development and on the long term it would be just an unneeded baggage.
  advise_on_resize() reworked accordingly.
ntfsresize.c:
  [Szaka] Simplicity rulez, this patch eliminates the "resize by number of
  clusters" feature. It was only used as a temporary helper for
  development and on the long term it would be just an unneeded baggage.
  advise_on_resize() reworked accordingly.

BKrev: 3de2128fY-mA-GfH497dipyVBkcFbg
2002-11-25 12:07:43 +00:00
cantab.net!aia21 885ae1eda8 [Szaka] Simplicity rulez, this patch eliminates the "resize by number of
clusters" feature. It was only used as a temporary helper for
development and on the long term it would be just an unneeded baggage.
advise_on_resize() reworked accordingly.

(Logical change 1.19)
2002-11-25 12:07:43 +00:00
cantab.net!aia21 c78a451b9a Simplicity rulez, this patch eliminates the "resize by number of
clusters" feature. It was only used as a temporary helper for
development and on the long term it would be just an unneeded baggage.
advise_on_resize() reworked accordingly.

(Logical change 1.19)
2002-11-25 12:07:43 +00:00
cantab.net!aia21 94ebdbc348 ntfsresize.8.in, ntfsresize.c:
Hi,
  This is important. kilo-, mega- or gigabytes prefixes use decimal, not
  binary units according to biggest standards (SI, ATA, IEEE, disk
  manufacturers, etc). Also only [kMG] accepted and [Kmg] not anymore.
  Manual updated according to this. "Side-effect" of the patch: user
  can't destroy his fs if uses the same or slightly bigger decimal unit
  for disk partitioning (e.g. by cfdisk or recent fdisk) as he did for
  ntfsresize [used binary units before]. From now on new/old volume
  sizes are printed in bytes and MB's, not in clusters and MB's.
  Cheers,
  Szaka

BKrev: 3de111daUryDdizzKIb25cpern36zg
2002-11-24 17:52:26 +00:00
cantab.net!aia21 1cdf00a894 Hi,
This is important. kilo-, mega- or gigabytes prefixes use decimal, not
binary units according to biggest standards (SI, ATA, IEEE, disk
manufacturers, etc). Also only [kMG] accepted and [Kmg] not anymore.
Manual updated according to this. "Side-effect" of the patch: user
can't destroy his fs if uses the same or slightly bigger decimal unit
for disk partitioning (e.g. by cfdisk or recent fdisk) as he did for
ntfsresize [used binary units before]. From now on new/old volume
sizes are printed in bytes and MB's, not in clusters and MB's.
Cheers,

Szaka

(Logical change 1.18)
2002-11-24 17:52:26 +00:00
flatcap.org!flatcap 51d2a5d007 [Szaka] More warnings and some corrections
(Logical change 1.17)
2002-11-22 12:44:17 +00:00
flatcap.org!flatcap 214c3ffc49 [Szaka] More warnings
BKrev: 3dde26a1jucIG8mPzp0iAtQMZVl6Gw
2002-11-22 12:44:17 +00:00
flatcap.org!flatcap 4afc98d6d8 [Szaka] More warnings
(Logical change 1.17)
2002-11-22 12:44:17 +00:00
cantab.net!aia21 7b28349903 attrib_RE.txt:
Rename: libntfs/attrib_RE.c -> libntfs/attrib_RE.txt

BKrev: 3dda5082r3Lfc2FwKCoSowS43rztZw
2002-11-19 14:53:54 +00:00
cantab.net!aia21 117764a1fb Rename: libntfs/attrib_RE.c -> libntfs/attrib_RE.txt
}(Logical change 1.16)
2002-11-19 14:53:54 +00:00
cantab.net!aia21 752f7f2026 Rename: libntfs/attrib_RE.c -> libntfs/attrib_RE.txt
(Logical change 1.16)
2002-11-19 14:53:54 +00:00
cantab.net!aia21 67b6ffec64 Initial revision 2002-11-19 14:53:54 +00:00
cantab.net!aia21 34b4126bec autogen.sh doesn't work with automake 1.5 -- fix by Szaka
(Logical change 1.15)
2002-11-18 16:27:23 +00:00
cantab.net!aia21 99045ef992 Merge ssh://linux-ntfs@bkbits.net/ntfs-progs
into cantab.net:/usr/src/ntfs-progs

2002/11/18 16:16:35+00:00 cantab.net!aia21
Makefile.am:
  autogen.sh doesn't work with automake 1.5 -- fix by Szaka

BKrev: 3dd914ebS77iNi1Z5xJQKqmZYV0AIA
2002-11-18 16:27:23 +00:00
cantab.net!aia21 52ec125006 update
(Logical change 1.14)
2002-11-17 16:31:17 +00:00
cantab.net!aia21 8ac1a44393 Makefile.in, configure:
update

BKrev: 3dd7c455pIzaW327Jc5NUrRByLwD7Q
2002-11-17 16:31:17 +00:00
cantab.net!aia21 611cba7fec update
(Logical change 1.13)
2002-11-17 16:27:15 +00:00
cantab.net!aia21 008844bfd5 stuff
(Logical change 1.13)
2002-11-17 16:27:15 +00:00
cantab.net!aia21 d6d4202da4 build ntfsresize
(Logical change 1.13)
2002-11-17 16:27:15 +00:00
cantab.net!aia21 2c3d6ec8e6 Initial revision 2002-11-17 16:27:15 +00:00
cantab.net!aia21 34e41fded7 Hi,
Below patch includes:

- ntfsresize man page
- ntfsresize TODO update
- some spelling correction
- more usage() cleanup
- corrected misleading message after successful test-run
- syncing device after resize
- more verbose/correct hints after resize

I have some more testers but no feedback yet due to lack of their
time.

Cheers,

	Szaka

BKrev: 3dd7c363eC7EpqUab5qjpcbq1eWfyw
2002-11-17 16:27:15 +00:00
cantab.net!aia21 b3c45be312 (Logical change 1.13) 2002-11-17 16:27:15 +00:00
cantab.net!aia21 efca76f378 Makefile.am:
Hi,
  The below patch makes ntfsresize build also at default.
  	Szaka

BKrev: 3dd7c165w-DfUx8Zyr1hcPcrEOc2lQ
2002-11-17 16:18:45 +00:00
cantab.net!aia21 f0711d1211 Hi,
The below patch makes ntfsresize build also at default.
	Szaka

(Logical change 1.12)
2002-11-17 16:18:45 +00:00
cantab.net!aia21 2bf15702e6 ntfsresize.c:
Hi,
  This patch adds the warning Anton requested,
  ---------------------------------------------------------->
  WARNING: Every sanity checks passed and only the DANGEROUS
  operations left. Please make sure all your important data
  had been backed up in case of an unexpected failure!
  Are you sure you want to proceed (y/[n])?
  OK quitting. NO CHANGES has been made to your NTFS volume.
  <----------------------------------------------------------
  The question will be skipped if the -f (force) used [e.g. for
  automatic testing]. This patch needs the earlier sent
  ntfsresize-usage-cleanup.diff patch.

  	Szaka

BKrev: 3dd7bfe0ZRpIzFdMtWEQJhzZVnbwxQ
2002-11-17 16:12:16 +00:00
cantab.net!aia21 54e91a485a Hi,
This patch adds the warning Anton requested,
-=------------------------=------------------------------->
WARNING: Every sanity checks passed and only the DANGEROUS
operations left. Please make sure all your important data
had been backed up in case of an unexpected failure!
Are you sure you want to proceed (y/[n])?
OK quitting. NO CHANGES has been made to your NTFS volume.
<----------------------------------------------------------The question will be skipped if the -f (force) used [e.g. for
automatic testing]. This patch needs the earlier sent
ntfsresize-usage-cleanup.diff patch.	Szaka

(Logical change 1.11)
2002-11-17 16:12:16 +00:00
cantab.net!aia21 adc4069576 ntfsresize.c:
Hi,

This patch adds version info, description and "Report bugs ...
Homepage ..." info to Usage screen.

        Szaka

BKrev: 3dd7bf3dJM3_Fmw46nwDMxoY8NnpgQ
2002-11-17 16:09:33 +00:00
cantab.net!aia21 ef2a978b93 Hi,
(Logical change 1.10)
2002-11-17 16:09:33 +00:00
flatcap.org!flatcap a918e028e7 minor build fix for gcc 3.2
BKrev: 3db5b592n3GVhX-gYQO51KSNW9QfGA
2002-10-22 20:31:14 +00:00
flatcap.org!flatcap f4bd1eae9e minor build fix for gcc 3.2
(Logical change 1.9)
2002-10-22 20:31:14 +00:00
cantab.net!aia21 714144e591 Fix compilation with gcc-3.2.
BKrev: 3daa951deXVPl6hQLeGynOL_A58xqg
2002-10-14 09:57:49 +00:00
cantab.net!aia21 89dcef0bf9 Fix compilation with gcc-3.2.
(Logical change 1.8)
2002-10-14 09:57:49 +00:00
flatcap.org!flatcap f698d25e8c ignore:
Teach BK to ignore configure output, general build products and specific programs

BKrev: 3d656cb3sIgrTr3fmfMsKzc3XRx0uw
2002-08-22 22:58:59 +00:00
flatcap.org!flatcap 46d1b0d940 Teach BK to ignore configure output, general build products and specific programs
(Logical change 1.7)
2002-08-22 22:58:59 +00:00
flatcap.org!flatcap f2508179fc updated rpm group
(Logical change 1.6)
2002-08-22 18:44:56 +00:00
flatcap.org!flatcap ce412deb27 linux-ntfs.spec.in:
updated rpm group

BKrev: 3d653128Dm91CbrBeji9nmja7mEcuQ
2002-08-22 18:44:56 +00:00
flatcap.org!flatcap c84faef728 Import changeset
BKrev: 3d6528eb_pWCFUFghG5TvvR1VYtCfQ
2002-08-22 18:09:47 +00:00
!szaka 1935ac9421 Move ntfs_set_volume_flags() from attrib[ch] to volume.[ch]
2002/07/14 12:36:04-00:00 !szaka
Increase NTFS_BUF_SIZE to 8192 (better average performance)

2002/07/12 12:38:54-00:00 !szaka
Rewrote $LogFile reset using new inode API and moved it from ntfsfix to
libntfs as ntfs_reset_logfile(). ntfsresize also resets log file.

2002/07/12 07:10:44-00:00 !szaka
NTFS_V* version macros and ntfs_is_version_supported() added.
Modified ntfsfix and ntfsresize to use them.

2002/07/11 16:20:33-00:00 !flatcap
whitespace and include guards

2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/06 20:47:32-00:00 !antona
The beginning of the directory operations! Introduce dir.[hc] and ntfs_lookup_inode_by_name().

2002/06/02 23:02:20-00:00 !antona
More fixes and updates.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/27 19:49:09-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/23 23:27:33-00:00 !antona
Fixup the force option in mkntfs.c. Change the ntfs_check_if_mounted so it works on system not implementing {set,get,end}mntent, too. Also make it more powerful in telling us not only if something is mounted but also if it is the fs root and if it is read-only.

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/10 23:37:19-00:00 !antona
Ok, ntfsd was a mistake for userspace. It increases complexity no end while
not giving us much functionality. Lets get it working and then worry about the
kernel. - As it was the idea originally anyway, so this is just a return on the
right track. (-8

We keep the timer and signal handler but the only thing we do is to set a bool
flag (ntfs_need_sync) and we will just check this in appropriate places and
if it is true we call ntfs_sync_volumes() which sets it back to false. This
means no more locking at all of any description and no need to worry about the
signal handler interrupting things in bad ways and/or at bad times in the main
code.

2001/04/10 22:20:19-00:00 !antona
Ok, ntfsd was a mistake for userspace. It increases complexity no end while
not giving us much functionality. Lets get it working and then worry about the
kernel. - As it was the idea originally anyway, so this is just a return on the
right track. (-8

We keep the timer and signal handler but the only thing we do is to set a bool
flag (ntfs_need_sync) and we will just check this in appropriate places and
if it is true we call ntfs_sync_volumes() which sets it back to false. This
means no more locking at all of any description and no need to worry about the
signal handler interrupting things in bad ways and/or at bad times in the main
code.

2001/04/09 00:05:37-00:00 !antona
More or less finished file handling. (Probably some useful functions are
still missing but they will be implemented as need arises.)

One thing that is stupid at the moment is we don't limit the amount of
cached mft_records so if you were to load loads the machine would eventually
run out of memory... Can't happen with files as they are limited to 1000,
unless you are short of memory. (Hard limit at the moment, set in ntfs_mount().
Maybe ntfsd should be monitoring memory usage and be throwing out unused cache
entries and closed_files? That would mean to have locking everywhere, though.)

Still missing: - Convert old code to use new stuff. - Add non-resident
attributes somewhere. Either into the mft_entry structure or into the
ntfs_file structure, but which? At the moment I tend to mft_entry so they can
be synced together with the entries by ntfsd.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/08 01:58:29-00:00 !antona
User space conversion of locking complete. I settled for using simple spinlocks
and atomic variables and instead of deadlocking/livelocking when using
spin_lock(), use spin_trylock() in a while letting go of the cpu between each
call and making a maximum of 100 iterations (or we return EDEADLK error code).

This is not the most efficient way, especially as can't have multiple readers
but it is the simplest way to go about things.

Should now have (almost) all required helper functions for dealing with mft
entries implemented.

Now need the file handling and then convert the whole project to use the new
code and then can finally get back to work on attribute searching...

2001/04/07 17:30:10-00:00 !antona
ntfsd should be finished now

2001/04/03 22:41:30-00:00 !antona
We now have files and keep track of them on a per volume basis and same
for inodes (mft_records). At least conceptually anyway.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/06 02:10:55-00:00 !antona
Allow variable length upcase table.
Progressing on find_next_attr().

2001/01/30 12:55:21-00:00 !antona
Fixed the compilation issues.

2001/01/25 14:00:43-00:00 !antona
Added volume.c code and fixed some typos and inconsistencies.

2001/01/24 02:13:24-00:00 !antona
Add a bunch of headers (attrib.h is work in progress).

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!szaka e80befbfb5 Merge set_ntfs_volume_flags() and code from ntfsfix as a new library
function: ntfs_set_volume_flags(). Note, ntfs_set_volume_flags() is
moving to volume.[ch]

2002/07/12 12:38:54-00:00 !szaka
Rewrote $LogFile reset using new inode API and moved it from ntfsfix to
libntfs as ntfs_reset_logfile(). ntfsresize also resets log file.

2002/07/12 07:10:44-00:00 !szaka
NTFS_V* version macros and ntfs_is_version_supported() added.
Modified ntfsfix and ntfsresize to use them.

2002/07/11 16:20:34-00:00 !flatcap
whitespace and include guards

2002/07/08 23:27:17-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/07 19:44:57-00:00 !antona
Change ntfs_read_file_record() not to abort if the inode is not in use. Adapt callers which care to check this themselves.

2002/07/03 21:56:01-00:00 !antona
Updates

2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/05 20:32:53-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/02 23:02:20-00:00 !antona
More fixes and updates.

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/27 19:49:10-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/21 01:26:39-00:00 !antona
Cleanup/streamline include file dependencies.

2002/04/20 23:09:43-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/20 01:53:03-00:00 !antona
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.

2002/04/19 21:09:55-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/15 19:17:24-00:00 !antona
Fix ntfsfix as well. This completes all changes and everything should be just as functional as before.

2002/04/14 14:15:47-00:00 !antona
Cleanups and updates.

2002/03/12 22:11:02-00:00 !antona
Final tidyups.

2002/03/12 22:00:44-00:00 !antona
Fix a few small mistakes

2002/03/12 21:48:27-00:00 !antona
Change version numbers of mkntfs and ntfsfix to match linux-ntfs release and add options to mkntfs to disable content indexing on the volume and to enable compression on the volume.

2002/01/26 02:22:05-00:00 !antona
Fix two bugs (we called is_baad_record instead of is_baad_recordp...). Thanks to
 David Martinez Moreno for reporting the compile time warnings on ia64 which led me to find the bugs.

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/11/09 18:24:32-00:00 !antona
Updates to docs, layout.h and ntfsfix to support Windows XP NTFS

2001/08/02 01:44:57-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 15:47:36-00:00 !antona
Fix

2001/04/11 15:29:39-00:00 !flatcap
minor build fixes

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/02 23:02:41-00:00 !antona
Fixed a braino the compiler didn't catch...

2001/04/02 02:38:39-00:00 !antona
I think version reporting is now fixed.

2001/04/02 02:20:53-00:00 !antona
Fixed up the automatic version numbering (I hope).

2001/04/02 02:13:57-00:00 !antona
Make the ntfsfix version be equal to the Revision in CVS.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/02 15:06:37-00:00 !antona
Full commit of my current dircetory. New files not yet added.

2001/02/03 04:21:49-00:00 !antona
Finished first public release. This is the final commit to make sure
everything is in cvs.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

2001/01/30 12:55:21-00:00 !antona
Fixed the compilation issues.

2001/01/27 14:22:02-00:00 !antona
Added a logfile dumper as a new utility.
Almost finished the first ntfsfix release. (Still missingin CVS are attrib.c
for ntfslib and the makefiles to build everything.)
Fixes for nested packed structure/union typedefs as gcc doesn't automatically
nest the __attribute__ ((__packed__)), even though according to the gcc info
page it does. (Thanks to Yuri Per <yuri@acronis.com> for pointing this out.)

2001/01/24 21:02:37-00:00 !antona
Added ntfsfix program.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!szaka 2ba0affba6 Fix incorrect message if new volume size was given in [KMG]Byte
2002/07/17 04:37:48-00:00 !szaka
Shrink volume to size given in byte[K|M|G]

2002/07/16 13:26:42-00:00 !szaka
"Calculate the smallest shrinked volume size supported" option added

2002/07/16 10:17:05-00:00 !szaka
Minor code refactoring

2002/07/15 16:41:48-00:00 !flatcap
AT_NONAME -> AT_UNNAMED

2002/07/14 18:13:04-00:00 !szaka
Mark the NTFS volume dirty. No need for ntfsfix anymore after ntfsresize.

2002/07/14 15:43:35-00:00 !szaka
Reserve space for backup boot sector at the end of device

2002/07/14 14:48:51-00:00 !szaka
Check if device mounted. Progress only if it's not or both ntfsresize
operation is read-only and device mounted read-only

2002/07/12 12:38:54-00:00 !szaka
Rewrote $LogFile reset using new inode API and moved it from ntfsfix to
libntfs as ntfs_reset_logfile(). ntfsresize also resets log file.

2002/07/12 07:10:44-00:00 !szaka
NTFS_V* version macros and ntfs_is_version_supported() added.
Modified ntfsfix and ntfsresize to use them.

2002/07/11 16:20:34-00:00 !flatcap
whitespace and include guards

2002/07/11 12:49:48-00:00 !szaka
Quit if mounted volume is dirty unless -f (force) option was given

2002/07/11 09:02:26-00:00 !szaka
Bail out if $Bitmap/$BadClust has attribite list attribute, this
condition is stronger what we need now but better to be on the
safer side. Other minor updates.

2002/07/10 10:56:26-00:00 !szaka
ntfsresize: cosmetic cleanup, progress bar added

2002/07/09 19:17:49-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

2002/07/09 09:07:10-00:00 !szaka
Don't give up inode walking on EIO: temporary fix for not being
	able to distinguish corrupt and not FILE records easily)

2002/07/09 00:00:19-00:00 !antona
Little fix to ntfsresize.

2002/07/08 23:27:17-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/08 15:59:35-00:00 !flatcap
Added Szaka's ntfsresize to the build

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!szaka fb6ff5a091 Initial revision 2002-08-22 18:09:47 +00:00
!flatcap 6e161b5f3e whitespace and include guards
2002/07/11 13:18:12-00:00 !flatcap
start to break up the dependency loops in the header files

2002/04/20 23:09:43-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/15 20:04:30-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2001/06/10 15:54:20-00:00 !antona
Linux-NTFS 0.1.0-pre1
=====================
-fixed up ntfsfix and ntfsdump_logfile
-corrected stuff
-several bug fixes
-fixed (hopefully) final bug with mkntfs (sd generator was wrong due to brain'o)
-mkntfs now completed, only need to add a few command line options before first
public release.
-rpm generation file updated and autostrip modified to make use of install-stip
make target instead of stripping manually
-made bootsector check verbosity during mount dependent on --enable-debug
configure option.

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 258d79f07a whitespace and include guards
2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/30 17:02:41-00:00 !flatcap
typos

2002/06/08 14:12:01-00:00 !antona
ntfs_readdir() has arrived.

2002/06/05 00:29:18-00:00 !antona
Make ntfs_attr_pread work with resident attributes and start on ntfs_attr_pwrite (incomplete!).

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/16 12:13:52-00:00 !antona
New API function mft.[ch]::read_file_record(). Also some cleanups.

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/11/17 02:03:14-00:00 !antona
Update layout.h attribute compression description.

2001/11/09 18:24:32-00:00 !antona
Updates to docs, layout.h and ntfsfix to support Windows XP NTFS

2001/09/03 22:01:08-00:00 !antona
Small clarifications to file attribute flags.

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/07/13 13:55:30-00:00 !antona
Updates to layout.h.

2001/06/14 15:41:41-00:00 !antona
Add comments for Windows XP ntfs changes in mft record header structure.

2001/06/09 00:25:55-00:00 !antona
mkntfs delayed. more reverse engineering required to determine exact method of
index entry collation. first few helper functions are already done and entered
into ntfslib in unistr.c

2001/06/08 19:58:24-00:00 !antona
getting closer to mkntfs alpha.

2001/06/06 22:55:49-00:00 !antona
And some more mkntfs + some updates to layout.h concerning directories and
alignment requirements.

2001/06/04 14:04:30-00:00 !antona
More work on mkntfs dir stuff.

2001/06/04 11:29:45-00:00 !antona
*** empty log message ***

2001/06/03 02:09:08-00:00 !antona
Fix/expand dircetory info in layout.h and add creation of index root attribute
to mkntfs.c.

2001/06/01 19:04:08-00:00 !antona
Updates & fixes.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 11:50:24-00:00 !antona
Forgot to cvs add ...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 92b27033b0 whitespace and include guards
2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/27 19:49:09-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/20 01:53:02-00:00 !antona
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.

2002/04/16 12:13:53-00:00 !antona
New API function mft.[ch]::read_file_record(). Also some cleanups.

2002/04/15 20:04:25-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/15 17:51:26-00:00 !antona
read/write_mft_record(s) are here

2002/04/15 00:45:28-00:00 !antona
Update headers to reflect changes in libntfs.

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2002/04/14 13:34:50-00:00 !antona
Throw away all unnecessary crap.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 14:29:11-00:00 !antona
Almost fixed compilaton. Remember to declare a struct type with
struct NAME { declaration }; rather than the bogus struct { declaration NAME };
then can use typedef NAME othername; on a forward declaration of NAME
(struct NAME;) and all is fine...

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/10 23:54:25-00:00 !antona
Fixed somethings...

2001/04/10 23:37:19-00:00 !antona
Ok, ntfsd was a mistake for userspace. It increases complexity no end while
not giving us much functionality. Lets get it working and then worry about the
kernel. - As it was the idea originally anyway, so this is just a return on the
right track. (-8

We keep the timer and signal handler but the only thing we do is to set a bool
flag (ntfs_need_sync) and we will just check this in appropriate places and
if it is true we call ntfs_sync_volumes() which sets it back to false. This
means no more locking at all of any description and no need to worry about the
signal handler interrupting things in bad ways and/or at bad times in the main
code.

2001/04/10 22:20:19-00:00 !antona
Ok, ntfsd was a mistake for userspace. It increases complexity no end while
not giving us much functionality. Lets get it working and then worry about the
kernel. - As it was the idea originally anyway, so this is just a return on the
right track. (-8

We keep the timer and signal handler but the only thing we do is to set a bool
flag (ntfs_need_sync) and we will just check this in appropriate places and
if it is true we call ntfs_sync_volumes() which sets it back to false. This
means no more locking at all of any description and no need to worry about the
signal handler interrupting things in bad ways and/or at bad times in the main
code.

2001/04/09 00:05:37-00:00 !antona
More or less finished file handling. (Probably some useful functions are
still missing but they will be implemented as need arises.)

One thing that is stupid at the moment is we don't limit the amount of
cached mft_records so if you were to load loads the machine would eventually
run out of memory... Can't happen with files as they are limited to 1000,
unless you are short of memory. (Hard limit at the moment, set in ntfs_mount().
Maybe ntfsd should be monitoring memory usage and be throwing out unused cache
entries and closed_files? That would mean to have locking everywhere, though.)

Still missing: - Convert old code to use new stuff. - Add non-resident
attributes somewhere. Either into the mft_entry structure or into the
ntfs_file structure, but which? At the moment I tend to mft_entry so they can
be synced together with the entries by ntfsd.

2001/04/08 01:58:29-00:00 !antona
User space conversion of locking complete. I settled for using simple spinlocks
and atomic variables and instead of deadlocking/livelocking when using
spin_lock(), use spin_trylock() in a while letting go of the cpu between each
call and making a maximum of 100 iterations (or we return EDEADLK error code).

This is not the most efficient way, especially as can't have multiple readers
but it is the simplest way to go about things.

Should now have (almost) all required helper functions for dealing with mft
entries implemented.

Now need the file handling and then convert the whole project to use the new
code and then can finally get back to work on attribute searching...

2001/04/05 20:14:45-00:00 !antona
Commit of current state of development including locking a la kernel.
This doesn't work on user space (semaphores don't work).
Just want to have it committed. Will take out locking / modify it where
necessary to use pthreads ASAP.

2001/04/03 23:38:54-00:00 !antona
Minor fix

2001/04/03 23:35:52-00:00 !antona
Few updates.

2001/04/03 22:41:30-00:00 !antona
We now have files and keep track of them on a per volume basis and same
for inodes (mft_records). At least conceptually anyway.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/31 15:25:19-00:00 !antona
Added a name comparison function.

2001/03/15 23:13:11-00:00 !antona
And this one...

2001/03/05 03:15:08-00:00 !antona
Forgot a few...

2001/03/05 02:45:35-00:00 !antona
Renamed things, broke everything. Should be stabilized now in the headers.
Still reworking find attribute stuff but at least I have an idea of how I want
to do it now.

2001/03/02 15:03:56-00:00 !antona
Update to latest include files.

2001/01/30 12:55:21-00:00 !antona
Fixed the compilation issues.

2001/01/30 12:29:03-00:00 !antona
And the last move into CVS. The make files. (Note: compilation is untested
and all changes have been done without testing so if it doesn't compile at
the moment don't be too surprised.)

2001/01/28 05:49:57-00:00 !antona
More header development. AttrDef description.

2001/01/27 14:22:02-00:00 !antona
Added a logfile dumper as a new utility.
Almost finished the first ntfsfix release. (Still missingin CVS are attrib.c
for ntfslib and the makefiles to build everything.)
Fixes for nested packed structure/union typedefs as gcc doesn't automatically
nest the __attribute__ ((__packed__)), even though according to the gcc info
page it does. (Thanks to Yuri Per <yuri@acronis.com> for pointing this out.)

2001/01/24 02:13:24-00:00 !antona
Add a bunch of headers (attrib.h is work in progress).

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 481eac5ebf whitespace and include guards
2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/08/02 01:44:56-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/12 22:37:20-00:00 !antona
Add a description and structure for holding attributes in memory. No code to
use it yet but it's a start. The design is geared with the ideas of making
searching for attributes and using/implementing the search context as easy as
possible, integrating the attributes into their mft_entries and maintining a
fast sync volume path.
Comments welcome.

2001/04/11 14:29:11-00:00 !antona
Almost fixed compilaton. Remember to declare a struct type with
struct NAME { declaration }; rather than the bogus struct { declaration NAME };
then can use typedef NAME othername; on a forward declaration of NAME
(struct NAME;) and all is fine...

2001/04/11 11:50:24-00:00 !antona
Forgot to cvs add ...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap a877f59d6f whitespace and include guards
2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/19 18:23:56-00:00 !antona
Add foundation of new inode API.

2002/04/18 17:20:05-00:00 !antona
New API function provided by unistr.[ch]: ntfs_mbstoucs()

2002/04/16 20:56:01-00:00 !antona
Add new API unistr.[ch]: ntfs_ucstombs() and make ntfslabel use it

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/06/09 00:25:55-00:00 !antona
mkntfs delayed. more reverse engineering required to determine exact method of
index entry collation. first few helper functions are already done and entered
into ntfslib in unistr.c

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/31 15:25:19-00:00 !antona
Added a name comparison function.

2001/03/07 01:17:33-00:00 !antona
Renamed the unicode files and introduced more code. Finished the new
find_first/next_attr() interface functions. Next on my list are functions
supporting attribute lists...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 8fd22f5f11 whitespace and include guards
2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2002/04/14 13:29:42-00:00 !antona
rename ntfs_rec to mst

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 91b6d82cbc whitespace and include guards
2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/06/02 23:02:20-00:00 !antona
More fixes and updates.

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/03/02 15:03:56-00:00 !antona
Update to latest include files.

2001/01/30 12:29:03-00:00 !antona
And the last move into CVS. The make files. (Note: compilation is untested
and all changes have been done without testing so if it doesn't compile at
the moment don't be too surprised.)

2001/01/25 22:25:43-00:00 !antona
More files added to ntfs lib. Fixed some consistency problems.

2001/01/24 20:37:36-00:00 !antona
Added for now last header file for boot sector handling.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap e1032c4b86 whitespace and include guards
2002/07/08 23:27:16-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/08 06:23:22-00:00 !antona
Don't use string concatenation with __FUNCTION__ as gcc-3.x don't like it.

2002/07/05 21:15:31-00:00 !uid28698
- Enable enumeration of attributes using ntfs_lookup_attr() which is
  requested by passing a type of AT_UNUSED (or simply zero) to
  ntfs_lookup_attr(). (Based on initial patch by Szakacsits Szabolcs.)
- Fix two minor buglets in ntfs_find_external_attr() where we would
  continue the search when we detect a mismatched type and/or name
  instead of aborting and returning error EIO to flag the corruption.

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/28 21:59:11-00:00 !antona
Cleanup.

2002/04/28 21:20:27-00:00 !mattjf
ntfslabel - Coverted stoucs to ntfs_mbstoucs()
	  - code cleanup
	  - better error checking
unistr.c  - removed size_t casts from ntfs_mbstoucs()

2002/04/18 17:20:05-00:00 !antona
New API function provided by unistr.[ch]: ntfs_mbstoucs()

2002/04/16 20:56:01-00:00 !antona
Add new API unistr.[ch]: ntfs_ucstombs() and make ntfslabel use it

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/15 20:04:27-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/14 14:08:30-00:00 !antona
Cleanup library code. Throw away unused stuff.

2001/06/09 16:31:13-00:00 !antona
mkntfs alpha release is here! Yey!
The only thing I am worried about is the fact that the system call to get the
number of sectors on the device returns a value rounded to the nearest 1024
bytes (converted to 512 byte blocks) thus we might be writting the backup boot
sector too early instead of on the real last sector but there is nothing I can
do apart from starting to play games like accessing the main device for hds
instead of the partition device which wouldn't help in the case of the last
partition though... Alternatively have to place the backup boot sector in the
middle of the disk like WinNT3.51 and earlier did but I need an image to see
exactly how they did it and even then we have the problem of not knowing where
the middle of the disk is as we don't really know how many sectors there are
for real with Linux kernel lying to us.

2001/06/09 00:25:55-00:00 !antona
mkntfs delayed. more reverse engineering required to determine exact method of
index entry collation. first few helper functions are already done and entered
into ntfslib in unistr.c

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/31 15:27:34-00:00 !antona
Added new name comparison function.

2001/03/07 01:17:33-00:00 !antona
Renamed the unicode files and introduced more code. Finished the new
find_first/next_attr() interface functions. Next on my list are functions
supporting attribute lists...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 6593450759 whitespace and include guards
2002/07/08 06:23:22-00:00 !antona
Don't use string concatenation with __FUNCTION__ as gcc-3.x don't like it.

2002/07/07 19:44:57-00:00 !antona
Change ntfs_read_file_record() not to abort if the inode is not in use. Adapt callers which care to check this themselves.

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/08 14:12:01-00:00 !antona
ntfs_readdir() has arrived.

2002/06/05 20:32:53-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/27 19:49:09-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/24 23:47:42-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/20 01:53:02-00:00 !antona
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.

2002/04/16 12:13:53-00:00 !antona
New API function mft.[ch]::read_file_record(). Also some cleanups.

2002/04/15 20:04:27-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/15 19:02:40-00:00 !antona
Really fix the library and mkntfs while at it.

2002/04/15 18:54:07-00:00 !antona
Update library for the new API.

2002/04/15 18:39:37-00:00 !antona
Cleanup some mistakes.

2002/04/15 17:51:26-00:00 !antona
read/write_mft_record(s) are here

2002/04/15 00:42:07-00:00 !antona
Big rewrite of disk_io.c. Now should have stable API for low level disk access. Move all mft record related stuff from disk_io.c to mft.c.

2002/04/14 14:08:30-00:00 !antona
Cleanup library code. Throw away unused stuff.

2002/04/14 13:34:49-00:00 !antona
Throw away all unnecessary crap.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 14:29:12-00:00 !antona
Almost fixed compilaton. Remember to declare a struct type with
struct NAME { declaration }; rather than the bogus struct { declaration NAME };
then can use typedef NAME othername; on a forward declaration of NAME
(struct NAME;) and all is fine...

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/10 23:37:19-00:00 !antona
Ok, ntfsd was a mistake for userspace. It increases complexity no end while
not giving us much functionality. Lets get it working and then worry about the
kernel. - As it was the idea originally anyway, so this is just a return on the
right track. (-8

We keep the timer and signal handler but the only thing we do is to set a bool
flag (ntfs_need_sync) and we will just check this in appropriate places and
if it is true we call ntfs_sync_volumes() which sets it back to false. This
means no more locking at all of any description and no need to worry about the
signal handler interrupting things in bad ways and/or at bad times in the main
code.

2001/04/09 00:05:37-00:00 !antona
More or less finished file handling. (Probably some useful functions are
still missing but they will be implemented as need arises.)

One thing that is stupid at the moment is we don't limit the amount of
cached mft_records so if you were to load loads the machine would eventually
run out of memory... Can't happen with files as they are limited to 1000,
unless you are short of memory. (Hard limit at the moment, set in ntfs_mount().
Maybe ntfsd should be monitoring memory usage and be throwing out unused cache
entries and closed_files? That would mean to have locking everywhere, though.)

Still missing: - Convert old code to use new stuff. - Add non-resident
attributes somewhere. Either into the mft_entry structure or into the
ntfs_file structure, but which? At the moment I tend to mft_entry so they can
be synced together with the entries by ntfsd.

2001/04/08 01:58:29-00:00 !antona
User space conversion of locking complete. I settled for using simple spinlocks
and atomic variables and instead of deadlocking/livelocking when using
spin_lock(), use spin_trylock() in a while letting go of the cpu between each
call and making a maximum of 100 iterations (or we return EDEADLK error code).

This is not the most efficient way, especially as can't have multiple readers
but it is the simplest way to go about things.

Should now have (almost) all required helper functions for dealing with mft
entries implemented.

Now need the file handling and then convert the whole project to use the new
code and then can finally get back to work on attribute searching...

2001/04/05 20:14:45-00:00 !antona
Commit of current state of development including locking a la kernel.
This doesn't work on user space (semaphores don't work).
Just want to have it committed. Will take out locking / modify it where
necessary to use pthreads ASAP.

2001/04/03 23:38:34-00:00 !antona
Mark mft entry dirty function complete

2001/03/05 03:04:40-00:00 !antona
Corresponding changes to the library.

2001/01/25 22:25:43-00:00 !antona
More files added to ntfs lib. Fixed some consistency problems.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 4593a8d3ca whitespace and include guards
2002/07/08 06:23:22-00:00 !antona
Don't use string concatenation with __FUNCTION__ as gcc-3.x don't like it.

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/05 20:32:53-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/05 00:29:19-00:00 !antona
Make ntfs_attr_pread work with resident attributes and start on ntfs_attr_pwrite (incomplete!).

2002/06/04 12:12:42-00:00 !antona
Final POSIXification of disk_io functions. (famous last words)

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/15 20:04:27-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/15 18:39:37-00:00 !antona
Cleanup some mistakes.

2002/04/15 17:51:26-00:00 !antona
read/write_mft_record(s) are here

2002/04/15 00:42:07-00:00 !antona
Big rewrite of disk_io.c. Now should have stable API for low level disk access. Move all mft record related stuff from disk_io.c to mft.c.

2002/04/14 15:26:23-00:00 !antona
Remove find_first_attr and make all users use get_attr_search_ctx + find_attr instead.

2002/04/14 14:08:30-00:00 !antona
Cleanup library code. Throw away unused stuff.

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 15:29:39-00:00 !flatcap
minor build fixes

2001/04/11 14:29:12-00:00 !antona
Almost fixed compilaton. Remember to declare a struct type with
struct NAME { declaration }; rather than the bogus struct { declaration NAME };
then can use typedef NAME othername; on a forward declaration of NAME
(struct NAME;) and all is fine...

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/05 20:14:45-00:00 !antona
Commit of current state of development including locking a la kernel.
This doesn't work on user space (semaphores don't work).
Just want to have it committed. Will take out locking / modify it where
necessary to use pthreads ASAP.

2001/04/03 22:42:42-00:00 !antona
See last commit message.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/26 04:34:20-00:00 !antona
typo fix

2001/03/26 04:28:07-00:00 !antona
Cleanup and fixes.

2001/03/26 03:39:59-00:00 !antona
Updates

2001/03/05 03:04:40-00:00 !antona
Corresponding changes to the library.

2001/03/02 15:05:53-00:00 !antona
Commit latest library state. !!!NOTE!!! This breaks everything!!! I'm in the
middle of rewritting the find_attribute stuff in attrib.c at the moment.

2001/01/26 00:34:10-00:00 !antona
Added disk io functions file.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 24f3018dfc whitespace and include guards
2002/07/03 21:56:01-00:00 !antona
Updates

2002/07/03 14:38:40-00:00 !antona
Cleanup the build process a bit.

2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/21 01:26:39-00:00 !antona
Cleanup/streamline include file dependencies.

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/16 12:13:53-00:00 !antona
New API function mft.[ch]::read_file_record(). Also some cleanups.

2001/06/16 19:59:51-00:00 !antona
Update ntfsdump_logfile and dumplog and the relevant textfiles.

2001/06/16 00:06:17-00:00 !antona
dumplog now decodes the first 0x5000 bytes of the logfile given on the command
line as fully as possible with the current knowledge of the logfile structures.

2001/06/15 16:45:12-00:00 !antona
New log dumper to operate on a file rather than a partition and it is more
advanced and corrected compared to ntfsdump_logfile.
Also add a file that will do the creation of the logfile structures for mkntfs.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 78374b2c2c whitespace and include guards
2002/07/03 21:56:00-00:00 !antona
Updates

2001/01/23 16:35:04-00:00 !antona
Added my templates for new source and include files.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 55763f61fa whitespace and include guards
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/30 17:02:41-00:00 !flatcap
typos

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/14 14:08:30-00:00 !antona
Cleanup library code. Throw away unused stuff.

2002/04/14 13:28:19-00:00 !antona
Cleanup mst fixup handling bringing it inline with kernel driver and rename the file to mst rather than ntfs_rec.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap c2cb8c0223 whitespace and include guards
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/08 14:12:01-00:00 !antona
ntfs_readdir() has arrived.

2002/06/06 20:47:29-00:00 !antona
The beginning of the directory operations! Introduce dir.[hc] and ntfs_lookup_inode_by_name().

2002/06/06 15:41:29-00:00 !antona
Add template files for directory handling code.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 4c4d606dcb whitespace and include guards
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/06 20:47:33-00:00 !antona
The beginning of the directory operations! Introduce dir.[hc] and ntfs_lookup_inode_by_name().

2002/06/02 23:02:20-00:00 !antona
More fixes and updates.

2002/04/24 01:37:37-00:00 !antona
New api call is_boot_sector_ntfs. A few folding help cleanups.

2002/04/21 01:26:39-00:00 !antona
Cleanup/streamline include file dependencies.

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/03/05 03:04:40-00:00 !antona
Corresponding changes to the library.

2001/01/30 12:29:03-00:00 !antona
And the last move into CVS. The make files. (Note: compilation is untested
and all changes have been done without testing so if it doesn't compile at
the moment don't be too surprised.)

2001/01/25 22:25:43-00:00 !antona
More files added to ntfs lib. Fixed some consistency problems.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap c5d4f9c9bc whitespace and include guards
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/04 12:12:42-00:00 !antona
Final POSIXification of disk_io functions. (famous last words)

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/15 18:39:36-00:00 !antona
Cleanup some mistakes.

2002/04/15 17:51:26-00:00 !antona
read/write_mft_record(s) are here

2002/04/15 00:45:28-00:00 !antona
Update headers to reflect changes in libntfs.

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 14:29:11-00:00 !antona
Almost fixed compilaton. Remember to declare a struct type with
struct NAME { declaration }; rather than the bogus struct { declaration NAME };
then can use typedef NAME othername; on a forward declaration of NAME
(struct NAME;) and all is fine...

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/03/26 04:30:27-00:00 !antona
Cleanup and fixes.

2001/01/26 00:34:35-00:00 !antona
Inconsisteny fixes.

2001/01/25 22:25:43-00:00 !antona
More files added to ntfs lib. Fixed some consistency problems.

2001/01/24 20:37:36-00:00 !antona
Added for now last header file for boot sector handling.

2001/01/24 18:44:31-00:00 !antona
Added disk_io.h header file.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 10a361fafa whitespace and include guards
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/20 01:53:02-00:00 !antona
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.

2002/04/19 21:09:55-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap c9180f848e whitespace and include guards
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/01/26 03:21:07-00:00 !antona
Preparations for 1.5.1 release.

2002/01/26 02:42:13-00:00 !antona
Compilation fixes for odd architectures. Had forgotten logfile.h. Damn...

2001/06/16 00:06:17-00:00 !antona
dumplog now decodes the first 0x5000 bytes of the logfile given on the command
line as fully as possible with the current knowledge of the logfile structures.

2001/06/15 16:47:46-00:00 !antona
Integrate logfile.c into mkntfs

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/03/05 03:15:08-00:00 !antona
Forgot a few...

2001/03/02 15:03:56-00:00 !antona
Update to latest include files.

2001/01/27 14:22:02-00:00 !antona
Added a logfile dumper as a new utility.
Almost finished the first ntfsfix release. (Still missingin CVS are attrib.c
for ntfslib and the makefiles to build everything.)
Fixes for nested packed structure/union typedefs as gcc doesn't automatically
nest the __attribute__ ((__packed__)), even though according to the gcc info
page it does. (Thanks to Yuri Per <yuri@acronis.com> for pointing this out.)

2001/01/24 21:02:37-00:00 !antona
Added ntfsfix program.

2001/01/24 10:30:49-00:00 !antona
The initial log file on disk structures (work in progress).

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 04ca1e570c whitespace and include guards
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/01/24 02:13:24-00:00 !antona
Add a bunch of headers (attrib.h is work in progress).

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 6e16c5a1ad whitespace and include guards
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/14 15:26:23-00:00 !antona
Remove find_first_attr and make all users use get_attr_search_ctx + find_attr instead.

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/10 22:20:19-00:00 !antona
Ok, ntfsd was a mistake for userspace. It increases complexity no end while
not giving us much functionality. Lets get it working and then worry about the
kernel. - As it was the idea originally anyway, so this is just a return on the
right track. (-8

We keep the timer and signal handler but the only thing we do is to set a bool
flag (ntfs_need_sync) and we will just check this in appropriate places and
if it is true we call ntfs_sync_volumes() which sets it back to false. This
means no more locking at all of any description and no need to worry about the
signal handler interrupting things in bad ways and/or at bad times in the main
code.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/05 20:14:45-00:00 !antona
Commit of current state of development including locking a la kernel.
This doesn't work on user space (semaphores don't work).
Just want to have it committed. Will take out locking / modify it where
necessary to use pthreads ASAP.

2001/04/03 22:41:30-00:00 !antona
We now have files and keep track of them on a per volume basis and same
for inodes (mft_records). At least conceptually anyway.

2001/01/25 22:25:43-00:00 !antona
More files added to ntfs lib. Fixed some consistency problems.

2001/01/24 15:01:18-00:00 !antona
Added bitmap header.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap fb83c257df whitespace and include guards
2002/06/30 17:01:53-00:00 !flatcap
added list_for_each_safe
removed pos->next (a prefetch), was confusing compiler

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 15:48:20-00:00 !antona
Fixed headers

2001/04/10 23:43:10-00:00 !antona
forgot list.h

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 5308ab00ab whitespace and include guards
2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/15 20:04:25-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2002/04/12 15:24:30-00:00 !antona
Forgot to add the debug header file!

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap c23679552d whitespace and include guards
2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/26 03:42:13-00:00 !antona
Forgot to add the new support.h

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 8c7233a354 whitespace and include guards
2001/01/23 16:35:04-00:00 !antona
Added my templates for new source and include files.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 67b85b0e53 new function headers and a few function moves
2002/07/11 16:20:34-00:00 !flatcap
whitespace and include guards

2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/09 19:17:49-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 0bb969090c new function headers and a few function moves
2002/07/11 16:20:33-00:00 !flatcap
whitespace and include guards

2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/09 19:17:48-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 5b6a80f9a5 new function headers and a few function moves
2002/07/11 16:20:33-00:00 !flatcap
whitespace and include guards

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 4f4c955da7 move the runlist functions from attrib.c to runlist.c
2002/06/06 15:45:06-00:00 !antona
And the headerfile too

2002/04/25 07:50:34-00:00 !antona
grr. MDK8.1 modified loads of stuff. Put it back with RH7.2

2002/04/24 23:47:42-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/19 18:23:56-00:00 !antona
Add foundation of new inode API.

2002/04/14 13:58:54-00:00 !antona
Tidyup last cleanups

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/01/26 04:32:35-00:00 !antona
RedHat 7.2 - updates

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/09 23:36:17-00:00 !antona
Bug fixes

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 11:49:15-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/07 00:53:37-00:00 !antona
Makefile updates.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/02/03 02:03:35-00:00 !antona
More files.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap cea30149a6 move the runlist functions from attrib.c to runlist.c
2002/06/06 15:45:06-00:00 !antona
And the headerfile too

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/19 18:23:56-00:00 !antona
Add foundation of new inode API.

2002/04/14 13:56:44-00:00 !antona
cleanup header files.

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 11:49:15-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/07 00:53:37-00:00 !antona
Makefile updates.

2001/03/26 03:42:13-00:00 !antona
Forgot to add the new support.h

2001/02/03 02:03:35-00:00 !antona
More files.

2001/02/02 01:28:46-00:00 !antona
make dist fixes using more Makefiles.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 1483abd26c move the runlist functions from attrib.c to runlist.c
2002/06/06 15:43:59-00:00 !antona
Add dir template to make files

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/25 07:50:34-00:00 !antona
grr. MDK8.1 modified loads of stuff. Put it back with RH7.2

2002/04/24 23:47:42-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/19 18:23:56-00:00 !antona
Add foundation of new inode API.

2002/04/15 20:04:26-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/14 14:08:29-00:00 !antona
Cleanup library code. Throw away unused stuff.

2002/01/26 04:32:35-00:00 !antona
RedHat 7.2 - updates

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/09 23:36:17-00:00 !antona
Bug fixes

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/10 18:30:17-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/06/01 02:07:25-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/07 00:53:37-00:00 !antona
Makefile updates.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/02/03 02:03:36-00:00 !antona
More files.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap bd23a01967 move the runlist functions from attrib.c to runlist.c
2002/06/06 15:43:58-00:00 !antona
Add dir template to make files

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/19 18:23:56-00:00 !antona
Add foundation of new inode API.

2002/04/15 20:04:26-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/14 14:08:29-00:00 !antona
Cleanup library code. Throw away unused stuff.

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/10 18:30:17-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/06/01 02:07:25-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/07 00:53:37-00:00 !antona
Makefile updates.

2001/03/26 03:46:56-00:00 !antona
Makefile fix.

2001/02/03 02:03:36-00:00 !antona
More files.

2001/02/02 01:15:17-00:00 !antona
Updated documentation and other text files. Preparing for initial release.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 3c202b8a4e minor build fixes
2002/07/18 02:44:32-00:00 !flatcap
should now be endian-safe

2002/07/17 23:41:19-00:00 !flatcap
remove dmalloc

2002/07/17 23:36:31-00:00 !flatcap
docs updated.  mem leak fixed.

2002/07/17 12:27:27-00:00 !flatcap
it was missing the very end of the mft, misplaced ) was losing stream names

2002/07/17 10:54:53-00:00 !flatcap
cut'n'paste classic

2002/07/17 10:51:15-00:00 !flatcap
a couple of new bits, nothing original

2002/07/16 23:41:43-00:00 !flatcap
sort out the output and some of the return values

2002/07/15 16:41:48-00:00 !flatcap
AT_NONAME -> AT_UNNAMED

2002/07/15 16:30:41-00:00 !flatcap
more tidying, more comments

2002/07/15 02:57:21-00:00 !flatcap
start tidying up and documenting

2002/07/14 15:53:03-00:00 !flatcap
perform some checks on the device we're opening

2002/07/14 14:49:22-00:00 !flatcap
open vol read-only, filter by last mod time

2002/07/14 11:20:20-00:00 !flatcap
filename regex matching works, default to case insensitive matching

2002/07/13 16:33:00-00:00 !flatcap
start to fill in the options

2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/09 19:17:49-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

2002/07/09 01:01:41-00:00 !flatcap
more noname changes

2002/07/03 11:03:12-00:00 !flatcap
another reminder

2002/07/01 13:30:28-00:00 !flatcap
lots of comments

2002/06/30 22:46:51-00:00 !flatcap
undelete -> ntfsundelete

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap bb8bf25e32 docs updated. mem leak fixed.
2002/07/17 10:51:15-00:00 !flatcap
a couple of new bits, nothing original

2002/07/16 23:41:43-00:00 !flatcap
sort out the output and some of the return values

2002/07/15 22:45:45-00:00 !flatcap
enough!

2002/07/15 16:30:41-00:00 !flatcap
more tidying, more comments

2002/07/15 02:57:21-00:00 !flatcap
start tidying up and documenting

2002/06/30 22:46:51-00:00 !flatcap
undelete -> ntfsundelete

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap e237cdbaea created a template for ntfswipe
(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 226a32f43c add ntfsundelete to the build. fix rpm build. trawl for typos.
2002/07/17 05:07:01-00:00 !szaka
ntfsresize update

2002/07/10 10:56:26-00:00 !szaka
ntfsresize: cosmetic cleanup, progress bar added

2002/07/08 16:55:43-00:00 !antona
Concolidate TODO files

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 87b71bf318 add ntfsundelete to the build. fix rpm build. trawl for typos.
2002/07/15 18:12:51-00:00 !antona
Update change log.

2002/07/15 18:10:23-00:00 !antona
update changelog

2002/07/14 17:41:48-00:00 !antona
Update changelog

2002/07/12 08:23:42-00:00 !antona
update changelog

2002/07/08 06:23:22-00:00 !antona
Don't use string concatenation with __FUNCTION__ as gcc-3.x don't like it.

2002/07/08 00:09:41-00:00 !antona
Implement attrib.[hc]::ntfs_rl_pwrite(). Fix a dumb bug in ntfs_attr_pwrite().

2002/07/06 20:22:56-00:00 !antona
Typo fix

2002/07/06 20:07:58-00:00 !antona
New API for compressing run lists into mapping pairs arrays and adapt mkntfs to that API. Addition of ntfs_walk_attrs().

2002/07/05 21:15:31-00:00 !uid28698
- Enable enumeration of attributes using ntfs_lookup_attr() which is
  requested by passing a type of AT_UNUSED (or simply zero) to
  ntfs_lookup_attr(). (Based on initial patch by Szakacsits Szabolcs.)
- Fix two minor buglets in ntfs_find_external_attr() where we would
  continue the search when we detect a mismatched type and/or name
  instead of aborting and returning error EIO to flag the corruption.

2002/07/05 17:07:48-00:00 !antona
Better gcc detection in 'configure.in'. (Szakacsits Szabolcs)

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/08 14:12:00-00:00 !antona
ntfs_readdir() has arrived.

2002/06/06 20:47:28-00:00 !antona
The beginning of the directory operations! Introduce dir.[hc] and ntfs_lookup_inode_by_name().

2002/06/05 20:32:52-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/04 12:12:41-00:00 !antona
Final POSIXification of disk_io functions. (famous last words)

2002/06/02 23:09:43-00:00 !antona
Update changelog and my todo

2002/06/02 23:02:20-00:00 !antona
More fixes and updates.

2002/06/02 13:57:58-00:00 !antona
Fix detection of read-only mounts in volume.c::ntfs_check_mnteent().

2002/06/01 00:41:44-00:00 !antona
huge update!

2002/05/19 18:37:27-00:00 !antona
Commit the change log and current todo file so people have a glimpse of what I am upto...

2002/04/29 12:58:34-00:00 !antona
Finish ntfs_attr_pread and ntfs_attr_mst_pread.

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/27 19:49:09-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/24 23:47:40-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/24 19:02:07-00:00 !antona
Add new API ntfs_attr_{get,put}.

2002/04/24 01:37:36-00:00 !antona
New api call is_boot_sector_ntfs. A few folding help cleanups.

2002/04/23 23:27:32-00:00 !antona
Fixup the force option in mkntfs.c. Change the ntfs_check_if_mounted so it works on system not implementing {set,get,end}mntent, too. Also make it more powerful in telling us not only if something is mounted but also if it is the fs root and if it is read-only.

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/21 01:26:39-00:00 !antona
Cleanup/streamline include file dependencies.

2002/04/20 23:10:18-00:00 !antona
Forgot something

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/20 01:53:02-00:00 !antona
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.

2002/04/19 21:48:31-00:00 !antona
Add a TODO list for the library in form of my personal roadmap. People can use that to pick things to work on if they want...

2002/04/19 21:09:54-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/19 18:23:55-00:00 !antona
Add foundation of new inode API.

2002/04/18 18:15:45-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/18 17:20:05-00:00 !antona
New API function provided by unistr.[ch]: ntfs_mbstoucs()

2002/04/16 20:56:01-00:00 !antona
Add new API unistr.[ch]: ntfs_ucstombs() and make ntfslabel use it

2002/04/16 12:13:52-00:00 !antona
New API function mft.[ch]::read_file_record(). Also some cleanups.

2002/04/15 20:07:58-00:00 !antona
Update

2002/04/15 17:51:26-00:00 !antona
read/write_mft_record(s) are here

2002/04/14 15:26:23-00:00 !antona
Remove find_first_attr and make all users use get_attr_search_ctx + find_attr instead.

2002/04/14 14:20:10-00:00 !antona
Prepare changelog to accept a long list of changes. (-;

2002/04/12 15:35:27-00:00 !antona
Fix hopefully last typo. (-:

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/03/12 21:55:30-00:00 !antona
Update docs and bump version to 1.6.0.

2002/03/12 21:48:27-00:00 !antona
Change version numbers of mkntfs and ntfsfix to match linux-ntfs release and add options to mkntfs to disable content indexing on the volume and to enable compression on the volume.

2002/03/12 00:34:35-00:00 !antona
Fix typo in mkntfs usage information.

2002/02/01 02:46:16-00:00 !antona
Attempt to fix compile warnings on powerpc.

2002/01/26 03:21:07-00:00 !antona
Preparations for 1.5.1 release.

2002/01/26 02:28:29-00:00 !antona
Update docs.

2002/01/10 11:04:44-00:00 !antona
Updates to spec file for dependencies.

2002/01/10 10:54:27-00:00 !antona
Updates

2002/01/10 10:43:04-00:00 !antona
Update changelog.

2002/01/10 10:19:29-00:00 !antona
Update changelog.

2001/12/15 05:28:50-00:00 !antona
Fix abortion in mkntfs due to weird error code EINVAL in seek.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/10 19:02:37-00:00 !antona
Update changelog with release version numbers.

2001/11/10 14:17:39-00:00 !antona
Enhance mkntfs' device size determination.

2001/11/09 23:36:16-00:00 !antona
Bug fixes

2001/11/09 21:30:51-00:00 !antona
Considering added functionality change version number to 1.3.0, update docs and mkntfs man page.

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/11/09 18:24:32-00:00 !antona
Updates to docs, layout.h and ntfsfix to support Windows XP NTFS

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/08/02 01:44:56-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/07/25 23:11:49-00:00 !antona
Update text files

2001/07/25 13:43:10-00:00 !antona
1.0.2 release. Mkntfs now in sbin and minor bugfix to mkntfs man page.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/10 18:30:16-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/02/02 01:15:17-00:00 !antona
Updated documentation and other text files. Preparing for initial release.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap b81549f25c add ntfsundelete to the build. fix rpm build. trawl for typos.
2002/07/06 20:07:58-00:00 !antona
New API for compressing run lists into mapping pairs arrays and adapt mkntfs to that API. Addition of ntfs_walk_attrs().

2002/07/03 21:56:00-00:00 !antona
Updates

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2001/01/30 12:29:03-00:00 !antona
And the last move into CVS. The make files. (Note: compilation is untested
and all changes have been done without testing so if it doesn't compile at
the moment don't be too surprised.)

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 0266d85b79 add ntfsundelete to the build. fix rpm build. trawl for typos.
2002/07/03 14:38:40-00:00 !antona
Cleanup the build process a bit.

2002/06/05 20:32:53-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/02 23:18:56-00:00 !antona
Updates to spec file and make files.

2002/04/12 15:28:09-00:00 !antona
Fix typo.

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/03/12 21:55:30-00:00 !antona
Update docs and bump version to 1.6.0.

2002/01/26 03:21:07-00:00 !antona
Preparations for 1.5.1 release.

2002/01/26 03:08:57-00:00 !flatcap
typo

2002/01/26 02:28:29-00:00 !antona
Update docs.

2002/01/10 11:25:16-00:00 !antona
...

2002/01/10 11:24:19-00:00 !antona
grrr

2002/01/10 11:20:31-00:00 !antona
Now did it right

2002/01/10 11:04:44-00:00 !antona
Updates to spec file for dependencies.

2002/01/10 10:54:27-00:00 !antona
Updates

2002/01/10 10:19:29-00:00 !antona
Update changelog.

2001/12/06 01:16:32-00:00 !antona
Update version number for ntfsfix

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/10 16:24:12-00:00 !antona
More logfile size updates so we are more sane with floppies.

2001/11/10 14:47:39-00:00 !antona
Debug display bug fixes.

2001/11/10 14:27:38-00:00 !antona
And more typos.

2001/11/10 14:25:33-00:00 !antona
Oops. Didn't compile. Typo

2001/11/10 14:22:15-00:00 !antona
Remove obsoleted disklabel.h stuff.

2001/11/10 14:17:39-00:00 !antona
Enhance mkntfs' device size determination.

2001/11/10 03:06:05-00:00 !antona
Bug fixes and debug output enhancements.

2001/11/09 23:36:16-00:00 !antona
Bug fixes

2001/11/09 21:30:51-00:00 !antona
Considering added functionality change version number to 1.3.0, update docs and mkntfs man page.

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/11/09 18:24:32-00:00 !antona
Updates to docs, layout.h and ntfsfix to support Windows XP NTFS

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/08/02 01:44:56-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/07/25 23:11:49-00:00 !antona
Update text files

2001/07/25 13:44:57-00:00 !antona
Forgot to update spec.in

2001/07/25 13:43:10-00:00 !antona
1.0.2 release. Mkntfs now in sbin and minor bugfix to mkntfs man page.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/16 19:59:51-00:00 !antona
Update ntfsdump_logfile and dumplog and the relevant textfiles.

2001/06/16 19:23:39-00:00 !antona
Version number update

2001/06/16 19:22:45-00:00 !antona
Get rid of logfile stuff for mkntfs as it is clearly not needed.

2001/06/13 19:04:20-00:00 !antona
Final prerelease. Updated version numbers of mkntfs in readme and rpm spec files.

2001/06/11 19:11:37-00:00 !antona
Fix rpm generation.
Circumvent configure bug by cheating in configure.in moving around nonopt to
host and setting nonopt to NONE.

2001/06/10 18:30:16-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/06/10 15:54:20-00:00 !antona
Linux-NTFS 0.1.0-pre1
=====================
-fixed up ntfsfix and ntfsdump_logfile
-corrected stuff
-several bug fixes
-fixed (hopefully) final bug with mkntfs (sd generator was wrong due to brain'o)
-mkntfs now completed, only need to add a few command line options before first
public release.
-rpm generation file updated and autostrip modified to make use of install-stip
make target instead of stripping manually
-made bootsector check verbosity during mount dependent on --enable-debug
configure option.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/03 02:03:35-00:00 !antona
More files.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 4826626026 add ntfsundelete to the build. fix rpm build. trawl for typos.
2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/03/12 21:55:30-00:00 !antona
Update docs and bump version to 1.6.0.

2002/01/26 03:21:07-00:00 !antona
Preparations for 1.5.1 release.

2002/01/26 02:28:29-00:00 !antona
Update docs.

2002/01/10 10:54:27-00:00 !antona
Updates

2001/11/09 21:30:51-00:00 !antona
Considering added functionality change version number to 1.3.0, update docs and mkntfs man page.

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/11/09 18:24:32-00:00 !antona
Updates to docs, layout.h and ntfsfix to support Windows XP NTFS

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/08/02 01:44:56-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/07/25 23:11:49-00:00 !antona
Update text files

2001/07/25 13:43:10-00:00 !antona
1.0.2 release. Mkntfs now in sbin and minor bugfix to mkntfs man page.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/16 19:59:51-00:00 !antona
Update ntfsdump_logfile and dumplog and the relevant textfiles.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/10 19:09:45-00:00 !antona
news update

2001/06/10 18:30:16-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/02/02 01:15:17-00:00 !antona
Updated documentation and other text files. Preparing for initial release.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 35e8097a0d add ntfsundelete to the build. fix rpm build. trawl for typos.
2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/03/12 21:55:30-00:00 !antona
Update docs and bump version to 1.6.0.

2002/01/26 02:28:29-00:00 !antona
Update docs.

2002/01/10 10:54:27-00:00 !antona
Updates

2002/01/10 10:19:29-00:00 !antona
Update changelog.

2001/12/06 01:16:32-00:00 !antona
Update version number for ntfsfix

2001/11/10 16:24:11-00:00 !antona
More logfile size updates so we are more sane with floppies.

2001/11/10 14:47:39-00:00 !antona
Debug display bug fixes.

2001/11/10 14:27:38-00:00 !antona
And more typos.

2001/11/10 14:25:33-00:00 !antona
Oops. Didn't compile. Typo

2001/11/10 14:22:15-00:00 !antona
Remove obsoleted disklabel.h stuff.

2001/11/10 14:17:39-00:00 !antona
Enhance mkntfs' device size determination.

2001/11/10 03:06:05-00:00 !antona
Bug fixes and debug output enhancements.

2001/11/09 23:36:16-00:00 !antona
Bug fixes

2001/11/09 21:30:51-00:00 !antona
Considering added functionality change version number to 1.3.0, update docs and mkntfs man page.

2001/11/09 18:24:32-00:00 !antona
Updates to docs, layout.h and ntfsfix to support Windows XP NTFS

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/08/02 01:44:56-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/07/25 23:11:49-00:00 !antona
Update text files

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/16 19:59:51-00:00 !antona
Update ntfsdump_logfile and dumplog and the relevant textfiles.

2001/06/16 19:23:39-00:00 !antona
Version number update

2001/06/16 19:22:45-00:00 !antona
Get rid of logfile stuff for mkntfs as it is clearly not needed.

2001/06/13 19:04:20-00:00 !antona
Final prerelease. Updated version numbers of mkntfs in readme and rpm spec files.

2001/06/11 19:11:37-00:00 !antona
Fix rpm generation.
Circumvent configure bug by cheating in configure.in moving around nonopt to
host and setting nonopt to NONE.

2001/06/10 18:30:16-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/02/02 01:15:17-00:00 !antona
Updated documentation and other text files. Preparing for initial release.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 290baa4af2 a couple of new bits, nothing original
2002/07/16 23:41:43-00:00 !flatcap
sort out the output and some of the return values

2002/07/15 16:30:41-00:00 !flatcap
more tidying, more comments

2002/07/14 15:53:03-00:00 !flatcap
perform some checks on the device we're opening

2002/07/14 14:49:22-00:00 !flatcap
open vol read-only, filter by last mod time

2002/07/14 11:20:20-00:00 !flatcap
filename regex matching works, default to case insensitive matching

2002/07/13 16:33:00-00:00 !flatcap
start to fill in the options

2002/07/11 13:18:12-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/01 13:30:28-00:00 !flatcap
lots of comments

2002/06/30 22:46:51-00:00 !flatcap
undelete -> ntfsundelete

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap c90602cacc AT_NONAME -> AT_UNNAMED
2002/07/14 17:24:58-00:00 !szaka
Remove obsolote/unused set_attribute_value()

2002/07/14 17:21:32-00:00 !szaka
Move ntfs_set_volume_flags() from attrib[ch] to volume.[ch]

2002/07/14 17:16:52-00:00 !szaka
Merge set_ntfs_volume_flags() and code from ntfsfix as a new library
function: ntfs_set_volume_flags(). Note, ntfs_set_volume_flags() is
moving to volume.[ch]

2002/07/12 08:18:15-00:00 !antona
sorry flatcap. - remove a lot of reorganization which rips the code into incomprehensible order. - all functions were and are again now placed together by logicnot by sheer randomness. - functions which call each other are placed together for example...

2002/07/11 23:44:13-00:00 !flatcap
new function headers and a few function moves

2002/07/11 16:20:33-00:00 !flatcap
whitespace and include guards

2002/07/09 19:17:49-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

2002/07/09 00:06:49-00:00 !antona
fix the cleanup...

2002/07/09 00:02:31-00:00 !antona
A little (potential) fix or better call it bug prevention and some cleanup.

2002/07/08 23:27:15-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/08 06:23:22-00:00 !antona
Don't use string concatenation with __FUNCTION__ as gcc-3.x don't like it.

2002/07/08 00:09:41-00:00 !antona
Implement attrib.[hc]::ntfs_rl_pwrite(). Fix a dumb bug in ntfs_attr_pwrite().

2002/07/06 20:07:59-00:00 !antona
New API for compressing run lists into mapping pairs arrays and adapt mkntfs to that API. Addition of ntfs_walk_attrs().

2002/07/05 21:15:31-00:00 !uid28698
- Enable enumeration of attributes using ntfs_lookup_attr() which is
  requested by passing a type of AT_UNUSED (or simply zero) to
  ntfs_lookup_attr(). (Based on initial patch by Szakacsits Szabolcs.)
- Fix two minor buglets in ntfs_find_external_attr() where we would
  continue the search when we detect a mismatched type and/or name
  instead of aborting and returning error EIO to flag the corruption.

2002/07/03 21:56:00-00:00 !antona
Updates

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/07/01 23:43:53-00:00 !flatcap
damn, the wrong name_offset

2002/07/01 23:22:35-00:00 !flatcap
endian fix

2002/06/08 14:12:01-00:00 !antona
ntfs_readdir() has arrived.

2002/06/07 01:16:20-00:00 !antona
Updates

2002/06/05 20:32:53-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/05 09:19:44-00:00 !antona
ntfs_attr_pread() fixes and finished 1st draft of ntfs_attr_pwrite().

2002/06/05 00:29:18-00:00 !antona
Make ntfs_attr_pread work with resident attributes and start on ntfs_attr_pwrite (incomplete!).

2002/06/02 23:02:20-00:00 !antona
More fixes and updates.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/29 12:58:34-00:00 !antona
Finish ntfs_attr_pread and ntfs_attr_mst_pread.

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/27 19:49:09-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/24 23:47:42-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/24 19:02:07-00:00 !antona
Add new API ntfs_attr_{get,put}.

2002/04/24 01:37:37-00:00 !antona
New api call is_boot_sector_ntfs. A few folding help cleanups.

2002/04/24 00:47:56-00:00 !flatcap
the phantom asterisk eater strikes

2002/04/23 17:00:03-00:00 !flatcap
off by one error in realloc

2002/04/23 16:10:48-00:00 !flatcap
bugfix for the transplanted runlist functions
a few bits to help folding

2002/04/23 11:11:36-00:00 !flatcap
*ahem*

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/21 10:11:36-00:00 !antona
Fix a buglet in the library and same in ntfslabel.c

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/19 21:21:46-00:00 !antona
Remove compile time warning...

2002/04/19 21:09:55-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/16 12:13:53-00:00 !antona
New API function mft.[ch]::read_file_record(). Also some cleanups.

2002/04/15 18:54:06-00:00 !antona
Update library for the new API.

2002/04/15 17:51:26-00:00 !antona
read/write_mft_record(s) are here

2002/04/15 00:42:07-00:00 !antona
Big rewrite of disk_io.c. Now should have stable API for low level disk access. Move all mft record related stuff from disk_io.c to mft.c.

2002/04/14 15:26:23-00:00 !antona
Remove find_first_attr and make all users use get_attr_search_ctx + find_attr instead.

2002/04/14 14:08:29-00:00 !antona
Cleanup library code. Throw away unused stuff.

2001/06/13 00:40:49-00:00 !antona
No more bugs (known) except issue with last sector not being writable when it is
an odd number.

2001/06/09 00:25:55-00:00 !antona
mkntfs delayed. more reverse engineering required to determine exact method of
index entry collation. first few helper functions are already done and entered
into ntfslib in unistr.c

2001/06/01 02:07:25-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/12 22:37:21-00:00 !antona
Add a description and structure for holding attributes in memory. No code to
use it yet but it's a start. The design is geared with the ideas of making
searching for attributes and using/implementing the search context as easy as
possible, integrating the attributes into their mft_entries and maintining a
fast sync volume path.
Comments welcome.

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/08 01:58:29-00:00 !antona
User space conversion of locking complete. I settled for using simple spinlocks
and atomic variables and instead of deadlocking/livelocking when using
spin_lock(), use spin_trylock() in a while letting go of the cpu between each
call and making a maximum of 100 iterations (or we return EDEADLK error code).

This is not the most efficient way, especially as can't have multiple readers
but it is the simplest way to go about things.

Should now have (almost) all required helper functions for dealing with mft
entries implemented.

Now need the file handling and then convert the whole project to use the new
code and then can finally get back to work on attribute searching...

2001/04/05 20:14:45-00:00 !antona
Commit of current state of development including locking a la kernel.
This doesn't work on user space (semaphores don't work).
Just want to have it committed. Will take out locking / modify it where
necessary to use pthreads ASAP.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/15 23:13:45-00:00 !antona
Current status of library. (Still not working.)

2001/03/07 01:17:33-00:00 !antona
Renamed the unicode files and introduced more code. Finished the new
find_first/next_attr() interface functions. Next on my list are functions
supporting attribute lists...

2001/03/06 02:10:55-00:00 !antona
Allow variable length upcase table.
Progressing on find_next_attr().

2001/03/05 03:04:40-00:00 !antona
Corresponding changes to the library.

2001/03/02 15:05:53-00:00 !antona
Commit latest library state. !!!NOTE!!! This breaks everything!!! I'm in the
middle of rewritting the find_attribute stuff in attrib.c at the moment.

2001/01/30 12:55:21-00:00 !antona
Fixed the compilation issues.

2001/01/30 00:13:11-00:00 !antona
Added in the current state of attribute handling to libntfs.
Now just missing the make files to make a first public release of ntfsfix!

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap b30305bf01 AT_NONAME -> AT_UNNAMED
2002/07/14 17:24:58-00:00 !szaka
Remove obsolote/unused set_attribute_value()

2002/07/14 17:21:32-00:00 !szaka
Move ntfs_set_volume_flags() from attrib[ch] to volume.[ch]

2002/07/14 17:16:52-00:00 !szaka
Merge set_ntfs_volume_flags() and code from ntfsfix as a new library
function: ntfs_set_volume_flags(). Note, ntfs_set_volume_flags() is
moving to volume.[ch]

2002/07/11 16:20:32-00:00 !flatcap
whitespace and include guards

2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/09 19:17:48-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

2002/07/08 23:27:15-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/08 00:09:41-00:00 !antona
Implement attrib.[hc]::ntfs_rl_pwrite(). Fix a dumb bug in ntfs_attr_pwrite().

2002/07/06 20:07:59-00:00 !antona
New API for compressing run lists into mapping pairs arrays and adapt mkntfs to that API. Addition of ntfs_walk_attrs().

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/30 12:52:25-00:00 !antona
Little something or other...

2002/06/05 20:32:53-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/05 00:29:18-00:00 !antona
Make ntfs_attr_pread work with resident attributes and start on ntfs_attr_pwrite (incomplete!).

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/29 12:58:34-00:00 !antona
Finish ntfs_attr_pread and ntfs_attr_mst_pread.

2002/04/27 19:49:09-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/24 23:47:42-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/24 19:02:07-00:00 !antona
Add new API ntfs_attr_{get,put}.

2002/04/23 11:02:59-00:00 !antona
Initial proposal for ntfs attribute ntfs_attr structure typedef.

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/19 21:09:54-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/15 17:51:26-00:00 !antona
read/write_mft_record(s) are here

2002/04/14 13:56:45-00:00 !antona
cleanup header files.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/08 01:58:29-00:00 !antona
User space conversion of locking complete. I settled for using simple spinlocks
and atomic variables and instead of deadlocking/livelocking when using
spin_lock(), use spin_trylock() in a while letting go of the cpu between each
call and making a maximum of 100 iterations (or we return EDEADLK error code).

This is not the most efficient way, especially as can't have multiple readers
but it is the simplest way to go about things.

Should now have (almost) all required helper functions for dealing with mft
entries implemented.

Now need the file handling and then convert the whole project to use the new
code and then can finally get back to work on attribute searching...

2001/04/05 20:14:45-00:00 !antona
Commit of current state of development including locking a la kernel.
This doesn't work on user space (semaphores don't work).
Just want to have it committed. Will take out locking / modify it where
necessary to use pthreads ASAP.

2001/04/02 22:28:39-00:00 !antona
Added cvs Id header and removed some outofdate stuff.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/31 15:25:19-00:00 !antona
Added a name comparison function.

2001/03/26 14:50:58-00:00 !antona
Fix a few typos.

2001/03/26 03:35:35-00:00 !antona
New attribute searching API header part complete.
This shouldn't change any more, except for the search context structure,
which might be simplified at some point.

2001/03/22 13:16:32-00:00 !antona
Clarified the reparse point tag flags.

2001/03/15 23:12:45-00:00 !antona
About time to do a new commit...

2001/03/05 03:15:08-00:00 !antona
Forgot a few...

2001/03/05 02:45:35-00:00 !antona
Renamed things, broke everything. Should be stabilized now in the headers.
Still reworking find attribute stuff but at least I have an idea of how I want
to do it now.

2001/03/04 14:28:13-00:00 !antona
Fixes.

2001/03/03 06:52:39-00:00 !antona
Finished entering security related headers.

2001/03/03 00:11:17-00:00 !antona
Mostly finished adding the $Secure information.

2001/03/02 15:03:56-00:00 !antona
Update to latest include files.

2001/02/03 02:03:35-00:00 !antona
More files.

2001/01/30 12:55:21-00:00 !antona
Fixed the compilation issues.

2001/01/30 12:29:03-00:00 !antona
And the last move into CVS. The make files. (Note: compilation is untested
and all changes have been done without testing so if it doesn't compile at
the moment don't be too surprised.)

2001/01/30 00:13:11-00:00 !antona
Added in the current state of attribute handling to libntfs.
Now just missing the make files to make a first public release of ntfsfix!

2001/01/28 05:49:57-00:00 !antona
More header development. AttrDef description.

2001/01/27 14:22:02-00:00 !antona
Added a logfile dumper as a new utility.
Almost finished the first ntfsfix release. (Still missingin CVS are attrib.c
for ntfslib and the makefiles to build everything.)
Fixes for nested packed structure/union typedefs as gcc doesn't automatically
nest the __attribute__ ((__packed__)), even though according to the gcc info
page it does. (Thanks to Yuri Per <yuri@acronis.com> for pointing this out.)

2001/01/26 02:36:10-00:00 !antona
More work on attrib.h.

2001/01/24 02:13:24-00:00 !antona
Add a bunch of headers (attrib.h is work in progress).

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap b47fe4d7ad AT_NONAME -> AT_UNNAMED
2002/07/14 17:21:32-00:00 !szaka
Move ntfs_set_volume_flags() from attrib[ch] to volume.[ch]

2002/07/14 13:18:01-00:00 !szaka
ntfs_reset_logfile(): delete a NOOP

2002/07/14 12:34:44-00:00 !szaka
ntfs_reset_logfile(): free resources in error, handle partial I/O

2002/07/12 12:38:54-00:00 !szaka
Rewrote $LogFile reset using new inode API and moved it from ntfsfix to
libntfs as ntfs_reset_logfile(). ntfsresize also resets log file.

2002/07/12 08:18:15-00:00 !antona
sorry flatcap. - remove a lot of reorganization which rips the code into incomprehensible order. - all functions were and are again now placed together by logicnot by sheer randomness. - functions which call each other are placed together for example...

2002/07/12 07:10:44-00:00 !szaka
NTFS_V* version macros and ntfs_is_version_supported() added.
Modified ntfsfix and ntfsresize to use them.

2002/07/11 23:44:13-00:00 !flatcap
new function headers and a few function moves

2002/07/11 16:20:34-00:00 !flatcap
whitespace and include guards

2002/07/09 19:17:49-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

2002/07/09 01:01:40-00:00 !flatcap
more noname changes

2002/07/08 23:27:16-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/07 01:16:20-00:00 !antona
Updates

2002/06/02 23:02:20-00:00 !antona
More fixes and updates.

2002/06/02 13:57:59-00:00 !antona
Fix detection of read-only mounts in volume.c::ntfs_check_mnteent().

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/27 19:49:09-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/25 08:22:14-00:00 !antona
Can't type..

2002/04/25 08:19:32-00:00 !antona
Improve function description.

2002/04/23 23:27:33-00:00 !antona
Fixup the force option in mkntfs.c. Change the ntfs_check_if_mounted so it works on system not implementing {set,get,end}mntent, too. Also make it more powerful in telling us not only if something is mounted but also if it is the fs root and if it is read-only.

2002/04/23 08:37:07-00:00 !antona
Fix minor buglet in volume.c and tidy up white space.

2002/04/23 08:29:13-00:00 !mattjf
Minor change to ntfs_check_if_mounted() description.

2002/04/23 08:25:41-00:00 !mattjf
Code cleanup.
Removed check_mount() and added a generic ntfs_check_if_mounted()
 function to the library
Better error checking

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/20 23:09:43-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/20 01:53:02-00:00 !antona
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.

2002/04/19 21:09:55-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/16 20:56:01-00:00 !antona
Add new API unistr.[ch]: ntfs_ucstombs() and make ntfslabel use it

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/16 12:13:53-00:00 !antona
New API function mft.[ch]::read_file_record(). Also some cleanups.

2002/04/15 20:04:28-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/15 19:02:41-00:00 !antona
Really fix the library and mkntfs while at it.

2002/04/15 18:54:07-00:00 !antona
Update library for the new API.

2002/04/15 00:42:08-00:00 !antona
Big rewrite of disk_io.c. Now should have stable API for low level disk access. Move all mft record related stuff from disk_io.c to mft.c.

2002/04/14 14:08:30-00:00 !antona
Cleanup library code. Throw away unused stuff.

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/04/11 23:10:59-00:00 !flatcap
Matt Fanto's changes to retrieve the volume name and a utility to print it

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/06/10 15:54:20-00:00 !antona
Linux-NTFS 0.1.0-pre1
=====================
-fixed up ntfsfix and ntfsdump_logfile
-corrected stuff
-several bug fixes
-fixed (hopefully) final bug with mkntfs (sd generator was wrong due to brain'o)
-mkntfs now completed, only need to add a few command line options before first
public release.
-rpm generation file updated and autostrip modified to make use of install-stip
make target instead of stripping manually
-made bootsector check verbosity during mount dependent on --enable-debug
configure option.

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 14:29:12-00:00 !antona
Almost fixed compilaton. Remember to declare a struct type with
struct NAME { declaration }; rather than the bogus struct { declaration NAME };
then can use typedef NAME othername; on a forward declaration of NAME
(struct NAME;) and all is fine...

2001/04/11 11:49:16-00:00 !antona

Header file reorganisation so that it compiles.

2001/04/10 23:37:19-00:00 !antona
Ok, ntfsd was a mistake for userspace. It increases complexity no end while
not giving us much functionality. Lets get it working and then worry about the
kernel. - As it was the idea originally anyway, so this is just a return on the
right track. (-8

We keep the timer and signal handler but the only thing we do is to set a bool
flag (ntfs_need_sync) and we will just check this in appropriate places and
if it is true we call ntfs_sync_volumes() which sets it back to false. This
means no more locking at all of any description and no need to worry about the
signal handler interrupting things in bad ways and/or at bad times in the main
code.

2001/04/09 00:05:37-00:00 !antona
More or less finished file handling. (Probably some useful functions are
still missing but they will be implemented as need arises.)

One thing that is stupid at the moment is we don't limit the amount of
cached mft_records so if you were to load loads the machine would eventually
run out of memory... Can't happen with files as they are limited to 1000,
unless you are short of memory. (Hard limit at the moment, set in ntfs_mount().
Maybe ntfsd should be monitoring memory usage and be throwing out unused cache
entries and closed_files? That would mean to have locking everywhere, though.)

Still missing: - Convert old code to use new stuff. - Add non-resident
attributes somewhere. Either into the mft_entry structure or into the
ntfs_file structure, but which? At the moment I tend to mft_entry so they can
be synced together with the entries by ntfsd.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/08 01:58:29-00:00 !antona
User space conversion of locking complete. I settled for using simple spinlocks
and atomic variables and instead of deadlocking/livelocking when using
spin_lock(), use spin_trylock() in a while letting go of the cpu between each
call and making a maximum of 100 iterations (or we return EDEADLK error code).

This is not the most efficient way, especially as can't have multiple readers
but it is the simplest way to go about things.

Should now have (almost) all required helper functions for dealing with mft
entries implemented.

Now need the file handling and then convert the whole project to use the new
code and then can finally get back to work on attribute searching...

2001/04/05 20:14:45-00:00 !antona
Commit of current state of development including locking a la kernel.
This doesn't work on user space (semaphores don't work).
Just want to have it committed. Will take out locking / modify it where
necessary to use pthreads ASAP.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/31 15:27:34-00:00 !antona
Added new name comparison function.

2001/03/06 02:10:55-00:00 !antona
Allow variable length upcase table.
Progressing on find_next_attr().

2001/03/05 03:04:40-00:00 !antona
Corresponding changes to the library.

2001/03/02 15:05:54-00:00 !antona
Commit latest library state. !!!NOTE!!! This breaks everything!!! I'm in the
middle of rewritting the find_attribute stuff in attrib.c at the moment.

2001/01/30 12:55:21-00:00 !antona
Fixed the compilation issues.

2001/01/25 22:25:43-00:00 !antona
More files added to ntfs lib. Fixed some consistency problems.

2001/01/25 14:00:43-00:00 !antona
Added volume.c code and fixed some typos and inconsistencies.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 1acb46ffeb AT_NONAME -> AT_UNNAMED
2002/07/12 08:18:15-00:00 !antona
sorry flatcap. - remove a lot of reorganization which rips the code into incomprehensible order. - all functions were and are again now placed together by logicnot by sheer randomness. - functions which call each other are placed together for example...

2002/07/11 23:44:13-00:00 !flatcap
new function headers and a few function moves

2002/07/11 16:20:33-00:00 !flatcap
whitespace and include guards

2002/07/09 19:17:49-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

2002/07/08 23:27:16-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/08 06:23:22-00:00 !antona
Don't use string concatenation with __FUNCTION__ as gcc-3.x don't like it.

2002/07/07 19:44:57-00:00 !antona
Change ntfs_read_file_record() not to abort if the inode is not in use. Adapt callers which care to check this themselves.

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/22 10:34:31-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/21 01:13:50-00:00 !antona
Remove commented out include

2002/04/21 01:12:55-00:00 !antona
Fix mkntfs again.

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/20 01:53:02-00:00 !antona
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.

2002/04/19 21:21:46-00:00 !antona
Remove compile time warning...

2002/04/19 21:09:55-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/19 18:23:56-00:00 !antona
Add foundation of new inode API.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap fd8f109ed2 AT_NONAME -> AT_UNNAMED
2002/07/12 08:18:15-00:00 !antona
sorry flatcap. - remove a lot of reorganization which rips the code into incomprehensible order. - all functions were and are again now placed together by logicnot by sheer randomness. - functions which call each other are placed together for example...

2002/07/11 23:44:13-00:00 !flatcap
new function headers and a few function moves

2002/07/11 16:20:33-00:00 !flatcap
whitespace and include guards

2002/07/08 23:27:16-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/08 06:23:22-00:00 !antona
Don't use string concatenation with __FUNCTION__ as gcc-3.x don't like it.

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/08 14:12:01-00:00 !antona
ntfs_readdir() has arrived.

2002/06/06 20:47:33-00:00 !antona
The beginning of the directory operations! Introduce dir.[hc] and ntfs_lookup_inode_by_name().

2002/06/06 15:41:30-00:00 !antona
Add template files for directory handling code.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 94ac119fb4 AT_NONAME -> AT_UNNAMED
2002/07/11 23:44:14-00:00 !flatcap
new function headers and a few function moves

2002/07/11 16:20:34-00:00 !flatcap
whitespace and include guards

2002/07/08 23:27:17-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/08 00:09:41-00:00 !antona
Implement attrib.[hc]::ntfs_rl_pwrite(). Fix a dumb bug in ntfs_attr_pwrite().

2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/07/01 23:18:37-00:00 !mattjf
ntfsinfo update

2002/06/30 21:22:52-00:00 !flatcap
a working undelete program, still very alpha

2002/06/25 23:35:49-00:00 !flatcap
put back locale line, accidentally deleted
put in extra check for inode

2002/06/25 15:17:13-00:00 !flatcap
minor bugfix, free used vars, remove duplicated code

2002/06/02 13:57:59-00:00 !antona
Fix detection of read-only mounts in volume.c::ntfs_check_mnteent().

2002/05/14 01:02:04-00:00 !mattjf

	Bugfix and code cleanup. ntfsinfo now returns the filename

2002/05/13 03:44:10-00:00 !mattjf
Update code

2002/05/11 21:43:56-00:00 !mattjf
	Added new code to ntfsinfo

2002/05/08 05:55:15-00:00 !mattjf

started work on ntfsinfo

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 87e81f1708 AT_NONAME -> AT_UNNAMED
2002/07/11 16:20:34-00:00 !flatcap
whitespace and include guards

2002/07/08 23:27:17-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/07 19:44:57-00:00 !antona
Change ntfs_read_file_record() not to abort if the inode is not in use. Adapt callers which care to check this themselves.

2002/07/03 21:56:01-00:00 !antona
Updates

2002/07/03 14:38:40-00:00 !antona
Cleanup the build process a bit.

2002/07/03 11:30:07-00:00 !flatcap
moved undelete,logprogs to EXTRA_PROGRAMS

2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/21 01:26:39-00:00 !antona
Cleanup/streamline include file dependencies.

2002/04/20 23:09:43-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/20 01:53:03-00:00 !antona
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.

2002/04/19 21:09:55-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/16 12:13:53-00:00 !antona
New API function mft.[ch]::read_file_record(). Also some cleanups.

2002/04/14 15:26:24-00:00 !antona
Remove find_first_attr and make all users use get_attr_search_ctx + find_attr instead.

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/06/16 19:59:51-00:00 !antona
Update ntfsdump_logfile and dumplog and the relevant textfiles.

2001/06/16 00:06:17-00:00 !antona
dumplog now decodes the first 0x5000 bytes of the logfile given on the command
line as fully as possible with the current knowledge of the logfile structures.

2001/06/10 18:30:17-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/06/10 15:54:20-00:00 !antona
Linux-NTFS 0.1.0-pre1
=====================
-fixed up ntfsfix and ntfsdump_logfile
-corrected stuff
-several bug fixes
-fixed (hopefully) final bug with mkntfs (sd generator was wrong due to brain'o)
-mkntfs now completed, only need to add a few command line options before first
public release.
-rpm generation file updated and autostrip modified to make use of install-stip
make target instead of stripping manually
-made bootsector check verbosity during mount dependent on --enable-debug
configure option.

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/11 15:36:54-00:00 !flatcap
fixed typo

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/02 15:06:37-00:00 !antona
Full commit of my current dircetory. New files not yet added.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

2001/01/27 14:22:02-00:00 !antona
Added a logfile dumper as a new utility.
Almost finished the first ntfsfix release. (Still missingin CVS are attrib.c
for ntfslib and the makefiles to build everything.)
Fixes for nested packed structure/union typedefs as gcc doesn't automatically
nest the __attribute__ ((__packed__)), even though according to the gcc info
page it does. (Thanks to Yuri Per <yuri@acronis.com> for pointing this out.)

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 39a5dcc1e4 AT_NONAME -> AT_UNNAMED
2002/07/11 16:20:34-00:00 !flatcap
whitespace and include guards

2002/07/08 23:27:17-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/07 19:44:57-00:00 !antona
Change ntfs_read_file_record() not to abort if the inode is not in use. Adapt callers which care to check this themselves.

2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/29 01:53:55-00:00 !antona
Loads of stuff. Improvements, start on attr pread and attr mst_pread. Write to follow. ntfslabel cleanup and extensions. libntfs cleanups, fixes, etc.

2002/04/28 21:20:27-00:00 !mattjf
ntfslabel - Coverted stoucs to ntfs_mbstoucs()
	  - code cleanup
	  - better error checking
unistr.c  - removed size_t casts from ntfs_mbstoucs()

2002/04/27 19:49:10-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/25 18:31:20-00:00 !mattjf
Code changes - still broke

2002/04/25 18:07:06-00:00 !mattjf
Changes to ntfslabel - still doesn't work yet

2002/04/23 23:27:33-00:00 !antona
Fixup the force option in mkntfs.c. Change the ntfs_check_if_mounted so it works on system not implementing {set,get,end}mntent, too. Also make it more powerful in telling us not only if something is mounted but also if it is the fs root and if it is read-only.

2002/04/23 19:37:18-00:00 !mattjf
Removed the check_mount() function and added ntfs_check_if_mounted() to
mkntfs

2002/04/23 08:25:41-00:00 !mattjf
Code cleanup.
Removed check_mount() and added a generic ntfs_check_if_mounted()
 function to the library
Better error checking

2002/04/21 10:11:36-00:00 !antona
Fix a buglet in the library and same in ntfslabel.c

2002/04/21 09:55:18-00:00 !mattjf
Changes to change_label()

2002/04/16 20:56:01-00:00 !antona
Add new API unistr.[ch]: ntfs_ucstombs() and make ntfslabel use it

2002/04/12 15:23:48-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/04/11 23:11:00-00:00 !flatcap
Matt Fanto's changes to retrieve the volume name and a utility to print it

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 6ce1d4bfed "configure --enable-really-static" and "make strip"
very little has changed, but configure has lots of line numbers
that have shift slightly

2002/07/19 14:53:27-00:00 !flatcap
created a template for ntfswipe

2002/07/18 02:57:56-00:00 !flatcap
add ntfsundelete to the build.  fix rpm build.  trawl for typos.

2002/07/08 15:59:34-00:00 !flatcap
Added Szaka's ntfsresize to the build

2002/07/03 14:38:40-00:00 !antona
Cleanup the build process a bit.

2002/07/03 12:55:52-00:00 !flatcap
added CLEANFILES to delete all the build products

2002/07/03 11:30:06-00:00 !flatcap
moved undelete,logprogs to EXTRA_PROGRAMS

2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/07/01 13:30:28-00:00 !flatcap
lots of comments

2002/06/30 22:46:51-00:00 !flatcap
undelete -> ntfsundelete

2002/06/30 21:22:52-00:00 !flatcap
a working undelete program, still very alpha

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/05/08 22:32:22-00:00 !antona
Update

2002/05/08 05:49:35-00:00 !mattjf


Started work on ntfsinfo

2002/04/25 07:50:34-00:00 !antona
grr. MDK8.1 modified loads of stuff. Put it back with RH7.2

2002/04/24 23:47:42-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/15 20:04:29-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/12 15:23:48-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/01/26 04:32:35-00:00 !antona
RedHat 7.2 - updates

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/09 23:36:17-00:00 !antona
Bug fixes

2001/11/09 19:21:09-00:00 !antona
Fix directories on large clusters and allow 4MB volumes.

2001/08/02 01:44:57-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/07/25 13:43:10-00:00 !antona
1.0.2 release. Mkntfs now in sbin and minor bugfix to mkntfs man page.

2001/07/24 17:56:21-00:00 !antona
OOps . forgot soemthing.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/16 19:22:45-00:00 !antona
Get rid of logfile stuff for mkntfs as it is clearly not needed.

2001/06/15 16:47:47-00:00 !antona
Integrate logfile.c into mkntfs

2001/06/11 19:11:37-00:00 !antona
Fix rpm generation.
Circumvent configure bug by cheating in configure.in moving around nonopt to
host and setting nonopt to NONE.

2001/06/11 04:02:09-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/10 18:30:17-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/06/04 23:38:55-00:00 !antona
Integrate ldm.c into automatic build process.
A bit more on mkntfs and make it compile (do _not_ run as it is - am working on
directory creation so chances are it will hang if you run it or something).

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/02/03 02:03:36-00:00 !antona
More files.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 65a618c053 "configure --enable-really-static" and "make strip"
very little has changed, but configure has lots of line numbers
that have shift slightly

2002/07/19 14:53:27-00:00 !flatcap
created a template for ntfswipe

2002/07/18 02:57:56-00:00 !flatcap
add ntfsundelete to the build.  fix rpm build.  trawl for typos.

2002/07/08 15:59:34-00:00 !flatcap
Added Szaka's ntfsresize to the build

2002/07/03 14:38:40-00:00 !antona
Cleanup the build process a bit.

2002/07/03 12:55:52-00:00 !flatcap
added CLEANFILES to delete all the build products

2002/07/03 11:30:06-00:00 !flatcap
moved undelete,logprogs to EXTRA_PROGRAMS

2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/07/01 13:30:28-00:00 !flatcap
lots of comments

2002/06/30 22:46:50-00:00 !flatcap
undelete -> ntfsundelete

2002/06/30 21:22:51-00:00 !flatcap
a working undelete program, still very alpha

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/05/08 22:32:22-00:00 !antona
Update

2002/05/08 05:49:35-00:00 !mattjf


Started work on ntfsinfo

2002/04/15 20:04:29-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/12 15:23:48-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2001/08/02 01:44:57-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/07/25 13:43:10-00:00 !antona
1.0.2 release. Mkntfs now in sbin and minor bugfix to mkntfs man page.

2001/07/24 17:56:21-00:00 !antona
OOps . forgot soemthing.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/16 19:22:45-00:00 !antona
Get rid of logfile stuff for mkntfs as it is clearly not needed.

2001/06/15 16:47:47-00:00 !antona
Integrate logfile.c into mkntfs

2001/06/11 19:11:37-00:00 !antona
Fix rpm generation.
Circumvent configure bug by cheating in configure.in moving around nonopt to
host and setting nonopt to NONE.

2001/06/10 18:30:17-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/06/04 23:38:55-00:00 !antona
Integrate ldm.c into automatic build process.
A bit more on mkntfs and make it compile (do _not_ run as it is - am working on
directory creation so chances are it will hang if you run it or something).

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/02 02:04:37-00:00 !antona
Everything compiles again! Yey! (Don't know about working though, haven't tried
it... So be careful...)
The definitely final find_{first_}attr() functions are in place. Currently
still no support for attribute lists.
The two new _RE files contain the C-fied and more or less (more less than more
actually) cleaned up functions from the ntfs driver. Once they are cleaned
up (find_attr() is already completed but I left it in the _RE files for future
reference/educational value) and modified to suit my ideas of how they should
work, which are not quite the same as the driver way, they will make it into
attrib.[ch].
If anyone gives the new code a try, I would be interested in whether it worked
or not... (-;

2001/03/02 15:06:37-00:00 !antona
Full commit of my current dircetory. New files not yet added.

2001/02/03 02:03:36-00:00 !antona
More files.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap d1a9dc7c7b "configure --enable-really-static" and "make strip"
very little has changed, but configure has lots of line numbers
that have shift slightly

2002/07/11 16:45:07-00:00 !antona
fix make dist

2002/06/05 20:32:52-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/02 23:18:56-00:00 !antona
Updates to spec file and make files.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/05/08 05:49:35-00:00 !mattjf


Started work on ntfsinfo

2002/04/25 07:50:33-00:00 !antona
grr. MDK8.1 modified loads of stuff. Put it back with RH7.2

2002/04/24 23:47:40-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/15 20:04:22-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/14 14:15:47-00:00 !antona
Cleanups and updates.

2002/01/26 04:32:35-00:00 !antona
RedHat 7.2 - updates

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/09 23:36:16-00:00 !antona
Bug fixes

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/11 19:11:37-00:00 !antona
Fix rpm generation.
Circumvent configure bug by cheating in configure.in moving around nonopt to
host and setting nonopt to NONE.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/03 02:03:35-00:00 !antona
More files.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap 908e9c8f40 "configure --enable-really-static" and "make strip"
very little has changed, but configure has lots of line numbers
that have shift slightly

2002/07/11 16:45:07-00:00 !antona
fix make dist

2002/06/05 20:32:52-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/02 23:18:56-00:00 !antona
Updates to spec file and make files.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/05/08 05:49:35-00:00 !mattjf


Started work on ntfsinfo

2002/04/15 20:04:22-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/14 14:15:47-00:00 !antona
Cleanups and updates.

2001/06/11 19:11:37-00:00 !antona
Fix rpm generation.
Circumvent configure bug by cheating in configure.in moving around nonopt to
host and setting nonopt to NONE.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/03 02:03:35-00:00 !antona
More files.

2001/02/02 01:28:46-00:00 !antona
make dist fixes using more Makefiles.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap e8f0620258 "configure --enable-really-static" and "make strip"
very little has changed, but configure has lots of line numbers
that have shift slightly

2002/07/05 17:07:48-00:00 !antona
Better gcc detection in 'configure.in'. (Szakacsits Szabolcs)

2002/07/03 14:38:40-00:00 !antona
Cleanup the build process a bit.

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/05 20:38:11-00:00 !antona
update

2002/06/02 14:11:09-00:00 !antona
.

2002/06/02 13:57:59-00:00 !antona
Fix detection of read-only mounts in volume.c::ntfs_check_mnteent().

2002/05/08 05:49:35-00:00 !mattjf


Started work on ntfsinfo

2002/04/29 13:00:39-00:00 !antona
Add check for mbsrtowcs

2002/04/24 23:47:40-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/18 18:15:45-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/14 14:15:47-00:00 !antona
Cleanups and updates.

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/03/12 22:02:29-00:00 !antona
Forgot to bump the version number.

2002/01/26 03:21:07-00:00 !antona
Preparations for 1.5.1 release.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/11/10 14:22:15-00:00 !antona
Remove obsoleted disklabel.h stuff.

2001/11/10 14:17:39-00:00 !antona
Enhance mkntfs' device size determination.

2001/11/09 23:38:38-00:00 !antona
Change version to 1.4.0 (keep odd ones for development releases).

2001/11/09 21:30:51-00:00 !antona
Considering added functionality change version number to 1.3.0, update docs and mkntfs man page.

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/11/09 18:24:32-00:00 !antona
Updates to docs, layout.h and ntfsfix to support Windows XP NTFS

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/08/02 01:44:56-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/07/25 23:11:49-00:00 !antona
Update text files

2001/07/25 13:43:10-00:00 !antona
1.0.2 release. Mkntfs now in sbin and minor bugfix to mkntfs man page.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/11 19:11:37-00:00 !antona
Fix rpm generation.
Circumvent configure bug by cheating in configure.in moving around nonopt to
host and setting nonopt to NONE.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/10 18:30:16-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/06/05 10:33:02-00:00 !antona
Update automatic config/make process and mkntfs to use the cvs release tag for
version reporting.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/03 02:03:35-00:00 !antona
More files.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap e3d2bc7ca5 "configure --enable-really-static" and "make strip"
very little has changed, but configure has lots of line numbers
that have shift slightly

2002/07/05 17:07:48-00:00 !antona
Better gcc detection in 'configure.in'. (Szakacsits Szabolcs)

2002/07/03 14:38:40-00:00 !antona
Cleanup the build process a bit.

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/05 20:38:11-00:00 !antona
update

2002/06/02 14:11:08-00:00 !antona
.

2002/06/02 13:57:59-00:00 !antona
Fix detection of read-only mounts in volume.c::ntfs_check_mnteent().

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/05/08 05:49:35-00:00 !mattjf


Started work on ntfsinfo

2002/04/29 13:00:32-00:00 !antona
Add check for mbsrtowcs

2002/04/25 07:50:33-00:00 !antona
grr. MDK8.1 modified loads of stuff. Put it back with RH7.2

2002/04/24 23:47:40-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/18 18:15:45-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/14 14:15:47-00:00 !antona
Cleanups and updates.

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2002/03/12 22:02:29-00:00 !antona
Forgot to bump the version number.

2002/01/26 04:32:35-00:00 !antona
RedHat 7.2 - updates

2002/01/26 03:21:07-00:00 !antona
Preparations for 1.5.1 release.

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/10 14:22:15-00:00 !antona
Remove obsoleted disklabel.h stuff.

2001/11/10 14:17:39-00:00 !antona
Enhance mkntfs' device size determination.

2001/11/09 23:38:38-00:00 !antona
Change version to 1.4.0 (keep odd ones for development releases).

2001/11/09 23:36:16-00:00 !antona
Bug fixes

2001/11/09 21:30:51-00:00 !antona
Considering added functionality change version number to 1.3.0, update docs and mkntfs man page.

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/08/02 01:44:56-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/07/25 23:11:49-00:00 !antona
Update text files

2001/07/25 13:43:10-00:00 !antona
1.0.2 release. Mkntfs now in sbin and minor bugfix to mkntfs man page.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/11 19:11:37-00:00 !antona
Fix rpm generation.
Circumvent configure bug by cheating in configure.in moving around nonopt to
host and setting nonopt to NONE.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/10 18:30:16-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/06/05 10:33:02-00:00 !antona
Update automatic config/make process and mkntfs to use the cvs release tag for
version reporting.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/03 02:03:35-00:00 !antona
More files.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!flatcap aaf8f8e036 Initial revision 2002-08-22 18:09:47 +00:00
!antona 769d28a550 little mod to ntfsfix manpage
2001/08/02 01:44:57-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 06c55716fc huge update!
2002/04/25 07:50:33-00:00 !antona
grr. MDK8.1 modified loads of stuff. Put it back with RH7.2

2002/04/24 23:47:40-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/01/26 04:32:35-00:00 !antona
RedHat 7.2 - updates

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/09 23:36:16-00:00 !antona
Bug fixes

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona bc2abe3c3f grr. MDK8.1 modified loads of stuff. Put it back with RH7.2
2002/04/24 23:47:41-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/01/26 04:32:35-00:00 !antona
RedHat 7.2 - updates

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/09 23:36:17-00:00 !antona
Bug fixes

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/07/24 17:41:01-00:00 !antona
Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/03 02:03:35-00:00 !antona
More files.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona c6a6056715 and a final revert i forgot
2002/07/11 23:44:13-00:00 !flatcap
new function headers and a few function moves

2002/07/11 16:20:32-00:00 !flatcap
whitespace and include guards

2002/07/11 13:18:11-00:00 !flatcap
start to break up the dependency loops in the header files

2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/06 20:47:31-00:00 !antona
The beginning of the directory operations! Introduce dir.[hc] and ntfs_lookup_inode_by_name().

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/19 21:21:46-00:00 !antona
Remove compile time warning...

2002/04/19 21:09:55-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/19 18:27:45-00:00 !antona
Bah. Typo fix.

2002/04/19 18:23:56-00:00 !antona
Add foundation of new inode API.

2002/04/15 22:35:07-00:00 !antona
Preliminary ntfs_inode structure. We shall see if that is all we need. (-;

2002/04/14 13:58:54-00:00 !antona
Tidyup last cleanups

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 6f714bdafe Updates
2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/15 20:04:31-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2001/06/10 02:25:38-00:00 !antona
mkntfs alpha 3
==============
- Several bugfixes (root dir link count wasn't incremented, mftmirror usns
weren't correct [off by one too high], etc).
- Implement new $UpCase generation using flatcap (Richard Russon)'s algorithm
for generating it. This dropped the stripped mkntfs executable from 204kb down
to 78kb in size. A whopping 62% size decrease! Yey! And the source code dropped
ny over 600kb in size as well. And compilation got quicker, too.

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 72a796dcc5 Updates
2002/05/06 14:14:07-00:00 !antona
Update ntfslabel manpage

2002/04/12 15:25:04-00:00 !antona
Add the manpage.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona e7450aab8a Updates
2002/03/12 21:48:27-00:00 !antona
Change version numbers of mkntfs and ntfsfix to match linux-ntfs release and add options to mkntfs to disable content indexing on the volume and to enable compression on the volume.

2001/11/09 21:30:52-00:00 !antona
Considering added functionality change version number to 1.3.0, update docs and mkntfs man page.

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/07/25 13:43:10-00:00 !antona
1.0.2 release. Mkntfs now in sbin and minor bugfix to mkntfs man page.

2001/06/13 19:00:56-00:00 !antona
More cleanups and man page final updates/polishing.

2001/06/11 04:02:09-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/10 18:30:17-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona ce79075614 Updates
2001/01/23 15:07:31-00:00 !antona
Initial revision

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 1521ab799f Update todo file.
2002/07/06 20:22:57-00:00 !antona
Typo fix

2002/06/08 14:33:09-00:00 !antona
Few odds and ends.

2002/06/07 01:16:20-00:00 !antona
Updates

2002/06/05 20:32:53-00:00 !antona
Mft mirror now updated from ntfs_write_mft_record, yey! Fixup ntfstools accordingly.

2002/06/01 00:41:45-00:00 !antona
huge update!

2002/05/19 18:37:27-00:00 !antona
Commit the change log and current todo file so people have a glimpse of what I am upto...

2002/05/08 22:30:29-00:00 !antona
Config file updates, add missing TODO.ntfsinfo

2002/04/20 23:09:42-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/19 21:48:31-00:00 !antona
Add a TODO list for the library in form of my personal roadmap. People can use that to pick things to work on if they want...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 98d7cd1cd3 Update build system with new document.
2001/06/01 02:07:24-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/02 01:28:46-00:00 !antona
make dist fixes using more Makefiles.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 06f77e49ca Update
2002/05/08 06:03:45-00:00 !mattjf

added ntfsinfo man page

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 603cbf0b79 More header development. AttrDef description.
(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona b4f400cb6e More files.
2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 57bffbc373 More files.
(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 000cb71a75 Minor updates and restructuring the distribution. See NEWS and ChangeLog for
details.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/02 00:30:25-00:00 !antona
Had to change symbolic links to files to get cvs to accept them.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 44151c5f55 It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/03 02:03:35-00:00 !antona
More files.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 1c83be791e It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/02 00:30:25-00:00 !antona
Had to change symbolic links to files to get cvs to accept them.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona ca715933a0 It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona cb99e98c69 Had to change symbolic links to files to get cvs to accept them.
(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 79d44e2d95 Forgot that one.
2001/06/10 18:30:16-00:00 !antona
Preparations for the 0.1.0 release. Updating documentation and information.
Updating rpm generation and added mkntfs man page which currently is not
accurate as it shows all the mke2fs options in it while mkntfs doesn't actually
accept any options except for device at all but it is a good starting point.

2001/02/02 01:15:17-00:00 !antona
Updated documentation and other text files. Preparing for initial release.

2001/02/02 00:30:25-00:00 !antona
Had to change symbolic links to files to get cvs to accept them.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 97b30713bf Concolidate TODO files
2001/03/26 03:39:59-00:00 !antona
Updates

2001/01/30 12:29:03-00:00 !antona
And the last move into CVS. The make files. (Note: compilation is untested
and all changes have been done without testing so if it doesn't compile at
the moment don't be too surprised.)

2001/01/24 02:10:41-00:00 !antona
Checkin my current todo files.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 856a1afb30 Cleanup the build process a bit.
2002/07/02 23:47:10-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/06/05 20:38:11-00:00 !antona
update

2002/06/02 14:11:08-00:00 !antona
.

2002/06/02 13:57:59-00:00 !antona
Fix detection of read-only mounts in volume.c::ntfs_check_mnteent().

2002/04/29 13:00:31-00:00 !antona
Add check for mbsrtowcs

2002/04/24 23:47:40-00:00 !antona
Hammer out the API for run list merging. Add calls for low level (using raw run lists and ATTR_RECORDs as parameters) run list merging, mappaing pairs decompression, and vcn to lcn conversion as well as high level (using ntfs_attr as parameter) calls for run list mapping and vcn to lcn conversion.

2002/04/18 18:15:45-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/14 14:15:47-00:00 !antona
Cleanups and updates.

2002/01/26 04:32:35-00:00 !antona
RedHat 7.2 - updates

2002/01/10 10:54:27-00:00 !antona
Updates

2001/12/15 05:13:08-00:00 !antona
Remove atomic ops and add compiler version check.

2001/12/06 01:14:52-00:00 !antona
Added mount flags to ntfs_mount and adapted utilities to new mount syntax.

2001/11/17 01:57:53-00:00 !antona
Update build system with new document.

2001/11/10 14:22:15-00:00 !antona
Remove obsoleted disklabel.h stuff.

2001/11/10 14:17:39-00:00 !antona
Enhance mkntfs' device size determination.

2001/11/09 23:36:16-00:00 !antona
Bug fixes

2001/11/09 19:24:23-00:00 !antona
With lots of luck this is going to be 1.2.3.

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/06/11 04:02:08-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/05 10:33:02-00:00 !antona
Update automatic config/make process and mkntfs to use the cvs release tag for
version reporting.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/03 02:03:35-00:00 !antona
More files.

2001/02/02 00:16:18-00:00 !antona
Changed make process to using autoconf/automake/libtool.
Added necessary files for this and for the gnu standard.
Inititial checkin. Probably still stuff missing. Will know soon...

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona bd5e13a59b Change sizedetection for files so we work with sparse files, too.
2002/07/15 16:41:48-00:00 !flatcap
AT_NONAME -> AT_UNNAMED

2002/07/15 15:09:21-00:00 !flatcap
lingering attribute name problems

2002/07/11 16:20:34-00:00 !flatcap
whitespace and include guards

2002/07/09 19:17:49-00:00 !flatcap
move the runlist functions from attrib.c to runlist.c

2002/07/08 23:27:16-00:00 !flatcap
added AT_NONAME so we can search for a (un)named attribute or just
iterate through all attributes

2002/07/06 20:07:59-00:00 !antona
New API for compressing run lists into mapping pairs arrays and adapt mkntfs to that API. Addition of ntfs_walk_attrs().

2002/07/03 21:56:01-00:00 !antona
Updates

2002/07/02 23:47:11-00:00 !antona
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.

2002/04/27 19:49:10-00:00 !antona
Update library, new APIs ntfs_attr_find_vcn(), misc fixes and cleanups, make all the utilities compile, fix bugs I noticed in ntfslabel and it now works properly.

2002/04/23 23:27:33-00:00 !antona
Fixup the force option in mkntfs.c. Change the ntfs_check_if_mounted so it works on system not implementing {set,get,end}mntent, too. Also make it more powerful in telling us not only if something is mounted but also if it is the fs root and if it is read-only.

2002/04/23 19:37:18-00:00 !mattjf
Removed the check_mount() function and added ntfs_check_if_mounted() to
mkntfs

2002/04/22 10:34:32-00:00 !antona
Attribute list support (merging done, part 2, some stuff still incomplete). mkntfs ntfs volume creation. See the changelog...

2002/04/21 01:26:39-00:00 !antona
Cleanup/streamline include file dependencies.

2002/04/21 01:12:55-00:00 !antona
Fix mkntfs again.

2002/04/20 23:09:43-00:00 !antona
Port attribute lookup functions with attribute list support from ntfs tng driver. Port/reimplement extent mft record handling code as well. Rename out all dollar signs from type names and constants. Adapt all callers to new API. Note mkntfs is currently broken due to some needed work.

2002/04/19 21:09:55-00:00 !antona
Finished provisional inode.c::ntfs_{open,close}_inode() functions. Also, started defining API provided by attrib.[ch], so far only done search context related stuff.

2002/04/18 18:15:46-00:00 !antona
Define API for bootsect.[ch]: is_boot_sector_ntfs().

2002/04/16 15:34:32-00:00 !antona
Fix the library...

2002/04/15 21:41:16-00:00 !antona
Little fix of a fix. (-:

2002/04/15 20:04:29-00:00 !antona
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).

2002/04/15 19:02:41-00:00 !antona
Really fix the library and mkntfs while at it.

2002/04/14 15:26:24-00:00 !antona
Remove find_first_attr and make all users use get_attr_search_ctx + find_attr instead.

2002/03/12 22:11:02-00:00 !antona
Final tidyups.

2002/03/12 22:00:44-00:00 !antona
Fix a few small mistakes

2002/03/12 21:48:27-00:00 !antona
Change version numbers of mkntfs and ntfsfix to match linux-ntfs release and add options to mkntfs to disable content indexing on the volume and to enable compression on the volume.

2002/03/12 00:34:35-00:00 !antona
Fix typo in mkntfs usage information.

2002/02/01 02:46:16-00:00 !antona
Attempt to fix compile warnings on powerpc.

2002/01/10 10:54:27-00:00 !antona
Updates

2002/01/10 10:11:46-00:00 !antona
Fix logfile size calculation.

2001/12/15 05:26:07-00:00 !antona
Hm, it would appear that on my SuSE 7.2 + many other thins + 2.5.1-pre11 kernel mkntfs gets an EINVAL from seek instead of ENOSPACE crashes out. Converted the crash into a warning only.

2001/11/10 16:24:13-00:00 !antona
More logfile size updates so we are more sane with floppies.

2001/11/10 14:47:39-00:00 !antona
Debug display bug fixes.

2001/11/10 14:27:38-00:00 !antona
And more typos.

2001/11/10 14:25:33-00:00 !antona
Oops. Didn't compile. Typo

2001/11/10 14:22:15-00:00 !antona
Remove obsoleted disklabel.h stuff.

2001/11/10 14:17:39-00:00 !antona
Enhance mkntfs' device size determination.

2001/11/10 03:06:05-00:00 !antona
Bug fixes and debug output enhancements.

2001/11/09 23:36:17-00:00 !antona
Bug fixes

2001/11/09 21:18:22-00:00 !antona
More fixes and allow small volumes down to 1MiB, scaling down the $LogFile as much as necessary.

2001/11/09 19:21:09-00:00 !antona
Fix directories on large clusters and allow 4MB volumes.

2001/08/27 16:58:07-00:00 !antona
Updates.

2001/07/25 22:49:25-00:00 !antona
Small tidying up of a misspelling.

2001/07/25 22:30:34-00:00 !antona
Bug fixes for cluster sizes > 4kb involving corrections to mft mirror size and contents, mft data attribute position and mft bitmap size. Some of those were
nasty so this is a major improvement.

2001/06/16 19:22:45-00:00 !antona
Get rid of logfile stuff for mkntfs as it is clearly not needed.

2001/06/16 18:26:34-00:00 !antona
Make mft bitmap non resident and located just after $Boot.
This fixes all the crashes experienced!
This makes mkntfs complete and bug free AFAIK.

2001/06/15 16:47:47-00:00 !antona
Integrate logfile.c into mkntfs

2001/06/13 19:00:56-00:00 !antona
More cleanups and man page final updates/polishing.

2001/06/13 18:07:00-00:00 !antona
Some output cleanup.

2001/06/13 12:21:51-00:00 !flatcap
the backup boot sector is in no-mans-land beyond the normal clusters

2001/06/13 11:51:17-00:00 !flatcap
fixed sector/cluster typo

2001/06/13 11:47:05-00:00 !flatcap
$bitmap - set bits beyond volume

2001/06/13 01:35:02-00:00 !antona
fix backup boot sector problem with error message instead of crashing out. we
rely on chkdsk to fix this as it is a kernel limitation we can't do anything
about atm.

2001/06/13 00:13:38-00:00 !antona
Fix run list corruption stupidity.

2001/06/12 22:39:35-00:00 !antona
Testing

2001/06/12 22:17:30-00:00 !antona
Testing.

2001/06/12 21:58:32-00:00 !antona
Fix stupid bugs in calculating the clusters per mft/index record values.

2001/06/12 20:13:35-00:00 !antona
Fix nr_sectors / sector_size problems with previous commit.

2001/06/12 20:02:50-00:00 !antona
Enable automatic determination of file size of non-block devices instead of
crashing out. A user specified size stil overrides the actual size, we assume the file size will be adjusted automatically by the seek to the last sector and
write of the backup boot sector.

2001/06/11 20:31:29-00:00 !antona
Bugfixing of mkntfs.c. Loads of it. (-8

2001/06/11 04:02:09-00:00 !antona
Linux-NTFS 1.0.0-pre-1 - FEATURE FREEZE
=======================================
mkntfs complete with option parsing and more cool things.
mkntfs man page complete.
info files updated.

TODO Before 1.0.0 final:

- Test mkntfs options & mkntfs itself.
- Test tar ball generation.
- Test rpm generation.

2001/06/10 15:54:20-00:00 !antona
Linux-NTFS 0.1.0-pre1
=====================
-fixed up ntfsfix and ntfsdump_logfile
-corrected stuff
-several bug fixes
-fixed (hopefully) final bug with mkntfs (sd generator was wrong due to brain'o)
-mkntfs now completed, only need to add a few command line options before first
public release.
-rpm generation file updated and autostrip modified to make use of install-stip
make target instead of stripping manually
-made bootsector check verbosity during mount dependent on --enable-debug
configure option.

2001/06/10 14:00:12-00:00 !antona
mkntfs alpha 4
==============
- set back up boot sector as used in volume bitmap

- almost no errors left. only thing chkdsk now complains about is the root dir
security descriptor.

2001/06/10 02:25:38-00:00 !antona
mkntfs alpha 3
==============
- Several bugfixes (root dir link count wasn't incremented, mftmirror usns
weren't correct [off by one too high], etc).
- Implement new $UpCase generation using flatcap (Richard Russon)'s algorithm
for generating it. This dropped the stripped mkntfs executable from 204kb down
to 78kb in size. A whopping 62% size decrease! Yey! And the source code dropped
ny over 600kb in size as well. And compilation got quicker, too.

2001/06/09 18:32:57-00:00 !antona
mkntfs alpha 2
create_hardlink() was forgetting to increment the use count!

2001/06/09 16:31:13-00:00 !antona
mkntfs alpha release is here! Yey!
The only thing I am worried about is the fact that the system call to get the
number of sectors on the device returns a value rounded to the nearest 1024
bytes (converted to 512 byte blocks) thus we might be writting the backup boot
sector too early instead of on the real last sector but there is nothing I can
do apart from starting to play games like accessing the main device for hds
instead of the partition device which wouldn't help in the case of the last
partition though... Alternatively have to place the backup boot sector in the
middle of the disk like WinNT3.51 and earlier did but I need an image to see
exactly how they did it and even then we have the problem of not knowing where
the middle of the disk is as we don't really know how many sectors there are
for real with Linux kernel lying to us.

2001/06/09 00:25:56-00:00 !antona
mkntfs delayed. more reverse engineering required to determine exact method of
index entry collation. first few helper functions are already done and entered
into ntfslib in unistr.c

2001/06/08 19:58:25-00:00 !antona
getting closer to mkntfs alpha.

2001/06/08 14:09:52-00:00 !antona
mkntfs compiles. But untested. Also there are still things to do...

2001/06/07 23:31:54-00:00 !antona
mkntfs - the end to the saga draws closer...

2001/06/06 22:55:49-00:00 !antona
And some more mkntfs + some updates to layout.h concerning directories and
alignment requirements.

2001/06/05 23:45:47-00:00 !antona
The mkntfs saga continues.

2001/06/05 10:33:02-00:00 !antona
Update automatic config/make process and mkntfs to use the cvs release tag for
version reporting.

2001/06/05 10:19:53-00:00 !antona
mkntfs update.

2001/06/04 23:38:55-00:00 !antona
Integrate ldm.c into automatic build process.
A bit more on mkntfs and make it compile (do _not_ run as it is - am working on
directory creation so chances are it will hang if you run it or something).

2001/06/04 14:04:31-00:00 !antona
More work on mkntfs dir stuff.

2001/06/04 11:29:45-00:00 !antona
*** empty log message ***

2001/06/03 12:04:30-00:00 !antona
More directory work in mkntfs

2001/06/03 02:09:08-00:00 !antona
Fix/expand dircetory info in layout.h and add creation of index root attribute
to mkntfs.c.

2001/06/01 19:04:08-00:00 !antona
Updates & fixes.

2001/06/01 02:07:26-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/04/08 03:02:55-00:00 !antona
Added cvs Id header.

2001/03/02 15:09:25-00:00 !antona
Added begin of mkntfs utility. (Doesn't do anything, including doesn't compile at the moment.)

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 9cbb7f7777 Added cvs Id header.
2001/03/26 03:39:59-00:00 !antona
Updates

2001/03/07 15:53:20-00:00 !antona
Some corrections/additions to attributes documentation.

2001/01/30 12:57:44-00:00 !antona
Some documentation I wrote on how attributes work in NTFS.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 6793494c49 Added cvs Id header.
2001/03/02 15:04:24-00:00 !antona
Update to latest docs.

2001/01/28 05:49:57-00:00 !antona
More header development. AttrDef description.

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 40ca008347 Added CodingStyle document to doc directory.
(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 72da03cc86 Add description of compression algorithm.
(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 6a4f3f919e Add Szakacsits Szabolcs <szaka@sienet.hu> (and myself) to CREDITS.
2002/07/03 21:56:00-00:00 !antona
Updates

2002/04/12 15:23:47-00:00 !antona
Cleanup ntfslabel, write a man page for it, integrate it all in the distribution properly, silence output from ntfs_mount() (conditional on running configure with --enable-debug), update all docs accordingly. Add Rich and Matt to AUTHORS.

2001/08/02 01:44:56-00:00 !antona
Add ntfsfix man page and spell fixes. Update to 1.2.1 version and update all text files to go with it and the rpm spec file.

2001/06/01 02:07:23-00:00 !antona
It has been a long time since last commit. At moment have done a lot of work
on mkntfs but also at the moment ntfsfix and ntfsdump_logfile and libntfs are
broken. Basically only mkntfs works and that is not complete either.

2001/02/02 01:15:17-00:00 !antona
Updated documentation and other text files. Preparing for initial release.

2001/01/30 12:29:03-00:00 !antona
And the last move into CVS. The make files. (Note: compilation is untested
and all changes have been done without testing so if it doesn't compile at
the moment don't be too surprised.)

(Logical change 1.5)
2002-08-22 18:09:47 +00:00
!antona 3fbf5c3625 Initial revision 2002-08-22 18:09:47 +00:00
cantab.net!aia21 856c10c4ae Don't ask each user if they agree to open logging.
BKrev: 3d64f8c6gOhCOZ3mda5KgsU5MsOmjA
2002-08-22 14:44:22 +00:00
cantab.net!aia21 3aaa8ebe68 Don't ask each user if they agree to open logging.
(Logical change 1.4)
2002-08-22 14:44:22 +00:00
cantab.net!aia21 b1d7b5a059 Update config file with our wanted defaults.
BKrev: 3d64f818DgkfNfT_NaEsKHuq3K_J1A
2002-08-22 14:41:28 +00:00
cantab.net!aia21 a6eb37f5af Update config file with our wanted defaults.
(Logical change 1.3)
2002-08-22 14:41:28 +00:00
cantab.net!aia21 67a9124c4d (Logical change 1.3) 2002-08-22 14:41:28 +00:00
cantab.net!aia21 b07bb68ea8 Initial revision 2002-08-22 14:41:28 +00:00
cantab.net!aia21 2f509bc875 Initial repository create
BKrev: 3d64f511qgPlhfO9hP8MTNf-3YQE3Q
2002-08-22 14:28:33 +00:00
cantab.net!aia21 9126c604fc (Logical change 1.2) 2002-08-22 14:28:33 +00:00
cantab.net!aia21 5e74700a30 Initial revision 2002-08-22 14:28:33 +00:00
163 changed files with 90532 additions and 3988 deletions

View File

@ -3,6 +3,7 @@ Present authors of ntfs-3g in alphabetical order:
Jean-Pierre Andre
Alon Bar-Lev
Martin Bene
Dominique L Bouix
Csaba Henk
Bernhard Kaindl

25
CREDITS
View File

@ -38,7 +38,24 @@ Ismail Donmez
Laszlo Dvornik
Pallaghy Ajtony
Szabolcs Szakacsits
Jean-Pierre Andre
Alejandro Pulver
Erik Larsson
Alon Bar-Lev
Alexei Alexandrov
Albert D. Cahalan
Russ Christensen
Pete Curran
Andras Erdei
Matthew J. Fanto
Marcin GibuÅa
Christophe Grenier
Ian Jackson
Carmelo Kintana
Jan Kratochvil
Lode Leroy
David Martínez Moreno
Giang Nguyen
Leonard Norrgård
Holger Ohmacht
Per Olofsson
Yuri Per
Richard Russon
Erik Sørnes

View File

@ -1,7 +1,3 @@
ChangeLog can be found at :
Detailed ChangeLog can be found at http://mercurial.creo.hu/repos/ntfs-3g-hg/
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/
https://github.com/tuxera/ntfs-3g/wiki

View File

@ -24,9 +24,37 @@ MAINTAINERCLEANFILES=\
$(srcdir)/m4/lt~obsolete.m4 \
$(srcdir)/m4/ltoptions.m4
SUBDIRS = include libfuse-lite libntfs-3g src
SUBDIRS = include libfuse-lite libntfs-3g ntfsprogs src
doc_DATA = README
dist-hook:
$(MKDIR_P) "$(distdir)/m4"
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
libs:
if FUSE_INTERNAL
(cd libfuse-lite && $(MAKE) libs) || exit 1;
endif
(cd libntfs-3g && $(MAKE) libs) || exit 1;
libntfs:
(cd libntfs-3g && $(MAKE) libs) || exit 1;
drivers: libs
(cd src && $(MAKE) drivers) || exit 1;
ntfsprogs: libntfs
(cd ntfsprogs && $(MAKE)) || exit 1;
if ENABLE_NTFSPROGS
strip:
(cd ntfsprogs && $(MAKE) strip) || exit 1;
extra: extras
extras: libs
(cd ntfsprogs && $(MAKE) extras) || exit 1;
endif

6
NEWS
View File

@ -1,5 +1,3 @@
Project information can be found at :
Project news are at http://www.ntfs-3g.org
Release notes are maintained at http://www.ntfs-3g.org/releases.html
https://github.com/tuxera/ntfs-3g/

147
README
View File

@ -3,43 +3,83 @@ INTRODUCTION
============
The NTFS-3G driver is an open source, freely available read/write NTFS driver
for Linux, FreeBSD, Mac OS X, NetBSD, Solaris and Haiku. It provides safe and
fast handling of the Windows XP, Windows Server 2003, Windows 2000, Windows
Vista, and Windows Server 2008 file systems.
for Linux, FreeBSD, macOS, NetBSD, OpenIndiana, QNX and Haiku. It provides
safe and fast handling of the Windows XP, Windows Server 2003, Windows 2000,
Windows Vista, Windows Server 2008, Windows 7, Windows 8, Windows Server 2012,
Windows Server 2016, Windows 10 and Windows Server 2019 NTFS file systems.
The purpose of the project is to develop, continuously quality test and
support a trustable, featureful and high performance solution for hardware
platforms and operating systems whose users need to reliably interoperate
with NTFS. Besides this practical goal, the project also aims to explore
the limits of the hybrid, kernel/user space filesystem driver approach,
performance, reliability and feature richness per invested effort wise.
The purpose of the project is to develop, quality assurance and support a
trustable, featureful and high performance solution for hardware platforms
and operating systems whose users need to reliably interoperate with NTFS.
Besides this practical goal, the project also aims to explore the limits
of the hybrid, kernel/user space filesystem driver approach, performance,
reliability and feature richness per invested effort wise.
The driver is in STABLE status. The test methods, the test suites used
can be found at
http://ntfs-3g.org/quality.html
Besides the common file system features, NTFS-3G has support for file
ownership and permissions, POSIX ACLs, junction points, extended attributes
and creating internally compressed files (parameter files in the directory
.NTFS-3G may be required to enable them). The new compressed file formats
available in Windows 10 can also be read through a plugin.
News, support answers, problem submission instructions, support and discussion
forums, performance numbers and other information are available on the project
web site at
forums, and other information are available on the project web site at
http://ntfs-3g.org
https://github.com/tuxera/ntfs-3g/wiki
The project has been funded, supported and maintained since 2008 by Tuxera:
https://tuxera.com
LICENSES
========
All the NTFS related components: the file system drivers, the ntfsprogs
utilities and the shared library libntfs-3g are distributed 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. See the included file COPYING.
The fuse-lite library is distributed under the terms of the GNU LGPLv2.
See the included file COPYING.LIB.
QUICK INSTALLATION
==================
Linux: Make sure you have the basic development tools and the kernel includes
the FUSE kernel module. Then type:
Most distributions have an up-to-date NTFS-3G package ready for use, and
the recommended way is to install it.
If you need some specific customization, you can compile and install from
the released source code. Make sure you have the basic development tools
and the kernel includes the FUSE kernel module. Then unpack the source
tarball and type:
./configure
make
make install # or 'sudo make install' if you aren't root.
Please note that NTFS-3G doesn't require the FUSE user space package anymore.
Please note that NTFS-3G doesn't require the FUSE user space package any
more.
Non-Linux: Please see the NTFS-3G web page for OS specific installation and
source packages.
The list of options for building specific configurations is displayed by
typing :
./configure --help
Below are a few specific options to ./configure :
--disable-ntfsprogs : do not build the ntfsprogs tools,
--enable-extras : build more ntfsprogs tools,
--disable-plugins : disable support for plugins
--enable-posix-acls : enable support for Posix ACLs
--enable-xattr-mappings : enable system extended attributes mappings
--with-fuse=external : use external fuse (overriding Linux default)
There are also a few make targets for building parts :
make libntfs : only build the libntfs-3g library
make libs : only build libntfs-3g (and libfuse-lite, if relevant)
make drivers : only build drivers and libraries, without ntfsprogs
make ntfsprogs : only build ntfsprogs and libntfs-3g, without drivers
USAGE
@ -57,7 +97,70 @@ or
Please see the ntfs-3g manual page for more options and examples.
You can also make NTFS to be mounted during boot by putting the below
line at the __END__ of the /etc/fstab file:
line at the END(!) of the /etc/fstab file:
/dev/sda1 /mnt/windows ntfs-3g defaults 0 0
TESTING WITHOUT INSTALLING
=========================
Newer versions of ntfs-3g can be tested without installing anything and
without disturbing an existing installation. Just configure and make as
shown previously. This will create the scripts ntfs-3g and lowntfs-3g
in the src directory, which you may activate for testing:
./configure
make
then, as root:
src/ntfs-3g [-o mount-options] /dev/sda1 /mnt/windows
And, to end the test, unmount the usual way:
umount /dev/sda1
NTFS UTILITIES
==============
The ntfsprogs directory includes utilities for doing all required tasks to
NTFS partitions. In general, just run a utility without any command line
options to display the version number and usage syntax.
The following utilities are so far implemented:
ntfsfix - Attempt to fix an NTFS partition and force Windows to check NTFS.
mkntfs - Format a partition with the NTFS filesystem. See man 8 mkntfs for
command line options.
ntfslabel - Display/change the label of an NTFS partition. See man 8 ntfslabel
for details.
ntfsundelete - Recover deleted files from an NTFS volume. See man 8
ntfsundelete for more details.
ntfsresize - Resize NTFS volumes. See man 8 ntfsresize for details.
ntfsclone - Efficiently create/restore an image of an NTFS partition. See
man 8 ntfsclone for details.
ntfscluster - Locate the owner of any given sector or cluster on an NTFS
partition. See man 8 ntfscluster for details.
ntfsinfo - Show some information about an NTFS partition or one of the files
or directories within it. See man 8 ntfsinfo for details.
ntfsrecover - Recover updates committed by Windows but interrupted before
being synced.
ntfsls - List information about files in a directory residing on an NTFS
partition. See man 8 ntfsls for details.
ntfscat - Concatenate files and print their contents on the standard output.
ntfscp - Overwrite files on an NTFS partition.
ntfssecaudit - Audit the security metadata.
ntfsusermap - Assistance for building a user mapping file.

126
TODO.ntfsprogs 100644
View File

@ -0,0 +1,126 @@
Please keep in alphabetical order so utilities are easier to find.
Thanks,
Anton
**********
* mkntfs *
**********
- Correct support for creating volumes with larger sector sizes (mft record
size, cluster size, and index block size must be >= sector size), so for 1k,
2k, and 4k sectors, we need to set the default mft record, cluster, and index
block size to be at least the sector size.
- Correct the odd last partition sector not being accessible under 2.4 kernels
by setting the device block size to the sector size (default is 1k on 2.4
kernels and they can't cope with partial sectors).
- Got a report that creating a floppy with mkntfs failed. Difference between
this floppy and the floppy created by the special tool found on the net was
said to be that the bitmap is 256kib on the special floppy while mkntfs will
make it much smaller. Need to verify this and experiment with the bitmap
size to make it work. Note, reporter was using win2k.
*************
* ntfsclone *
*************
- get rid of the unneeded lseek()'s during reads/writes (probably it
doesn't improve performance much, or any at all)
- catch if source and dest are the same
- disable consistency check for --metadata (e.g. if the check is crashing)
- option: --inode
- option: --data
- metadata cloning: skip more non-needed inodes
- manual: document LFS issues (smbfs' lfs option, nfs)
- manual: mention optimized seeks
- manual: optimal backup if disks have bad sectors
- manual: ntfsclone guarantees the restored image works only
if one restores to the exactly same partition. For example,
one can not copy system partition to a different partition:
minimum "hidden sectors" field and BOOT.INI need modifications.
We could do these adjustments optionally.
- check if kernel block size = GCD(page size, device size) makes
effect on performance (Al Viro says no)
- check whether the O_WRONLY -> O_RDWR change made effect on performance
***********
* ntfscmp *
***********
- compare mft record headers
- exit status is 0 if inputs are the same, 1 if different, other if trouble
- optionally ignore less interesting fields (e.g. attribute instance)
- new option: --metadata mode
- unnamed resident attributes with same type are ignored
- code cleanup, remove many cross-util duplicates
- handle deleted records
- performance: special handling for sparse files
**********
* ntfscp *
**********
- add ability to copy multiple files at once.
***********
* ntfsfix *
***********
- Cleanup to use ntfs_attr_* API for editing $MFTMirr, $Volume, and $LogFile.
This has the immediate benefit of enabling attribute list support and making
the code simpler.
- On ntfs 3.0+ volumes need to disable the usn journal if it is active. This
means deleting file $UsnJrnl from /$Extend directory.
- On ntfs 3.0+ volumes need to mark the quota out of date? - Probably, but
it shouldn't cause any corruption not doing so for the moment so this is
not a showstopper bug for the first release. (AIA)
*************
* ntfslabel *
*************
- Support ioctls for kernel driver and ntfsmount for reading/changing the label.
*************
* ntfsmount *
*************
**************
* ntfsresize *
**************
High priority
- move ntfs consistency check to libntfs (for ntfsck, ntfsclone, etc)
- use different exit codes (e.g. corrupt volume detected, unsupported case,
bad sectors, etc)
Medium priority
- cope with the rare, unsupported cases, see man ntfsresize 'KNOWN ISSUES'
- save $Bitmap if it was modified and an error occures (e.g. bad sector).
- handle signals (^C, etc)
Low priority
- fully support disks with bad sectors (attrlist attr, unknown bad sectors)
- move volume start
****************
* ntfsundelete *
****************
- undelete by name rather than inode number
- support for compressed files
- support for internationalisation
- recover by type?
- mass undelete (using wildcards)
- display parent directory
- name "<none>" to MFTn

View File

@ -2,8 +2,9 @@
# configure.ac - Source file to generate "./configure" to prepare package for
# compilation.
#
# Copyright (c) 2000-2006 Anton Altaparmakov
# Copyright (c) 2005-2008 Szabolcs Szakacsits
# Copyright (c) 2000-2013 Anton Altaparmakov
# Copyright (c) 2003 Jan Kratochvil
# Copyright (c) 2005-2009 Szabolcs Szakacsits
# Copyright (C) 2007-2008 Alon Bar-Lev
#
# This program/include file is free software; you can redistribute it and/or
@ -23,8 +24,8 @@
# Autoconf
AC_PREREQ(2.59)
AC_INIT([ntfs-3g],[2009.4.4],[ntfs-3g-devel@lists.sf.net])
LIBNTFS_3G_VERSION="54"
AC_INIT([ntfs-3g],[2022.10.3],[ntfs-3g-devel@lists.sf.net])
LIBNTFS_3G_VERSION="89"
AC_CONFIG_SRCDIR([src/ntfs-3g.c])
# Environment
@ -32,7 +33,7 @@ AC_CANONICAL_HOST
AC_CANONICAL_TARGET
# Automake
AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
AM_INIT_AUTOMAKE([])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
@ -106,6 +107,28 @@ AC_ARG_ENABLE(
[enable_mtab="yes"]
)
AC_ARG_ENABLE(
[posix-acls],
[AS_HELP_STRING([--enable-posix-acls],[enable POSIX ACL support])],
,
[enable_posix_acls="no"]
)
AC_ARG_ENABLE(
[xattr-mappings],
[AS_HELP_STRING([--enable-xattr-mappings],[enable system extended attributes mappings])],
,
[enable_xattr_mappings="no"]
)
AC_ARG_ENABLE(
[plugins],
[AS_HELP_STRING([--disable-plugins], [Disable external reparse point
plugins for the ntfs-3g FUSE driver])],
[if test x${enableval} = "xyes"; then disable_plugins="no"; fi],
[disable_plugins="no"]
)
AC_ARG_ENABLE(
[device-default-io-ops],
[AS_HELP_STRING([--disable-device-default-io-ops],[install default IO ops])],
@ -113,6 +136,43 @@ AC_ARG_ENABLE(
[enable_device_default_io_ops="yes"]
)
AC_ARG_ENABLE(
[ntfs-3g],
[AS_HELP_STRING([--disable-ntfs-3g],[disable the ntfs-3g FUSE driver])],
,
[enable_ntfs_3g="yes"]
)
AC_ARG_ENABLE(
[ntfsprogs],
[AS_HELP_STRING([--disable-ntfsprogs],[disable ntfsprogs utilities
(default=no)])],
,
[enable_ntfsprogs="yes"]
)
AC_ARG_ENABLE(crypto,
AS_HELP_STRING(--enable-crypto,enable crypto related code and utilities
(default=no)), ,
enable_crypto=no
)
AC_ARG_ENABLE(
[extras],
[AS_HELP_STRING([--enable-extras],[enable extra ntfsprogs utilities
(default=no)])],
,
[enable_extras="no"]
)
AC_ARG_ENABLE(
[quarantined],
[AS_HELP_STRING([--enable-quarantined],[enable quarantined ntfsprogs utilities
(default=no)])],
,
[enable_quarantined="no"]
)
AC_ARG_ENABLE(
[nfconv],
[AS_HELP_STRING([--disable-nfconv],[disable the 'nfconv' patch, which adds support for Unicode normalization form conversion when built on Mac OS X @<:@default=enabled for Mac OS X@:>@])],
@ -139,6 +199,9 @@ ifdef(
[AC_PROG_LIBTOOL]
)
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
AC_PATH_PROG([MV], [mv])
AC_PATH_PROG([RM], [rm])
AC_PATH_PROG([SED], [sed])
@ -163,27 +226,31 @@ case "${target}" in
;;
esac
AC_MSG_CHECKING([fuse compatibility])
case "${target_os}" in
linux*)
AC_ARG_WITH(
[fuse],
[AS_HELP_STRING([--with-fuse=<internal|external>],[Select FUSE library: internal or external @<:@default=internal@:>@])],
,
[with_fuse="internal"]
)
;;
darwin*|netbsd*|solaris*)
with_fuse="external"
;;
freebsd*)
AC_MSG_ERROR([Please see FreeBSD support at http://www.freshports.org/sysutils/fusefs-ntfs])
;;
*)
AC_MSG_ERROR([ntfs-3g can be built for Linux, FreeBSD, Mac OS X, NetBSD, and Solaris only.])
;;
esac
AC_MSG_RESULT([${with_fuse}])
if test "x${enable_ntfs_3g}" != "xyes"; then
with_fuse="none"
elif test "x${with_fuse}" = "x"; then
AC_MSG_CHECKING([fuse compatibility])
case "${target_os}" in
linux*|solaris*)
AC_ARG_WITH(
[fuse],
[AS_HELP_STRING([--with-fuse=<internal|external>],[Select FUSE library: internal or external @<:@default=internal@:>@])],
,
[with_fuse="internal"]
)
;;
darwin*|netbsd*|kfreebsd*-gnu)
with_fuse="external"
;;
freebsd*)
AC_MSG_ERROR([Please see FreeBSD support at http://www.freshports.org/sysutils/fusefs-ntfs])
;;
*)
AC_MSG_ERROR([ntfs-3g can be built for Linux, FreeBSD, Mac OS X, NetBSD, and Solaris only.])
;;
esac
AC_MSG_RESULT([${with_fuse}])
fi
case "${target_os}" in
solaris*)
@ -223,7 +290,28 @@ if test "${with_fuse}" = "internal"; then
[1],
[Define to 1 if using internal fuse]
)
else
AC_MSG_CHECKING([Solaris OS])
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE(
[
AC_LANG_SOURCE(
[[#if !((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)))]]
[[#error "Not a Solaris system."]]
[[#endif]]
)
],
[
AC_MSG_RESULT([yes])
LIBFUSE_LITE_CFLAGS="${LIBFUSE_LITE_CFLAGS} -std=c99 -D__SOLARIS__ -D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
LIBFUSE_LITE_LIBS="${LIBFUSE_LITE_LIBS} -lxnet"
],
[
AC_MSG_RESULT([no])
]
)
AC_LANG_POP([C])
elif test "${with_fuse}" = "external"; then
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
@ -242,15 +330,158 @@ else
FUSE_LIB_PATH=`$PKG_CONFIG --libs-only-L fuse | sed -e 's,/[/]*,/,g' -e 's,[ ]*$,,'`
fi
# Autodetect whether we can build crypto stuff or not.
compile_crypto=false
if test "$enable_crypto" != "no"; then
have_libgcrypt=false
AM_PATH_LIBGCRYPT(1.2.2, [ have_libgcrypt=true ],
[
if test "$enable_crypto" = "yes"; then
AC_MSG_ERROR([ntfsprogs crypto code requires the gcrypt library.])
else
AC_MSG_WARN([ntfsprogs crypto code requires the gcrypt library.])
fi
])
have_libgnutls=false
PKG_CHECK_MODULES(GNUTLS, gnutls >= 1.4.4, [ have_libgnutls=true ],
if test "$enable_crypto" = "yes"; then
AC_MSG_ERROR([ntfsprogs crypto code requires the gnutls library.])
else
AC_MSG_WARN([ntfsprogs crypto code requires the gnutls library.])
fi
)
if test "$have_libgcrypt" = "true"; then
if test "$have_libgnutls" = "true"; then
compile_crypto=true
AC_DEFINE([ENABLE_CRYPTO], 1,
[Define this to 1 if you want to enable support of
encrypted files in libntfs and utilities.])
fi
fi
fi
AM_CONDITIONAL(ENABLE_CRYPTO, $compile_crypto)
# add --with-extra-includes and --with-extra-libs switch to ./configure
all_libraries="$all_libraries $USER_LDFLAGS"
all_includes="$all_includes $USER_INCLUDES"
AC_SUBST(all_includes)
AC_SUBST(all_libraries)
# Specify support for generating DCE compliant UUIDs (aka GUIDs). We check if
# uuid/uuid.h header is present and the uuid library is present that goes with
# it and then check if uuid_generate() is present and usable.
#
# DCE UUIDs are enabled by default and can be disabled with the --disable-uuid
# option to the configure script.
AC_ARG_WITH(uuid, [
--with-uuid@<:@=PFX@:>@ generate DCE compliant UUIDs, with optional prefix
to uuid library and headers @<:@default=detect@:>@
--without-uuid do not generate DCE compliant UUIDs],
if test "$with_uuid" = "yes"; then
extrapath=default
elif test "$with_uuid" = "no"; then
extrapath=
else
extrapath=$with_uuid
fi,
extrapath=default
)
if test "x$extrapath" != "x"; then
if test "x$extrapath" != "xdefault"; then
MKNTFS_CPPFLAGS="$MKNTFS_CPPFLAGS -I$extrapath/include"
MKNTFS_LIBS="$MKNTFS_LIBS -L$extrapath/lib"
fi
search_for_luuid="yes"
AC_CHECK_HEADER([uuid/uuid.h],
[],
[
AC_MSG_WARN([ntfsprogs DCE compliant UUID generation code requires the uuid library.])
search_for_luuid="no"
],
)
if test "x$search_for_luuid" != "xno"; then
# Look for uuid_generate in the standard C library.
AC_CHECK_FUNC([uuid_generate],
[
AC_DEFINE([ENABLE_UUID], 1,
[Define this to 1 if you want to enable
generation of DCE compliant UUIDs.])
search_for_luuid="no"
],
[],
)
fi
if test "x$search_for_luuid" != "xno"; then
# Look for uuid_generate in the 'uuid' library.
AC_CHECK_LIB([uuid], [uuid_generate],
[
AC_DEFINE([ENABLE_UUID], 1,
[Define this to 1 if you want to enable
generation of DCE compliant UUIDs.])
MKNTFS_LIBS="$MKNTFS_LIBS -luuid"
search_for_luuid="no"
],
[],
)
fi
if test "x$search_for_luuid" != "xno"; then
AC_MSG_WARN([ntfsprogs DCE compliant UUID generation code requires the uuid library.])
fi
fi
# Specify support for obtaining the correct BIOS legacy geometry needed for
# Windows to boot in CHS mode. We check if hd.h header is present and the hd
# library is present that goes with it and then check if the hd_list() function
# is present and usable.
#
# Using the hd library is enabled by default and can be disabled with the
# --disable-hd option to the configure script.
AC_ARG_WITH(hd, [
--with-hd@<:@=PFX@:>@ use Windows compliant disk geometry, with optional
prefix to hd library and headers @<:@default=detect@:>@
--without-hd do not use Windows compliant disk geometry],
if test "$with_hd" = "yes"; then
extrapath2=default
elif test "$with_hd" = "no"; then
extrapath2=
else
extrapath2=$with_hd
fi,
extrapath2=default
)
if test "x$extrapath2" != "x"; then
if test "x$extrapath2" != "xdefault"; then
LIBNTFS_CPPFLAGS="$LIBNTFS_CPPFLAGS -I$extrapath2/include"
LIBNTFS_LIBS="$LIBNTFS_LIBS -L$extrapath2/lib"
fi
AC_CHECK_HEADER([hd.h],
AC_CHECK_LIB([hd], [hd_list],
AC_DEFINE([ENABLE_HD], 1,
[Define this to 1 if you want to enable use of Windows
compliant disk geometry.])
LIBNTFS_LIBS="$LIBNTFS_LIBS -lhd"
NTFSPROGS_STATIC_LIBS="$NTFSPROGS_STATIC_LIBS -lhd",
AC_MSG_WARN([ntfsprogs Windows compliant geometry code requires the hd library.]),
),
AC_MSG_WARN([ntfsprogs Windows compliant geometry code requires the hd library.]),
)
fi
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_MAJOR
AC_CHECK_HEADERS([ctype.h fcntl.h libgen.h libintl.h limits.h locale.h \
mntent.h stddef.h stdint.h stdlib.h stdio.h stdarg.h string.h \
strings.h errno.h time.h unistd.h utime.h wchar.h getopt.h features.h \
endian.h byteswap.h sys/byteorder.h sys/endian.h sys/param.h \
sys/ioctl.h sys/mkdev.h sys/mount.h sys/stat.h sys/types.h sys/vfs.h \
sys/statvfs.h sys/sysmacros.h linux/major.h linux/fd.h linux/hdreg.h \
machine/endian.h windows.h syslog.h])
regex.h endian.h byteswap.h sys/byteorder.h sys/disk.h sys/endian.h \
sys/param.h sys/ioctl.h sys/mount.h sys/stat.h sys/types.h \
sys/vfs.h sys/statvfs.h linux/major.h linux/fd.h \
linux/fs.h inttypes.h linux/hdreg.h \
machine/endian.h windows.h syslog.h pwd.h malloc.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
@ -274,6 +505,7 @@ AC_STRUCT_ST_BLOCKS
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_CHECK_MEMBERS([struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_atimespec])
AC_CHECK_MEMBERS([struct stat.st_atimensec])
# For the 'nfconv' patch (Mac OS X only):
case "${target_os}" in
@ -307,10 +539,20 @@ AC_CHECK_FUNCS([ \
atexit basename daemon dup2 fdatasync ffs getopt_long hasmntopt \
mbsinit memmove memset realpath regcomp setlocale setxattr \
strcasecmp strchr strdup strerror strnlen strsep strtol strtoul \
sysconf utime fork \
sysconf utime utimensat gettimeofday clock_gettime fork memcpy random snprintf \
])
AC_SYS_LARGEFILE
# The dlopen API might be in libc or in libdl. Check libc first, then
# fall back to libdl.
LIBDL=""
if test "x${disable_plugins}" = "xno"; then
AC_CHECK_LIB(c, dlopen, ,
[AC_CHECK_LIB(dl, dlopen, [LIBDL="-ldl"],
[AC_MSG_ERROR(["Unable to find libdl (required for external plugin support)"])])])
fi
AC_SUBST([LIBDL])
if test "$GCC" = "yes" ; then
# We add -Wall to enable some compiler warnings.
CFLAGS="${CFLAGS} -Wall"
@ -322,7 +564,7 @@ if test "${enable_pedantic}" = "yes"; then
fi
if test "${enable_warnings}" = "yes"; then
CFLAGS="${CFLAGS} -W -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wmultichar -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wformat -Wformat-security"
CFLAGS="${CFLAGS} -W -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wmultichar -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wformat -Wformat-security -Wuninitialized"
fi
if test "${enable_debug}" = "yes"; then
@ -341,6 +583,9 @@ test "${enable_device_default_io_ops}" = "no" && AC_DEFINE(
)
test "${enable_mtab}" = "no" && AC_DEFINE([IGNORE_MTAB], [1], [Don't update /etc/mtab])
test "${enable_posix_acls}" != "no" && AC_DEFINE([POSIXACLS], [1], [POSIX ACL support])
test "${enable_xattr_mappings}" != "no" && AC_DEFINE([XATTR_MAPPINGS], [1], [system extended attributes mappings])
test "${disable_plugins}" != "no" && AC_DEFINE([DISABLE_PLUGINS], [1], [Define to 1 for disabling reparse plugins])
test "${enable_really_static}" = "yes" && enable_library="no"
test "${enable_library}" = "no" && enable_ldconfig="no"
@ -372,7 +617,13 @@ AC_SUBST([rootbindir])
AC_SUBST([rootsbindir])
AC_SUBST([rootlibdir])
AC_SUBST([LIBNTFS_3G_VERSION])
AC_SUBST([LIBFUSE_LITE_CFLAGS])
AC_SUBST([LIBFUSE_LITE_LIBS])
AC_SUBST([MKNTFS_CPPFLAGS])
AC_SUBST([MKNTFS_LIBS])
AC_SUBST([LIBNTFS_CPPFLAGS])
AC_SUBST([LIBNTFS_LIBS])
AC_SUBST([NTFSPROGS_STATIC_LIBS])
AC_SUBST([OUTPUT_FORMAT])
AM_CONDITIONAL([FUSE_INTERNAL], [test "${with_fuse}" = "internal"])
AM_CONDITIONAL([GENERATE_LDSCRIPT], [test "${enable_ldscript}" = "yes"])
@ -382,6 +633,11 @@ AM_CONDITIONAL([RUN_LDCONFIG], [test "${enable_ldconfig}" = "yes"])
AM_CONDITIONAL([REALLYSTATIC], [test "${enable_really_static}" = "yes"])
AM_CONDITIONAL([INSTALL_LIBRARY], [test "${enable_library}" = "yes"])
AM_CONDITIONAL([ENABLE_MOUNT_HELPER], [test "${enable_mount_helper}" = "yes"])
AM_CONDITIONAL([ENABLE_NTFS_3G], [test "${enable_ntfs_3g}" = "yes"])
AM_CONDITIONAL([ENABLE_NTFSPROGS], [test "${enable_ntfsprogs}" = "yes"])
AM_CONDITIONAL([ENABLE_EXTRAS], [test "${enable_extras}" = "yes"])
AM_CONDITIONAL([ENABLE_QUARANTINED], [test "${enable_quarantined}" = "yes"])
AM_CONDITIONAL([DISABLE_PLUGINS], [test "${disable_plugins}" != "no"])
# workaround for <autoconf-2.60
if test -z "${docdir}"; then
@ -404,6 +660,27 @@ AC_CONFIG_FILES([
libntfs-3g/Makefile
libntfs-3g/libntfs-3g.pc
libntfs-3g/libntfs-3g.script.so
ntfsprogs/Makefile
ntfsprogs/mkntfs.8
ntfsprogs/ntfscat.8
ntfsprogs/ntfsclone.8
ntfsprogs/ntfscluster.8
ntfsprogs/ntfscmp.8
ntfsprogs/ntfscp.8
ntfsprogs/ntfsfix.8
ntfsprogs/ntfsinfo.8
ntfsprogs/ntfslabel.8
ntfsprogs/ntfsls.8
ntfsprogs/ntfsprogs.8
ntfsprogs/ntfsresize.8
ntfsprogs/ntfsundelete.8
ntfsprogs/ntfsdecrypt.8
ntfsprogs/ntfswipe.8
ntfsprogs/ntfstruncate.8
ntfsprogs/ntfsfallocate.8
ntfsprogs/ntfsrecover.8
ntfsprogs/ntfsusermap.8
ntfsprogs/ntfssecaudit.8
src/Makefile
src/ntfs-3g.8
src/ntfs-3g.probe.8

View File

@ -1,5 +1,5 @@
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
MAINTAINERCLEANFILES = Makefile.in
noinst_HEADERS = \
fuse.h \

View File

@ -67,6 +67,7 @@ typedef int (*fuse_fill_dir_t) (void *buf, const char *name,
* Changed in fuse 2.8.0 (regardless of API version)
* Previously, paths were limited to a length of PATH_MAX.
*/
struct fuse_operations {
/** Get file attributes.
*
@ -419,6 +420,34 @@ struct fuse_operations {
* Introduced in version 2.6
*/
int (*bmap) (const char *, size_t blocksize, uint64_t *idx);
/**
* Ioctl
*
* flags will have FUSE_IOCTL_COMPAT set for 32bit ioctls in
* 64bit environment. The size and direction of data is
* determined by _IOC_*() decoding of cmd. For _IOC_NONE,
* data will be NULL, for _IOC_WRITE data is out area, for
* _IOC_READ in area and if both are set in/out area. In all
* non-NULL cases, the area is of _IOC_SIZE(cmd) bytes.
*
* Introduced in version 2.8
*
* Note : the unsigned long request submitted by the application
* is truncated to 32 bits, and forwarded as a signed int.
*/
int (*ioctl) (const char *, int cmd, void *arg,
struct fuse_file_info *, unsigned int flags, void *data);
/*
* The flags below have been discarded, they should not be used
*/
unsigned int flag_nullpath_ok : 1;
/**
* Reserved flags, don't set
*/
unsigned int flag_reserved : 30;
};
/** Extra context that may be needed by some filesystems
@ -441,6 +470,9 @@ struct fuse_context {
/** Private filesystem data */
void *private_data;
/** Umask of the calling process (introduced in version 2.8) */
mode_t umask;
};
/* ----------------------------------------------------------- *
@ -588,6 +620,8 @@ int fuse_fs_removexattr(struct fuse_fs *fs, const char *path,
const char *name);
int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize,
uint64_t *idx);
int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, int cmd, void *arg,
struct fuse_file_info *fi, unsigned int flags, void *data);
void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn);
void fuse_fs_destroy(struct fuse_fs *fs);
@ -605,6 +639,47 @@ void fuse_fs_destroy(struct fuse_fs *fs);
struct fuse_fs *fuse_fs_new(const struct fuse_operations *op, size_t op_size,
void *user_data);
#ifdef __SOLARIS__
/**
* Filesystem module
*
* Filesystem modules are registered with the FUSE_REGISTER_MODULE()
* macro.
*
* If the "-omodules=modname:..." option is present, filesystem
* objects are created and pushed onto the stack with the 'factory'
* function.
*/
struct fuse_module {
/**
* Name of filesystem
*/
const char *name;
/**
* Factory for creating filesystem objects
*
* The function may use and remove options from 'args' that belong
* to this module.
*
* For now the 'fs' vector always contains exactly one filesystem.
* This is the filesystem which will be below the newly created
* filesystem in the stack.
*
* @param args the command line arguments
* @param fs NULL terminated filesystem object vector
* @return the new filesystem object
*/
struct fuse_fs *(*factory)(struct fuse_args *args, struct fuse_fs *fs[]);
struct fuse_module *next;
struct fusemod_so *so;
int ctr;
};
#endif /* __SOLARIS__ */
/* ----------------------------------------------------------- *
* Advanced API for event handling, don't worry about this... *
* ----------------------------------------------------------- */

View File

@ -16,21 +16,58 @@
#define _FUSE_COMMON_H_
#include "fuse_opt.h"
#include <stdio.h> /* temporary */
#include <stdint.h>
/** Major version of FUSE library interface */
#define FUSE_MAJOR_VERSION 2
/** Minor version of FUSE library interface */
#ifdef POSIXACLS
#define FUSE_MINOR_VERSION 8
#else
#define FUSE_MINOR_VERSION 7
#endif
#define FUSE_MAKE_VERSION(maj, min) ((maj) * 10 + (min))
#define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION)
/* This interface uses 64 bit off_t */
#if defined(__SOLARIS__) && !defined(__x86_64__) && (_FILE_OFFSET_BITS != 64)
#error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef POSIXACLS
/*
* FUSE_CAP_DONT_MASK: don't apply umask to file mode on create operations
* FUSE_CAP_POSIX_ACL: process Posix ACLs within the kernel
*/
#define FUSE_CAP_DONT_MASK (1 << 6)
#define FUSE_CAP_POSIX_ACL (1 << 18)
#endif
#define FUSE_CAP_BIG_WRITES (1 << 5)
#define FUSE_CAP_IOCTL_DIR (1 << 11)
/**
* Ioctl flags
*
* FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
* FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
* FUSE_IOCTL_RETRY: retry with new iovecs
* FUSE_IOCTL_DIR: is a directory
*/
#define FUSE_IOCTL_COMPAT (1 << 0)
#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
#define FUSE_IOCTL_RETRY (1 << 2)
#define FUSE_IOCTL_DIR (1 << 4)
#define FUSE_IOCTL_MAX_IOV 256
/**
* Information about open files
*
@ -104,10 +141,12 @@ struct fuse_conn_info {
*/
unsigned max_readahead;
unsigned capable;
unsigned want;
/**
* For future use.
*/
unsigned reserved[27];
unsigned reserved[25];
};
struct fuse_session;
@ -133,6 +172,41 @@ struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args);
*/
void fuse_unmount(const char *mountpoint, struct fuse_chan *ch);
#ifdef __SOLARIS__
/**
* Parse common options
*
* The following options are parsed:
*
* '-f' foreground
* '-d' '-odebug' foreground, but keep the debug option
* '-s' single threaded
* '-h' '--help' help
* '-ho' help without header
* '-ofsname=..' file system name, if not present, then set to the program
* name
*
* All parameters may be NULL
*
* @param args argument vector
* @param mountpoint the returned mountpoint, should be freed after use
* @param multithreaded set to 1 unless the '-s' option is present
* @param foreground set to 1 if one of the relevant options is present
* @return 0 on success, -1 on failure
*/
int fuse_parse_cmdline(struct fuse_args *args, char **mountpoint,
int *multithreaded, int *foreground);
/**
* Go into the background
*
* @param foreground if true, stay in the foreground
* @return 0 on success, -1 on failure
*/
int fuse_daemonize(int foreground);
#endif /* __SOLARIS__ */
/**
* Get the version of the library
*

View File

@ -30,6 +30,9 @@
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*
* 7.12
* - add umask flag to input argument of open, mknod and mkdir
*/
#ifndef linux
@ -45,8 +48,20 @@
/** Version number of this interface */
#define FUSE_KERNEL_VERSION 7
/** Minor version number of this interface */
#define FUSE_KERNEL_MINOR_VERSION 8
/** Minor version number of this interface
* We introduce ourself as 7.18 (Posix ACLS : 7.12, IOCTL_DIR : 7.18)
* and we expect features features defined for 7.18, but not implemented
* here to not be triggered by ntfs-3g.
*/
#define FUSE_KERNEL_MINOR_VERSION 18
/*
* For binary compatibility with old kernels we accept falling back
* to 7.12 or earlier maximum version supported by the kernel
*/
#define FUSE_KERNEL_MAJOR_FALLBACK 7
#define FUSE_KERNEL_MINOR_FALLBACK 12
/** The node ID of the root inode */
#define FUSE_ROOT_ID 1
@ -75,6 +90,7 @@ struct fuse_attr {
__u32 uid;
__u32 gid;
__u32 rdev;
__u64 filling; /* JPA needed for minor >= 12, but meaning unknown */
};
struct fuse_kstatfs {
@ -119,9 +135,17 @@ struct fuse_file_lock {
/**
* INIT request/reply flags
* FUSE_BIG_WRITES: allow big writes to be issued to the file system
* FUSE_DONT_MASK: don't apply umask to file mode on create operations
* FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories
* FUSE_POSIX_ACL: kernel supports Posix ACLs
*/
#define FUSE_ASYNC_READ (1 << 0)
#define FUSE_POSIX_LOCKS (1 << 1)
#define FUSE_BIG_WRITES (1 << 5)
#define FUSE_DONT_MASK (1 << 6)
#define FUSE_HAS_IOCTL_DIR (1 << 11)
#define FUSE_POSIX_ACL (1 << 19)
/**
* Release flags
@ -165,10 +189,12 @@ enum fuse_opcode {
FUSE_INTERRUPT = 36,
FUSE_BMAP = 37,
FUSE_DESTROY = 38,
FUSE_IOCTL = 39,
};
/* The read buffer is required to be at least 8k, but may be much larger */
#define FUSE_MIN_READ_BUFFER 8192
#define FUSE_COMPAT_ENTRY_OUT_SIZE 120 /* JPA */
struct fuse_entry_out {
__u64 nodeid; /* Inode ID */
@ -185,6 +211,8 @@ struct fuse_forget_in {
__u64 nlookup;
};
#define FUSE_COMPAT_FUSE_ATTR_OUT_SIZE 96 /* JPA */
struct fuse_attr_out {
__u64 attr_valid; /* Cache timeout for the attributes */
__u32 attr_valid_nsec;
@ -192,14 +220,18 @@ struct fuse_attr_out {
struct fuse_attr attr;
};
#define FUSE_COMPAT_MKNOD_IN_SIZE 8
struct fuse_mknod_in {
__u32 mode;
__u32 rdev;
__u32 umask;
__u32 padding;
};
struct fuse_mkdir_in {
__u32 mode;
__u32 padding;
__u32 umask;
};
struct fuse_rename_in {
@ -230,8 +262,15 @@ struct fuse_setattr_in {
};
struct fuse_open_in {
__u32 flags;
__u32 mode; /* unused for protocol < 7.12 */
};
struct fuse_create_in {
__u32 flags;
__u32 mode;
__u32 umask;
__u32 padding;
};
struct fuse_open_out {
@ -261,11 +300,16 @@ struct fuse_read_in {
__u32 padding;
};
#define FUSE_COMPAT_WRITE_IN_SIZE 24 /* JPA */
struct fuse_write_in {
__u64 fh;
__u64 offset;
__u32 size;
__u32 write_flags;
__u64 lock_owner; /* JPA */
__u32 flags; /* JPA */
__u32 padding; /* JPA */
};
struct fuse_write_out {
@ -345,6 +389,27 @@ struct fuse_bmap_out {
__u64 block;
};
struct fuse_ioctl_in {
__u64 fh;
__u32 flags;
__u32 cmd;
__u64 arg;
__u32 in_size;
__u32 out_size;
};
struct fuse_ioctl_iovec {
__u64 base;
__u64 len;
};
struct fuse_ioctl_out {
__s32 result;
__u32 flags;
__u32 in_iovs;
__u32 out_iovs;
};
struct fuse_in_header {
__u32 len;
__u32 opcode;

View File

@ -100,6 +100,9 @@ struct fuse_ctx {
/** Thread ID of the calling process */
pid_t pid;
/** Umask of the calling process (introduced in version 2.8) */
mode_t umask;
};
/* 'to_set' flags in setattr */
@ -109,6 +112,8 @@ struct fuse_ctx {
#define FUSE_SET_ATTR_SIZE (1 << 3)
#define FUSE_SET_ATTR_ATIME (1 << 4)
#define FUSE_SET_ATTR_MTIME (1 << 5)
#define FUSE_SET_ATTR_ATIME_NOW (1 << 7)
#define FUSE_SET_ATTR_MTIME_NOW (1 << 8)
/* ----------------------------------------------------------- *
* Request methods and replies *
@ -798,6 +803,40 @@ struct fuse_lowlevel_ops {
*/
void (*bmap) (fuse_req_t req, fuse_ino_t ino, size_t blocksize,
uint64_t idx);
/**
* Ioctl
*
* Note: For unrestricted ioctls (not allowed for FUSE
* servers), data in and out areas can be discovered by giving
* iovs and setting FUSE_IOCTL_RETRY in @flags. For
* restricted ioctls, kernel prepares in/out data area
* according to the information encoded in cmd.
*
* Introduced in version 2.8
*
* Note : the unsigned long request submitted by the application
* is truncated to 32 bits, and forwarded as a signed int.
*
* Valid replies:
* fuse_reply_ioctl_retry
* fuse_reply_ioctl
* fuse_reply_ioctl_iov
* fuse_reply_err
*
* @param req request handle
* @param ino the inode number
* @param cmd ioctl command
* @param arg ioctl argument
* @param fi file information
* @param flags for FUSE_IOCTL_* flags
* @param in_buf data fetched from the caller
* @param in_bufsz number of fetched bytes
* @param out_bufsz maximum size of output data
*/
void (*ioctl) (fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
struct fuse_file_info *fi, unsigned flags,
const void *in_buf, size_t in_bufsz, size_t out_bufsz);
};
/**
@ -920,6 +959,21 @@ int fuse_reply_write(fuse_req_t req, size_t count);
*/
int fuse_reply_buf(fuse_req_t req, const char *buf, size_t size);
#ifdef POSIXACLS
/**
* Reply with data vector
*
* Possible requests:
* read, readdir, getxattr, listxattr
*
* @param req request handle
* @param iov the vector containing the data
* @param count the size of vector
* @return zero for success, -errno for failure to send reply
*/
int fuse_reply_iov(fuse_req_t req, const struct iovec *iov, int count);
#endif
/**
* Reply with filesystem statistics
*
@ -1000,6 +1054,20 @@ size_t fuse_add_direntry(fuse_req_t req, char *buf, size_t bufsize,
const char *name, const struct stat *stbuf,
off_t off);
/**
* Reply to finish ioctl
*
* Possible requests:
* ioctl
*
* @param req request handle
* @param result result to be passed to the caller
* @param buf buffer containing output data
* @param size length of output data
*/
int fuse_reply_ioctl(fuse_req_t req, int result, const void *buf, size_t size);
/* ----------------------------------------------------------- *
* Utility functions *
* ----------------------------------------------------------- */
@ -1057,6 +1125,13 @@ int fuse_req_interrupted(fuse_req_t req);
* Filesystem setup *
* ----------------------------------------------------------- */
#ifdef __SOLARIS__
/* Deprecated, don't use */
int fuse_lowlevel_is_lib_option(const char *opt);
#endif /* __SOLARIS__ */
/**
* Create a low level session
*

View File

@ -2,10 +2,12 @@
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
headers = \
acls.h \
attrib.h \
attrlist.h \
bitmap.h \
bootsect.h \
cache.h \
collate.h \
compat.h \
compress.h \
@ -13,9 +15,12 @@ headers = \
device.h \
device_io.h \
dir.h \
ea.h \
efs.h \
endians.h \
index.h \
inode.h \
ioctl.h \
layout.h \
lcnalloc.h \
logfile.h \
@ -24,12 +29,18 @@ headers = \
misc.h \
mst.h \
ntfstime.h \
object_id.h \
param.h \
plugin.h \
realpath.h \
reparse.h \
runlist.h \
security.h \
support.h \
types.h \
unistr.h \
volume.h
volume.h \
xattrs.h
if INSTALL_LIBRARY
ntfs3ginclude_HEADERS = $(headers)

View File

@ -0,0 +1,184 @@
/*
*
* Copyright (c) 2007-2008 Jean-Pierre Andre
*
*/
/*
* This program 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 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 ACLS_H
#define ACLS_H
#include "endians.h"
/*
* JPA configuration modes for security.c / acls.c
* should be moved to some config file
*/
#define BUFSZ 1024 /* buffer size to read mapping file */
#define MAPPINGFILE ".NTFS-3G/UserMapping" /* default mapping file */
#define LINESZ 120 /* maximum useful size of a mapping line */
#define CACHE_PERMISSIONS_BITS 6 /* log2 of unitary allocation of permissions */
#define CACHE_PERMISSIONS_SIZE 262144 /* max cacheable permissions */
/*
* Matching of ntfs permissions to Linux permissions
* these constants are adapted to endianness
* when setting, set them all
* when checking, check one is present
*/
/* flags which are set to mean exec, write or read */
#define FILE_READ (FILE_READ_DATA)
#define FILE_WRITE (FILE_WRITE_DATA | FILE_APPEND_DATA \
| READ_CONTROL | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA)
#define FILE_EXEC (FILE_EXECUTE)
#define DIR_READ FILE_LIST_DIRECTORY
#define DIR_WRITE (FILE_ADD_FILE | FILE_ADD_SUBDIRECTORY | FILE_DELETE_CHILD \
| READ_CONTROL | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA)
#define DIR_EXEC (FILE_TRAVERSE)
/* flags tested for meaning exec, write or read */
/* tests for write allow for interpretation of a sticky bit */
#define FILE_GREAD (FILE_READ_DATA | GENERIC_READ)
#define FILE_GWRITE (FILE_WRITE_DATA | FILE_APPEND_DATA | GENERIC_WRITE)
#define FILE_GEXEC (FILE_EXECUTE | GENERIC_EXECUTE)
#define DIR_GREAD (FILE_LIST_DIRECTORY | GENERIC_READ)
#define DIR_GWRITE (FILE_ADD_FILE | FILE_ADD_SUBDIRECTORY | GENERIC_WRITE)
#define DIR_GEXEC (FILE_TRAVERSE | GENERIC_EXECUTE)
/* standard owner (and administrator) rights */
#define OWNER_RIGHTS (DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER \
| SYNCHRONIZE \
| FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES \
| FILE_READ_EA | FILE_WRITE_EA)
/* standard world rights */
#define WORLD_RIGHTS (READ_CONTROL | FILE_READ_ATTRIBUTES | FILE_READ_EA \
| SYNCHRONIZE)
/* inheritance flags for files and directories */
#define FILE_INHERITANCE NO_PROPAGATE_INHERIT_ACE
#define DIR_INHERITANCE (OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE)
/*
* To identify NTFS ACL meaning Posix ACL granted to root
* we use rights always granted to anybody, so they have no impact
* either on Windows or on Linux.
*/
#define ROOT_OWNER_UNMARK SYNCHRONIZE /* ACL granted to root as owner */
#define ROOT_GROUP_UNMARK FILE_READ_EA /* ACL granted to root as group */
/*
* Maximum SID size and a type large enough to hold it
*/
#define MAX_SID_SIZE (8 + SID_MAX_SUB_AUTHORITIES*4)
typedef char BIGSID[MAX_SID_SIZE];
/*
* Struct to hold the input mapping file
* (private to this module)
*/
struct MAPLIST {
struct MAPLIST *next;
char *uidstr; /* uid text from the same record */
char *gidstr; /* gid text from the same record */
char *sidstr; /* sid text from the same record */
char maptext[LINESZ + 1];
};
typedef int (*FILEREADER)(void *fileid, char *buf, size_t size, off_t pos);
/*
* Constants defined in acls.c
*/
extern const SID *adminsid;
extern const SID *worldsid;
/*
* Functions defined in acls.c
*/
BOOL ntfs_valid_descr(const char *securattr, unsigned int attrsz);
BOOL ntfs_valid_pattern(const SID *sid);
BOOL ntfs_valid_sid(const SID *sid);
BOOL ntfs_same_sid(const SID *first, const SID *second);
BOOL ntfs_is_user_sid(const SID *usid);
int ntfs_sid_size(const SID * sid);
unsigned int ntfs_attr_size(const char *attr);
const SID *ntfs_find_usid(const struct MAPPING *usermapping,
uid_t uid, SID *pdefsid);
const SID *ntfs_find_gsid(const struct MAPPING *groupmapping,
gid_t gid, SID *pdefsid);
uid_t ntfs_find_user(const struct MAPPING *usermapping, const SID *usid);
gid_t ntfs_find_group(const struct MAPPING *groupmapping, const SID * gsid);
const SID *ntfs_acl_owner(const char *secattr);
#if POSIXACLS
BOOL ntfs_valid_posix(const struct POSIX_SECURITY *pxdesc);
void ntfs_sort_posix(struct POSIX_SECURITY *pxdesc);
int ntfs_merge_mode_posix(struct POSIX_SECURITY *pxdesc, mode_t mode);
struct POSIX_SECURITY *ntfs_build_inherited_posix(
const struct POSIX_SECURITY *pxdesc, mode_t mode,
mode_t umask, BOOL isdir);
struct POSIX_SECURITY *ntfs_build_basic_posix(
const struct POSIX_SECURITY *pxdesc, mode_t mode,
mode_t umask, BOOL isdir);
struct POSIX_SECURITY *ntfs_replace_acl(const struct POSIX_SECURITY *oldpxdesc,
const struct POSIX_ACL *newacl, int count, BOOL deflt);
struct POSIX_SECURITY *ntfs_build_permissions_posix(
struct MAPPING* const mapping[],
const char *securattr,
const SID *usid, const SID *gsid, BOOL isdir);
struct POSIX_SECURITY *ntfs_merge_descr_posix(const struct POSIX_SECURITY *first,
const struct POSIX_SECURITY *second);
char *ntfs_build_descr_posix(struct MAPPING* const mapping[],
struct POSIX_SECURITY *pxdesc,
int isdir, const SID *usid, const SID *gsid);
#endif /* POSIXACLS */
int ntfs_inherit_acl(const ACL *oldacl, ACL *newacl,
const SID *usid, const SID *gsid,
BOOL fordir, le16 inherited);
int ntfs_build_permissions(const char *securattr,
const SID *usid, const SID *gsid, BOOL isdir);
char *ntfs_build_descr(mode_t mode,
int isdir, const SID * usid, const SID * gsid);
struct MAPLIST *ntfs_read_mapping(FILEREADER reader, void *fileid);
struct MAPPING *ntfs_do_user_mapping(struct MAPLIST *firstitem);
struct MAPPING *ntfs_do_group_mapping(struct MAPLIST *firstitem);
void ntfs_free_mapping(struct MAPPING *mapping[]);
#endif /* ACLS_H */

View File

@ -4,6 +4,7 @@
* Copyright (c) 2000-2004 Anton Altaparmakov
* Copyright (c) 2004-2005 Yura Pakhuchiy
* Copyright (c) 2006-2007 Szabolcs Szakacsits
* Copyright (c) 2010 Jean-Pierre Andre
*
* 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
@ -37,6 +38,10 @@ typedef struct _ntfs_attr_search_ctx ntfs_attr_search_ctx;
#include "logging.h"
extern ntfschar AT_UNNAMED[];
extern ntfschar STREAM_SDS[];
/* The little endian Unicode string $TXF_DATA as a global constant. */
extern ntfschar TXF_DATA[10];
/**
* enum ntfs_lcn_special_values - special return values for ntfs_*_vcn_to_lcn()
@ -53,6 +58,13 @@ typedef enum {
LCN_EIO = -5,
} ntfs_lcn_special_values;
typedef enum { /* ways of processing holes when expanding */
HOLES_NO,
HOLES_OK,
HOLES_DELAY,
HOLES_NONRES
} hole_type;
/**
* struct ntfs_attr_search_ctx - search context used in attribute search functions
* @mrec: buffer containing mft record to search
@ -174,6 +186,7 @@ struct _ntfs_attr {
runlist_element *rl;
ntfs_inode *ni;
ATTR_TYPES type;
ATTR_FLAGS data_flags;
ntfschar *name;
u32 name_len;
unsigned long state;
@ -184,6 +197,7 @@ struct _ntfs_attr {
u32 compression_block_size;
u8 compression_block_size_bits;
u8 compression_block_clusters;
s8 unused_runs; /* pre-reserved entries available */
};
/**
@ -193,6 +207,11 @@ struct _ntfs_attr {
typedef enum {
NA_Initialized, /* 1: structure is initialized. */
NA_NonResident, /* 1: Attribute is not resident. */
NA_BeingNonResident, /* 1: Attribute is being made not resident. */
NA_FullyMapped, /* 1: Attribute has been fully mapped */
NA_DataAppending, /* 1: Attribute is being appended to */
NA_ComprClosing, /* 1: Compressed attribute is being closed */
NA_RunlistDirty, /* 1: Runlist has been updated */
} ntfs_attr_state_bits;
#define test_nattr_flag(na, flag) test_bit(NA_##flag, (na)->state)
@ -207,6 +226,26 @@ typedef enum {
#define NAttrSetNonResident(na) set_nattr_flag(na, NonResident)
#define NAttrClearNonResident(na) clear_nattr_flag(na, NonResident)
#define NAttrBeingNonResident(na) test_nattr_flag(na, BeingNonResident)
#define NAttrSetBeingNonResident(na) set_nattr_flag(na, BeingNonResident)
#define NAttrClearBeingNonResident(na) clear_nattr_flag(na, BeingNonResident)
#define NAttrFullyMapped(na) test_nattr_flag(na, FullyMapped)
#define NAttrSetFullyMapped(na) set_nattr_flag(na, FullyMapped)
#define NAttrClearFullyMapped(na) clear_nattr_flag(na, FullyMapped)
#define NAttrDataAppending(na) test_nattr_flag(na, DataAppending)
#define NAttrSetDataAppending(na) set_nattr_flag(na, DataAppending)
#define NAttrClearDataAppending(na) clear_nattr_flag(na, DataAppending)
#define NAttrRunlistDirty(na) test_nattr_flag(na, RunlistDirty)
#define NAttrSetRunlistDirty(na) set_nattr_flag(na, RunlistDirty)
#define NAttrClearRunlistDirty(na) clear_nattr_flag(na, RunlistDirty)
#define NAttrComprClosing(na) test_nattr_flag(na, ComprClosing)
#define NAttrSetComprClosing(na) set_nattr_flag(na, ComprClosing)
#define NAttrClearComprClosing(na) clear_nattr_flag(na, ComprClosing)
#define GenNAttrIno(func_name, flag) \
extern int NAttr##func_name(ntfs_attr *na); \
extern void NAttrSet##func_name(ntfs_attr *na); \
@ -245,11 +284,14 @@ typedef union {
} attr_val;
extern void ntfs_attr_init(ntfs_attr *na, const BOOL non_resident,
const BOOL compressed, const BOOL encrypted, const BOOL sparse,
const ATTR_FLAGS data_flags, const BOOL encrypted,
const BOOL sparse,
const s64 allocated_size, const s64 data_size,
const s64 initialized_size, const s64 compressed_size,
const u8 compression_unit);
/* warning : in the following "name" has to be freeable */
/* or one of constants AT_UNNAMED, NTFS_INDEX_I30 or STREAM_SDS */
extern ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type,
ntfschar *name, u32 name_len);
extern void ntfs_attr_close(ntfs_attr *na);
@ -258,6 +300,7 @@ extern s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count,
void *b);
extern s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count,
const void *b);
extern int ntfs_attr_pclose(ntfs_attr *na);
extern void *ntfs_attr_readall(ntfs_inode *ni, const ATTR_TYPES type,
ntfschar *name, u32 name_len, s64 *data_size);
@ -275,23 +318,26 @@ extern runlist_element *ntfs_attr_find_vcn(ntfs_attr *na, const VCN vcn);
extern int ntfs_attr_size_bounds_check(const ntfs_volume *vol,
const ATTR_TYPES type, const s64 size);
extern int ntfs_attr_can_be_non_resident(const ntfs_volume *vol,
const ATTR_TYPES type);
extern int ntfs_attr_can_be_resident(const ntfs_volume *vol,
const ATTR_TYPES type);
int ntfs_attr_make_non_resident(ntfs_attr *na,
ntfs_attr_search_ctx *ctx);
int ntfs_attr_force_non_resident(ntfs_attr *na);
extern int ntfs_make_room_for_attr(MFT_RECORD *m, u8 *pos, u32 size);
extern int ntfs_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type,
ntfschar *name, u8 name_len, u8 *val, u32 size,
const ntfschar *name, u8 name_len, const u8 *val, u32 size,
ATTR_FLAGS flags);
extern int ntfs_non_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type,
ntfschar *name, u8 name_len, VCN lowest_vcn, int dataruns_size,
ATTR_FLAGS flags);
const ntfschar *name, u8 name_len, VCN lowest_vcn,
int dataruns_size, ATTR_FLAGS flags);
extern int ntfs_attr_record_rm(ntfs_attr_search_ctx *ctx);
extern int ntfs_attr_add(ntfs_inode *ni, ATTR_TYPES type,
ntfschar *name, u8 name_len, u8 *val, s64 size);
ntfschar *name, u8 name_len, const u8 *val, s64 size);
extern int ntfs_attr_set_flags(ntfs_inode *ni, ATTR_TYPES type,
const ntfschar *name, u8 name_len, ATTR_FLAGS flags,
ATTR_FLAGS mask);
extern int ntfs_attr_rm(ntfs_attr *na);
extern int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size);
@ -305,6 +351,7 @@ extern int ntfs_attr_record_move_away(ntfs_attr_search_ctx *ctx, int extra);
extern int ntfs_attr_update_mapping_pairs(ntfs_attr *na, VCN from_vcn);
extern int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize);
extern int ntfs_attr_truncate_solid(ntfs_attr *na, const s64 newsize);
/**
* get_attribute_value_length - return the length of the value of an attribute
@ -339,10 +386,19 @@ extern s64 ntfs_get_attribute_value(const ntfs_volume *vol,
extern void ntfs_attr_name_free(char **name);
extern char *ntfs_attr_name_get(const ntfschar *uname, const int uname_len);
extern int ntfs_attr_exist(ntfs_inode *ni, const ATTR_TYPES type,
ntfschar *name, u32 name_len);
const ntfschar *name, u32 name_len);
extern int ntfs_attr_remove(ntfs_inode *ni, const ATTR_TYPES type,
ntfschar *name, u32 name_len);
extern s64 ntfs_attr_get_free_bits(ntfs_attr *na);
extern int ntfs_attr_data_read(ntfs_inode *ni,
ntfschar *stream_name, int stream_name_len,
char *buf, size_t size, off_t offset);
extern int ntfs_attr_data_write(ntfs_inode *ni,
ntfschar *stream_name, int stream_name_len,
const char *buf, size_t size, off_t offset);
extern int ntfs_attr_shrink_size(ntfs_inode *ni, ntfschar *stream_name,
int stream_name_len, off_t offset);
extern int ntfs_attr_inconsistent(const ATTR_RECORD *a, const MFT_REF mref);
#endif /* defined _NTFS_ATTRIB_H */

View File

@ -0,0 +1,118 @@
/*
* cache.h : deal with indexed LRU caches
*
* Copyright (c) 2008-2010 Jean-Pierre Andre
*
* 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_CACHE_H_
#define _NTFS_CACHE_H_
#include "volume.h"
struct CACHED_GENERIC {
struct CACHED_GENERIC *next;
struct CACHED_GENERIC *previous;
void *variable;
size_t varsize;
union ALIGNMENT payload[0];
} ;
struct CACHED_INODE {
struct CACHED_INODE *next;
struct CACHED_INODE *previous;
const char *pathname;
size_t varsize;
union ALIGNMENT payload[0];
/* above fields must match "struct CACHED_GENERIC" */
u64 inum;
} ;
struct CACHED_NIDATA {
struct CACHED_NIDATA *next;
struct CACHED_NIDATA *previous;
const char *pathname; /* not used */
size_t varsize; /* not used */
union ALIGNMENT payload[0];
/* above fields must match "struct CACHED_GENERIC" */
u64 inum;
ntfs_inode *ni;
} ;
struct CACHED_LOOKUP {
struct CACHED_LOOKUP *next;
struct CACHED_LOOKUP *previous;
const char *name;
size_t namesize;
union ALIGNMENT payload[0];
/* above fields must match "struct CACHED_GENERIC" */
u64 parent;
u64 inum;
} ;
enum {
CACHE_FREE = 1,
CACHE_NOHASH = 2
} ;
typedef int (*cache_compare)(const struct CACHED_GENERIC *cached,
const struct CACHED_GENERIC *item);
typedef void (*cache_free)(const struct CACHED_GENERIC *cached);
typedef int (*cache_hash)(const struct CACHED_GENERIC *cached);
struct HASH_ENTRY {
struct HASH_ENTRY *next;
struct CACHED_GENERIC *entry;
} ;
struct CACHE_HEADER {
const char *name;
struct CACHED_GENERIC *most_recent_entry;
struct CACHED_GENERIC *oldest_entry;
struct CACHED_GENERIC *free_entry;
struct HASH_ENTRY *free_hash;
struct HASH_ENTRY **first_hash;
cache_free dofree;
cache_hash dohash;
unsigned long reads;
unsigned long writes;
unsigned long hits;
int fixed_size;
int max_hash;
struct CACHED_GENERIC entry[0];
} ;
/* cast to generic, avoiding gcc warnings */
#define GENERIC(pstr) ((const struct CACHED_GENERIC*)(const void*)(pstr))
struct CACHED_GENERIC *ntfs_fetch_cache(struct CACHE_HEADER *cache,
const struct CACHED_GENERIC *wanted,
cache_compare compare);
struct CACHED_GENERIC *ntfs_enter_cache(struct CACHE_HEADER *cache,
const struct CACHED_GENERIC *item,
cache_compare compare);
int ntfs_invalidate_cache(struct CACHE_HEADER *cache,
const struct CACHED_GENERIC *item,
cache_compare compare, int flags);
int ntfs_remove_cache(struct CACHE_HEADER *cache,
struct CACHED_GENERIC *item, int flags);
void ntfs_create_lru_caches(ntfs_volume *vol);
void ntfs_free_lru_caches(ntfs_volume *vol);
#endif /* _NTFS_CACHE_H_ */

View File

@ -29,9 +29,6 @@
#define NTFS_COLLATION_ERROR -2
extern BOOL ntfs_is_collation_rule_supported(COLLATION_RULES cr);
extern int ntfs_collate(ntfs_volume *vol, COLLATION_RULES cr,
const void *data1, const int data1_len,
const void *data2, const int data2_len);
extern COLLATE ntfs_get_collate_function(COLLATION_RULES);
#endif /* _NTFS_COLLATE_H */

View File

@ -1,9 +1,10 @@
/*
* compat.h - Tweaks for Windows compatibility.
* compat.h - Tweaks for compatibility with non-Linux systems.
*
* Copyright (c) 2002 Richard Russon
* Copyright (c) 2002-2004 Anton Altaparmakov
* Copyright (c) 2008-2009 Szabolcs Szakacsits
* Copyright (c) 2019 Jean-Pierre Andre
*
* 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
@ -31,6 +32,30 @@
#include <sys/param.h>
#endif
#include <errno.h> /* ENODATA */
#ifndef ENODATA
#define ENODATA ENOENT
#endif
#ifndef ELIBBAD
#define ELIBBAD ENOEXEC
#endif
#ifndef ELIBACC
#define ELIBACC ENOENT
#endif
/* xattr APIs in macOS differs from Linux ones in that they expect the special
* error code ENOATTR to be returned when an attribute cannot be found. So
* define NTFS_NOXATTR_ERRNO to the appropriate "no xattr found" errno value for
* the platform. */
#if defined(__APPLE__) || defined(__DARWIN__)
#define NTFS_NOXATTR_ERRNO ENOATTR
#else
#define NTFS_NOXATTR_ERRNO ENODATA
#endif
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif

View File

@ -29,5 +29,13 @@
extern s64 ntfs_compressed_attr_pread(ntfs_attr *na, s64 pos, s64 count,
void *b);
extern s64 ntfs_compressed_pwrite(ntfs_attr *na, runlist_element *brl, s64 wpos,
s64 offs, s64 to_write, s64 rounded,
const void *b, int compressed_part,
VCN *update_from);
extern int ntfs_compressed_close(ntfs_attr *na, runlist_element *brl,
s64 offs, VCN *update_from);
#endif /* defined _NTFS_COMPRESS_H */

View File

@ -38,10 +38,10 @@ static __inline__ void ntfs_debug_runlist_dump(const struct _runlist_element *rl
#define NTFS_BUG(msg) \
{ \
int ___i; \
int ___i = 1; \
ntfs_log_critical("Bug in %s(): %s\n", __FUNCTION__, msg); \
ntfs_log_debug("Forcing segmentation fault!"); \
___i = ((int*)NULL)[1]; \
___i = ((int*)NULL)[___i]; \
}
#endif /* defined _NTFS_DEBUG_H */

View File

@ -1,7 +1,8 @@
/*
* device.h - Exports for low level device io. Originated from the Linux-NTFS project.
*
* Copyright (c) 2000-2006 Anton Altaparmakov
* Copyright (c) 2000-2013 Anton Altaparmakov
* Copyright (c) 2008-2013 Tuxera Inc.
*
* 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
@ -41,6 +42,7 @@ typedef enum {
ND_ReadOnly, /* 1: Device is read-only. */
ND_Dirty, /* 1: Device is dirty, needs sync. */
ND_Block, /* 1: Device is a block device. */
ND_Sync, /* 1: Device is mounted with "-o sync" */
} ntfs_device_state_bits;
#define test_ndev_flag(nd, flag) test_bit(ND_##flag, (nd)->d_state)
@ -63,11 +65,20 @@ typedef enum {
#define NDevSetBlock(nd) set_ndev_flag(nd, Block)
#define NDevClearBlock(nd) clear_ndev_flag(nd, Block)
#define NDevSync(nd) test_ndev_flag(nd, Sync)
#define NDevSetSync(nd) set_ndev_flag(nd, Sync)
#define NDevClearSync(nd) clear_ndev_flag(nd, Sync)
/**
* struct ntfs_device -
*
* The ntfs device structure defining all operations needed to access the low
* level device underlying the ntfs volume.
*
* Note d_heads and d_sectors_per_track are only set as a result of a call to
* either ntfs_device_heads_get() or ntfs_device_sectors_per_track_get() (both
* calls will set up both fields or if getting them failed they will be left at
* -1).
*/
struct ntfs_device {
struct ntfs_device_operations *d_ops; /* Device operations. */
@ -75,6 +86,10 @@ struct ntfs_device {
char *d_name; /* Name of device. */
void *d_private; /* Private data used by the
device operations. */
int d_heads; /* Disk geometry: number of
heads or -1. */
int d_sectors_per_track; /* Disk geometry: number of
sectors per track or -1. */
};
struct stat;
@ -96,12 +111,14 @@ struct ntfs_device_operations {
s64 offset);
int (*sync)(struct ntfs_device *dev);
int (*stat)(struct ntfs_device *dev, struct stat *buf);
int (*ioctl)(struct ntfs_device *dev, int request, void *argp);
int (*ioctl)(struct ntfs_device *dev, unsigned long request,
void *argp);
};
extern struct ntfs_device *ntfs_device_alloc(const char *name, const long state,
struct ntfs_device_operations *dops, void *priv_data);
extern int ntfs_device_free(struct ntfs_device *dev);
extern int ntfs_device_sync(struct ntfs_device *dev);
extern s64 ntfs_pread(struct ntfs_device *dev, const s64 pos, s64 count,
void *b);

View File

@ -28,12 +28,18 @@
#ifndef NO_NTFS_DEVICE_DEFAULT_IO_OPS
#ifndef __CYGWIN32__
#if defined(linux) || defined(__uClinux__) || defined(__sun) \
|| defined(__APPLE__) || defined(__DARWIN__)
/* Make sure the presence of <windows.h> means compiling for Windows */
#undef HAVE_WINDOWS_H
#endif
/* Not on Cygwin; use standard Unix style low level device operations. */
#ifndef HAVE_WINDOWS_H
/* Not for Windows use standard Unix style low level device operations. */
#define ntfs_device_default_io_ops ntfs_device_unix_io_ops
#else /* __CYGWIN32__ */
#else /* HAVE_WINDOWS_H */
#ifndef HDIO_GETGEO
# define HDIO_GETGEO 0x301
@ -60,10 +66,15 @@ struct hd_geometry {
# define BLKBSZSET 0x40041271
#endif
/* On Cygwin; use Win32 low level device operations. */
/* On Windows (and Cygwin) : use Win32 low level device operations. */
#define ntfs_device_default_io_ops ntfs_device_win32_io_ops
#endif /* __CYGWIN32__ */
/* A few useful functions */
int ntfs_win32_set_sparse(int);
int ntfs_win32_ftruncate(int fd, s64 size);
int ntfs_device_win32_ftruncate(struct ntfs_device*, s64);
#endif /* HAVE_WINDOWS_H */
/* Forward declaration. */

View File

@ -61,21 +61,25 @@ extern ntfschar NTFS_INDEX_R[3];
extern u64 ntfs_inode_lookup_by_name(ntfs_inode *dir_ni,
const ntfschar *uname, const int uname_len);
extern u64 ntfs_inode_lookup_by_mbsname(ntfs_inode *dir_ni, const char *name);
extern void ntfs_inode_update_mbsname(ntfs_inode *dir_ni, const char *name,
u64 inum);
extern ntfs_inode *ntfs_pathname_to_inode(ntfs_volume *vol, ntfs_inode *parent,
const char *pathname);
extern ntfs_inode *ntfs_create(ntfs_inode *dir_ni, ntfschar *name, u8 name_len,
dev_t type);
extern ntfs_inode *ntfs_create_device(ntfs_inode *dir_ni,
ntfschar *name, u8 name_len, dev_t type, dev_t dev);
extern ntfs_inode *ntfs_create_symlink(ntfs_inode *dir_ni,
ntfschar *name, u8 name_len, ntfschar *target, int target_len);
extern ntfs_inode *ntfs_create(ntfs_inode *dir_ni, le32 securid,
const ntfschar *name, u8 name_len, mode_t type);
extern ntfs_inode *ntfs_create_device(ntfs_inode *dir_ni, le32 securid,
const ntfschar *name, u8 name_len, mode_t type, dev_t dev);
extern ntfs_inode *ntfs_create_symlink(ntfs_inode *dir_ni, le32 securid,
const ntfschar *name, u8 name_len, const ntfschar *target,
int target_len);
extern int ntfs_check_empty_dir(ntfs_inode *ni);
extern int ntfs_delete(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name,
extern int ntfs_delete(ntfs_volume *vol, const char *path,
ntfs_inode *ni, ntfs_inode *dir_ni, const ntfschar *name,
u8 name_len);
extern int ntfs_link(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name,
extern int ntfs_link(ntfs_inode *ni, ntfs_inode *dir_ni, const ntfschar *name,
u8 name_len);
/*
@ -90,6 +94,7 @@ extern int ntfs_link(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name,
#define NTFS_DT_LNK 10
#define NTFS_DT_SOCK 12
#define NTFS_DT_WHT 14
#define NTFS_DT_REPARSE 32
/*
* This is the "ntfs_filldir" function type, used by ntfs_readdir() to let
@ -104,5 +109,24 @@ typedef int (*ntfs_filldir_t)(void *dirent, const ntfschar *name,
extern int ntfs_readdir(ntfs_inode *dir_ni, s64 *pos,
void *dirent, ntfs_filldir_t filldir);
ntfs_inode *ntfs_dir_parent_inode(ntfs_inode *ni);
u32 ntfs_interix_types(ntfs_inode *ni);
int ntfs_get_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni,
char *value, size_t size);
int ntfs_set_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni,
const char *value, size_t size, int flags);
int ntfs_remove_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni);
int ntfs_dir_link_cnt(ntfs_inode *ni);
#if CACHE_INODE_SIZE
struct CACHED_GENERIC;
extern int ntfs_dir_inode_hash(const struct CACHED_GENERIC *cached);
extern int ntfs_dir_lookup_hash(const struct CACHED_GENERIC *cached);
#endif
#endif /* defined _NTFS_DIR_H */

View File

@ -0,0 +1,37 @@
/*
*
* Copyright (c) 2014-2021 Jean-Pierre Andre
*
*/
/*
* This program 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 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 EA_H
#define EA_H
int ntfs_ea_check_wsldev(ntfs_inode *ni, dev_t *rdevp);
int ntfs_ea_set_wsl_not_symlink(ntfs_inode *ni, mode_t mode, dev_t dev);
int ntfs_get_ntfs_ea(ntfs_inode *ni, char *value, size_t size);
int ntfs_set_ntfs_ea(ntfs_inode *ni, const char *value, size_t size, int flags);
int ntfs_remove_ntfs_ea(ntfs_inode *ni);
#endif /* EA_H */

View File

@ -1,7 +1,6 @@
/*
* device_io.c - Default device io operations. Originated from the Linux-NTFS project.
*
* Copyright (c) 2003 Anton Altaparmakov
* Copyright (c) 2009 Martin Bene
*
* 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
@ -19,20 +18,13 @@
* Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef EFS_H
#define EFS_H
#ifndef NO_NTFS_DEVICE_DEFAULT_IO_OPS
int ntfs_get_efs_info(ntfs_inode *ni, char *value, size_t size);
#ifndef __CYGWIN32__
int ntfs_set_efs_info(ntfs_inode *ni,
const char *value, size_t size, int flags);
int ntfs_efs_fixup_attribute(ntfs_attr_search_ctx *ctx, ntfs_attr *na);
/* Not on Cygwin; use standard Unix style low level device operations. */
#include "unix_io.c"
#else /* __CYGWIN32__ */
/* On Cygwin; use Win32 low level device operations. */
#include "win32_io.c"
#endif /* __CYGWIN32__ */
#endif /* NO_NTFS_DEVICE_DEFAULT_IO_OPS */
#endif /* EFS_H */

View File

@ -61,10 +61,16 @@
# define __BYTE_ORDER BYTE_ORDER
# define __LITTLE_ENDIAN LITTLE_ENDIAN
# define __BIG_ENDIAN BIG_ENDIAN
# elif defined(__BYTE_ORDER__)
# elif defined(__BYTE_ORDER__) && defined(__LITTLE_ENDIAN__) && \
defined(__BIG_ENDIAN__)
# define __BYTE_ORDER __BYTE_ORDER__
# define __LITTLE_ENDIAN __LITTLE_ENDIAN__
# define __BIG_ENDIAN __BIG_ENDIAN__
# elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
defined(__ORDER_BIG_ENDIAN__)
# define __BYTE_ORDER __BYTE_ORDER__
# define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
# define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
# elif (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \
defined(WORDS_LITTLEENDIAN)
# define __BYTE_ORDER 1
@ -126,6 +132,22 @@
#define __constant_cpu_to_le32(x) (x)
#define __constant_cpu_to_le64(x) (x)
#define __be16_to_cpu(x) bswap_16(x)
#define __be32_to_cpu(x) bswap_32(x)
#define __be64_to_cpu(x) bswap_64(x)
#define __cpu_to_be16(x) bswap_16(x)
#define __cpu_to_be32(x) bswap_32(x)
#define __cpu_to_be64(x) bswap_64(x)
#define __constant_be16_to_cpu(x) __ntfs_bswap_constant_16((u16)(x))
#define __constant_be32_to_cpu(x) __ntfs_bswap_constant_32((u32)(x))
#define __constant_be64_to_cpu(x) __ntfs_bswap_constant_64((u64)(x))
#define __constant_cpu_to_be16(x) __ntfs_bswap_constant_16((u16)(x))
#define __constant_cpu_to_be32(x) __ntfs_bswap_constant_32((u32)(x))
#define __constant_cpu_to_be64(x) __ntfs_bswap_constant_64((u64)(x))
#elif defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)
#define __le16_to_cpu(x) bswap_16(x)
@ -144,6 +166,22 @@
#define __constant_cpu_to_le32(x) __ntfs_bswap_constant_32((u32)(x))
#define __constant_cpu_to_le64(x) __ntfs_bswap_constant_64((u64)(x))
#define __be16_to_cpu(x) (x)
#define __be32_to_cpu(x) (x)
#define __be64_to_cpu(x) (x)
#define __cpu_to_be16(x) (x)
#define __cpu_to_be32(x) (x)
#define __cpu_to_be64(x) (x)
#define __constant_be16_to_cpu(x) (x)
#define __constant_be32_to_cpu(x) (x)
#define __constant_be64_to_cpu(x) (x)
#define __constant_cpu_to_be16(x) (x)
#define __constant_cpu_to_be32(x) (x)
#define __constant_cpu_to_be64(x) (x)
#else
#error "You must define __BYTE_ORDER to be __LITTLE_ENDIAN or __BIG_ENDIAN."
@ -190,14 +228,78 @@
#define cpu_to_sle32p(x) (s32)__cpu_to_le32(*(s32*)(x))
#define cpu_to_sle64p(x) (s64)__cpu_to_le64(*(s64*)(x))
/* Unsigned from BE to CPU conversion. */
#define be16_to_cpu(x) (u16)__be16_to_cpu((u16)(x))
#define be32_to_cpu(x) (u32)__be32_to_cpu((u32)(x))
#define be64_to_cpu(x) (u64)__be64_to_cpu((u64)(x))
#define be16_to_cpup(x) (u16)__be16_to_cpu(*(const u16*)(x))
#define be32_to_cpup(x) (u32)__be32_to_cpu(*(const u32*)(x))
#define be64_to_cpup(x) (u64)__be64_to_cpu(*(const u64*)(x))
/* Signed from BE to CPU conversion. */
#define sbe16_to_cpu(x) (s16)__be16_to_cpu((s16)(x))
#define sbe32_to_cpu(x) (s32)__be32_to_cpu((s32)(x))
#define sbe64_to_cpu(x) (s64)__be64_to_cpu((s64)(x))
#define sbe16_to_cpup(x) (s16)__be16_to_cpu(*(s16*)(x))
#define sbe32_to_cpup(x) (s32)__be32_to_cpu(*(s32*)(x))
#define sbe64_to_cpup(x) (s64)__be64_to_cpu(*(s64*)(x))
/* Unsigned from CPU to BE conversion. */
#define cpu_to_be16(x) (u16)__cpu_to_be16((u16)(x))
#define cpu_to_be32(x) (u32)__cpu_to_be32((u32)(x))
#define cpu_to_be64(x) (u64)__cpu_to_be64((u64)(x))
#define cpu_to_be16p(x) (u16)__cpu_to_be16(*(u16*)(x))
#define cpu_to_be32p(x) (u32)__cpu_to_be32(*(u32*)(x))
#define cpu_to_be64p(x) (u64)__cpu_to_be64(*(u64*)(x))
/* Signed from CPU to BE conversion. */
#define cpu_to_sbe16(x) (s16)__cpu_to_be16((s16)(x))
#define cpu_to_sbe32(x) (s32)__cpu_to_be32((s32)(x))
#define cpu_to_sbe64(x) (s64)__cpu_to_be64((s64)(x))
#define cpu_to_sbe16p(x) (s16)__cpu_to_be16(*(s16*)(x))
#define cpu_to_sbe32p(x) (s32)__cpu_to_be32(*(s32*)(x))
#define cpu_to_sbe64p(x) (s64)__cpu_to_be64(*(s64*)(x))
/* Constant endianness conversion defines. */
#define const_le16_to_cpu(x) __constant_le16_to_cpu(x)
#define const_le32_to_cpu(x) __constant_le32_to_cpu(x)
#define const_le64_to_cpu(x) __constant_le64_to_cpu(x)
#define const_le16_to_cpu(x) ((u16) __constant_le16_to_cpu(x))
#define const_le32_to_cpu(x) ((u32) __constant_le32_to_cpu(x))
#define const_le64_to_cpu(x) ((u64) __constant_le64_to_cpu(x))
#define const_cpu_to_le16(x) __constant_cpu_to_le16(x)
#define const_cpu_to_le32(x) __constant_cpu_to_le32(x)
#define const_cpu_to_le64(x) __constant_cpu_to_le64(x)
#define const_cpu_to_le16(x) ((le16) __constant_cpu_to_le16(x))
#define const_cpu_to_le32(x) ((le32) __constant_cpu_to_le32(x))
#define const_cpu_to_le64(x) ((le64) __constant_cpu_to_le64(x))
#define const_sle16_to_cpu(x) ((s16) __constant_le16_to_cpu((le16) x))
#define const_sle32_to_cpu(x) ((s32) __constant_le32_to_cpu((le32) x))
#define const_sle64_to_cpu(x) ((s64) __constant_le64_to_cpu((le64) x))
#define const_cpu_to_sle16(x) ((sle16) __constant_cpu_to_le16((u16) x))
#define const_cpu_to_sle32(x) ((sle32) __constant_cpu_to_le32((u32) x))
#define const_cpu_to_sle64(x) ((sle64) __constant_cpu_to_le64((u64) x))
#define const_be16_to_cpu(x) ((u16) __constant_be16_to_cpu(x)))
#define const_be32_to_cpu(x) ((u32) __constant_be32_to_cpu(x)))
#define const_be64_to_cpu(x) ((u64) __constant_be64_to_cpu(x)))
#define const_cpu_to_be16(x) ((be16) __constant_cpu_to_be16(x))
#define const_cpu_to_be32(x) ((be32) __constant_cpu_to_be32(x))
#define const_cpu_to_be64(x) ((be64) __constant_cpu_to_be64(x))
#define const_sbe16_to_cpu(x) ((s16) __constant_be16_to_cpu((be16) x))
#define const_sbe32_to_cpu(x) ((s32) __constant_be32_to_cpu((be32) x))
#define const_sbe64_to_cpu(x) ((s64) __constant_be64_to_cpu((be64) x))
#define const_cpu_to_sbe16(x) ((sbe16) __constant_cpu_to_be16((u16) x))
#define const_cpu_to_sbe32(x) ((sbe32) __constant_cpu_to_be32((u32) x))
#define const_cpu_to_sbe64(x) ((sbe64) __constant_cpu_to_be64((u64) x))
#endif /* defined _NTFS_ENDIANS_H */

View File

@ -25,6 +25,34 @@
#ifndef _NTFS_INDEX_H
#define _NTFS_INDEX_H
/* Convenience macros to test the versions of gcc.
* Use them like this:
* #if __GNUC_PREREQ (2,8)
* ... code requiring gcc 2.8 or later ...
* #endif
* Note - they won't work for gcc1 or glibc1, since the _MINOR macros
* were not defined then.
*/
#ifndef __GNUC_PREREQ
# if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
# else
# define __GNUC_PREREQ(maj, min) 0
# endif
#endif
/* allows us to warn about unused results of certain function calls */
#ifndef __attribute_warn_unused_result__
# if __GNUC_PREREQ (3,4)
# define __attribute_warn_unused_result__ \
__attribute__ ((__warn_unused_result__))
# else
# define __attribute_warn_unused_result__ /* empty */
# endif
#endif
#include "attrib.h"
#include "types.h"
#include "layout.h"
@ -35,6 +63,9 @@
#define MAX_PARENT_VCN 32
typedef int (*COLLATE)(ntfs_volume *vol, const void *data1, int len1,
const void *data2, int len2);
/**
* struct ntfs_index_context -
* @ni: inode containing the @entry described by this context
@ -88,7 +119,7 @@ typedef struct {
INDEX_ENTRY *entry;
void *data;
u16 data_len;
COLLATION_RULES cr;
COLLATE collate;
BOOL is_in_root;
INDEX_ROOT *ir;
ntfs_attr_search_ctx *actx;
@ -98,6 +129,7 @@ typedef struct {
VCN parent_vcn[MAX_PARENT_VCN]; /* entry's parent nodes */
int pindex; /* maximum it's the number of the parent nodes */
BOOL ib_dirty;
BOOL bad_index;
u32 block_size;
u8 vcn_size_bits;
} ntfs_index_context;
@ -107,12 +139,20 @@ extern ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *ni,
extern void ntfs_index_ctx_put(ntfs_index_context *ictx);
extern void ntfs_index_ctx_reinit(ntfs_index_context *ictx);
extern int ntfs_index_block_inconsistent(const INDEX_BLOCK *ib, u32 block_size,
u64 inum, VCN vcn);
extern int ntfs_index_entry_inconsistent(const INDEX_ENTRY *ie,
COLLATION_RULES collation_rule, u64 inum);
extern int ntfs_index_lookup(const void *key, const int key_len,
ntfs_index_context *ictx) __attribute_warn_unused_result__;
extern INDEX_ENTRY *ntfs_index_next(INDEX_ENTRY *ie,
ntfs_index_context *ictx);
extern int ntfs_index_add_filename(ntfs_inode *ni, FILE_NAME_ATTR *fn,
MFT_REF mref);
extern int ntfs_index_remove(ntfs_inode *ni, const void *key, const int keylen);
extern int ntfs_index_remove(ntfs_inode *dir_ni, ntfs_inode *ni,
const void *key, const int keylen);
extern INDEX_ROOT *ntfs_index_root_get(ntfs_inode *ni, ATTR_RECORD *attr);
@ -124,5 +164,9 @@ extern char *ntfs_ie_filename_get(INDEX_ENTRY *ie);
extern void ntfs_ie_filename_dump(INDEX_ENTRY *ie);
extern void ntfs_ih_filename_dump(INDEX_HEADER *ih);
/* the following was added by JPA for use in security.c */
extern int ntfs_ie_add(ntfs_index_context *icx, INDEX_ENTRY *ie);
extern int ntfs_index_rm(ntfs_index_context *icx);
#endif /* _NTFS_INDEX_H */

View File

@ -32,6 +32,7 @@ typedef struct _ntfs_inode ntfs_inode;
#include "layout.h"
#include "support.h"
#include "volume.h"
#include "ntfstime.h"
/**
* enum ntfs_inode_state_bits -
@ -48,6 +49,9 @@ typedef enum {
mft record and then to disk. */
NI_FileNameDirty, /* 1: FILE_NAME attributes need to be updated
in the index. */
NI_v3_Extensions, /* 1: JPA v3.x extensions present. */
NI_TimesSet, /* 1: Use times which were set */
NI_KnownSize, /* 1: Set if sizes are meaningful */
} ntfs_inode_state_bits;
#define test_nino_flag(ni, flag) test_bit(NI_##flag, (ni)->state)
@ -133,8 +137,11 @@ struct _ntfs_inode {
* These two fields are used to sync filename index and guaranteed to be
* correct, however value in index itself maybe wrong (windows itself
* do not update them properly).
* For directories, they hold the index size, provided the
* flag KnownSize is set.
*/
s64 data_size; /* Data size of unnamed DATA attribute. */
s64 data_size; /* Data size of unnamed DATA attribute
(or INDEX_ROOT for directories) */
s64 allocated_size; /* Allocated size stored in the filename
index. (NOTE: Equal to allocated size of
the unnamed data attribute for normal or
@ -147,10 +154,16 @@ struct _ntfs_inode {
* STANDARD_INFORMATION attribute and used to sync it and FILE_NAME
* attribute in the index.
*/
time_t creation_time;
time_t last_data_change_time;
time_t last_mft_change_time;
time_t last_access_time;
ntfs_time creation_time;
ntfs_time last_data_change_time;
ntfs_time last_mft_change_time;
ntfs_time last_access_time;
/* NTFS 3.x extensions added by JPA */
/* only if NI_v3_Extensions is set in state */
le32 owner_id;
le32 security_id;
le64 quota_charged;
le64 usn;
};
typedef enum {
@ -169,9 +182,22 @@ extern ntfs_inode *ntfs_inode_allocate(ntfs_volume *vol);
extern ntfs_inode *ntfs_inode_open(ntfs_volume *vol, const MFT_REF mref);
extern int ntfs_inode_close(ntfs_inode *ni);
extern int ntfs_inode_close_in_dir(ntfs_inode *ni, ntfs_inode *dir_ni);
#if CACHE_NIDATA_SIZE
struct CACHED_GENERIC;
extern int ntfs_inode_real_close(ntfs_inode *ni);
extern void ntfs_inode_invalidate(ntfs_volume *vol, const MFT_REF mref);
extern void ntfs_inode_nidata_free(const struct CACHED_GENERIC *cached);
extern int ntfs_inode_nidata_hash(const struct CACHED_GENERIC *item);
#endif
extern ntfs_inode *ntfs_extent_inode_open(ntfs_inode *base_ni,
const MFT_REF mref);
const leMFT_REF mref);
extern int ntfs_inode_attach_all_extents(ntfs_inode *ni);
@ -187,4 +213,13 @@ extern int ntfs_inode_free_space(ntfs_inode *ni, int size);
extern int ntfs_inode_badclus_bad(u64 mft_no, ATTR_RECORD *a);
extern int ntfs_inode_get_times(ntfs_inode *ni, char *value, size_t size);
extern int ntfs_inode_set_times(ntfs_inode *ni, const char *value,
size_t size, int flags);
/* debugging */
#define debug_double_inode(num, type)
#define debug_cached_inode(ni)
#endif /* defined _NTFS_INODE_H */

View File

@ -0,0 +1,35 @@
/*
*
* Copyright (c) 2014 Jean-Pierre Andre
*
*/
/*
* This program 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 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 IOCTL_H
#define IOCTL_H
/*
* Using an "unsigned long cmd" internally, like in <sys/ioctl.h> for Linux
* Note however that fuse truncates the arg to 32 bits, and that
* some commands (e.g. FITRIM) do not fit in a signed 32 bit field.
*/
int ntfs_ioctl(ntfs_inode *ni, unsigned long cmd, void *arg,
unsigned int flags, void *data);
#endif /* IOCTL_H */

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,7 @@ extern runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
LCN start_lcn, const NTFS_CLUSTER_ALLOCATION_ZONES zone);
extern int ntfs_cluster_free_from_rl(ntfs_volume *vol, runlist *rl);
extern int ntfs_cluster_free_basic(ntfs_volume *vol, s64 lcn, s64 count);
extern int ntfs_cluster_free(ntfs_volume *vol, ntfs_attr *na, VCN start_vcn,
s64 count);

View File

@ -2,6 +2,7 @@
* logfile.h - Exports for $LogFile handling. Originated from the Linux-NTFS project.
*
* Copyright (c) 2000-2005 Anton Altaparmakov
* Copyright (c) 2016 Jean-Pierre Andre
*
* 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
@ -93,7 +94,8 @@ typedef struct {
version is 1. */
/* 28*/ sle16 major_ver; /* Log file major version. We only support
version 1.1. */
/* sizeof() = 30 (0x1e) bytes */
/* 30*/ le16 usn;
/* sizeof() = 32 (0x20) bytes */
} __attribute__((__packed__)) RESTART_PAGE_HEADER;
/*
@ -101,8 +103,8 @@ typedef struct {
* in this particular client array. Also inside the client records themselves,
* this means that there are no client records preceding or following this one.
*/
#define LOGFILE_NO_CLIENT const_cpu_to_le16(0xffff)
#define LOGFILE_NO_CLIENT_CPU 0xffff
#define LOGFILE_NO_CLIENT const_cpu_to_le16(LOGFILE_NO_CLIENT_CPU)
/*
* These are the so far known RESTART_AREA_* flags (16-bit) which contain
@ -308,35 +310,36 @@ typedef struct {
typedef struct {
/* 0 NTFS_RECORD; -- Unfolded here as gcc doesn't like unnamed structs. */
NTFS_RECORD_TYPES magic;/* Usually the magic is "RCRD". */
u16 usa_ofs; /* See NTFS_RECORD definition in layout.h.
le16 usa_ofs; /* See NTFS_RECORD definition in layout.h.
When creating, set this to be immediately
after this header structure (without any
alignment). */
u16 usa_count; /* See NTFS_RECORD definition in layout.h. */
le16 usa_count; /* See NTFS_RECORD definition in layout.h. */
union {
LSN last_lsn;
s64 file_offset;
leLSN last_lsn;
sle64 file_offset;
} __attribute__((__packed__)) copy;
u32 flags;
u16 page_count;
u16 page_position;
union {
struct {
u16 next_record_offset;
u8 reserved[6];
LSN last_end_lsn;
} __attribute__((__packed__)) packed;
} __attribute__((__packed__)) header;
le32 flags;
le16 page_count;
le16 page_position;
le16 next_record_offset;
le16 reserved[3];
leLSN last_end_lsn;
} __attribute__((__packed__)) RECORD_PAGE_HEADER;
/**
* enum LOG_RECORD_FLAGS - Possible 16-bit flags for log records.
*
* Some flags describe what kind of update is being logged.
*
* (Or is it log record pages?)
*/
typedef enum {
LOG_RECORD_MULTI_PAGE = const_cpu_to_le16(0x0001), /* ??? */
/* The flags below were introduced in Windows 10 */
LOG_RECORD_DELETING = const_cpu_to_le16(0x0002),
LOG_RECORD_ADDING = const_cpu_to_le16(0x0004),
LOG_RECORD_SIZE_PLACE_HOLDER = 0xffff,
/* This has nothing to do with the log record. It is only so
gcc knows to make the flags 16-bit. */
@ -346,47 +349,120 @@ typedef enum {
* struct LOG_CLIENT_ID - The log client id structure identifying a log client.
*/
typedef struct {
u16 seq_number;
u16 client_index;
le16 seq_number;
le16 client_index;
} __attribute__((__packed__)) LOG_CLIENT_ID;
/*
* LOG_RECORD_TYPE : types of log records
*/
enum {
LOG_STANDARD = const_cpu_to_le32(1),
LOG_CHECKPOINT = const_cpu_to_le32(2),
LOG_RECORD_TYPE_PLACE_HOLDER = 0xffffffffU
} ;
typedef le32 LOG_RECORD_TYPE;
/*
* ATTRIBUTE_FLAGS : flags describing the kind of NTFS record
* is being updated.
* These flags were introduced in Vista, only two flags are known?
*/
enum {
ACTS_ON_MFT = const_cpu_to_le16(2),
ACTS_ON_INDX = const_cpu_to_le16(8),
ATTRIBUTE_FLAGS_PLACE_HOLDER = 0xffff,
} ;
typedef le16 ATTRIBUTE_FLAGS;
#define LOG_RECORD_HEAD_SZ 0x30 /* size of header of struct LOG_RECORD */
/**
* struct LOG_RECORD - Log record header.
*
* Each log record seems to have a constant size of 0x70 bytes.
*/
typedef struct {
LSN this_lsn;
LSN client_previous_lsn;
LSN client_undo_next_lsn;
u32 client_data_length;
leLSN this_lsn;
leLSN client_previous_lsn;
leLSN client_undo_next_lsn;
le32 client_data_length;
LOG_CLIENT_ID client_id;
u32 record_type;
u32 transaction_id;
u16 flags;
u16 reserved_or_alignment[3];
LOG_RECORD_TYPE record_type;
le32 transaction_id;
LOG_RECORD_FLAGS log_record_flags;
le16 reserved_or_alignment[3];
/* Now are at ofs 0x30 into struct. */
u16 redo_operation;
u16 undo_operation;
u16 redo_offset;
u16 redo_length;
u16 undo_offset;
u16 undo_length;
u16 target_attribute;
u16 lcns_to_follow; /* Number of lcn_list entries
le16 redo_operation;
le16 undo_operation;
le16 redo_offset;
le16 redo_length;
union {
struct {
le16 undo_offset;
le16 undo_length;
le16 target_attribute;
le16 lcns_to_follow; /* Number of lcn_list entries
following this entry. */
/* Now at ofs 0x40. */
u16 record_offset;
u16 attribute_offset;
u32 alignment_or_reserved;
VCN target_vcn;
le16 record_offset;
le16 attribute_offset;
le16 cluster_index;
ATTRIBUTE_FLAGS attribute_flags;
leVCN target_vcn;
/* Now at ofs 0x50. */
struct { /* Only present if lcns_to_follow
is not 0. */
LCN lcn;
} __attribute__((__packed__)) lcn_list[0];
leLCN lcn_list[0]; /* Only present if lcns_to_follow
is not 0. */
} __attribute__((__packed__));
struct {
leLSN transaction_lsn;
leLSN attributes_lsn;
leLSN names_lsn;
leLSN dirty_pages_lsn;
le64 unknown_list[0];
} __attribute__((__packed__));
} __attribute__((__packed__));
} __attribute__((__packed__)) LOG_RECORD;
/**
* struct BITMAP_ACTION - Bitmap change being logged
*/
struct BITMAP_ACTION {
le32 firstbit;
le32 count;
} ;
/**
* struct ATTR - Attribute record.
*
* The format of an attribute record has changed from Windows 10.
* The old format was 44 bytes long, despite having 8 bytes fields,
* and this leads to alignment problems in arrays.
* This problem does not occur in the new format, which is shorter.
* The format being used can generally be determined from size.
*/
typedef struct { /* Format up to Win10 (44 bytes) */
le64 unknown1;
le64 unknown2;
le64 inode;
leLSN lsn;
le32 unknown3;
le32 type;
le32 unknown4;
} __attribute__((__packed__)) ATTR_OLD;
typedef struct { /* Format since Win10 (40 bytes) */
le64 unknown1;
le64 unknown2;
le32 type;
le32 unknown3;
le64 inode;
leLSN lsn;
} __attribute__((__packed__)) ATTR_NEW;
extern BOOL ntfs_check_logfile(ntfs_attr *log_na, RESTART_PAGE_HEADER **rp);
extern BOOL ntfs_is_logfile_clean(ntfs_attr *log_na, RESTART_PAGE_HEADER *rp);
extern int ntfs_empty_logfile(ntfs_attr *na);

View File

@ -114,5 +114,8 @@ int ntfs_log_redirect(const char *function, const char *file, int line,
#define ntfs_log_leave(FORMAT, ARGS...)do {} while (0)
#endif /* DEBUG */
void ntfs_log_early_error(const char *format, ...)
__attribute__((format(printf, 1, 2)));
#endif /* _LOGGING_H_ */

View File

@ -124,6 +124,8 @@ extern int ntfs_mft_record_format(const ntfs_volume *vol, const MFT_REF mref);
extern ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, ntfs_inode *base_ni);
extern ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol, BOOL mft_data);
extern int ntfs_mft_record_free(ntfs_volume *vol, ntfs_inode *ni);
extern int ntfs_mft_usn_dec(MFT_RECORD *mrec);

View File

@ -1,8 +1,32 @@
/*
* misc.h : miscellaneous exports
* - memory allocation
*
* Copyright (c) 2008 Jean-Pierre Andre
*
* 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_MISC_H_
#define _NTFS_MISC_H_
void *ntfs_calloc(size_t size);
void *ntfs_malloc(size_t size);
void *ntfs_realloc(void *ptr, size_t size);
void ntfs_free(void *ptr);
#endif /* _NTFS_MISC_H_ */

View File

@ -25,8 +25,11 @@
#include "types.h"
#include "layout.h"
#include "volume.h"
extern int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size);
extern int ntfs_mst_post_read_fixup_warn(NTFS_RECORD *b, const u32 size,
BOOL warn);
extern int ntfs_mst_pre_write_fixup(NTFS_RECORD *b, const u32 size);
extern void ntfs_mst_post_write_fixup(NTFS_RECORD *b);

View File

@ -3,6 +3,7 @@
*
* Copyright (c) 2005 Anton Altaparmakov
* Copyright (c) 2005 Yura Pakhuchiy
* Copyright (c) 2010 Jean-Pierre Andre
*
* 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
@ -26,44 +27,105 @@
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_GETTIMEOFDAY
#include <sys/time.h>
#endif
#include "types.h"
/*
* assume "struct timespec" is not defined if st_mtime is not defined
*/
#if !defined(st_mtime) & !defined(__timespec_defined)
struct timespec {
time_t tv_sec;
long tv_nsec;
} ;
#endif
/*
* There are four times more conversions of internal representation
* to ntfs representation than any other conversion, so the most
* efficient internal representation is ntfs representation
* (with low endianness)
*/
typedef sle64 ntfs_time;
#define NTFS_TIME_OFFSET ((s64)(369 * 365 + 89) * 24 * 3600 * 10000000)
/**
* ntfs2utc - Convert an NTFS time to Unix time
* ntfs2timespec - Convert an NTFS time to Unix time
* @ntfs_time: An NTFS time in 100ns units since 1601
*
* NTFS stores times as the number of 100ns intervals since January 1st 1601 at
* 00:00 UTC. This system will not suffer from Y2K problems until ~57000AD.
*
* Return: n A Unix time (number of seconds since 1970)
* Return: A Unix time (number of seconds since 1970, and nanoseconds)
*/
static __inline__ time_t ntfs2utc(s64 ntfs_time)
static __inline__ struct timespec ntfs2timespec(ntfs_time ntfstime)
{
return (sle64_to_cpu(ntfs_time) - (NTFS_TIME_OFFSET)) / 10000000;
struct timespec spec;
s64 cputime;
cputime = sle64_to_cpu(ntfstime);
spec.tv_sec = (cputime - (NTFS_TIME_OFFSET)) / 10000000;
spec.tv_nsec = (cputime - (NTFS_TIME_OFFSET)
- (s64)spec.tv_sec*10000000)*100;
/* force zero nsec for overflowing dates */
if ((spec.tv_nsec < 0) || (spec.tv_nsec > 999999999))
spec.tv_nsec = 0;
return (spec);
}
/**
* utc2ntfs - Convert Linux time to NTFS time
* timespec2ntfs - Convert Linux time to NTFS time
* @utc_time: Linux time to convert to NTFS
*
* Convert the Linux time @utc_time to its corresponding NTFS time.
*
* Linux stores time in a long at present and measures it as the number of
* 1-second intervals since 1st January 1970, 00:00:00 UTC.
* 1-second intervals since 1st January 1970, 00:00:00 UTC
* with a separated non-negative nanosecond value
*
* NTFS uses Microsoft's standard time format which is stored in a s64 and is
* NTFS uses Microsoft's standard time format which is stored in a sle64 and is
* measured as the number of 100 nano-second intervals since 1st January 1601,
* 00:00:00 UTC.
*
* Return: n An NTFS time (100ns units since Jan 1601)
* Return: An NTFS time (100ns units since Jan 1601)
*/
static __inline__ s64 utc2ntfs(time_t utc_time)
static __inline__ ntfs_time timespec2ntfs(struct timespec spec)
{
/* Convert to 100ns intervals and then add the NTFS time offset. */
return cpu_to_sle64((s64)utc_time * 10000000 + NTFS_TIME_OFFSET);
s64 units;
units = (s64)spec.tv_sec * 10000000
+ NTFS_TIME_OFFSET + spec.tv_nsec/100;
return (cpu_to_sle64(units));
}
/*
* Return the current time in ntfs format
*/
static __inline__ ntfs_time ntfs_current_time(void)
{
struct timespec now;
#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_SYS_CLOCK_GETTIME)
clock_gettime(CLOCK_REALTIME, &now);
#elif defined(HAVE_GETTIMEOFDAY)
struct timeval microseconds;
gettimeofday(&microseconds, (struct timezone*)NULL);
now.tv_sec = microseconds.tv_sec;
now.tv_nsec = microseconds.tv_usec*1000;
#else
now.tv_sec = time((time_t*)NULL);
now.tv_nsec = 0;
#endif
return (timespec2ntfs(now));
}
#endif /* _NTFS_NTFSTIME_H */

View File

@ -0,0 +1,35 @@
/*
*
* Copyright (c) 2008 Jean-Pierre Andre
*
*/
/*
* This program 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 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 OBJECT_ID_H
#define OBJECT_ID_H
int ntfs_get_ntfs_object_id(ntfs_inode *ni, char *value, size_t size);
int ntfs_set_ntfs_object_id(ntfs_inode *ni, const char *value,
size_t size, int flags);
int ntfs_remove_ntfs_object_id(ntfs_inode *ni);
int ntfs_delete_object_id_index(ntfs_inode *ni);
#endif /* OBJECT_ID_H */

View File

@ -0,0 +1,163 @@
/*
* param.h - Parameter values for ntfs-3g
*
* Copyright (c) 2009-2010 Jean-Pierre Andre
*
* 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_PARAM_H
#define _NTFS_PARAM_H
#define CACHE_INODE_SIZE 32 /* inode cache, zero or >= 3 and not too big */
#define CACHE_NIDATA_SIZE 64 /* idata cache, zero or >= 3 and not too big */
#define CACHE_LOOKUP_SIZE 64 /* lookup cache, zero or >= 3 and not too big */
#define CACHE_SECURID_SIZE 16 /* securid cache, zero or >= 3 and not too big */
#define CACHE_LEGACY_SIZE 8 /* legacy cache size, zero or >= 3 and not too big */
#define FORCE_FORMAT_v1x 0 /* Insert security data as in NTFS v1.x */
#define OWNERFROMACL 1 /* Get the owner from ACL (not Windows owner) */
/* default security sub-authorities */
enum {
DEFSECAUTH1 = -1153374643, /* 3141592653 */
DEFSECAUTH2 = 589793238,
DEFSECAUTH3 = 462843383,
DEFSECBASE = 10000
};
/*
* Parameters for formatting
*/
/* Up to Windows 10, the cluster size was limited to 64K */
#define NTFS_MAX_CLUSTER_SIZE 2097152 /* Windows 10 Creators allows 2MB */
/*
* Parameters for compression
*/
/* default option for compression */
#define DEFAULT_COMPRESSION 1
/* (log2 of) number of clusters in a compression block for new files */
#define STANDARD_COMPRESSION_UNIT 4
/* maximum cluster size for allowing compression for new files */
#define MAX_COMPRESSION_CLUSTER_SIZE 4096
/*
* Parameters for default options
*/
#define DEFAULT_DMTIME 60 /* default 1mn for delay_mtime */
/*
* Use of big write buffers
*
* With small volumes, the cluster allocator may fail to allocate
* enough clusters when the volume is nearly full. At most a run
* can be allocated per bitmap chunk. So, there is a danger when the
* number of chunks (capacity/(32768*clsiz)) is less than the number
* of clusters in the biggest write buffer (131072/clsiz). Hence
* a safe minimal capacity is 4GB
*/
#define SAFE_CAPACITY_FOR_BIG_WRITES 0x100000000LL
/*
* Parameters for runlists
*/
/* only update the final extent of a runlist when appending data */
#define PARTIAL_RUNLIST_UPDATING 1
/*
* Parameters for upper-case table
*/
/* Create upper-case tables as defined by Windows 6.1 (Win7) */
#define UPCASE_MAJOR 6
#define UPCASE_MINOR 1
/*
* Parameters for user and xattr mappings
*/
#define XATTRMAPPINGFILE ".NTFS-3G/XattrMapping" /* default mapping file */
/*
* Parameters for path canonicalization
*/
#define MAPPERNAMELTH 256
/*
* Permission checking modes for high level and low level
*
* The choices for high and low lowel are independent, they have
* no effect on the library
*
* Stick to the recommended values unless you understand the consequences
* on protection and performances. Use of cacheing is good for
* performances, but bad on security with internal fuse or external
* fuse older than 2.8
*
* On Linux, cacheing is discouraged for the high level interface
* in order to get proper support of hard links. As a consequence,
* having access control in the file system leads to fewer requests
* to the file system and fewer context switches.
*
* Irrespective of the selected mode, cacheing is always used
* in read-only mounts
*
* Possible values for high level :
* 1 : no cache, kernel control (recommended)
* 4 : no cache, file system control
* 6 : kernel/fuse cache, file system control (OpenIndiana only)
* 7 : no cache, kernel control for ACLs
*
* Possible values for low level :
* 2 : no cache, kernel control
* 3 : use kernel/fuse cache, kernel control (recommended)
* 5 : no cache, file system control
* 6 : kernel/fuse cache, file system control (OpenIndiana only)
* 8 : no cache, kernel control for ACLs
* 9 : kernel/fuse cache, kernel control for ACLs (target)
*
* Use of options 7, 8 and 9 requires a fuse module upgrade
* When Posix ACLs are selected in the configure options, a value
* of 6 is added in the mount report.
*/
#define TIMEOUT_RO 600 /* Attribute time out for read-only mounts */
#if defined(__sun) && defined(__SVR4)
/*
* Access control by kernel is not implemented on OpenIndiana,
* however care is taken of cacheing hard-linked files.
*/
#define HPERMSCONFIG 6
#define LPERMSCONFIG 6
#else /* defined(__sun) && defined(__SVR4) */
/*
* Cacheing by kernel is buggy on Linux when access control is done
* by the file system, and also when using hard-linked files on
* the fuse high level interface.
* Also ACL checks by recent kernels do not prove satisfactory.
*/
#define HPERMSCONFIG 1
#define LPERMSCONFIG 3
#endif /* defined(__sun) && defined(__SVR4) */
#endif /* defined _NTFS_PARAM_H */

View File

@ -0,0 +1,194 @@
/*
* plugin.h : define interface for plugin development
*
* Copyright (c) 2015-2021 Jean-Pierre Andre
*
*/
/*
* This program 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 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
*/
/*
* This file defines the interface to ntfs-3g plugins which
* add support for processing some type of reparse points.
*/
#ifndef _NTFS_PLUGIN_H
#define _NTFS_PLUGIN_H
#include "layout.h"
#include "inode.h"
#include "dir.h"
struct fuse_file_info;
struct stat;
/*
* The plugin operations currently defined.
* These functions should return a non-negative value when they
* succeed, or a negative errno value when they fail.
* They must not close or free their arguments.
* The file system must be left in a consistent state after
* each individual call.
* If an operation is not defined, an EOPNOTSUPP error is
* returned to caller.
*/
typedef struct plugin_operations {
/*
* Set the attributes st_size, st_blocks and st_mode
* into a struct stat. The returned st_mode must at least
* define the file type. Depending on the permissions options
* used for mounting, the umask will be applied to the returned
* permissions, or the permissions will be changed according
* to the ACL set on the file.
*/
int (*getattr)(ntfs_inode *ni, const REPARSE_POINT *reparse,
struct stat *stbuf);
/*
* Open a file for reading or writing
* The field fi->flags indicates the kind of opening.
* The field fi->fh may be used to store some information which
* will be available to subsequent reads and writes. When used
* this field must be non-null.
* The returned value is zero for success and a negative errno
* value for failure.
*/
int (*open)(ntfs_inode *ni, const REPARSE_POINT *reparse,
struct fuse_file_info *fi);
/*
* Release an open file or directory
* This is only called if fi->fh has been set to a non-null
* value while opening. It may be used to free some context
* specific to the open file or directory
* The returned value is zero for success or a negative errno
* value for failure.
*/
int (*release)(ntfs_inode *ni, const REPARSE_POINT *reparse,
struct fuse_file_info *fi);
/*
* Read from an open file
* The returned value is the count of bytes which were read
* or a negative errno value for failure.
* If the returned value is positive, the access time stamp
* will be updated after the call.
*/
int (*read)(ntfs_inode *ni, const REPARSE_POINT *reparse,
char *buf, size_t size,
off_t offset, struct fuse_file_info *fi);
/*
* Write to an open file
* The file system must be left consistent after each write call,
* the file itself must be at least deletable if the application
* writing to it is killed for some reason.
* The returned value is the count of bytes which were written
* or a negative errno value for failure.
* If the returned value is positive, the modified time stamp
* will be updated after the call.
*/
int (*write)(ntfs_inode *ni, const REPARSE_POINT *reparse,
const char *buf, size_t size,
off_t offset, struct fuse_file_info *fi);
/*
* Get a symbolic link
* The symbolic link must be returned in an allocated buffer,
* encoded in a zero terminated multibyte string compatible
* with the locale mount option.
* The returned value is zero for success or a negative errno
* value for failure.
*/
int (*readlink)(ntfs_inode *ni, const REPARSE_POINT *reparse,
char **pbuf);
/*
* Truncate a file (shorten or append zeroes)
* The returned value is zero for success or a negative errno
* value for failure.
* If the returned value is zero, the modified time stamp
* will be updated after the call.
*/
int (*truncate)(ntfs_inode *ni, const REPARSE_POINT *reparse,
off_t size);
/*
* Open a directory
* The field fi->flags indicates the kind of opening.
* The field fi->fh may be used to store some information which
* will be available to subsequent readdir(). When used
* this field must be non-null and freed in release().
* The returned value is zero for success and a negative errno
* value for failure.
*/
int (*opendir)(ntfs_inode *ni, const REPARSE_POINT *reparse,
struct fuse_file_info *fi);
/*
* Get entries from a directory
*
* Use the filldir() function with fillctx argument to return
* the directory entries.
* Names "." and ".." are expected to be returned.
* The returned value is zero for success and a negative errno
* value for failure.
*/
int (*readdir)(ntfs_inode *ni, const REPARSE_POINT *reparse,
s64 *pos, void *fillctx, ntfs_filldir_t filldir,
struct fuse_file_info *fi);
/*
* Create a new file of any type
*
* The returned value is a pointer to the inode created, or
* NULL if failed, with errno telling why.
*/
ntfs_inode *(*create)(ntfs_inode *dir_ni, const REPARSE_POINT *reparse,
le32 securid, ntfschar *name, int name_len,
mode_t type);
/*
* Link a new name to a file or directory
* Linking a directory is needed for renaming a directory
* The returned value is zero for success or a negative errno
* value for failure.
* If the returned value is zero, the modified time stamp
* will be updated after the call.
*/
int (*link)(ntfs_inode *dir_ni, const REPARSE_POINT *reparse,
ntfs_inode *ni, ntfschar *name, int name_len);
/*
* Unlink a name from a directory
* The argument pathname may be NULL
* The returned value is zero for success or a negative errno
* value for failure.
*/
int (*unlink)(ntfs_inode *dir_ni, const REPARSE_POINT *reparse,
const char *pathname,
ntfs_inode *ni, ntfschar *name, int name_len);
} plugin_operations_t;
/*
* Plugin initialization routine
* Returns the entry table if successful, otherwise returns NULL
* and sets errno (e.g. to EINVAL if the tag is not supported by
* the plugin.)
*/
typedef const struct plugin_operations *(*plugin_init_t)(le32 tag);
const struct plugin_operations *init(le32 tag);
#endif /* _NTFS_PLUGIN_H */

View File

@ -0,0 +1,24 @@
/*
* realpath.h - realpath() aware of device mapper
*/
#ifndef REALPATH_H
#define REALPATH_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_REALPATH
#define ntfs_realpath realpath
#else
extern char *ntfs_realpath(const char *path, char *resolved_path);
#endif
#ifdef linux
extern char *ntfs_realpath_canonicalize(const char *path, char *resolved_path);
#else
#define ntfs_realpath_canonicalize ntfs_realpath
#endif
#endif /* REALPATH_H */

View File

@ -0,0 +1,51 @@
/*
*
* Copyright (c) 2008 Jean-Pierre Andre
*
*/
/*
* This program 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 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 REPARSE_H
#define REPARSE_H
char *ntfs_make_symlink(ntfs_inode *ni, const char *mnt_point);
BOOL ntfs_possible_symlink(ntfs_inode *ni);
int ntfs_get_ntfs_reparse_data(ntfs_inode *ni, char *value, size_t size);
char *ntfs_get_abslink(ntfs_volume *vol, ntfschar *junction,
int count, const char *mnt_point, BOOL isdir);
REPARSE_POINT *ntfs_get_reparse_point(ntfs_inode *ni);
int ntfs_reparse_check_wsl(ntfs_inode *ni, const REPARSE_POINT *reparse);
int ntfs_reparse_set_wsl_symlink(ntfs_inode *ni,
const ntfschar *target, int target_len);
int ntfs_reparse_set_wsl_not_symlink(ntfs_inode *ni, mode_t mode);
int ntfs_set_ntfs_reparse_data(ntfs_inode *ni, const char *value,
size_t size, int flags);
int ntfs_remove_ntfs_reparse_data(ntfs_inode *ni);
int ntfs_delete_reparse_index(ntfs_inode *ni);
#endif /* REPARSE_H */

View File

@ -49,12 +49,15 @@ struct _runlist_element {/* In memory vcn to lcn mapping structure element. */
s64 length; /* Run length in clusters. */
};
extern runlist_element *ntfs_rl_extend(ntfs_attr *na, runlist_element *rl,
int more_entries);
extern LCN ntfs_rl_vcn_to_lcn(const runlist_element *rl, const VCN vcn);
extern s64 ntfs_rl_pread(const ntfs_volume *vol, const runlist_element *rl,
const s64 pos, s64 count, void *b);
extern s64 ntfs_rl_pwrite(const ntfs_volume *vol, const runlist_element *rl,
const s64 pos, s64 count, void *b);
s64 ofs, const s64 pos, s64 count, void *b);
extern runlist_element *ntfs_runlists_merge(runlist_element *drl,
runlist_element *srl);
@ -65,14 +68,14 @@ extern runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol,
extern int ntfs_get_nr_significant_bytes(const s64 n);
extern int ntfs_get_size_for_mapping_pairs(const ntfs_volume *vol,
const runlist_element *rl, const VCN start_vcn);
const runlist_element *rl, const VCN start_vcn, int max_size);
extern int ntfs_write_significant_bytes(u8 *dst, const u8 *dst_max,
const s64 n);
extern int ntfs_mapping_pairs_build(const ntfs_volume *vol, u8 *dst,
const int dst_len, const runlist_element *rl,
const VCN start_vcn, VCN *const stop_vcn);
const VCN start_vcn, runlist_element const **stop_rl);
extern int ntfs_rl_truncate(runlist **arl, const VCN start_vcn);

View File

@ -4,6 +4,7 @@
*
* Copyright (c) 2004 Anton Altaparmakov
* Copyright (c) 2005-2006 Szabolcs Szakacsits
* Copyright (c) 2007-2010 Jean-Pierre Andre
*
* 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
@ -27,28 +28,189 @@
#include "types.h"
#include "layout.h"
#include "inode.h"
#include "dir.h"
#include "endians.h"
extern const GUID *const zero_guid;
#ifndef POSIXACLS
#define POSIXACLS 0
#endif
/*
* item in the mapping list
*/
struct MAPPING {
struct MAPPING *next;
int xid; /* linux id : uid or gid */
SID *sid; /* Windows id : usid or gsid */
int grcnt; /* group count (for users only) */
gid_t *groups; /* groups which the user is member of */
};
/*
* Entry in the permissions cache
* Note : this cache is not organized as a generic cache
*/
struct CACHED_PERMISSIONS {
uid_t uid;
gid_t gid;
le32 inh_fileid;
le32 inh_dirid;
#if POSIXACLS
struct POSIX_SECURITY *pxdesc;
unsigned int pxdescsize:16;
#endif
unsigned int mode:12;
unsigned int valid:1;
} ;
/*
* Entry in the permissions cache for directories with no security_id
*/
struct CACHED_PERMISSIONS_LEGACY {
struct CACHED_PERMISSIONS_LEGACY *next;
struct CACHED_PERMISSIONS_LEGACY *previous;
void *variable;
size_t varsize;
union ALIGNMENT payload[0];
/* above fields must match "struct CACHED_GENERIC" */
u64 mft_no;
struct CACHED_PERMISSIONS perm;
} ;
/*
* Entry in the securid cache
*/
struct CACHED_SECURID {
struct CACHED_SECURID *next;
struct CACHED_SECURID *previous;
void *variable;
size_t varsize;
union ALIGNMENT payload[0];
/* above fields must match "struct CACHED_GENERIC" */
uid_t uid;
gid_t gid;
unsigned int dmode;
le32 securid;
} ;
/*
* Header of the security cache
* (has no cache structure by itself)
*/
struct CACHED_PERMISSIONS_HEADER {
unsigned int last;
/* statistics for permissions */
unsigned long p_writes;
unsigned long p_reads;
unsigned long p_hits;
} ;
/*
* The whole permissions cache
*/
struct PERMISSIONS_CACHE {
struct CACHED_PERMISSIONS_HEADER head;
struct CACHED_PERMISSIONS *cachetable[1]; /* array of variable size */
} ;
/*
* Security flags values
*/
enum {
SECURITY_DEFAULT, /* rely on fuse for permissions checking */
SECURITY_RAW, /* force same ownership/permissions on files */
SECURITY_ACL, /* enable Posix ACLs (when compiled in) */
SECURITY_ADDSECURIDS, /* upgrade old security descriptors */
SECURITY_STATICGRPS, /* use static groups for access control */
SECURITY_WANTED /* a security related option was present */
} ;
/*
* Security context, needed by most security functions
*/
enum { MAPUSERS, MAPGROUPS, MAPCOUNT } ;
struct SECURITY_CONTEXT {
ntfs_volume *vol;
struct MAPPING *mapping[MAPCOUNT];
struct PERMISSIONS_CACHE **pseccache;
uid_t uid; /* uid of user requesting (not the mounter) */
gid_t gid; /* gid of user requesting (not the mounter) */
pid_t tid; /* thread id of thread requesting */
mode_t umask; /* umask of requesting thread */
} ;
#if POSIXACLS
/*
* Posix ACL structures
*/
struct POSIX_ACE {
u16 tag;
u16 perms;
s32 id;
} __attribute__((__packed__));
struct POSIX_ACL {
u8 version;
u8 flags;
u16 filler;
struct POSIX_ACE ace[0];
} __attribute__((__packed__));
struct POSIX_SECURITY {
mode_t mode;
int acccnt;
int defcnt;
int firstdef;
u16 tagsset;
u16 filler;
struct POSIX_ACL acl;
} ;
/*
* Posix tags, cpu-endian 16 bits
*/
enum {
POSIX_ACL_USER_OBJ = 1,
POSIX_ACL_USER = 2,
POSIX_ACL_GROUP_OBJ = 4,
POSIX_ACL_GROUP = 8,
POSIX_ACL_MASK = 16,
POSIX_ACL_OTHER = 32,
POSIX_ACL_SPECIAL = 64 /* internal use only */
} ;
#define POSIX_ACL_EXTENSIONS (POSIX_ACL_USER | POSIX_ACL_GROUP | POSIX_ACL_MASK)
/*
* Posix permissions, cpu-endian 16 bits
*/
enum {
POSIX_PERM_X = 1,
POSIX_PERM_W = 2,
POSIX_PERM_R = 4,
POSIX_PERM_DENIAL = 64 /* internal use only */
} ;
#define POSIX_VERSION 2
#endif
extern BOOL ntfs_guid_is_zero(const GUID *guid);
extern char *ntfs_guid_to_mbs(const GUID *guid, char *guid_str);
/**
* ntfs_sid_is_valid - determine if a SID is valid
* @sid: SID for which to determine if it is valid
*
* Determine if the SID pointed to by @sid is valid.
*
* Return TRUE if it is valid and FALSE otherwise.
*/
static __inline__ BOOL ntfs_sid_is_valid(const SID *sid)
{
if (!sid || sid->revision != SID_REVISION ||
sid->sub_authority_count > SID_MAX_SUB_AUTHORITIES)
return FALSE;
return TRUE;
}
extern int ntfs_sid_to_mbs_size(const SID *sid);
extern char *ntfs_sid_to_mbs(const SID *sid, char *sid_str,
size_t sid_str_size);
@ -58,4 +220,119 @@ extern int ntfs_sd_add_everyone(ntfs_inode *ni);
extern le32 ntfs_security_hash(const SECURITY_DESCRIPTOR_RELATIVE *sd,
const u32 len);
int ntfs_build_mapping(struct SECURITY_CONTEXT *scx, const char *usermap_path,
BOOL allowdef);
int ntfs_get_owner_mode(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, struct stat*);
int ntfs_set_mode(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, mode_t mode);
BOOL ntfs_allowed_as_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni);
int ntfs_allowed_access(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, int accesstype);
int ntfs_allowed_create(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, gid_t *pgid, mode_t *pdsetgid);
BOOL old_ntfs_allowed_dir_access(struct SECURITY_CONTEXT *scx,
const char *path, int accesstype);
#if POSIXACLS
le32 ntfs_alloc_securid(struct SECURITY_CONTEXT *scx,
uid_t uid, gid_t gid, ntfs_inode *dir_ni,
mode_t mode, BOOL isdir);
#else
le32 ntfs_alloc_securid(struct SECURITY_CONTEXT *scx,
uid_t uid, gid_t gid, mode_t mode, BOOL isdir);
#endif
int ntfs_set_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni,
uid_t uid, gid_t gid);
int ntfs_set_ownmod(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, uid_t uid, gid_t gid, mode_t mode);
#if POSIXACLS
int ntfs_set_owner_mode(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, uid_t uid, gid_t gid,
mode_t mode, struct POSIX_SECURITY *pxdesc);
#else
int ntfs_set_owner_mode(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, uid_t uid, gid_t gid, mode_t mode);
#endif
le32 ntfs_inherited_id(struct SECURITY_CONTEXT *scx,
ntfs_inode *dir_ni, BOOL fordir);
int ntfs_open_secure(ntfs_volume *vol);
int ntfs_close_secure(ntfs_volume *vol);
void ntfs_destroy_security_context(struct SECURITY_CONTEXT *scx);
#if POSIXACLS
int ntfs_set_inherited_posix(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, uid_t uid, gid_t gid,
ntfs_inode *dir_ni, mode_t mode);
int ntfs_get_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni,
const char *name, char *value, size_t size);
int ntfs_set_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni,
const char *name, const char *value, size_t size,
int flags);
int ntfs_remove_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni,
const char *name);
#endif
int ntfs_get_ntfs_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni,
char *value, size_t size);
int ntfs_set_ntfs_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni,
const char *value, size_t size, int flags);
int ntfs_get_ntfs_attrib(ntfs_inode *ni, char *value, size_t size);
int ntfs_set_ntfs_attrib(ntfs_inode *ni,
const char *value, size_t size, int flags);
/*
* Security API for direct access to security descriptors
* based on Win32 API
*/
#define MAGIC_API 0x09042009
struct SECURITY_API {
u32 magic;
struct SECURITY_CONTEXT security;
struct PERMISSIONS_CACHE *seccache;
} ;
/*
* The following constants are used in interfacing external programs.
* They are not to be stored on disk and must be defined in their
* native cpu representation.
* When disk representation (le) is needed, use SE_DACL_PRESENT, etc.
*/
enum { OWNER_SECURITY_INFORMATION = 1,
GROUP_SECURITY_INFORMATION = 2,
DACL_SECURITY_INFORMATION = 4,
SACL_SECURITY_INFORMATION = 8
} ;
int ntfs_get_file_security(struct SECURITY_API *scapi,
const char *path, u32 selection,
char *buf, u32 buflen, u32 *psize);
int ntfs_set_file_security(struct SECURITY_API *scapi,
const char *path, u32 selection, const char *attr);
int ntfs_get_file_attributes(struct SECURITY_API *scapi,
const char *path);
BOOL ntfs_set_file_attributes(struct SECURITY_API *scapi,
const char *path, s32 attrib);
BOOL ntfs_read_directory(struct SECURITY_API *scapi,
const char *path, ntfs_filldir_t callback, void *context);
int ntfs_read_sds(struct SECURITY_API *scapi,
char *buf, u32 size, u32 offset);
INDEX_ENTRY *ntfs_read_sii(struct SECURITY_API *scapi,
INDEX_ENTRY *entry);
INDEX_ENTRY *ntfs_read_sdh(struct SECURITY_API *scapi,
INDEX_ENTRY *entry);
struct SECURITY_API *ntfs_initialize_file_security(const char *device,
unsigned long flags);
BOOL ntfs_leave_file_security(struct SECURITY_API *scx);
int ntfs_get_usid(struct SECURITY_API *scapi, uid_t uid, char *buf);
int ntfs_get_gsid(struct SECURITY_API *scapi, gid_t gid, char *buf);
int ntfs_get_user(struct SECURITY_API *scapi, const SID *usid);
int ntfs_get_group(struct SECURITY_API *scapi, const SID *gsid);
#endif /* defined _NTFS_SECURITY_H */

View File

@ -48,15 +48,23 @@ typedef u16 le16;
typedef u32 le32;
typedef u64 le64;
typedef u16 be16;
typedef u32 be32;
typedef u64 be64;
/*
* Declare sle{16,32,64} to be unsigned because we do not want sign extension
* on BE architectures.
* Declare s{l,b}e{16,32,64} to be unsigned because we do not want sign
* extension on BE architectures.
*/
typedef u16 sle16;
typedef u32 sle32;
typedef u64 sle64;
typedef u16 ntfschar; /* 2-byte Unicode character type. */
typedef u16 sbe16;
typedef u32 sbe32;
typedef u64 sbe64;
typedef le16 ntfschar; /* 2-byte Unicode character type. */
#define UCHAR_T_SIZE_BITS 1
/*
@ -120,5 +128,13 @@ typedef enum {
#define STATUS_KEEP_SEARCHING (-3)
#define STATUS_NOT_FOUND (-4)
/*
* Force alignment in a struct if required by processor
*/
union ALIGNMENT {
u64 u64align;
void *ptralign;
} ;
#endif /* defined _NTFS_TYPES_H */

View File

@ -30,9 +30,9 @@ extern BOOL ntfs_names_are_equal(const ntfschar *s1, size_t s1_len,
const ntfschar *s2, size_t s2_len, const IGNORE_CASE_BOOL ic,
const ntfschar *upcase, const u32 upcase_size);
extern int ntfs_names_collate(const ntfschar *name1, const u32 name1_len,
extern int ntfs_names_full_collate(const ntfschar *name1, const u32 name1_len,
const ntfschar *name2, const u32 name2_len,
const int err_val, const IGNORE_CASE_BOOL ic,
const IGNORE_CASE_BOOL ic,
const ntfschar *upcase, const u32 upcase_len);
extern int ntfs_ucsncmp(const ntfschar *s1, const ntfschar *s2, size_t n);
@ -47,24 +47,36 @@ extern ntfschar *ntfs_ucsndup(const ntfschar *s, u32 maxlen);
extern void ntfs_name_upcase(ntfschar *name, u32 name_len,
const ntfschar *upcase, const u32 upcase_len);
extern void ntfs_file_value_upcase(FILE_NAME_ATTR *file_name_attr,
const ntfschar *upcase, const u32 upcase_len);
extern void ntfs_name_locase(ntfschar *name, u32 name_len,
const ntfschar *locase, const u32 locase_len);
extern int ntfs_file_values_compare(const FILE_NAME_ATTR *file_name_attr1,
const FILE_NAME_ATTR *file_name_attr2,
const int err_val, const IGNORE_CASE_BOOL ic,
extern void ntfs_file_value_upcase(FILE_NAME_ATTR *file_name_attr,
const ntfschar *upcase, const u32 upcase_len);
extern int ntfs_ucstombs(const ntfschar *ins, const int ins_len, char **outs,
int outs_len);
extern int ntfs_mbstoucs(const char *ins, ntfschar **outs);
extern char *ntfs_uppercase_mbs(const char *low,
const ntfschar *upcase, u32 upcase_len);
extern void ntfs_upcase_table_build(ntfschar *uc, u32 uc_len);
extern u32 ntfs_upcase_build_default(ntfschar **upcase);
extern ntfschar *ntfs_locase_table_build(const ntfschar *uc, u32 uc_cnt);
extern ntfschar *ntfs_str2ucs(const char *s, int *len);
extern void ntfs_ucsfree(ntfschar *ucs);
extern BOOL ntfs_forbidden_chars(const ntfschar *name, int len, BOOL strict);
extern BOOL ntfs_forbidden_names(ntfs_volume *vol,
const ntfschar *name, int len, BOOL strict);
extern BOOL ntfs_collapsible_chars(ntfs_volume *vol,
const ntfschar *shortname, int shortlen,
const ntfschar *longname, int longlen);
extern int ntfs_set_char_encoding(const char *locale);
#if defined(__APPLE__) || defined(__DARWIN__)
/**
* Mac OS X only.

View File

@ -5,6 +5,7 @@
* Copyright (c) 2004-2005 Richard Russon
* Copyright (c) 2005-2006 Yura Pakhuchiy
* Copyright (c) 2005-2009 Szabolcs Szakacsits
* Copyright (c) 2010 Jean-Pierre Andre
*
* 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
@ -35,48 +36,49 @@
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
/* Do not #include <sys/mount.h> here : conflicts with <linux/fs.h> */
#ifdef HAVE_MNTENT_H
#include <mntent.h>
#endif
/*
* Under Cygwin, DJGPP and FreeBSD we do not have MS_RDONLY,
* so we define them ourselves.
*/
#ifndef MS_RDONLY
#define MS_RDONLY 1
#endif
#define MS_EXCLUSIVE 0x08000000
#ifndef MS_RECOVER
#define MS_RECOVER 0x10000000
#endif
#define MS_IGNORE_HIBERFILE 0x20000000
/* Forward declaration */
typedef struct _ntfs_volume ntfs_volume;
#include "param.h"
#include "types.h"
#include "support.h"
#include "device.h"
#include "inode.h"
#include "attrib.h"
#include "index.h"
/**
* enum ntfs_mount_flags -
*
* Flags for the ntfs_mount() function.
*/
enum {
NTFS_MNT_NONE = 0x00000000,
NTFS_MNT_RDONLY = 0x00000001,
NTFS_MNT_MAY_RDONLY = 0x02000000, /* Allow fallback to ro */
NTFS_MNT_FORENSIC = 0x04000000, /* No modification during
* mount. */
NTFS_MNT_EXCLUSIVE = 0x08000000,
NTFS_MNT_RECOVER = 0x10000000,
NTFS_MNT_IGNORE_HIBERFILE = 0x20000000,
};
typedef unsigned long ntfs_mount_flags;
/**
* enum ntfs_mounted_flags -
*
* Flags returned by the ntfs_check_if_mounted() function.
*/
typedef enum {
NTFS_MF_MOUNTED = 1, /* Device is mounted. */
NTFS_MF_ISROOT = 2, /* Device is mounted as system root. */
NTFS_MF_READONLY = 4, /* Device is mounted read-only. */
} ntfs_mount_flags;
} ntfs_mounted_flags;
extern int ntfs_check_if_mounted(const char *file, unsigned long *mnt_flags);
@ -96,6 +98,11 @@ typedef enum {
NTFS_VOLUME_INSECURE = 22
} ntfs_volume_status;
typedef enum {
NTFS_FILES_INTERIX,
NTFS_FILES_WSL,
} ntfs_volume_special_files;
/**
* enum ntfs_volume_state_bits -
*
@ -105,6 +112,12 @@ typedef enum {
NV_ReadOnly, /* 1: Volume is read-only. */
NV_CaseSensitive, /* 1: Volume is mounted case-sensitive. */
NV_LogFileEmpty, /* 1: $logFile journal is empty. */
NV_ShowSysFiles, /* 1: Show NTFS metafiles. */
NV_ShowHidFiles, /* 1: Show files marked hidden. */
NV_HideDotFiles, /* 1: Set hidden flag on dot files */
NV_Compression, /* 1: allow compression */
NV_NoFixupWarn, /* 1: Do not log fixup errors */
NV_FreeSpaceKnown, /* 1: The free space is now known */
} ntfs_volume_state_bits;
#define test_nvol_flag(nv, flag) test_bit(NV_##flag, (nv)->state)
@ -123,6 +136,30 @@ typedef enum {
#define NVolSetLogFileEmpty(nv) set_nvol_flag(nv, LogFileEmpty)
#define NVolClearLogFileEmpty(nv) clear_nvol_flag(nv, LogFileEmpty)
#define NVolShowSysFiles(nv) test_nvol_flag(nv, ShowSysFiles)
#define NVolSetShowSysFiles(nv) set_nvol_flag(nv, ShowSysFiles)
#define NVolClearShowSysFiles(nv) clear_nvol_flag(nv, ShowSysFiles)
#define NVolShowHidFiles(nv) test_nvol_flag(nv, ShowHidFiles)
#define NVolSetShowHidFiles(nv) set_nvol_flag(nv, ShowHidFiles)
#define NVolClearShowHidFiles(nv) clear_nvol_flag(nv, ShowHidFiles)
#define NVolHideDotFiles(nv) test_nvol_flag(nv, HideDotFiles)
#define NVolSetHideDotFiles(nv) set_nvol_flag(nv, HideDotFiles)
#define NVolClearHideDotFiles(nv) clear_nvol_flag(nv, HideDotFiles)
#define NVolCompression(nv) test_nvol_flag(nv, Compression)
#define NVolSetCompression(nv) set_nvol_flag(nv, Compression)
#define NVolClearCompression(nv) clear_nvol_flag(nv, Compression)
#define NVolNoFixupWarn(nv) test_nvol_flag(nv, NoFixupWarn)
#define NVolSetNoFixupWarn(nv) set_nvol_flag(nv, NoFixupWarn)
#define NVolClearNoFixupWarn(nv) clear_nvol_flag(nv, NoFixupWarn)
#define NVolFreeSpaceKnown(nv) test_nvol_flag(nv, FreeSpaceKnown)
#define NVolSetFreeSpaceKnown(nv) set_nvol_flag(nv, FreeSpaceKnown)
#define NVolClearFreeSpaceKnown(nv) clear_nvol_flag(nv, FreeSpaceKnown)
/*
* NTFS version 1.1 and 1.2 are used by Windows NT4.
* NTFS version 2.x is used by Windows 2000 Beta
@ -154,7 +191,7 @@ struct _ntfs_volume {
ntfs_inode *vol_ni; /* ntfs_inode structure for FILE_Volume. */
u8 major_ver; /* Ntfs major version of volume. */
u8 minor_ver; /* Ntfs minor version of volume. */
u16 flags; /* Bit array of VOLUME_* flags. */
le16 flags; /* Bit array of VOLUME_* flags. */
u16 sector_size; /* Byte size of a sector. */
u8 sector_size_bits; /* Log(2) of the byte size of a sector. */
@ -167,6 +204,7 @@ struct _ntfs_volume {
/* Variables used by the cluster and mft allocators. */
u8 mft_zone_multiplier; /* Initial mft zone multiplier. */
u8 full_zones; /* cluster zones which are full */
s64 mft_data_pos; /* Mft record number at which to allocate the
next mft record. */
LCN mft_zone_start; /* First cluster of the mft zone. */
@ -196,6 +234,12 @@ struct _ntfs_volume {
bit means that the mft record is in use and
vice versa. */
ntfs_inode *secure_ni; /* ntfs_inode structure for FILE $Secure */
ntfs_index_context *secure_xsii; /* index for using $Secure:$SII */
ntfs_index_context *secure_xsdh; /* index for using $Secure:$SDH */
int secure_reentry; /* check for non-rentries */
unsigned int secure_flags; /* flags, see security.h for values */
int mftmirr_size; /* Size of the FILE_MFTMirr in mft records. */
LCN mftmirr_lcn; /* Logical cluster number of the data attribute
for FILE_MFTMirr. */
@ -208,6 +252,9 @@ struct _ntfs_volume {
FILE_UpCase. */
u32 upcase_len; /* Length in Unicode characters of the upcase
table. */
ntfschar *locase; /* Lower case equivalents of all 65536 2-byte
Unicode characters. Only if option
case_ignore is set. */
ATTR_DEF *attrdef; /* Attribute definitions. Obtained from
FILE_AttrDef. */
@ -217,6 +264,28 @@ struct _ntfs_volume {
s64 free_clusters; /* Track the number of free clusters which
greatly improves statfs() performance */
s64 free_mft_records; /* Same for free mft records (see above) */
BOOL efs_raw; /* volume is mounted for raw access to
efs-encrypted files */
ntfs_volume_special_files special_files; /* Implementation of special files */
const char *abs_mnt_point; /* Mount point */
#ifdef XATTR_MAPPINGS
struct XATTRMAPPING *xattr_mapping;
#endif /* XATTR_MAPPINGS */
#if CACHE_INODE_SIZE
struct CACHE_HEADER *xinode_cache;
#endif
#if CACHE_NIDATA_SIZE
struct CACHE_HEADER *nidata_cache;
#endif
#if CACHE_LOOKUP_SIZE
struct CACHE_HEADER *lookup_cache;
#endif
#if CACHE_SECURID_SIZE
struct CACHE_HEADER *securid_cache;
#endif
#if CACHE_LEGACY_SIZE
struct CACHE_HEADER *legacy_cache;
#endif
};
extern const char *ntfs_home;
@ -224,24 +293,31 @@ extern const char *ntfs_home;
extern ntfs_volume *ntfs_volume_alloc(void);
extern ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev,
unsigned long flags);
ntfs_mount_flags flags);
extern ntfs_volume *ntfs_device_mount(struct ntfs_device *dev,
unsigned long flags);
ntfs_mount_flags flags);
extern ntfs_volume *ntfs_mount(const char *name, unsigned long flags);
extern ntfs_volume *ntfs_mount(const char *name, ntfs_mount_flags flags);
extern int ntfs_umount(ntfs_volume *vol, const BOOL force);
extern int ntfs_version_is_supported(ntfs_volume *vol);
extern int ntfs_volume_check_hiberfile(ntfs_volume *vol, int verbose);
extern int ntfs_logfile_reset(ntfs_volume *vol);
extern int ntfs_volume_write_flags(ntfs_volume *vol, const u16 flags);
extern int ntfs_volume_write_flags(ntfs_volume *vol, const le16 flags);
extern int ntfs_volume_error(int err);
extern void ntfs_mount_error(const char *vol, const char *mntpoint, int err);
extern int ntfs_volume_get_free_space(ntfs_volume *vol);
extern int ntfs_volume_rename(ntfs_volume *vol, const ntfschar *label,
int label_len);
extern int ntfs_set_shown_files(ntfs_volume *vol,
BOOL show_sys_files, BOOL show_hid_files, BOOL hide_dot_files);
extern int ntfs_set_locale(void);
extern int ntfs_set_ignore_case(ntfs_volume *vol);
#endif /* defined _NTFS_VOLUME_H */

View File

@ -0,0 +1,97 @@
/*
* xattrs.h : definitions related to system extended attributes
*
* Copyright (c) 2010 Jean-Pierre Andre
*
* 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_XATTRS_H_
#define _NTFS_XATTRS_H_
/*
* Flags that modify setxattr() semantics. These flags are also used by a
* number of libntfs-3g functions, such as ntfs_set_ntfs_acl(), which were
* originally tied to extended attributes support but now can be used by
* applications even if the platform does not support extended attributes.
*
* Careful: applications including this header should define HAVE_SETXATTR or
* HAVE_SYS_XATTR_H if the platform supports extended attributes. Otherwise the
* defined flags values may be incorrect (they will be correct for Linux but not
* necessarily for other platforms).
*/
#if defined(HAVE_SETXATTR) || defined(HAVE_SYS_XATTR_H)
#include <sys/xattr.h>
#else
#include "compat.h" /* may be needed for ENODATA definition */
#define XATTR_CREATE 1
#define XATTR_REPLACE 2
#endif
/*
* Identification of data mapped to the system name space
*/
enum SYSTEMXATTRS {
XATTR_UNMAPPED,
XATTR_NTFS_ACL,
XATTR_NTFS_ATTRIB,
XATTR_NTFS_ATTRIB_BE,
XATTR_NTFS_EFSINFO,
XATTR_NTFS_REPARSE_DATA,
XATTR_NTFS_OBJECT_ID,
XATTR_NTFS_DOS_NAME,
XATTR_NTFS_TIMES,
XATTR_NTFS_TIMES_BE,
XATTR_NTFS_CRTIME,
XATTR_NTFS_CRTIME_BE,
XATTR_NTFS_EA,
XATTR_POSIX_ACC,
XATTR_POSIX_DEF
} ;
struct XATTRMAPPING {
struct XATTRMAPPING *next;
enum SYSTEMXATTRS xattr;
char name[1]; /* variable length */
} ;
#ifdef XATTR_MAPPINGS
struct XATTRMAPPING *ntfs_xattr_build_mapping(ntfs_volume *vol,
const char *path);
void ntfs_xattr_free_mapping(struct XATTRMAPPING*);
#endif /* XATTR_MAPPINGS */
enum SYSTEMXATTRS ntfs_xattr_system_type(const char *name,
ntfs_volume *vol);
struct SECURITY_CONTEXT;
int ntfs_xattr_system_getxattr(struct SECURITY_CONTEXT *scx,
enum SYSTEMXATTRS attr,
ntfs_inode *ni, ntfs_inode *dir_ni,
char *value, size_t size);
int ntfs_xattr_system_setxattr(struct SECURITY_CONTEXT *scx,
enum SYSTEMXATTRS attr,
ntfs_inode *ni, ntfs_inode *dir_ni,
const char *value, size_t size, int flags);
int ntfs_xattr_system_removexattr(struct SECURITY_CONTEXT *scx,
enum SYSTEMXATTRS attr,
ntfs_inode *ni, ntfs_inode *dir_ni);
#endif /* _NTFS_XATTRS_H_ */

View File

@ -7,6 +7,10 @@ endif
libfuse_lite_la_CFLAGS= \
$(AM_CFLAGS) \
$(LIBFUSE_LITE_CFLAGS)
libfuse_lite_la_CPPFLAGS= \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/include/fuse-lite
libfuse_lite_la_LIBADD = $(LIBFUSE_LITE_LIBS)
@ -26,3 +30,5 @@ libfuse_lite_la_SOURCES = \
mount.c \
mount_util.c \
mount_util.h
libs: libfuse-lite.la

View File

@ -6,6 +6,11 @@
See the file COPYING.LIB
*/
#ifdef __SOLARIS__
/* For pthread_rwlock_t */
#define _GNU_SOURCE
#endif /* __SOLARIS__ */
#include "config.h"
#include "fuse_i.h"
#include "fuse_lowlevel.h"
@ -28,6 +33,10 @@
#include <sys/uio.h>
#include <sys/time.h>
#ifdef __SOLARIS__
#define FUSE_MAX_PATH 4096
#endif /* __SOLARIS__ */
#define FUSE_DEFAULT_INTR_SIGNAL SIGUSR1
#define FUSE_UNKNOWN_INO 0xffffffff
@ -54,13 +63,27 @@ struct fuse_config {
int intr;
int intr_signal;
int help;
#ifdef __SOLARIS__
int auto_cache;
char *modules;
#endif /* __SOLARIS__ */
};
struct fuse_fs {
struct fuse_operations op;
void *user_data;
#ifdef __SOLARIS__
struct fuse_module *m;
#endif /* __SOLARIS__ */
};
#ifdef __SOLARIS__
struct fusemod_so {
void *handle;
int ctr;
};
#endif /* __SOLARIS__ */
struct fuse {
struct fuse_session *se;
struct node **name_table;
@ -97,6 +120,12 @@ struct node {
uint64_t nlookup;
int open_count;
int is_hidden;
#ifdef __SOLARIS__
struct timespec stat_updated;
struct timespec mtime;
off_t size;
int cache_valid;
#endif /* __SOLARIS__ */
struct lock *locks;
};
@ -105,7 +134,6 @@ struct fuse_dh {
struct fuse *fuse;
fuse_req_t req;
char *contents;
int allocated;
unsigned len;
unsigned size;
unsigned needlen;
@ -124,6 +152,107 @@ static pthread_key_t fuse_context_key;
static pthread_mutex_t fuse_context_lock = PTHREAD_MUTEX_INITIALIZER;
static int fuse_context_ref;
#ifdef __SOLARIS__
static struct fusemod_so *fuse_current_so;
static struct fuse_module *fuse_modules;
static int fuse_load_so_name(const char *soname)
{
struct fusemod_so *so;
so = calloc(1, sizeof(struct fusemod_so));
if (!so) {
fprintf(stderr, "fuse: memory allocation failed\n");
return -1;
}
fuse_current_so = so;
so->handle = dlopen(soname, RTLD_NOW);
fuse_current_so = NULL;
if (!so->handle) {
fprintf(stderr, "fuse: %s\n", dlerror());
goto err;
}
if (!so->ctr) {
fprintf(stderr, "fuse: %s did not register any modules", soname);
goto err;
}
return 0;
err:
if (so->handle)
dlclose(so->handle);
free(so);
return -1;
}
static int fuse_load_so_module(const char *module)
{
int res;
char *soname = malloc(strlen(module) + 64);
if (!soname) {
fprintf(stderr, "fuse: memory allocation failed\n");
return -1;
}
sprintf(soname, "libfusemod_%s.so", module);
res = fuse_load_so_name(soname);
free(soname);
return res;
}
static struct fuse_module *fuse_find_module(const char *module)
{
struct fuse_module *m;
for (m = fuse_modules; m; m = m->next) {
if (strcmp(module, m->name) == 0) {
m->ctr++;
break;
}
}
return m;
}
static struct fuse_module *fuse_get_module(const char *module)
{
struct fuse_module *m;
pthread_mutex_lock(&fuse_context_lock);
m = fuse_find_module(module);
if (!m) {
int err = fuse_load_so_module(module);
if (!err)
m = fuse_find_module(module);
}
pthread_mutex_unlock(&fuse_context_lock);
return m;
}
static void fuse_put_module(struct fuse_module *m)
{
pthread_mutex_lock(&fuse_context_lock);
assert(m->ctr > 0);
m->ctr--;
if (!m->ctr && m->so) {
struct fusemod_so *so = m->so;
assert(so->ctr > 0);
so->ctr--;
if (!so->ctr) {
struct fuse_module **mp;
for (mp = &fuse_modules; *mp;) {
if ((*mp)->so == so)
*mp = (*mp)->next;
else
mp = &(*mp)->next;
}
dlclose(so->handle);
free(so);
}
}
pthread_mutex_unlock(&fuse_context_lock);
}
#endif /* __SOLARIS__ */
static struct node *get_node_nocheck(struct fuse *f, fuse_ino_t nodeid)
{
size_t hash = nodeid % f->id_table_size;
@ -296,10 +425,15 @@ static struct node *find_node(struct fuse *f, fuse_ino_t parent,
return node;
}
#ifndef __SOLARIS__
static char *add_name(char **buf, unsigned *bufsize, char *s, const char *name)
#else /* __SOLARIS__ */
static char *add_name(char *buf, char *s, const char *name)
#endif /* __SOLARIS__ */
{
size_t len = strlen(name);
#ifndef __SOLARIS__
if (s - len <= *buf) {
unsigned pathlen = *bufsize - (s - *buf);
unsigned newbufsize = *bufsize;
@ -322,7 +456,14 @@ static char *add_name(char **buf, unsigned *bufsize, char *s, const char *name)
*bufsize = newbufsize;
}
s -= len;
strncpy(s, name, len);
#else /* ! __SOLARIS__ */
s -= len;
if (s <= buf) {
fprintf(stderr, "fuse: path too long: ...%s\n", s + len);
return NULL;
}
#endif /* __SOLARIS__ */
memcpy(s, name, len);
s--;
*s = '/';
@ -331,6 +472,42 @@ static char *add_name(char **buf, unsigned *bufsize, char *s, const char *name)
static char *get_path_name(struct fuse *f, fuse_ino_t nodeid, const char *name)
{
#ifdef __SOLARIS__
char buf[FUSE_MAX_PATH];
char *s = buf + FUSE_MAX_PATH - 1;
struct node *node;
*s = '\0';
if (name != NULL) {
s = add_name(buf, s, name);
if (s == NULL)
return NULL;
}
pthread_mutex_lock(&f->lock);
for (node = get_node(f, nodeid); node && node->nodeid != FUSE_ROOT_ID;
node = node->parent) {
if (node->name == NULL) {
s = NULL;
break;
}
s = add_name(buf, s, node->name);
if (s == NULL)
break;
}
pthread_mutex_unlock(&f->lock);
if (node == NULL || s == NULL)
return NULL;
else if (*s == '\0')
return strdup("/");
else
return strdup(s);
#else /* __SOLARIS__ */
unsigned bufsize = 256;
char *buf;
char *s;
@ -375,6 +552,7 @@ static char *get_path_name(struct fuse *f, fuse_ino_t nodeid, const char *name)
out_free:
free(buf);
return NULL;
#endif /* __SOLARIS__ */
}
static char *get_path(struct fuse *f, fuse_ino_t nodeid)
@ -861,6 +1039,21 @@ int fuse_fs_removexattr(struct fuse_fs *fs, const char *path, const char *name)
return -ENOSYS;
}
int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, int cmd, void *arg,
struct fuse_file_info *fi, unsigned int flags, void *data)
{
fuse_get_context()->private_data = fs->user_data;
if (fs->op.ioctl) {
/*
if (fs->debug)
fprintf(stderr, "ioctl[%llu] 0x%x flags: 0x%x\n",
(unsigned long long) fi->fh, cmd, flags);
*/
return fs->op.ioctl(path, cmd, arg, fi, flags, data);
} else
return -ENOSYS;
}
static int is_open(struct fuse *f, fuse_ino_t dir, const char *name)
{
struct node *node;
@ -929,6 +1122,44 @@ static int hide_node(struct fuse *f, const char *oldpath,
return err;
}
#ifdef __SOLARIS__
static int mtime_eq(const struct stat *stbuf, const struct timespec *ts)
{
return stbuf->st_mtime == ts->tv_sec && ST_MTIM_NSEC(stbuf) == ts->tv_nsec;
}
#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC CLOCK_REALTIME
#endif
static void curr_time(struct timespec *now)
{
static clockid_t clockid = CLOCK_MONOTONIC;
int res = clock_gettime(clockid, now);
if (res == -1 && errno == EINVAL) {
clockid = CLOCK_REALTIME;
res = clock_gettime(clockid, now);
}
if (res == -1) {
perror("fuse: clock_gettime");
abort();
}
}
static void update_stat(struct node *node, const struct stat *stbuf)
{
if (node->cache_valid && (!mtime_eq(stbuf, &node->mtime) ||
stbuf->st_size != node->size))
node->cache_valid = 0;
node->mtime.tv_sec = stbuf->st_mtime;
node->mtime.tv_nsec = ST_MTIM_NSEC(stbuf);
node->size = stbuf->st_size;
curr_time(&node->stat_updated);
}
#endif /* __SOLARIS__ */
static int lookup_path(struct fuse *f, fuse_ino_t nodeid,
const char *name, const char *path,
struct fuse_entry_param *e, struct fuse_file_info *fi)
@ -951,6 +1182,13 @@ static int lookup_path(struct fuse *f, fuse_ino_t nodeid,
e->generation = node->generation;
e->entry_timeout = f->conf.entry_timeout;
e->attr_timeout = f->conf.attr_timeout;
#ifdef __SOLARIS__
if (f->conf.auto_cache) {
pthread_mutex_lock(&f->lock);
update_stat(node, &e->attr);
pthread_mutex_unlock(&f->lock);
}
#endif /* __SOLARIS__ */
set_stat(f, e->ino, &e->attr);
if (f->conf.debug)
fprintf(stderr, " NODEID: %lu\n", (unsigned long) e->ino);
@ -1021,10 +1259,17 @@ static struct fuse *req_fuse_prepare(fuse_req_t req)
c->ctx.uid = ctx->uid;
c->ctx.gid = ctx->gid;
c->ctx.pid = ctx->pid;
#ifdef POSIXACLS
c->ctx.umask = ctx->umask;
#endif
return c->ctx.fuse;
}
#ifndef __SOLARIS__
static void reply_err(fuse_req_t req, int err)
#else /* __SOLARIS__ */
static inline void reply_err(fuse_req_t req, int err)
#endif /* __SOLARIS__ */
{
/* fuse_reply_err() uses non-negated errno values */
fuse_reply_err(req, -err);
@ -1035,8 +1280,15 @@ static void reply_entry(fuse_req_t req, const struct fuse_entry_param *e,
{
if (!err) {
struct fuse *f = req_fuse(req);
#ifdef __SOLARIS__
/* Skip forget for negative result */
if ((fuse_reply_entry(req, e) == -ENOENT)
&& (e->ino != 0))
forget_node(f, e->ino, 1);
#else /* __SOLARIS__ */
if (fuse_reply_entry(req, e) == -ENOENT)
forget_node(f, e->ino, 1);
#endif
} else
reply_err(req, err);
}
@ -1063,6 +1315,10 @@ void fuse_fs_destroy(struct fuse_fs *fs)
fuse_get_context()->private_data = fs->user_data;
if (fs->op.destroy)
fs->op.destroy(fs->user_data);
#ifdef __SOLARIS__
if (fs->m)
fuse_put_module(fs->m);
#endif /* __SOLARIS__ */
free(fs);
}
@ -1139,6 +1395,13 @@ static void fuse_lib_getattr(fuse_req_t req, fuse_ino_t ino,
}
pthread_rwlock_unlock(&f->tree_lock);
if (!err) {
#ifdef __SOLARIS__
if (f->conf.auto_cache) {
pthread_mutex_lock(&f->lock);
update_stat(get_node(f, ino), &buf);
pthread_mutex_unlock(&f->lock);
}
#endif /* __SOLARIS__ */
set_stat(f, ino, &buf);
fuse_reply_attr(req, &buf, f->conf.attr_timeout);
} else
@ -1184,6 +1447,29 @@ static void fuse_lib_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
else
err = fuse_fs_truncate(f->fs, path, attr->st_size);
}
#ifdef HAVE_UTIMENSAT
if (!err &&
(valid & (FUSE_SET_ATTR_ATIME | FUSE_SET_ATTR_MTIME))) {
struct timespec tv[2];
tv[0].tv_sec = 0;
tv[1].tv_sec = 0;
tv[0].tv_nsec = UTIME_OMIT;
tv[1].tv_nsec = UTIME_OMIT;
if (valid & FUSE_SET_ATTR_ATIME_NOW)
tv[0].tv_nsec = UTIME_NOW;
else if (valid & FUSE_SET_ATTR_ATIME)
tv[0] = attr->st_atim;
if (valid & FUSE_SET_ATTR_MTIME_NOW)
tv[1].tv_nsec = UTIME_NOW;
else if (valid & FUSE_SET_ATTR_MTIME)
tv[1] = attr->st_mtim;
err = fuse_fs_utimens(f->fs, path, tv);
} else
#endif
if (!err && (valid & (FUSE_SET_ATTR_ATIME | FUSE_SET_ATTR_MTIME)) ==
(FUSE_SET_ATTR_ATIME | FUSE_SET_ATTR_MTIME)) {
struct timespec tv[2];
@ -1200,6 +1486,13 @@ static void fuse_lib_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
}
pthread_rwlock_unlock(&f->tree_lock);
if (!err) {
#ifdef __SOLARIS__
if (f->conf.auto_cache) {
pthread_mutex_lock(&f->lock);
update_stat(get_node(f, ino), &buf);
pthread_mutex_unlock(&f->lock);
}
#endif /* __SOLARIS__ */
set_stat(f, ino, &buf);
fuse_reply_attr(req, &buf, f->conf.attr_timeout);
} else
@ -1544,6 +1837,47 @@ static void fuse_lib_create(fuse_req_t req, fuse_ino_t parent,
pthread_rwlock_unlock(&f->tree_lock);
}
#ifdef __SOLARIS__
static double diff_timespec(const struct timespec *t1,
const struct timespec *t2)
{
return (t1->tv_sec - t2->tv_sec) +
((double) t1->tv_nsec - (double) t2->tv_nsec) / 1000000000.0;
}
static void open_auto_cache(struct fuse *f, fuse_ino_t ino, const char *path,
struct fuse_file_info *fi)
{
struct node *node;
pthread_mutex_lock(&f->lock);
node = get_node(f, ino);
if (node->cache_valid) {
struct timespec now;
curr_time(&now);
if (diff_timespec(&now, &node->stat_updated) > f->conf.ac_attr_timeout) {
struct stat stbuf;
int err;
pthread_mutex_unlock(&f->lock);
err = fuse_fs_fgetattr(f->fs, path, &stbuf, fi);
pthread_mutex_lock(&f->lock);
if (!err)
update_stat(node, &stbuf);
else
node->cache_valid = 0;
}
}
if (node->cache_valid)
fi->keep_cache = 1;
node->cache_valid = 1;
pthread_mutex_unlock(&f->lock);
}
#endif /* __SOLARIS__ */
static void fuse_lib_open(fuse_req_t req, fuse_ino_t ino,
struct fuse_file_info *fi)
{
@ -1563,6 +1897,11 @@ static void fuse_lib_open(fuse_req_t req, fuse_ino_t ino,
fi->direct_io = 1;
if (f->conf.kernel_cache)
fi->keep_cache = 1;
#ifdef __SOLARIS__
if (f->conf.auto_cache)
open_auto_cache(f, ino, path, fi);
#endif /* __SOLARIS__ */
}
fuse_finish_interrupt(f, req, &d);
}
@ -1762,12 +2101,17 @@ static int extend_contents(struct fuse_dh *dh, unsigned minsize)
unsigned newsize = dh->size;
if (!newsize)
newsize = 1024;
#ifndef __SOLARIS__
while (newsize < minsize) {
if (newsize >= 0x80000000)
newsize = 0xffffffff;
else
newsize *= 2;
}
#else /* __SOLARIS__ */
while (newsize < minsize)
newsize *= 2;
#endif /* __SOLARIS__ */
newptr = (char *) realloc(dh->contents, newsize);
if (!newptr) {
@ -1879,7 +2223,7 @@ static void fuse_lib_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
}
}
if (dh->filled) {
if (off < dh->len) {
if ((off >= 0) && (off < dh->len)) {
if (off + size > dh->len)
size = dh->len - off;
} else
@ -2391,6 +2735,62 @@ static void fuse_lib_bmap(fuse_req_t req, fuse_ino_t ino, size_t blocksize,
reply_err(req, err);
}
static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
struct fuse_file_info *llfi, unsigned int flags,
const void *in_buf, size_t in_bufsz,
size_t out_bufsz)
{
struct fuse *f = req_fuse_prepare(req);
struct fuse_intr_data d;
struct fuse_file_info fi;
char *path, *out_buf = NULL;
int err;
err = -EPERM;
if (flags & FUSE_IOCTL_UNRESTRICTED)
goto err;
if (flags & FUSE_IOCTL_DIR)
get_dirhandle(llfi, &fi);
else
fi = *llfi;
if (out_bufsz) {
err = -ENOMEM;
out_buf = malloc(out_bufsz);
if (!out_buf)
goto err;
}
assert(!in_bufsz || !out_bufsz || in_bufsz == out_bufsz);
if (out_buf)
memcpy(out_buf, in_buf, in_bufsz);
path = get_path(f, ino); /* Should be get_path_nullok() */
if (!path) {
err = ENOENT;
goto err;
}
fuse_prepare_interrupt(f, req, &d);
/* Note : const qualifier dropped */
err = fuse_fs_ioctl(f->fs, path, cmd, arg, &fi, flags,
out_buf ? (void*)out_buf : (void*)(uintptr_t)in_buf);
fuse_finish_interrupt(f, req, &d);
free(path);
if (err >= 0) { /* not an error */
fuse_reply_ioctl(req, err, out_buf, out_bufsz);
goto out;
}
err:
reply_err(req, err);
out:
free(out_buf);
}
static struct fuse_lowlevel_ops fuse_path_ops = {
.init = fuse_lib_init,
.destroy = fuse_lib_destroy,
@ -2426,6 +2826,7 @@ static struct fuse_lowlevel_ops fuse_path_ops = {
.getlk = fuse_lib_getlk,
.setlk = fuse_lib_setlk,
.bmap = fuse_lib_bmap,
.ioctl = fuse_lib_ioctl,
};
struct fuse_session *fuse_get_session(struct fuse *f)
@ -2474,6 +2875,10 @@ static const struct fuse_opt fuse_lib_opts[] = {
FUSE_LIB_OPT("readdir_ino", readdir_ino, 1),
FUSE_LIB_OPT("direct_io", direct_io, 1),
FUSE_LIB_OPT("kernel_cache", kernel_cache, 1),
#ifdef __SOLARIS__
FUSE_LIB_OPT("auto_cache", auto_cache, 1),
FUSE_LIB_OPT("noauto_cache", auto_cache, 0),
#endif /* __SOLARIS__ */
FUSE_LIB_OPT("umask=", set_mode, 1),
FUSE_LIB_OPT("umask=%o", umask, 0),
FUSE_LIB_OPT("uid=", set_uid, 1),
@ -2487,6 +2892,9 @@ static const struct fuse_opt fuse_lib_opts[] = {
FUSE_LIB_OPT("negative_timeout=%lf", negative_timeout, 0),
FUSE_LIB_OPT("intr", intr, 1),
FUSE_LIB_OPT("intr_signal=%d", intr_signal, 0),
#ifdef __SOLARIS__
FUSE_LIB_OPT("modules=%s", modules, 0),
#endif /* __SOLARIS__ */
FUSE_OPT_END
};
@ -2498,6 +2906,9 @@ static void fuse_lib_help(void)
" -o readdir_ino try to fill in d_ino in readdir\n"
" -o direct_io use direct I/O\n"
" -o kernel_cache cache files in kernel\n"
#ifdef __SOLARIS__
" -o [no]auto_cache enable caching based on modification times (off)\n"
#endif /* __SOLARIS__ */
" -o umask=M set file permissions (octal)\n"
" -o uid=N set file owner\n"
" -o gid=N set file group\n"
@ -2507,9 +2918,42 @@ static void fuse_lib_help(void)
" -o ac_attr_timeout=T auto cache timeout for attributes (attr_timeout)\n"
" -o intr allow requests to be interrupted\n"
" -o intr_signal=NUM signal to send on interrupt (%i)\n"
#ifdef __SOLARIS__
" -o modules=M1[:M2...] names of modules to push onto filesystem stack\n"
#endif /* __SOLARIS__ */
"\n", FUSE_DEFAULT_INTR_SIGNAL);
}
#ifdef __SOLARIS__
static void fuse_lib_help_modules(void)
{
struct fuse_module *m;
fprintf(stderr, "\nModule options:\n");
pthread_mutex_lock(&fuse_context_lock);
for (m = fuse_modules; m; m = m->next) {
struct fuse_fs *fs = NULL;
struct fuse_fs *newfs;
struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
if (fuse_opt_add_arg(&args, "") != -1 &&
fuse_opt_add_arg(&args, "-h") != -1) {
fprintf(stderr, "\n[%s]\n", m->name);
newfs = m->factory(&args, &fs);
assert(newfs == NULL);
}
fuse_opt_free_args(&args);
}
pthread_mutex_unlock(&fuse_context_lock);
}
int fuse_is_lib_option(const char *opt)
{
return fuse_lowlevel_is_lib_option(opt) ||
fuse_opt_match(fuse_lib_opts, opt);
}
#endif /* __SOLARIS__ */
static int fuse_lib_opt_proc(void *data, const char *arg, int key,
struct fuse_args *outargs)
{
@ -2558,6 +3002,32 @@ static void fuse_restore_intr_signal(int signum)
sigaction(signum, &sa, NULL);
}
#ifdef __SOLARIS__
static int fuse_push_module(struct fuse *f, const char *module,
struct fuse_args *args)
{
struct fuse_fs *newfs;
struct fuse_module *m = fuse_get_module(module);
struct fuse_fs *fs[2];
fs[0] = f->fs;
fs[1] = NULL;
if (!m)
return -1;
newfs = m->factory(args, fs);
if (!newfs) {
fuse_put_module(m);
return -1;
}
newfs->m = m;
f->fs = newfs;
return 0;
}
#endif /* __SOLARIS__ */
struct fuse_fs *fuse_fs_new(const struct fuse_operations *op, size_t op_size,
void *user_data)
{
@ -2618,10 +3088,26 @@ struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args,
if (fuse_opt_parse(args, &f->conf, fuse_lib_opts, fuse_lib_opt_proc) == -1)
goto out_free_fs;
#ifdef __SOLARIS__
if (f->conf.modules) {
char *module;
char *next;
for (module = f->conf.modules; module; module = next) {
char *p;
for (p = module; *p && *p != ':'; p++);
next = *p ? p + 1 : NULL;
*p = '\0';
if (module[0] && fuse_push_module(f, module, args) == -1)
goto out_free_fs;
}
}
#endif /* __SOLARIS__ */
if (!f->conf.ac_attr_timeout_set)
f->conf.ac_attr_timeout = f->conf.attr_timeout;
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
/*
* In FreeBSD, we always use these settings as inode numbers are needed to
* make getcwd(3) work.
@ -2630,7 +3116,12 @@ struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args,
#endif
f->se = fuse_lowlevel_new(args, &llop, sizeof(llop), f);
if (f->se == NULL) {
#ifdef __SOLARIS__
if (f->conf.help)
fuse_lib_help_modules();
#endif /* __SOLARIS__ */
goto out_free_fs;
}
@ -2698,6 +3189,9 @@ struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args,
called on the filesystem without init being called first */
fs->op.destroy = NULL;
fuse_fs_destroy(f->fs);
#ifdef __SOLARIS__
free(f->conf.modules);
#endif /* __SOLARIS__ */
out_free:
free(f);
out_delete_context_key:
@ -2747,7 +3241,9 @@ void fuse_destroy(struct fuse *f)
pthread_mutex_destroy(&f->lock);
pthread_rwlock_destroy(&f->tree_lock);
fuse_session_destroy(f->se);
#ifdef __SOLARIS__
free(f->conf.modules);
#endif /* __SOLARIS__ */
free(f);
fuse_delete_context_key();
}

View File

@ -22,7 +22,17 @@
#include <limits.h>
#include <errno.h>
#define PARAM(inarg) (((char *)(inarg)) + sizeof(*(inarg)))
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
#endif
#define PARAM(inarg) (((const char *)(inarg)) + sizeof(*(inarg)))
#define OFFSET_MAX 0x7fffffffffffffffLL
struct fuse_ll;
@ -69,7 +79,13 @@ static void convert_stat(const struct stat *stbuf, struct fuse_attr *attr)
attr->nlink = stbuf->st_nlink;
attr->uid = stbuf->st_uid;
attr->gid = stbuf->st_gid;
#if defined(__SOLARIS__) && defined(_LP64)
/* Must pack the device the old way (attr->rdev limited to 32 bits) */
attr->rdev = ((major(stbuf->st_rdev) & 0x3fff) << 18)
| (minor(stbuf->st_rdev) & 0x3ffff);
#else
attr->rdev = stbuf->st_rdev;
#endif
attr->size = stbuf->st_size;
attr->blocks = stbuf->st_blocks;
attr->atime = stbuf->st_atime;
@ -78,6 +94,9 @@ static void convert_stat(const struct stat *stbuf, struct fuse_attr *attr)
attr->atimensec = ST_ATIM_NSEC(stbuf);
attr->mtimensec = ST_MTIM_NSEC(stbuf);
attr->ctimensec = ST_CTIM_NSEC(stbuf);
#ifdef POSIXACLS
attr->filling = 0; /* JPA trying to be safe */
#endif
}
static void convert_attr(const struct fuse_setattr_in *attr, struct stat *stbuf)
@ -182,13 +201,34 @@ static int send_reply(fuse_req_t req, int error, const void *arg,
struct iovec iov[2];
int count = 1;
if (argsize) {
iov[1].iov_base = (void *) arg;
/* Note : const qualifier dropped */
iov[1].iov_base = (void *)(uintptr_t) arg;
iov[1].iov_len = argsize;
count++;
}
return send_reply_iov(req, error, iov, count);
}
#if 0 /* not used */
int fuse_reply_iov(fuse_req_t req, const struct iovec *iov, int count)
{
int res;
struct iovec *padded_iov;
padded_iov = malloc((count + 1) * sizeof(struct iovec));
if (padded_iov == NULL)
return fuse_reply_err(req, -ENOMEM);
memcpy(padded_iov + 1, iov, count * sizeof(struct iovec));
count++;
res = send_reply_iov(req, 0, padded_iov, count);
free(padded_iov);
return res;
}
#endif
size_t fuse_dirent_size(size_t namelen)
{
return FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + namelen);
@ -207,7 +247,7 @@ char *fuse_add_dirent(char *buf, const char *name, const struct stat *stbuf,
dirent->off = off;
dirent->namelen = namelen;
dirent->type = (stbuf->st_mode & 0170000) >> 12;
strncpy(dirent->name, name, namelen);
memcpy(dirent->name, name, namelen);
if (padlen)
memset(buf + entlen, 0, padlen);
@ -267,7 +307,8 @@ static unsigned long calc_timeout_sec(double t)
static unsigned int calc_timeout_nsec(double t)
{
double f = t - (double) calc_timeout_sec(t);
unsigned long secs = calc_timeout_sec(t);
double f = t - (double)secs;
if (f < 0.0)
return 0;
else if (f >= 0.999999999)
@ -309,7 +350,8 @@ int fuse_reply_entry(fuse_req_t req, const struct fuse_entry_param *e)
memset(&arg, 0, sizeof(arg));
fill_entry(&arg, e);
return send_reply_ok(req, &arg, sizeof(arg));
return send_reply_ok(req, &arg, (req->f->conn.proto_minor >= 12
? sizeof(arg) : FUSE_COMPAT_ENTRY_OUT_SIZE));
}
int fuse_reply_create(fuse_req_t req, const struct fuse_entry_param *e,
@ -322,8 +364,15 @@ int fuse_reply_create(fuse_req_t req, const struct fuse_entry_param *e,
memset(&arg, 0, sizeof(arg));
fill_entry(&arg.e, e);
fill_open(&arg.o, f);
return send_reply_ok(req, &arg, sizeof(arg));
if (req->f->conn.proto_minor < 12) {
fill_open((struct fuse_open_out*)
((char*)&arg + FUSE_COMPAT_ENTRY_OUT_SIZE), f);
return send_reply_ok(req, &arg,
FUSE_COMPAT_ENTRY_OUT_SIZE + sizeof(struct fuse_open_out));
} else {
fill_open(&arg.o, f);
return send_reply_ok(req, &arg, sizeof(arg));
}
}
int fuse_reply_attr(fuse_req_t req, const struct stat *attr,
@ -336,7 +385,8 @@ int fuse_reply_attr(fuse_req_t req, const struct stat *attr,
arg.attr_valid_nsec = calc_timeout_nsec(attr_timeout);
convert_stat(attr, &arg.attr);
return send_reply_ok(req, &arg, sizeof(arg));
return send_reply_ok(req, &arg, (req->f->conn.proto_minor >= 12
? sizeof(arg) : FUSE_COMPAT_FUSE_ATTR_OUT_SIZE));
}
int fuse_reply_readlink(fuse_req_t req, const char *linkname)
@ -416,9 +466,31 @@ int fuse_reply_bmap(fuse_req_t req, uint64_t idx)
return send_reply_ok(req, &arg, sizeof(arg));
}
int fuse_reply_ioctl(fuse_req_t req, int result, const void *buf, size_t size)
{
struct fuse_ioctl_out arg;
struct iovec iov[3];
size_t count = 1;
memset(&arg, 0, sizeof(arg));
arg.result = result;
iov[count].iov_base = &arg;
iov[count].iov_len = sizeof(arg);
count++;
if (size) {
/* Note : const qualifier dropped */
iov[count].iov_base = (char *)(uintptr_t) buf;
iov[count].iov_len = size;
count++;
}
return send_reply_iov(req, 0, iov, count);
}
static void do_lookup(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
char *name = (char *) inarg;
const char *name = (const char *) inarg;
if (req->f->op.lookup)
req->f->op.lookup(req, nodeid, name);
@ -428,7 +500,7 @@ static void do_lookup(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_forget(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_forget_in *arg = (struct fuse_forget_in *) inarg;
const struct fuse_forget_in *arg = (const struct fuse_forget_in *) inarg;
if (req->f->op.forget)
req->f->op.forget(req, nodeid, arg->nlookup);
@ -448,7 +520,7 @@ static void do_getattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_setattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_setattr_in *arg = (struct fuse_setattr_in *) inarg;
const struct fuse_setattr_in *arg = (const struct fuse_setattr_in *) inarg;
if (req->f->op.setattr) {
struct fuse_file_info *fi = NULL;
@ -457,20 +529,19 @@ static void do_setattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
memset(&stbuf, 0, sizeof(stbuf));
convert_attr(arg, &stbuf);
if (arg->valid & FATTR_FH) {
arg->valid &= ~FATTR_FH;
memset(&fi_store, 0, sizeof(fi_store));
fi = &fi_store;
fi->fh = arg->fh;
fi->fh_old = fi->fh;
}
req->f->op.setattr(req, nodeid, &stbuf, arg->valid, fi);
req->f->op.setattr(req, nodeid, &stbuf, arg->valid & ~FATTR_FH, fi);
} else
fuse_reply_err(req, ENOSYS);
}
static void do_access(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_access_in *arg = (struct fuse_access_in *) inarg;
const struct fuse_access_in *arg = (const struct fuse_access_in *) inarg;
if (req->f->op.access)
req->f->op.access(req, nodeid, arg->mask);
@ -490,17 +561,36 @@ static void do_readlink(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_mknod(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_mknod_in *arg = (struct fuse_mknod_in *) inarg;
const struct fuse_mknod_in *arg = (const struct fuse_mknod_in *) inarg;
const char *name = PARAM(arg);
if (req->f->op.mknod)
req->f->op.mknod(req, nodeid, PARAM(arg), arg->mode, arg->rdev);
if (req->f->conn.proto_minor >= 12)
req->ctx.umask = arg->umask;
else
name = (const char *) inarg + FUSE_COMPAT_MKNOD_IN_SIZE;
if (req->f->op.mknod) {
#if defined(__SOLARIS__) && defined(_LP64)
/*
* Must unpack the device, as arg->rdev is limited to 32 bits,
* and must have the same format in 32-bit and 64-bit builds.
*/
req->f->op.mknod(req, nodeid, name, arg->mode,
makedev((arg->rdev >> 18) & 0x3fff,
arg->rdev & 0x3ffff));
#else
req->f->op.mknod(req, nodeid, name, arg->mode, arg->rdev);
#endif
} else
fuse_reply_err(req, ENOSYS);
}
static void do_mkdir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_mkdir_in *arg = (struct fuse_mkdir_in *) inarg;
const struct fuse_mkdir_in *arg = (const struct fuse_mkdir_in *) inarg;
if (req->f->conn.proto_minor >= 12)
req->ctx.umask = arg->umask;
if (req->f->op.mkdir)
req->f->op.mkdir(req, nodeid, PARAM(arg), arg->mode);
@ -510,7 +600,7 @@ static void do_mkdir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_unlink(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
char *name = (char *) inarg;
const char *name = (const char *) inarg;
if (req->f->op.unlink)
req->f->op.unlink(req, nodeid, name);
@ -520,7 +610,7 @@ static void do_unlink(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_rmdir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
char *name = (char *) inarg;
const char *name = (const char *) inarg;
if (req->f->op.rmdir)
req->f->op.rmdir(req, nodeid, name);
@ -530,8 +620,8 @@ static void do_rmdir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_symlink(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
char *name = (char *) inarg;
char *linkname = ((char *) inarg) + strlen((char *) inarg) + 1;
const char *name = (const char *) inarg;
const char *linkname = ((const char *) inarg) + strlen((const char *) inarg) + 1;
if (req->f->op.symlink)
req->f->op.symlink(req, linkname, nodeid, name);
@ -541,9 +631,9 @@ static void do_symlink(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_rename(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_rename_in *arg = (struct fuse_rename_in *) inarg;
char *oldname = PARAM(arg);
char *newname = oldname + strlen(oldname) + 1;
const struct fuse_rename_in *arg = (const struct fuse_rename_in *) inarg;
const char *oldname = PARAM(arg);
const char *newname = oldname + strlen(oldname) + 1;
if (req->f->op.rename)
req->f->op.rename(req, nodeid, oldname, arg->newdir, newname);
@ -553,7 +643,7 @@ static void do_rename(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_link(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_link_in *arg = (struct fuse_link_in *) inarg;
const struct fuse_link_in *arg = (const struct fuse_link_in *) inarg;
if (req->f->op.link)
req->f->op.link(req, arg->oldnodeid, nodeid, PARAM(arg));
@ -563,22 +653,28 @@ static void do_link(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_create(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_open_in *arg = (struct fuse_open_in *) inarg;
const struct fuse_create_in *arg = (const struct fuse_create_in *) inarg;
if (req->f->op.create) {
struct fuse_file_info fi;
const char *name = PARAM(arg);
memset(&fi, 0, sizeof(fi));
fi.flags = arg->flags;
req->f->op.create(req, nodeid, PARAM(arg), arg->mode, &fi);
if (req->f->conn.proto_minor >= 12)
req->ctx.umask = arg->umask;
else
name = (const char *) inarg + sizeof(struct fuse_open_in);
req->f->op.create(req, nodeid, name, arg->mode, &fi);
} else
fuse_reply_err(req, ENOSYS);
}
static void do_open(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_open_in *arg = (struct fuse_open_in *) inarg;
const struct fuse_open_in *arg = (const struct fuse_open_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -592,7 +688,7 @@ static void do_open(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_read(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_read_in *arg = (struct fuse_read_in *) inarg;
const struct fuse_read_in *arg = (const struct fuse_read_in *) inarg;
if (req->f->op.read) {
struct fuse_file_info fi;
@ -607,7 +703,7 @@ static void do_read(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_write(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_write_in *arg = (struct fuse_write_in *) inarg;
const struct fuse_write_in *arg = (const struct fuse_write_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -615,15 +711,21 @@ static void do_write(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
fi.fh_old = fi.fh;
fi.writepage = arg->write_flags & 1;
if (req->f->op.write)
req->f->op.write(req, nodeid, PARAM(arg), arg->size, arg->offset, &fi);
else
if (req->f->op.write) {
const char *buf;
if (req->f->conn.proto_minor >= 12)
buf = PARAM(arg);
else
buf = ((const char*)arg) + FUSE_COMPAT_WRITE_IN_SIZE;
req->f->op.write(req, nodeid, buf, arg->size, arg->offset, &fi);
} else
fuse_reply_err(req, ENOSYS);
}
static void do_flush(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_flush_in *arg = (struct fuse_flush_in *) inarg;
const struct fuse_flush_in *arg = (const struct fuse_flush_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -641,7 +743,7 @@ static void do_flush(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_release(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_release_in *arg = (struct fuse_release_in *) inarg;
const struct fuse_release_in *arg = (const struct fuse_release_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -661,7 +763,7 @@ static void do_release(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_fsync(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_fsync_in *arg = (struct fuse_fsync_in *) inarg;
const struct fuse_fsync_in *arg = (const struct fuse_fsync_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -676,7 +778,7 @@ static void do_fsync(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_opendir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_open_in *arg = (struct fuse_open_in *) inarg;
const struct fuse_open_in *arg = (const struct fuse_open_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -690,7 +792,7 @@ static void do_opendir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_readdir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_read_in *arg = (struct fuse_read_in *) inarg;
const struct fuse_read_in *arg = (const struct fuse_read_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -705,7 +807,7 @@ static void do_readdir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_releasedir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_release_in *arg = (struct fuse_release_in *) inarg;
const struct fuse_release_in *arg = (const struct fuse_release_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -721,7 +823,7 @@ static void do_releasedir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_fsyncdir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_fsync_in *arg = (struct fuse_fsync_in *) inarg;
const struct fuse_fsync_in *arg = (const struct fuse_fsync_in *) inarg;
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
@ -752,9 +854,9 @@ static void do_statfs(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_setxattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_setxattr_in *arg = (struct fuse_setxattr_in *) inarg;
char *name = PARAM(arg);
char *value = name + strlen(name) + 1;
const struct fuse_setxattr_in *arg = (const struct fuse_setxattr_in *) inarg;
const char *name = PARAM(arg);
const char *value = name + strlen(name) + 1;
if (req->f->op.setxattr)
req->f->op.setxattr(req, nodeid, name, value, arg->size, arg->flags);
@ -764,7 +866,7 @@ static void do_setxattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_getxattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_getxattr_in *arg = (struct fuse_getxattr_in *) inarg;
const struct fuse_getxattr_in *arg = (const struct fuse_getxattr_in *) inarg;
if (req->f->op.getxattr)
req->f->op.getxattr(req, nodeid, PARAM(arg), arg->size);
@ -774,7 +876,7 @@ static void do_getxattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_listxattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_getxattr_in *arg = (struct fuse_getxattr_in *) inarg;
const struct fuse_getxattr_in *arg = (const struct fuse_getxattr_in *) inarg;
if (req->f->op.listxattr)
req->f->op.listxattr(req, nodeid, arg->size);
@ -784,7 +886,7 @@ static void do_listxattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_removexattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
char *name = (char *) inarg;
const char *name = (const char *) inarg;
if (req->f->op.removexattr)
req->f->op.removexattr(req, nodeid, name);
@ -792,7 +894,7 @@ static void do_removexattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
fuse_reply_err(req, ENOSYS);
}
static void convert_fuse_file_lock(struct fuse_file_lock *fl,
static void convert_fuse_file_lock(const struct fuse_file_lock *fl,
struct flock *flock)
{
memset(flock, 0, sizeof(struct flock));
@ -808,7 +910,7 @@ static void convert_fuse_file_lock(struct fuse_file_lock *fl,
static void do_getlk(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_lk_in *arg = (struct fuse_lk_in *) inarg;
const struct fuse_lk_in *arg = (const struct fuse_lk_in *) inarg;
struct fuse_file_info fi;
struct flock flock;
@ -826,7 +928,7 @@ static void do_getlk(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
static void do_setlk_common(fuse_req_t req, fuse_ino_t nodeid,
const void *inarg, int should_sleep)
{
struct fuse_lk_in *arg = (struct fuse_lk_in *) inarg;
const struct fuse_lk_in *arg = (const struct fuse_lk_in *) inarg;
struct fuse_file_info fi;
struct flock flock;
@ -887,7 +989,7 @@ static int find_interrupted(struct fuse_ll *f, struct fuse_req *req)
static void do_interrupt(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_interrupt_in *arg = (struct fuse_interrupt_in *) inarg;
const struct fuse_interrupt_in *arg = (const struct fuse_interrupt_in *) inarg;
struct fuse_ll *f = req->f;
(void) nodeid;
@ -927,7 +1029,7 @@ static struct fuse_req *check_interrupt(struct fuse_ll *f, struct fuse_req *req)
static void do_bmap(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_bmap_in *arg = (struct fuse_bmap_in *) inarg;
const struct fuse_bmap_in *arg = (const struct fuse_bmap_in *) inarg;
if (req->f->op.bmap)
req->f->op.bmap(req, nodeid, arg->blocksize, arg->block);
@ -935,9 +1037,42 @@ static void do_bmap(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
fuse_reply_err(req, ENOSYS);
}
static void do_ioctl(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
const struct fuse_ioctl_in *arg = (const struct fuse_ioctl_in *) inarg;
unsigned int flags = arg->flags;
const void *in_buf = arg->in_size ? PARAM(arg) : NULL;
struct fuse_file_info fi;
if (flags & FUSE_IOCTL_DIR &&
!(req->f->conn.want & FUSE_CAP_IOCTL_DIR)) {
fuse_reply_err(req, ENOTTY);
return;
}
memset(&fi, 0, sizeof(fi));
fi.fh = arg->fh;
/* TODO JPA (need req->ioctl_64bit in obscure fuse_req_t)
// probably a 64 bit ioctl on a 32-bit cpu
// this is to forward a request from the kernel
if (sizeof(void *) == 4 && req->f->conn.proto_minor >= 16 &&
!(flags & FUSE_IOCTL_32BIT)) {
req->ioctl_64bit = 1;
}
*/
if (req->f->op.ioctl)
req->f->op.ioctl(req, nodeid, arg->cmd,
(void *)(uintptr_t)arg->arg, &fi, flags,
in_buf, arg->in_size, arg->out_size);
else
fuse_reply_err(req, ENOSYS);
}
static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_init_in *arg = (struct fuse_init_in *) inarg;
const struct fuse_init_in *arg = (const struct fuse_init_in *) inarg;
struct fuse_init_out outarg;
struct fuse_ll *f = req->f;
size_t bufsize = fuse_chan_bufsize(req->ch);
@ -965,6 +1100,16 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
f->conn.async_read = arg->flags & FUSE_ASYNC_READ;
if (arg->max_readahead < f->conn.max_readahead)
f->conn.max_readahead = arg->max_readahead;
#ifdef POSIXACLS
if (arg->flags & FUSE_DONT_MASK)
f->conn.capable |= FUSE_CAP_DONT_MASK;
if (arg->flags & FUSE_POSIX_ACL)
f->conn.capable |= FUSE_CAP_POSIX_ACL;
#endif
if (arg->flags & FUSE_BIG_WRITES)
f->conn.capable |= FUSE_CAP_BIG_WRITES;
if (arg->flags & FUSE_HAS_IOCTL_DIR)
f->conn.capable |= FUSE_CAP_IOCTL_DIR;
} else {
f->conn.async_read = 0;
f->conn.max_readahead = 0;
@ -986,11 +1131,47 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
memset(&outarg, 0, sizeof(outarg));
outarg.major = FUSE_KERNEL_VERSION;
outarg.minor = FUSE_KERNEL_MINOR_VERSION;
/*
* Suggest using protocol 7.18 when available, and fallback
* to 7.12 or even earlier when running on an old kernel.
* Protocol 7.12 has the ability to process the umask
* conditionnally (as needed if POSIXACLS is set)
* Protocol 7.18 has the ability to process the ioctls
*/
if (arg->major > 7 || (arg->major == 7 && arg->minor >= 18)) {
outarg.minor = FUSE_KERNEL_MINOR_VERSION;
if (f->conn.want & FUSE_CAP_IOCTL_DIR)
outarg.flags |= FUSE_HAS_IOCTL_DIR;
#ifdef POSIXACLS
if (f->conn.want & FUSE_CAP_DONT_MASK)
outarg.flags |= FUSE_DONT_MASK;
if (f->conn.want & FUSE_CAP_POSIX_ACL)
outarg.flags |= FUSE_POSIX_ACL;
#endif
} else {
/* Never use a version more recent than supported by the kernel */
if ((arg->major < FUSE_KERNEL_MAJOR_FALLBACK)
|| ((arg->major == FUSE_KERNEL_MAJOR_FALLBACK)
&& (arg->minor < FUSE_KERNEL_MINOR_FALLBACK))) {
outarg.major = arg->major;
outarg.minor = arg->minor;
} else {
outarg.major = FUSE_KERNEL_MAJOR_FALLBACK;
outarg.minor = FUSE_KERNEL_MINOR_FALLBACK;
#ifdef POSIXACLS
if (f->conn.want & FUSE_CAP_DONT_MASK)
outarg.flags |= FUSE_DONT_MASK;
if (f->conn.want & FUSE_CAP_POSIX_ACL)
outarg.flags |= FUSE_POSIX_ACL;
#endif
}
}
if (f->conn.async_read)
outarg.flags |= FUSE_ASYNC_READ;
if (f->op.getlk && f->op.setlk)
outarg.flags |= FUSE_POSIX_LOCKS;
if (f->conn.want & FUSE_CAP_BIG_WRITES)
outarg.flags |= FUSE_BIG_WRITES;
outarg.max_readahead = f->conn.max_readahead;
outarg.max_write = f->conn.max_write;
@ -1089,6 +1270,7 @@ static struct {
[FUSE_CREATE] = { do_create, "CREATE" },
[FUSE_INTERRUPT] = { do_interrupt, "INTERRUPT" },
[FUSE_BMAP] = { do_bmap, "BMAP" },
[FUSE_IOCTL] = { do_ioctl, "IOCTL" },
[FUSE_DESTROY] = { do_destroy, "DESTROY" },
};
@ -1106,7 +1288,7 @@ static void fuse_ll_process(void *data, const char *buf, size_t len,
struct fuse_chan *ch)
{
struct fuse_ll *f = (struct fuse_ll *) data;
struct fuse_in_header *in = (struct fuse_in_header *) buf;
const struct fuse_in_header *in = (const struct fuse_in_header *) buf;
const void *inarg = buf + sizeof(struct fuse_in_header);
struct fuse_req *req;
@ -1213,6 +1395,15 @@ static int fuse_ll_opt_proc(void *data, const char *arg, int key,
return -1;
}
#ifdef __SOLARIS__
int fuse_lowlevel_is_lib_option(const char *opt)
{
return fuse_opt_match(fuse_ll_opts, opt);
}
#endif /* __SOLARIS__ */
static void fuse_ll_destroy(void *data)
{
struct fuse_ll *f = (struct fuse_ll *) data;
@ -1273,4 +1464,3 @@ struct fuse_session *fuse_lowlevel_new(struct fuse_args *args,
out:
return NULL;
}

View File

@ -36,6 +36,12 @@ static inline void fuse_mutex_init(pthread_mutex_t *mut)
#define ST_MTIM_NSEC(stbuf) ((stbuf)->st_mtimespec.tv_nsec)
#define ST_ATIM_NSEC_SET(stbuf, val) (stbuf)->st_atimespec.tv_nsec = (val)
#define ST_MTIM_NSEC_SET(stbuf, val) (stbuf)->st_mtimespec.tv_nsec = (val)
#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC)
#define ST_ATIM_NSEC(stbuf) ((stbuf)->st_atimensec)
#define ST_CTIM_NSEC(stbuf) ((stbuf)->st_ctimensec)
#define ST_MTIM_NSEC(stbuf) ((stbuf)->st_mtimensec)
#define ST_ATIM_NSEC_SET(stbuf, val) (stbuf)->st_atimensec = (val)
#define ST_MTIM_NSEC_SET(stbuf, val) (stbuf)->st_mtimensec = (val)
#else
#define ST_ATIM_NSEC(stbuf) 0
#define ST_CTIM_NSEC(stbuf) 0

View File

@ -264,9 +264,23 @@ static int process_real_option_group(struct fuse_opt_context *ctx, char *opts)
do {
int res;
sep = strchr(opts, ',');
if (sep)
*sep = '\0';
#ifdef __SOLARIS__
/*
* On Solaris, the device name contains commas, so the
* option "fsname" has to be the last one and its commas
* should not be interpreted as option separators.
* This had to be hardcoded because the option "fsname"
* may be found though not present in option list.
*/
if (!strncmp(opts,"fsname=",7))
sep = (char*)NULL;
else
#endif /* __SOLARIS__ */
{
sep = strchr(opts, ',');
if (sep)
*sep = '\0';
}
res = process_gopt(ctx, opts, 1);
if (res == -1)
return -1;

View File

@ -165,9 +165,20 @@ struct fuse_session *fuse_chan_session(struct fuse_chan *ch)
int fuse_chan_recv(struct fuse_chan **chp, char *buf, size_t size)
{
struct fuse_chan *ch = *chp;
return ch->op.receive(chp, buf, size);
}
#ifdef __SOLARIS__
int fuse_chan_receive(struct fuse_chan *ch, char *buf, size_t size)
{
int res;
res = fuse_chan_recv(&ch, buf, size);
return res >= 0 ? res : (res != -EINTR && res != -EAGAIN) ? -1 : 0;
}
#endif /* __SOLARIS__ */
int fuse_chan_send(struct fuse_chan *ch, const struct iovec iov[], size_t count)
{
return ch->op.send(ch, iov, count);
@ -180,4 +191,3 @@ void fuse_chan_destroy(struct fuse_chan *ch)
ch->op.destroy(ch);
free(ch);
}

View File

@ -22,13 +22,13 @@ static void exit_handler(int sig)
fuse_session_exit(fuse_instance);
}
static int set_one_signal_handler(int sig, void (*handler)(int))
static int set_one_signal_handler(int sig, void (*handler)(int), int remove)
{
struct sigaction sa;
struct sigaction old_sa;
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_handler = handler;
sa.sa_handler = remove ? SIG_DFL : handler;
sigemptyset(&(sa.sa_mask));
sa.sa_flags = 0;
@ -37,7 +37,7 @@ static int set_one_signal_handler(int sig, void (*handler)(int))
return -1;
}
if (old_sa.sa_handler == SIG_DFL &&
if (old_sa.sa_handler == (remove ? handler : SIG_DFL) &&
sigaction(sig, &sa, NULL) == -1) {
perror("fuse: cannot set signal handler");
return -1;
@ -47,10 +47,10 @@ static int set_one_signal_handler(int sig, void (*handler)(int))
int fuse_set_signal_handlers(struct fuse_session *se)
{
if (set_one_signal_handler(SIGHUP, exit_handler) == -1 ||
set_one_signal_handler(SIGINT, exit_handler) == -1 ||
set_one_signal_handler(SIGTERM, exit_handler) == -1 ||
set_one_signal_handler(SIGPIPE, SIG_IGN) == -1)
if (set_one_signal_handler(SIGHUP, exit_handler, 0) == -1 ||
set_one_signal_handler(SIGINT, exit_handler, 0) == -1 ||
set_one_signal_handler(SIGTERM, exit_handler, 0) == -1 ||
set_one_signal_handler(SIGPIPE, SIG_IGN, 0) == -1)
return -1;
fuse_instance = se;
@ -65,9 +65,9 @@ void fuse_remove_signal_handlers(struct fuse_session *se)
else
fuse_instance = NULL;
set_one_signal_handler(SIGHUP, SIG_DFL);
set_one_signal_handler(SIGINT, SIG_DFL);
set_one_signal_handler(SIGTERM, SIG_DFL);
set_one_signal_handler(SIGPIPE, SIG_DFL);
set_one_signal_handler(SIGHUP, exit_handler, 1);
set_one_signal_handler(SIGINT, exit_handler, 1);
set_one_signal_handler(SIGTERM, exit_handler, 1);
set_one_signal_handler(SIGPIPE, SIG_IGN, 1);
}

View File

@ -19,14 +19,21 @@
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <paths.h>
#ifdef __SOLARIS__
#include <sys/mnttab.h>
#else /* __SOLARIS__ */
#include <grp.h>
#include <mntent.h>
#include <sys/fsuid.h>
#endif /* __SOLARIS__ */
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/fsuid.h>
#include <sys/socket.h>
#include <sys/utsname.h>
#include <grp.h>
#define FUSE_DEV_NEW "/dev/fuse"
@ -41,6 +48,32 @@ static int mount_max = 1000;
int drop_privs(void);
int restore_privs(void);
#ifdef __SOLARIS__
/*
* fusermount is not implemented in fuse-lite for Solaris,
* only the minimal functions are provided.
*/
/*
* Solaris doesn't have setfsuid/setfsgid.
* This doesn't really matter anyway as this program shouldn't be made
* suid on Solaris. It should instead be used via a profile with the
* sys_mount privilege.
*/
int drop_privs(void)
{
return (0);
}
int restore_privs(void)
{
return (0);
}
#else /* __SOLARIS__ */
static const char *get_user_name(void)
{
struct passwd *pw = getpwuid(getuid());
@ -412,7 +445,7 @@ static int do_mount(const char *mnt, char **typep, mode_t rootmode,
if (errno_save == EPERM)
fprintf(stderr, "User doesn't have privilege to mount. "
"For more information\nplease see: "
"http://ntfs-3g.org/support.html#unprivileged\n");
"http://tuxera.com/community/ntfs-3g-faq/#unprivileged\n");
}
goto err;
} else {
@ -588,7 +621,8 @@ static int mount_fuse(const char *mnt, const char *opts)
&source, &mnt_opts);
if (currdir_fd != -1) {
fchdir(currdir_fd);
__attribute__((unused))int ignored_fchdir_status =
fchdir(currdir_fd);
close(currdir_fd);
}
if (mountpoint_fd != -1)
@ -667,3 +701,5 @@ out:
free(mnt);
return res;
}
#endif /* __SOLARIS__ */

View File

@ -15,6 +15,18 @@ struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args)
struct fuse_chan *ch;
int fd;
#ifdef __SOLARIS__
/*
* Make sure file descriptors 0, 1 and 2 are open, otherwise chaos
* would ensue.
*/
do {
fd = open("/dev/null", O_RDWR);
if (fd > 2)
close(fd);
} while (fd >= 0 && fd <= 2);
#endif /* __SOLARIS__ */
fd = fuse_kern_mount(mountpoint, args);
if (fd == -1)
return NULL;
@ -38,3 +50,12 @@ int fuse_version(void)
return FUSE_VERSION;
}
#ifdef __SOLARIS__
#undef fuse_main
int fuse_main(void);
int fuse_main(void)
{
fprintf(stderr, "fuse_main(): This function does not exist\n");
return -1;
}
#endif /* __SOLARIS__ */

View File

@ -12,6 +12,7 @@
#include "mount_util.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stddef.h>
@ -23,6 +24,21 @@
#include <sys/wait.h>
#include <sys/mount.h>
#ifdef __SOLARIS__
#define FUSERMOUNT_PROG "fusermount"
#define FUSE_COMMFD_ENV "_FUSE_COMMFD"
#ifndef FUSERMOUNT_DIR
#define FUSERMOUNT_DIR "/usr"
#endif /* FUSERMOUNT_DIR */
#ifndef HAVE_FORK
#define fork() vfork()
#endif
#endif /* __SOLARIS__ */
#ifndef MS_DIRSYNC
#define MS_DIRSYNC 128
#endif
@ -44,8 +60,16 @@ struct mount_opts {
int allow_root;
int ishelp;
int flags;
#ifdef __SOLARIS__
int nonempty;
int blkdev;
char *fsname;
char *subtype;
char *subtype_opt;
#else
int blkdev;
char *fsname;
#endif
char *mtab_opts;
char *fusermount_opts;
char *kernel_opts;
@ -54,6 +78,42 @@ struct mount_opts {
#define FUSE_MOUNT_OPT(t, p) { t, offsetof(struct mount_opts, p), 1 }
static const struct fuse_opt fuse_mount_opts[] = {
#ifdef __SOLARIS__
FUSE_MOUNT_OPT("allow_other", allow_other),
FUSE_MOUNT_OPT("allow_root", allow_root),
FUSE_MOUNT_OPT("nonempty", nonempty),
FUSE_MOUNT_OPT("blkdev", blkdev),
FUSE_MOUNT_OPT("fsname=%s", fsname),
FUSE_MOUNT_OPT("subtype=%s", subtype),
FUSE_OPT_KEY("allow_other", KEY_KERN_OPT),
FUSE_OPT_KEY("allow_root", KEY_ALLOW_ROOT),
FUSE_OPT_KEY("nonempty", KEY_FUSERMOUNT_OPT),
FUSE_OPT_KEY("blkdev", KEY_FUSERMOUNT_OPT),
FUSE_OPT_KEY("fsname=", KEY_FUSERMOUNT_OPT),
FUSE_OPT_KEY("subtype=", KEY_SUBTYPE_OPT),
FUSE_OPT_KEY("large_read", KEY_KERN_OPT),
FUSE_OPT_KEY("blksize=", KEY_KERN_OPT),
FUSE_OPT_KEY("default_permissions", KEY_KERN_OPT),
FUSE_OPT_KEY("max_read=", KEY_KERN_OPT),
FUSE_OPT_KEY("max_read=", FUSE_OPT_KEY_KEEP),
FUSE_OPT_KEY("user=", KEY_MTAB_OPT),
FUSE_OPT_KEY("-r", KEY_RO),
FUSE_OPT_KEY("ro", KEY_KERN_FLAG),
FUSE_OPT_KEY("rw", KEY_KERN_FLAG),
FUSE_OPT_KEY("suid", KEY_KERN_FLAG),
FUSE_OPT_KEY("nosuid", KEY_KERN_FLAG),
FUSE_OPT_KEY("-g", KEY_KERN_FLAG),
FUSE_OPT_KEY("-m", KEY_KERN_FLAG),
FUSE_OPT_KEY("-O", KEY_KERN_FLAG),
FUSE_OPT_KEY("setuid", KEY_KERN_OPT),
FUSE_OPT_KEY("nosetuid", KEY_KERN_OPT),
FUSE_OPT_KEY("devices", KEY_KERN_OPT),
FUSE_OPT_KEY("nodevices", KEY_KERN_OPT),
FUSE_OPT_KEY("exec", KEY_KERN_OPT),
FUSE_OPT_KEY("noexec", KEY_KERN_OPT),
FUSE_OPT_KEY("nbmand", KEY_KERN_OPT),
FUSE_OPT_KEY("nonbmand", KEY_KERN_OPT),
#else /* __SOLARIS__ */
FUSE_MOUNT_OPT("allow_other", allow_other),
FUSE_MOUNT_OPT("allow_root", allow_root),
FUSE_MOUNT_OPT("blkdev", blkdev),
@ -65,6 +125,7 @@ static const struct fuse_opt fuse_mount_opts[] = {
FUSE_OPT_KEY("large_read", KEY_KERN_OPT),
FUSE_OPT_KEY("blksize=", KEY_KERN_OPT),
FUSE_OPT_KEY("default_permissions", KEY_KERN_OPT),
FUSE_OPT_KEY("context=", KEY_KERN_OPT),
FUSE_OPT_KEY("max_read=", KEY_KERN_OPT),
FUSE_OPT_KEY("max_read=", FUSE_OPT_KEY_KEEP),
FUSE_OPT_KEY("user=", KEY_MTAB_OPT),
@ -82,6 +143,7 @@ static const struct fuse_opt fuse_mount_opts[] = {
FUSE_OPT_KEY("dirsync", KEY_KERN_FLAG),
FUSE_OPT_KEY("atime", KEY_KERN_FLAG),
FUSE_OPT_KEY("noatime", KEY_KERN_FLAG),
#endif /* __SOLARIS__ */
FUSE_OPT_KEY("-h", KEY_HELP),
FUSE_OPT_KEY("--help", KEY_HELP),
FUSE_OPT_KEY("-V", KEY_VERSION),
@ -89,6 +151,42 @@ static const struct fuse_opt fuse_mount_opts[] = {
FUSE_OPT_END
};
#ifdef __SOLARIS__
static void mount_help(void)
{
fprintf(stderr,
" -o allow_other allow access to other users\n"
" -o allow_root allow access to root\n"
" -o nonempty allow mounts over non-empty file/dir\n"
" -o default_permissions enable permission checking by kernel\n"
" -o fsname=NAME set filesystem name\n"
" -o subtype=NAME set filesystem type\n"
" -o large_read issue large read requests (2.4 only)\n"
" -o max_read=N set maximum size of read requests\n"
"\n"
);
}
static void exec_fusermount(const char *argv[])
{
execv(FUSERMOUNT_DIR "/" FUSERMOUNT_PROG, (char **) argv);
execvp(FUSERMOUNT_PROG, (char **) argv);
}
static void mount_version(void)
{
int pid = fork();
if (!pid) {
const char *argv[] = { FUSERMOUNT_PROG, "--version", NULL };
exec_fusermount(argv);
_exit(1);
} else if (pid != -1)
waitpid(pid, NULL, 0);
}
#endif /* __SOLARIS__ */
struct mount_flags {
const char *opt;
unsigned long flag;
@ -100,6 +198,7 @@ static struct mount_flags mount_flags[] = {
{"ro", MS_RDONLY, 1},
{"suid", MS_NOSUID, 0},
{"nosuid", MS_NOSUID, 1},
#ifndef __SOLARIS__
{"dev", MS_NODEV, 0},
{"nodev", MS_NODEV, 1},
{"exec", MS_NOEXEC, 0},
@ -109,9 +208,42 @@ static struct mount_flags mount_flags[] = {
{"atime", MS_NOATIME, 0},
{"noatime", MS_NOATIME, 1},
{"dirsync", MS_DIRSYNC, 1},
#else /* __SOLARIS__ */
{"-g", MS_GLOBAL, 1}, /* 1eaf4 */
{"-m", MS_NOMNTTAB, 1}, /* 1eb00 */
{"-O", MS_OVERLAY, 1}, /* 1eb0c */
#endif /* __SOLARIS__ */
{NULL, 0, 0}
};
#ifdef __SOLARIS__
/*
* See comments in fuse_kern_mount()
*/
struct solaris_mount_opts {
int nosuid;
int setuid;
int nosetuid;
int devices;
int nodevices;
};
#define SOLARIS_MOUNT_OPT(t, p, n) \
{ t, offsetof(struct solaris_mount_opts, p), n }
static const struct fuse_opt solaris_mnt_opts[] = {
SOLARIS_MOUNT_OPT("suid", setuid, 1),
SOLARIS_MOUNT_OPT("suid", devices, 1),
SOLARIS_MOUNT_OPT("nosuid", nosuid, 1),
SOLARIS_MOUNT_OPT("setuid", setuid, 1),
SOLARIS_MOUNT_OPT("nosetuid", nosetuid, 1),
SOLARIS_MOUNT_OPT("devices", devices, 1),
SOLARIS_MOUNT_OPT("nodevices", nodevices, 1),
FUSE_OPT_END
};
#endif /* __SOLARIS__ */
static void set_mount_flag(const char *s, int *flags)
{
int i;
@ -155,23 +287,85 @@ static int fuse_mount_opt_proc(void *data, const char *arg, int key,
case KEY_FUSERMOUNT_OPT:
return fuse_opt_add_opt(&mo->fusermount_opts, arg);
#ifdef __SOLARIS__
case KEY_SUBTYPE_OPT:
return fuse_opt_add_opt(&mo->subtype_opt, arg);
#endif /* __SOLARIS__ */
case KEY_MTAB_OPT:
return fuse_opt_add_opt(&mo->mtab_opts, arg);
case KEY_HELP:
#ifdef __SOLARIS__
mount_help();
#endif /* __SOLARIS__ */
mo->ishelp = 1;
break;
case KEY_VERSION:
#ifdef __SOLARIS__
mount_version();
#endif /* __SOLARIS__ */
mo->ishelp = 1;
break;
}
return 1;
}
#ifdef __SOLARIS__
/* return value:
* >= 0 => fd
* -1 => error
*/
static int receive_fd(int fd)
{
struct msghdr msg;
struct iovec iov;
char buf[1];
int rv;
size_t ccmsg[CMSG_SPACE(sizeof(int)) / sizeof(size_t)];
struct cmsghdr *cmsg;
iov.iov_base = buf;
iov.iov_len = 1;
msg.msg_name = 0;
msg.msg_namelen = 0;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
/* old BSD implementations should use msg_accrights instead of
* msg_control; the interface is different. */
msg.msg_control = ccmsg;
msg.msg_controllen = sizeof(ccmsg);
while(((rv = recvmsg(fd, &msg, 0)) == -1) && errno == EINTR);
if (rv == -1) {
perror("recvmsg");
return -1;
}
if(!rv) {
/* EOF */
return -1;
}
cmsg = CMSG_FIRSTHDR(&msg);
if (cmsg->cmsg_type != SCM_RIGHTS) {
fprintf(stderr, "got control message of unknown type %d\n",
cmsg->cmsg_type);
return -1;
}
return *(int*)CMSG_DATA(cmsg);
}
#endif /* __SOLARIS__ */
void fuse_kern_unmount(const char *mountpoint, int fd)
{
int res;
#ifdef __SOLARIS__
int pid;
#endif /* __SOLARIS__ */
if (!mountpoint)
return;
@ -186,12 +380,218 @@ void fuse_kern_unmount(const char *mountpoint, int fd)
then the filesystem is already unmounted */
if (res == 1 && (pfd.revents & POLLERR))
return;
/*
* Need to close file descriptor, otherwise synchronous umount
* would recurse into filesystem, and deadlock.
*/
close(fd);
}
close(fd);
#ifndef __SOLARIS__
fusermount(1, 0, 1, "", mountpoint);
#else /* __SOLARIS__ */
if (geteuid() == 0) {
fuse_mnt_umount("fuse", mountpoint, 1);
return;
}
res = umount2(mountpoint, 2);
if (res == 0)
return;
pid = fork();
if(pid == -1)
return;
if(pid == 0) {
const char *argv[] =
{ FUSERMOUNT_PROG, "-u", "-q", "-z", "--", mountpoint, NULL };
exec_fusermount(argv);
_exit(1);
}
waitpid(pid, NULL, 0);
#endif /* __SOLARIS__ */
}
#ifdef __SOLARIS__
static int fuse_mount_fusermount(const char *mountpoint, const char *opts,
int quiet)
{
int fds[2], pid;
int res;
int rv;
if (!mountpoint) {
fprintf(stderr, "fuse: missing mountpoint\n");
return -1;
}
res = socketpair(PF_UNIX, SOCK_STREAM, 0, fds);
if(res == -1) {
perror("fuse: socketpair() failed");
return -1;
}
pid = fork();
if(pid == -1) {
perror("fuse: fork() failed");
close(fds[0]);
close(fds[1]);
return -1;
}
if(pid == 0) {
char env[10];
const char *argv[32];
int a = 0;
if (quiet) {
int fd = open("/dev/null", O_RDONLY);
dup2(fd, 1);
dup2(fd, 2);
}
argv[a++] = FUSERMOUNT_PROG;
if (opts) {
argv[a++] = "-o";
argv[a++] = opts;
}
argv[a++] = "--";
argv[a++] = mountpoint;
argv[a++] = NULL;
close(fds[1]);
fcntl(fds[0], F_SETFD, 0);
snprintf(env, sizeof(env), "%i", fds[0]);
setenv(FUSE_COMMFD_ENV, env, 1);
exec_fusermount(argv);
perror("fuse: failed to exec fusermount");
_exit(1);
}
close(fds[0]);
rv = receive_fd(fds[1]);
close(fds[1]);
waitpid(pid, NULL, 0); /* bury zombie */
return rv;
}
static int fuse_mount_sys(const char *mnt, struct mount_opts *mo,
const char *mnt_opts)
{
char tmp[128];
const char *devname = "/dev/fuse";
char *source = NULL;
char *type = NULL;
struct stat stbuf;
int fd;
int res;
if (!mnt) {
fprintf(stderr, "fuse: missing mountpoint\n");
return -1;
}
res = lstat(mnt, &stbuf);
if (res == -1) {
fprintf(stderr ,"fuse: failed to access mountpoint %s: %s\n",
mnt, strerror(errno));
return -1;
}
if (!mo->nonempty) {
res = fuse_mnt_check_empty("fuse", mnt, stbuf.st_mode, stbuf.st_size);
if (res == -1)
return -1;
}
fd = open(devname, O_RDWR);
if (fd == -1) {
if (errno == ENODEV || errno == ENOENT)
fprintf(stderr,
"fuse: device not found, try 'modprobe fuse' first\n");
else
fprintf(stderr, "fuse: failed to open %s: %s\n", devname,
strerror(errno));
return -1;
}
snprintf(tmp, sizeof(tmp), "fd=%i,rootmode=%o,user_id=%i,group_id=%i", fd,
stbuf.st_mode & S_IFMT, getuid(), getgid());
res = fuse_opt_add_opt(&mo->kernel_opts, tmp);
if (res == -1)
goto out_close;
source = malloc((mo->fsname ? strlen(mo->fsname) : 0) +
(mo->subtype ? strlen(mo->subtype) : 0) +
strlen(devname) + 32);
type = malloc((mo->subtype ? strlen(mo->subtype) : 0) + 32);
if (!type || !source) {
fprintf(stderr, "fuse: failed to allocate memory\n");
goto out_close;
}
strcpy(type, mo->blkdev ? "fuseblk" : "fuse");
if (mo->subtype) {
strcat(type, ".");
strcat(type, mo->subtype);
}
strcpy(source,
mo->fsname ? mo->fsname : (mo->subtype ? mo->subtype : devname));
/* JPA added two final zeroes */
res = mount(source, mnt, MS_OPTIONSTR|mo->flags, type, NULL, 0,
mo->kernel_opts, MAX_MNTOPT_STR, 0, 0);
if (res == -1 && errno == EINVAL && mo->subtype) {
/* Probably missing subtype support */
strcpy(type, mo->blkdev ? "fuseblk" : "fuse");
if (mo->fsname) {
if (!mo->blkdev)
sprintf(source, "%s#%s", mo->subtype, mo->fsname);
} else {
strcpy(source, type);
}
/* JPA two null args added */
res = mount(source, mnt, MS_OPTIONSTR|mo->flags, type, NULL, 0,
mo->kernel_opts, MAX_MNTOPT_STR, 0, 0);
}
if (res == -1) {
/*
* Maybe kernel doesn't support unprivileged mounts, in this
* case try falling back to fusermount
*/
if (errno == EPERM) {
res = -2;
} else {
int errno_save = errno;
if (mo->blkdev && errno == ENODEV && !fuse_mnt_check_fuseblk())
fprintf(stderr, "fuse: 'fuseblk' support missing\n");
else
fprintf(stderr, "fuse: mount failed: %s\n",
strerror(errno_save));
}
goto out_close;
}
return fd;
out_umount:
umount2(mnt, 2); /* lazy umount */
out_close:
free(type);
free(source);
close(fd);
return res;
}
#endif /* __SOLARIS__ */
static int get_mnt_flag_opts(char **mnt_optsp, int flags)
{
int i;
@ -201,8 +601,8 @@ static int get_mnt_flag_opts(char **mnt_optsp, int flags)
for (i = 0; mount_flags[i].opt != NULL; i++) {
if (mount_flags[i].on && (flags & mount_flags[i].flag) &&
fuse_opt_add_opt(mnt_optsp, mount_flags[i].opt) == -1)
return -1;
fuse_opt_add_opt(mnt_optsp, mount_flags[i].opt) == -1)
return -1;
}
return 0;
}
@ -212,26 +612,71 @@ int fuse_kern_mount(const char *mountpoint, struct fuse_args *args)
struct mount_opts mo;
int res = -1;
char *mnt_opts = NULL;
#ifdef __SOLARIS__
struct solaris_mount_opts smo;
struct fuse_args sa = FUSE_ARGS_INIT(0, NULL);
#endif /* __SOLARIS__ */
memset(&mo, 0, sizeof(mo));
#ifndef __SOLARIS__
if (getuid())
mo.flags = MS_NOSUID | MS_NODEV;
#else /* __SOLARIS__ */
mo.flags = 0;
memset(&smo, 0, sizeof(smo));
if (args != NULL) {
while (args->argv[sa.argc] != NULL)
fuse_opt_add_arg(&sa, args->argv[sa.argc]);
}
#endif /* __SOLARIS__ */
if (args &&
fuse_opt_parse(args, &mo, fuse_mount_opts, fuse_mount_opt_proc) == -1)
#ifndef __SOLARIS__
return -1;
#else /* __SOLARIS__ */
goto out; /* if SOLARIS, clean up 'sa' */
/*
* In Solaris, nosuid is equivalent to nosetuid + nodevices. We only
* have MS_NOSUID for mount flags (no MS_(NO)SETUID, etc.). But if
* we set that as a default, it restricts specifying just nosetuid
* or nodevices; there is no way for the user to specify setuid +
* nodevices or vice-verse. So we parse the existing options, then
* add restrictive defaults if needed.
*/
if (fuse_opt_parse(&sa, &smo, solaris_mnt_opts, NULL) == -1)
goto out;
if (smo.nosuid || (!smo.nodevices && !smo.devices
&& !smo.nosetuid && !smo.setuid)) {
mo.flags |= MS_NOSUID;
} else {
/*
* Defaults; if neither nodevices|devices,nosetuid|setuid has
* been specified, add the default negative option string. If
* both have been specified (i.e., -osuid,nosuid), leave them
* alone; the last option will have precedence.
*/
if (!smo.nodevices && !smo.devices)
if (fuse_opt_add_opt(&mo.kernel_opts, "nodevices") == -1)
goto out;
if (!smo.nosetuid && !smo.setuid)
if (fuse_opt_add_opt(&mo.kernel_opts, "nosetuid") == -1)
goto out;
}
#endif /* __SOLARIS__ */
if (mo.allow_other && mo.allow_root) {
fprintf(stderr, "fuse: 'allow_other' and 'allow_root' options are mutually exclusive\n");
goto out;
}
res = 0;
res = -1;
if (mo.ishelp)
goto out;
res = -1;
if (get_mnt_flag_opts(&mnt_opts, mo.flags) == -1)
goto out;
#ifndef __SOLARIS__
if (!(mo.flags & MS_NODEV) && fuse_opt_add_opt(&mnt_opts, "dev") == -1)
goto out;
if (!(mo.flags & MS_NOSUID) && fuse_opt_add_opt(&mnt_opts, "suid") == -1)
@ -242,15 +687,48 @@ int fuse_kern_mount(const char *mountpoint, struct fuse_args *args)
goto out;
if (mo.fusermount_opts && fuse_opt_add_opt(&mnt_opts, mo.fusermount_opts) < 0)
goto out;
res = fusermount(0, 0, 0, mnt_opts ? mnt_opts : "", mountpoint);
#else /* __SOLARIS__ */
if (mo.kernel_opts && fuse_opt_add_opt(&mnt_opts, mo.kernel_opts) == -1)
goto out;
if (mo.mtab_opts && fuse_opt_add_opt(&mnt_opts, mo.mtab_opts) == -1)
goto out;
res = fuse_mount_sys(mountpoint, &mo, mnt_opts);
if (res == -2) {
if (mo.fusermount_opts &&
fuse_opt_add_opt(&mnt_opts, mo.fusermount_opts) == -1)
goto out;
if (mo.subtype) {
char *tmp_opts = NULL;
res = -1;
if (fuse_opt_add_opt(&tmp_opts, mnt_opts) == -1 ||
fuse_opt_add_opt(&tmp_opts, mo.subtype_opt) == -1) {
free(tmp_opts);
goto out;
}
res = fuse_mount_fusermount(mountpoint, tmp_opts, 1);
free(tmp_opts);
if (res == -1)
res = fuse_mount_fusermount(mountpoint, mnt_opts, 0);
} else {
res = fuse_mount_fusermount(mountpoint, mnt_opts, 0);
}
}
#endif /* __SOLARIS__ */
out:
free(mnt_opts);
#ifdef __SOLARIS__
fuse_opt_free_args(&sa);
free(mo.subtype);
free(mo.subtype_opt);
#endif /* __SOLARIS__ */
free(mo.fsname);
free(mo.fusermount_opts);
free(mo.kernel_opts);
free(mo.mtab_opts);
return res;
}

View File

@ -15,11 +15,254 @@
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <mntent.h>
#include <paths.h>
#include <sys/stat.h>
#include <sys/wait.h>
#ifdef __SOLARIS__
#else /* __SOLARIS__ */
#include <mntent.h>
#include <sys/mount.h>
#include <sys/param.h>
#endif /* __SOLARIS__ */
#ifdef __SOLARIS__
char *mkdtemp(char *template);
#ifndef _PATH_MOUNTED
#define _PATH_MOUNTED "/etc/mnttab"
#endif /* _PATH_MOUNTED */
#ifndef IGNORE_MTAB
static int mtab_needs_update(const char *mnt)
{
struct stat stbuf;
/* If mtab is within new mount, don't touch it */
if (strncmp(mnt, _PATH_MOUNTED, strlen(mnt)) == 0 &&
_PATH_MOUNTED[strlen(mnt)] == '/')
return 0;
if (lstat(_PATH_MOUNTED, &stbuf) != -1 && S_ISLNK(stbuf.st_mode))
return 0;
return 1;
}
#endif /* IGNORE_MTAB */
int fuse_mnt_add_mount(const char *progname, const char *fsname,
const char *mnt, const char *type, const char *opts)
{
int res;
int status;
#ifndef IGNORE_MTAB
if (!mtab_needs_update(mnt))
return 0;
#endif /* IGNORE_MTAB */
res = fork();
if (res == -1) {
fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno));
return -1;
}
if (res == 0) {
char *env = NULL;
char templ[] = "/tmp/fusermountXXXXXX";
char *tmp;
setuid(geteuid());
/*
* hide in a directory, where mount isn't able to resolve
* fsname as a valid path
*/
tmp = mkdtemp(templ);
if (!tmp) {
fprintf(stderr, "%s: failed to create temporary directory\n",
progname);
exit(1);
}
if (chdir(tmp)) {
fprintf(stderr, "%s: failed to chdir to %s: %s\n",
progname, tmp, strerror(errno));
exit(1);
}
rmdir(tmp);
execle("/sbin/mount", "/sbin/mount", "-F", type, "-o", opts,
fsname, mnt, NULL, &env);
fprintf(stderr, "%s: failed to execute /sbin/mount: %s\n", progname,
strerror(errno));
exit(1);
}
res = waitpid(res, &status, 0);
if (res == -1) {
fprintf(stderr, "%s: waitpid: %s\n", progname, strerror(errno));
return -1;
}
if (status != 0)
return -1;
return 0;
}
int fuse_mnt_umount(const char *progname, const char *mnt, int lazy)
{
int res;
int status;
#ifndef IGNORE_MTAB
if (!mtab_needs_update(mnt))
return 0;
#endif /* IGNORE_MTAB */
res = fork();
if (res == -1) {
fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno));
return -1;
}
if (res == 0) {
char *env = NULL;
setuid(geteuid());
if (lazy) {
execle("/sbin/umount", "/sbin/umount", mnt,
NULL, &env);
} else {
execle("/sbin/umount", "/sbin/umount", "-f", mnt,
NULL, &env);
}
fprintf(stderr, "%s: failed to execute /sbin/umount: %s\n", progname,
strerror(errno));
exit(1);
}
res = waitpid(res, &status, 0);
if (res == -1) {
fprintf(stderr, "%s: waitpid: %s\n", progname, strerror(errno));
return -1;
}
if (status != 0)
return -1;
return 0;
}
char *fuse_mnt_resolve_path(const char *progname, const char *orig)
{
char buf[PATH_MAX];
char *copy;
char *dst;
char *end;
char *lastcomp;
const char *toresolv;
if (!orig[0]) {
fprintf(stderr, "%s: invalid mountpoint '%s'\n", progname, orig);
return NULL;
}
copy = strdup(orig);
if (copy == NULL) {
fprintf(stderr, "%s: failed to allocate memory\n", progname);
return NULL;
}
toresolv = copy;
lastcomp = NULL;
for (end = copy + strlen(copy) - 1; end > copy && *end == '/'; end --);
if (end[0] != '/') {
char *tmp;
end[1] = '\0';
tmp = strrchr(copy, '/');
if (tmp == NULL) {
lastcomp = copy;
toresolv = ".";
} else {
lastcomp = tmp + 1;
if (tmp == copy)
toresolv = "/";
}
if (strcmp(lastcomp, ".") == 0 || strcmp(lastcomp, "..") == 0) {
lastcomp = NULL;
toresolv = copy;
}
else if (tmp)
tmp[0] = '\0';
}
if (realpath(toresolv, buf) == NULL) {
fprintf(stderr, "%s: bad mount point %s: %s\n", progname, orig,
strerror(errno));
free(copy);
return NULL;
}
if (lastcomp == NULL)
dst = strdup(buf);
else {
dst = (char *) malloc(strlen(buf) + 1 + strlen(lastcomp) + 1);
if (dst) {
unsigned buflen = strlen(buf);
if (buflen && buf[buflen-1] == '/')
sprintf(dst, "%s%s", buf, lastcomp);
else
sprintf(dst, "%s/%s", buf, lastcomp);
}
}
free(copy);
if (dst == NULL)
fprintf(stderr, "%s: failed to allocate memory\n", progname);
return dst;
}
int fuse_mnt_check_empty(const char *progname, const char *mnt,
mode_t rootmode, off_t rootsize)
{
int isempty = 1;
if (S_ISDIR(rootmode)) {
struct dirent *ent;
DIR *dp = opendir(mnt);
if (dp == NULL) {
fprintf(stderr, "%s: failed to open mountpoint for reading: %s\n",
progname, strerror(errno));
return -1;
}
while ((ent = readdir(dp)) != NULL) {
if (strcmp(ent->d_name, ".") != 0 &&
strcmp(ent->d_name, "..") != 0) {
isempty = 0;
break;
}
}
closedir(dp);
} else if (rootsize)
isempty = 0;
if (!isempty) {
fprintf(stderr, "%s: mountpoint is not empty\n", progname);
fprintf(stderr, "%s: if you are sure this is safe, use the 'nonempty' mount option\n", progname);
return -1;
}
return 0;
}
int fuse_mnt_check_fuseblk(void)
{
char buf[256];
FILE *f = fopen("/proc/filesystems", "r");
if (!f)
return 1;
while (fgets(buf, sizeof(buf), f))
if (strstr(buf, "fuseblk\n")) {
fclose(f);
return 1;
}
fclose(f);
return 0;
}
#else /* __SOLARIS__ */
static int mtab_needs_update(const char *mnt)
{
@ -68,10 +311,13 @@ int fuse_mnt_add_mount(const char *progname, const char *fsname,
return 0;
}
if (res == 0) {
char *env = NULL;
char templ[] = "/tmp/fusermountXXXXXX";
char *tmp;
setuid(geteuid());
if (setuid(geteuid()))
fprintf(stderr, "%s: failed to setuid : %s\n", progname,
strerror(errno));
/*
* hide in a directory, where mount isn't able to resolve
@ -89,8 +335,8 @@ int fuse_mnt_add_mount(const char *progname, const char *fsname,
exit(1);
}
rmdir(tmp);
execl("/bin/mount", "/bin/mount", "-i", "-f", "-t", type, "-o", opts,
fsname, mnt, NULL);
execle("/bin/mount", "/bin/mount", "-i", "-f", "-t", type, "-o", opts,
fsname, mnt, NULL, &env);
fprintf(stderr, "%s: failed to execute /bin/mount: %s\n", progname,
strerror(errno));
exit(1);
@ -117,9 +363,18 @@ int fuse_mnt_umount(const char *progname, const char *mnt, int lazy)
return -1;
}
if (res == 0) {
setuid(geteuid());
execl("/bin/umount", "/bin/umount", "-i", mnt, lazy ? "-l" : NULL,
NULL);
char *env = NULL;
if (setuid(geteuid()))
fprintf(stderr, "%s: failed to setuid : %s\n", progname,
strerror(errno));
if (lazy) {
execle("/bin/umount", "/bin/umount", "-i", mnt, "-l",
NULL, &env);
} else {
execle("/bin/umount", "/bin/umount", "-i", mnt,
NULL, &env);
}
fprintf(stderr, "%s: failed to execute /bin/umount: %s\n", progname,
strerror(errno));
exit(1);
@ -217,3 +472,5 @@ int fuse_mnt_check_fuseblk(void)
fclose(f);
return 0;
}
#endif /* __SOLARIS__ */

View File

@ -14,6 +14,14 @@ int fuse_mnt_umount(const char *progname, const char *mnt, int lazy);
char *fuse_mnt_resolve_path(const char *progname, const char *orig);
int fuse_mnt_check_fuseblk(void);
#ifdef __SOLARIS__
int fuse_mnt_check_empty(const char *progname, const char *mnt,
mode_t rootmode, off_t rootsize);
#else /* __SOLARIS__ */
int fusermount(int unmount, int quiet, int lazy, const char *opts,
const char *origmnt);
#endif /* __SOLARIS__ */

View File

@ -9,37 +9,43 @@ else
noinst_LTLIBRARIES = libntfs-3g.la
endif
libntfs_3g_la_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/include/ntfs-3g
libntfs_3g_la_CFLAGS = $(AM_CFLAGS)
libntfs_3g_la_CPPFLAGS= $(AM_CPPFLAGS) $(LIBNTFS_CPPFLAGS) -I$(top_srcdir)/include/ntfs-3g
libntfs_3g_la_LIBADD = $(LIBNTFS_LIBS)
libntfs_3g_la_LDFLAGS = -version-info $(LIBNTFS_3G_VERSION) -no-undefined
if FUSE_INTERNAL
libntfs_3g_la_LIBADD = $(top_builddir)/libfuse-lite/libfuse-lite.la
endif
libntfs_3g_la_SOURCES = \
acls.c \
attrib.c \
attrlist.c \
bitmap.c \
bootsect.c \
cache.c \
collate.c \
compat.c \
compress.c \
debug.c \
device.c \
dir.c \
ea.c \
efs.c \
index.c \
inode.c \
ioctl.c \
lcnalloc.c \
logfile.c \
logging.c \
mft.c \
misc.c \
mst.c \
object_id.c \
realpath.c \
reparse.c \
runlist.c \
security.c \
unistr.c \
volume.c
volume.c \
xattrs.c
if NTFS_DEVICE_DEFAULT_IO_OPS
if WINDOWS
@ -72,3 +78,7 @@ if INSTALL_LIBRARY
$(RM) -f "$(DESTDIR)/$(rootlibdir)"/libntfs-3g.so*
endif
if ENABLE_NTFSPROGS
libs: $(lib_LTLIBRARIES)
endif

4511
libntfs-3g/acls.c 100644

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -107,7 +107,7 @@ int ntfs_attrlist_need(ntfs_inode *ni)
int ntfs_attrlist_entry_add(ntfs_inode *ni, ATTR_RECORD *attr)
{
ATTR_LIST_ENTRY *ale;
MFT_REF mref;
leMFT_REF mref;
ntfs_attr *na = NULL;
ntfs_attr_search_ctx *ctx;
u8 *new_al;
@ -150,7 +150,7 @@ int ntfs_attrlist_entry_add(ntfs_inode *ni, ATTR_RECORD *attr)
if (!ntfs_attr_lookup(attr->type, (attr->name_length) ? (ntfschar*)
((u8*)attr + le16_to_cpu(attr->name_offset)) :
AT_UNNAMED, attr->name_length, CASE_SENSITIVE,
(attr->non_resident) ? le64_to_cpu(attr->lowest_vcn) :
(attr->non_resident) ? sle64_to_cpu(attr->lowest_vcn) :
0, (attr->non_resident) ? NULL : ((u8*)attr +
le16_to_cpu(attr->value_offset)), (attr->non_resident) ?
0 : le32_to_cpu(attr->value_length), ctx)) {
@ -193,7 +193,7 @@ int ntfs_attrlist_entry_add(ntfs_inode *ni, ATTR_RECORD *attr)
if (attr->non_resident)
ale->lowest_vcn = attr->lowest_vcn;
else
ale->lowest_vcn = 0;
ale->lowest_vcn = const_cpu_to_sle64(0);
ale->mft_reference = mref;
ale->instance = attr->instance;
memcpy(ale->name, (u8 *)attr + le16_to_cpu(attr->name_offset),
@ -265,7 +265,7 @@ int ntfs_attrlist_entry_rm(ntfs_attr_search_ctx *ctx)
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, lowest_vcn %lld.\n",
(long long) ctx->ntfs_ino->mft_no,
(unsigned) le32_to_cpu(ctx->al_entry->type),
(long long) le64_to_cpu(ctx->al_entry->lowest_vcn));
(long long) sle64_to_cpu(ctx->al_entry->lowest_vcn));
if (!NInoAttrList(base_ni)) {
ntfs_log_trace("Attribute list isn't present.\n");

View File

@ -38,6 +38,7 @@
#include <errno.h>
#endif
#include "param.h"
#include "compat.h"
#include "bootsect.h"
#include "debug.h"
@ -61,11 +62,12 @@ BOOL ntfs_boot_sector_is_ntfs(NTFS_BOOT_SECTOR *b)
{
u32 i;
BOOL ret = FALSE;
u16 sectors_per_cluster;
ntfs_log_debug("Beginning bootsector check.\n");
ntfs_log_debug("Checking OEMid, NTFS signature.\n");
if (b->oem_id != cpu_to_le64(0x202020205346544eULL)) { /* "NTFS " */
if (b->oem_id != const_cpu_to_le64(0x202020205346544eULL)) { /* "NTFS " */
ntfs_log_error("NTFS signature is missing.\n");
goto not_ntfs;
}
@ -83,15 +85,27 @@ BOOL ntfs_boot_sector_is_ntfs(NTFS_BOOT_SECTOR *b)
case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128:
break;
default:
ntfs_log_error("Unexpected sectors per cluster value (%d).\n",
b->bpb.sectors_per_cluster);
goto not_ntfs;
if ((b->bpb.sectors_per_cluster < 240)
|| (b->bpb.sectors_per_cluster > 253)) {
if (b->bpb.sectors_per_cluster > 128)
ntfs_log_error("Unexpected sectors"
" per cluster value (code 0x%x)\n",
b->bpb.sectors_per_cluster);
else
ntfs_log_error("Unexpected sectors"
" per cluster value (%d).\n",
b->bpb.sectors_per_cluster);
goto not_ntfs;
}
}
ntfs_log_debug("Checking cluster size.\n");
i = (u32)le16_to_cpu(b->bpb.bytes_per_sector) *
b->bpb.sectors_per_cluster;
if (i > 65536) {
if (b->bpb.sectors_per_cluster > 128)
sectors_per_cluster = 1 << (256 - b->bpb.sectors_per_cluster);
else
sectors_per_cluster = b->bpb.sectors_per_cluster;
i = (u32)le16_to_cpu(b->bpb.bytes_per_sector) * sectors_per_cluster;
if (i > NTFS_MAX_CLUSTER_SIZE) {
ntfs_log_error("Unexpected cluster size (%d).\n", i);
goto not_ntfs;
}
@ -140,7 +154,15 @@ BOOL ntfs_boot_sector_is_ntfs(NTFS_BOOT_SECTOR *b)
}
}
if (b->end_of_sector_marker != cpu_to_le16(0xaa55))
/* MFT and MFTMirr may not overlap the boot sector or be the same */
if (((s64)sle64_to_cpu(b->mft_lcn) <= 0)
|| ((s64)sle64_to_cpu(b->mftmirr_lcn) <= 0)
|| (b->mft_lcn == b->mftmirr_lcn)) {
ntfs_log_error("Invalid location of MFT or MFTMirr.\n");
goto not_ntfs;
}
if (b->end_of_sector_marker != const_cpu_to_le16(0xaa55))
ntfs_log_debug("Warning: Bootsector has invalid end of sector "
"marker.\n");
@ -171,7 +193,7 @@ static const char *last_sector_error =
int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs)
{
s64 sectors;
u8 sectors_per_cluster;
u16 sectors_per_cluster;
s8 c;
/* We return -1 with errno = EINVAL on error. */
@ -186,7 +208,10 @@ int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs)
* below or equal the number_of_clusters) really belong in the
* ntfs_boot_sector_is_ntfs but in this way we can just do this once.
*/
sectors_per_cluster = bs->bpb.sectors_per_cluster;
if (bs->bpb.sectors_per_cluster > 128)
sectors_per_cluster = 1 << (256 - bs->bpb.sectors_per_cluster);
else
sectors_per_cluster = bs->bpb.sectors_per_cluster;
ntfs_log_debug("SectorsPerCluster = 0x%x\n", sectors_per_cluster);
if (sectors_per_cluster & (sectors_per_cluster - 1)) {
ntfs_log_error("sectors_per_cluster (%d) is not a power of 2."
@ -204,7 +229,7 @@ int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs)
(sectors - 1) << vol->sector_size_bits,
SEEK_SET) == -1) {
ntfs_log_perror("Failed to read last sector (%lld)",
(long long)sectors);
(long long)(sectors - 1));
ntfs_log_error("%s", last_sector_error);
return -1;
}
@ -215,8 +240,8 @@ int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs)
vol->mftmirr_lcn = sle64_to_cpu(bs->mftmirr_lcn);
ntfs_log_debug("MFT LCN = %lld\n", (long long)vol->mft_lcn);
ntfs_log_debug("MFTMirr LCN = %lld\n", (long long)vol->mftmirr_lcn);
if (vol->mft_lcn > vol->nr_clusters ||
vol->mftmirr_lcn > vol->nr_clusters) {
if ((vol->mft_lcn < 0 || vol->mft_lcn > vol->nr_clusters) ||
(vol->mftmirr_lcn < 0 || vol->mftmirr_lcn > vol->nr_clusters)) {
ntfs_log_error("$MFT LCN (%lld) or $MFTMirr LCN (%lld) is "
"greater than the number of clusters (%lld).\n",
(long long)vol->mft_lcn, (long long)vol->mftmirr_lcn,

606
libntfs-3g/cache.c 100644
View File

@ -0,0 +1,606 @@
/**
* cache.c : deal with LRU caches
*
* Copyright (c) 2008-2010 Jean-Pierre Andre
*
* 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
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "types.h"
#include "security.h"
#include "cache.h"
#include "misc.h"
#include "logging.h"
/*
* General functions to deal with LRU caches
*
* The cached data have to be organized in a structure in which
* the first fields must follow a mandatory pattern and further
* fields may contain any fixed size data. They are stored in an
* LRU list.
*
* A compare function must be provided for finding a wanted entry
* in the cache. Another function may be provided for invalidating
* an entry to facilitate multiple invalidation.
*
* These functions never return error codes. When there is a
* shortage of memory, data is simply not cached.
* When there is a hashing bug, hashing is dropped, and sequential
* searches are used.
*/
/*
* Enter a new hash index, after a new record has been inserted
*
* Do not call when a record has been modified (with no key change)
*/
static void inserthashindex(struct CACHE_HEADER *cache,
struct CACHED_GENERIC *current)
{
int h;
struct HASH_ENTRY *link;
struct HASH_ENTRY *first;
if (cache->dohash) {
h = cache->dohash(current);
if ((h >= 0) && (h < cache->max_hash)) {
/* get a free link and insert at top of hash list */
link = cache->free_hash;
if (link) {
cache->free_hash = link->next;
first = cache->first_hash[h];
if (first)
link->next = first;
else
link->next = NULL;
link->entry = current;
cache->first_hash[h] = link;
} else {
ntfs_log_error("No more hash entries,"
" cache %s hashing dropped\n",
cache->name);
cache->dohash = (cache_hash)NULL;
}
} else {
ntfs_log_error("Illegal hash value,"
" cache %s hashing dropped\n",
cache->name);
cache->dohash = (cache_hash)NULL;
}
}
}
/*
* Drop a hash index when a record is about to be deleted
*/
static void drophashindex(struct CACHE_HEADER *cache,
const struct CACHED_GENERIC *current, int hash)
{
struct HASH_ENTRY *link;
struct HASH_ENTRY *previous;
if (cache->dohash) {
if ((hash >= 0) && (hash < cache->max_hash)) {
/* find the link and unlink */
link = cache->first_hash[hash];
previous = (struct HASH_ENTRY*)NULL;
while (link && (link->entry != current)) {
previous = link;
link = link->next;
}
if (link) {
if (previous)
previous->next = link->next;
else
cache->first_hash[hash] = link->next;
link->next = cache->free_hash;
cache->free_hash = link;
} else {
ntfs_log_error("Bad hash list,"
" cache %s hashing dropped\n",
cache->name);
cache->dohash = (cache_hash)NULL;
}
} else {
ntfs_log_error("Illegal hash value,"
" cache %s hashing dropped\n",
cache->name);
cache->dohash = (cache_hash)NULL;
}
}
}
/*
* Fetch an entry from cache
*
* returns the cache entry, or NULL if not available
* The returned entry may be modified, but not freed
*/
struct CACHED_GENERIC *ntfs_fetch_cache(struct CACHE_HEADER *cache,
const struct CACHED_GENERIC *wanted, cache_compare compare)
{
struct CACHED_GENERIC *current;
struct CACHED_GENERIC *previous;
struct HASH_ENTRY *link;
int h;
current = (struct CACHED_GENERIC*)NULL;
if (cache) {
if (cache->dohash) {
/*
* When possible, use the hash table to
* locate the entry if present
*/
h = cache->dohash(wanted);
link = cache->first_hash[h];
while (link && compare(link->entry, wanted))
link = link->next;
if (link)
current = link->entry;
}
if (!cache->dohash) {
/*
* Search sequentially in LRU list if no hash table
* or if hashing has just failed
*/
current = cache->most_recent_entry;
while (current
&& compare(current, wanted)) {
current = current->next;
}
}
if (current) {
previous = current->previous;
cache->hits++;
if (previous) {
/*
* found and not at head of list, unlink from current
* position and relink as head of list
*/
previous->next = current->next;
if (current->next)
current->next->previous
= current->previous;
else
cache->oldest_entry
= current->previous;
current->next = cache->most_recent_entry;
current->previous
= (struct CACHED_GENERIC*)NULL;
cache->most_recent_entry->previous = current;
cache->most_recent_entry = current;
}
}
cache->reads++;
}
return (current);
}
/*
* Enter an inode number into cache
* returns the cache entry or NULL if not possible
*/
struct CACHED_GENERIC *ntfs_enter_cache(struct CACHE_HEADER *cache,
const struct CACHED_GENERIC *item,
cache_compare compare)
{
struct CACHED_GENERIC *current;
struct CACHED_GENERIC *before;
struct HASH_ENTRY *link;
int h;
current = (struct CACHED_GENERIC*)NULL;
if (cache) {
if (cache->dohash) {
/*
* When possible, use the hash table to
* find out whether the entry if present
*/
h = cache->dohash(item);
link = cache->first_hash[h];
while (link && compare(link->entry, item))
link = link->next;
if (link) {
current = link->entry;
}
}
if (!cache->dohash) {
/*
* Search sequentially in LRU list to locate the end,
* and find out whether the entry is already in list
* As we normally go to the end, no statistics is
* kept.
*/
current = cache->most_recent_entry;
while (current
&& compare(current, item)) {
current = current->next;
}
}
if (!current) {
/*
* Not in list, get a free entry or reuse the
* last entry, and relink as head of list
* Note : we assume at least three entries, so
* before, previous and first are different when
* an entry is reused.
*/
if (cache->free_entry) {
current = cache->free_entry;
cache->free_entry = cache->free_entry->next;
if (item->varsize) {
current->variable = ntfs_malloc(
item->varsize);
} else
current->variable = (void*)NULL;
current->varsize = item->varsize;
if (!cache->oldest_entry)
cache->oldest_entry = current;
} else {
/* reusing the oldest entry */
current = cache->oldest_entry;
before = current->previous;
before->next = (struct CACHED_GENERIC*)NULL;
if (cache->dohash)
drophashindex(cache,current,
cache->dohash(current));
if (cache->dofree)
cache->dofree(current);
cache->oldest_entry = current->previous;
if (item->varsize) {
if (current->varsize)
current->variable = realloc(
current->variable,
item->varsize);
else
current->variable = ntfs_malloc(
item->varsize);
} else {
if (current->varsize)
free(current->variable);
current->variable = (void*)NULL;
}
current->varsize = item->varsize;
}
current->next = cache->most_recent_entry;
current->previous = (struct CACHED_GENERIC*)NULL;
if (cache->most_recent_entry)
cache->most_recent_entry->previous = current;
cache->most_recent_entry = current;
memcpy(current->payload, item->payload, cache->fixed_size);
if (item->varsize) {
if (current->variable) {
memcpy(current->variable,
item->variable, item->varsize);
} else {
/*
* no more memory for variable part
* recycle entry in free list
* not an error, just uncacheable
*/
cache->most_recent_entry = current->next;
current->next = cache->free_entry;
cache->free_entry = current;
current = (struct CACHED_GENERIC*)NULL;
}
} else {
current->variable = (void*)NULL;
current->varsize = 0;
}
if (cache->dohash && current)
inserthashindex(cache,current);
}
cache->writes++;
}
return (current);
}
/*
* Invalidate a cache entry
* The entry is moved to the free entry list
* A specific function may be called for entry deletion
*/
static void do_invalidate(struct CACHE_HEADER *cache,
struct CACHED_GENERIC *current, int flags)
{
struct CACHED_GENERIC *previous;
previous = current->previous;
if ((flags & CACHE_FREE) && cache->dofree)
cache->dofree(current);
/*
* Relink into free list
*/
if (current->next)
current->next->previous = current->previous;
else
cache->oldest_entry = current->previous;
if (previous)
previous->next = current->next;
else
cache->most_recent_entry = current->next;
current->next = cache->free_entry;
cache->free_entry = current;
if (current->variable)
free(current->variable);
current->varsize = 0;
}
/*
* Invalidate entries in cache
*
* Several entries may have to be invalidated (at least for inodes
* associated to directories which have been renamed), a different
* compare function may be provided to select entries to invalidate
*
* Returns the number of deleted entries, this can be used by
* the caller to signal a cache corruption if the entry was
* supposed to be found.
*/
int ntfs_invalidate_cache(struct CACHE_HEADER *cache,
const struct CACHED_GENERIC *item, cache_compare compare,
int flags)
{
struct CACHED_GENERIC *current;
struct CACHED_GENERIC *next;
struct HASH_ENTRY *link;
int count;
int h;
current = (struct CACHED_GENERIC*)NULL;
count = 0;
if (cache) {
if (!(flags & CACHE_NOHASH) && cache->dohash) {
/*
* When possible, use the hash table to
* find out whether the entry if present
*/
h = cache->dohash(item);
link = cache->first_hash[h];
while (link) {
if (compare(link->entry, item))
link = link->next;
else {
current = link->entry;
link = link->next;
if (current) {
drophashindex(cache,current,h);
do_invalidate(cache,
current,flags);
count++;
}
}
}
}
if ((flags & CACHE_NOHASH) || !cache->dohash) {
/*
* Search sequentially in LRU list
*/
current = cache->most_recent_entry;
while (current) {
if (!compare(current, item)) {
next = current->next;
if (cache->dohash)
drophashindex(cache,current,
cache->dohash(current));
do_invalidate(cache,current,flags);
current = next;
count++;
} else {
current = current->next;
}
}
}
}
return (count);
}
int ntfs_remove_cache(struct CACHE_HEADER *cache,
struct CACHED_GENERIC *item, int flags)
{
int count;
count = 0;
if (cache) {
if (cache->dohash)
drophashindex(cache,item,cache->dohash(item));
do_invalidate(cache,item,flags);
count++;
}
return (count);
}
/*
* Free memory allocated to a cache
*/
static void ntfs_free_cache(struct CACHE_HEADER *cache)
{
struct CACHED_GENERIC *entry;
if (cache) {
for (entry=cache->most_recent_entry; entry; entry=entry->next) {
if (cache->dofree)
cache->dofree(entry);
if (entry->variable)
free(entry->variable);
}
free(cache);
}
}
/*
* Create a cache
*
* Returns the cache header, or NULL if the cache could not be created
*/
static struct CACHE_HEADER *ntfs_create_cache(const char *name,
cache_free dofree, cache_hash dohash,
int full_item_size,
int item_count, int max_hash)
{
struct CACHE_HEADER *cache;
struct CACHED_GENERIC *pc;
struct CACHED_GENERIC *qc;
struct HASH_ENTRY *ph;
struct HASH_ENTRY *qh;
struct HASH_ENTRY **px;
size_t size;
int i;
size = sizeof(struct CACHE_HEADER) + item_count*full_item_size;
if (max_hash)
size += item_count*sizeof(struct HASH_ENTRY)
+ max_hash*sizeof(struct HASH_ENTRY*);
cache = (struct CACHE_HEADER*)ntfs_malloc(size);
if (cache) {
/* header */
cache->name = name;
cache->dofree = dofree;
if (dohash && max_hash) {
cache->dohash = dohash;
cache->max_hash = max_hash;
} else {
cache->dohash = (cache_hash)NULL;
cache->max_hash = 0;
}
cache->fixed_size = full_item_size - sizeof(struct CACHED_GENERIC);
cache->reads = 0;
cache->writes = 0;
cache->hits = 0;
/* chain the data entries, and mark an invalid entry */
cache->most_recent_entry = (struct CACHED_GENERIC*)NULL;
cache->oldest_entry = (struct CACHED_GENERIC*)NULL;
cache->free_entry = &cache->entry[0];
pc = &cache->entry[0];
for (i=0; i<(item_count - 1); i++) {
qc = (struct CACHED_GENERIC*)((char*)pc
+ full_item_size);
pc->next = qc;
pc->variable = (void*)NULL;
pc->varsize = 0;
pc = qc;
}
/* special for the last entry */
pc->next = (struct CACHED_GENERIC*)NULL;
pc->variable = (void*)NULL;
pc->varsize = 0;
if (max_hash) {
/* chain the hash entries */
ph = (struct HASH_ENTRY*)(((char*)pc) + full_item_size);
cache->free_hash = ph;
for (i=0; i<(item_count - 1); i++) {
qh = &ph[1];
ph->next = qh;
ph = qh;
}
/* special for the last entry */
if (item_count) {
ph->next = (struct HASH_ENTRY*)NULL;
}
/* create and initialize the hash indexes */
px = (struct HASH_ENTRY**)&ph[1];
cache->first_hash = px;
for (i=0; i<max_hash; i++)
px[i] = (struct HASH_ENTRY*)NULL;
} else {
cache->free_hash = (struct HASH_ENTRY*)NULL;
cache->first_hash = (struct HASH_ENTRY**)NULL;
}
}
return (cache);
}
/*
* Create all LRU caches
*
* No error return, if creation is not possible, cacheing will
* just be not available
*/
void ntfs_create_lru_caches(ntfs_volume *vol)
{
#if CACHE_INODE_SIZE
/* inode cache */
vol->xinode_cache = ntfs_create_cache("inode",(cache_free)NULL,
ntfs_dir_inode_hash, sizeof(struct CACHED_INODE),
CACHE_INODE_SIZE, 2*CACHE_INODE_SIZE);
#endif
#if CACHE_NIDATA_SIZE
/* idata cache */
vol->nidata_cache = ntfs_create_cache("nidata",
ntfs_inode_nidata_free, ntfs_inode_nidata_hash,
sizeof(struct CACHED_NIDATA),
CACHE_NIDATA_SIZE, 2*CACHE_NIDATA_SIZE);
#endif
#if CACHE_LOOKUP_SIZE
/* lookup cache */
vol->lookup_cache = ntfs_create_cache("lookup",
(cache_free)NULL, ntfs_dir_lookup_hash,
sizeof(struct CACHED_LOOKUP),
CACHE_LOOKUP_SIZE, 2*CACHE_LOOKUP_SIZE);
#endif
vol->securid_cache = ntfs_create_cache("securid",(cache_free)NULL,
(cache_hash)NULL,sizeof(struct CACHED_SECURID), CACHE_SECURID_SIZE, 0);
#if CACHE_LEGACY_SIZE
vol->legacy_cache = ntfs_create_cache("legacy",(cache_free)NULL,
(cache_hash)NULL, sizeof(struct CACHED_PERMISSIONS_LEGACY), CACHE_LEGACY_SIZE, 0);
#endif
}
/*
* Free all LRU caches
*/
void ntfs_free_lru_caches(ntfs_volume *vol)
{
#if CACHE_INODE_SIZE
ntfs_free_cache(vol->xinode_cache);
#endif
#if CACHE_NIDATA_SIZE
ntfs_free_cache(vol->nidata_cache);
#endif
#if CACHE_LOOKUP_SIZE
ntfs_free_cache(vol->lookup_cache);
#endif
ntfs_free_cache(vol->securid_cache);
#if CACHE_LEGACY_SIZE
ntfs_free_cache(vol->legacy_cache);
#endif
}

View File

@ -23,36 +23,23 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include "attrib.h"
#include "index.h"
#include "collate.h"
#include "debug.h"
#include "unistr.h"
#include "logging.h"
BOOL ntfs_is_collation_rule_supported(COLLATION_RULES cr)
{
int i;
/*
* FIXME: At the moment we only support COLLATION_BINARY,
* COLLATION_NTOFS_ULONG and COLLATION_FILE_NAME so we return false
* for everything else.
*/
if (cr != COLLATION_BINARY && cr != COLLATION_NTOFS_ULONG &&
cr != COLLATION_FILE_NAME)
return FALSE;
i = le32_to_cpu(cr);
if (((i >= 0) && (i <= 0x02)) ||
((i >= 0x10) && (i <= 0x13)))
return TRUE;
return FALSE;
}
/**
* ntfs_collate_binary - Which of two binary objects should be listed first
* @vol: unused
@ -121,6 +108,101 @@ static int ntfs_collate_ntofs_ulong(ntfs_volume *vol __attribute__((unused)),
return rc;
}
/**
* ntfs_collate_ntofs_ulongs - Which of two le32 arrays should be listed first
*
* Returns: -1, 0 or 1 depending of how the arrays compare
*/
static int ntfs_collate_ntofs_ulongs(ntfs_volume *vol __attribute__((unused)),
const void *data1, const int data1_len,
const void *data2, const int data2_len)
{
int rc;
int len;
const le32 *p1, *p2;
u32 d1, d2;
ntfs_log_trace("Entering.\n");
if ((data1_len != data2_len) || (data1_len <= 0) || (data1_len & 3)) {
ntfs_log_error("data1_len or data2_len not valid\n");
return NTFS_COLLATION_ERROR;
}
p1 = (const le32*)data1;
p2 = (const le32*)data2;
len = data1_len;
do {
d1 = le32_to_cpup(p1);
p1++;
d2 = le32_to_cpup(p2);
p2++;
} while ((d1 == d2) && ((len -= 4) > 0));
if (d1 < d2)
rc = -1;
else {
if (d1 == d2)
rc = 0;
else
rc = 1;
}
ntfs_log_trace("Done, returning %i.\n", rc);
return rc;
}
/**
* ntfs_collate_ntofs_security_hash - Which of two security descriptors
* should be listed first
* @vol: unused
* @data1:
* @data1_len:
* @data2:
* @data2_len:
*
* JPA compare two security hash keys made of two unsigned le32
*
* Returns: -1, 0 or 1 depending of how the keys compare
*/
static int ntfs_collate_ntofs_security_hash(ntfs_volume *vol __attribute__((unused)),
const void *data1, const int data1_len,
const void *data2, const int data2_len)
{
int rc;
u32 d1, d2;
const le32 *p1, *p2;
ntfs_log_trace("Entering.\n");
if (data1_len != data2_len || data1_len != 8) {
ntfs_log_error("data1_len or/and data2_len not equal to 8.\n");
return NTFS_COLLATION_ERROR;
}
p1 = (const le32*)data1;
p2 = (const le32*)data2;
d1 = le32_to_cpup(p1);
d2 = le32_to_cpup(p2);
if (d1 < d2)
rc = -1;
else {
if (d1 > d2)
rc = 1;
else {
p1++;
p2++;
d1 = le32_to_cpup(p1);
d2 = le32_to_cpup(p2);
if (d1 < d2)
rc = -1;
else {
if (d1 > d2)
rc = 1;
else
rc = 0;
}
}
}
ntfs_log_trace("Done, returning %i.\n", rc);
return rc;
}
/**
* ntfs_collate_file_name - Which of two filenames should be listed first
* @vol:
@ -137,85 +219,53 @@ static int ntfs_collate_file_name(ntfs_volume *vol,
const void *data1, const int data1_len __attribute__((unused)),
const void *data2, const int data2_len __attribute__((unused)))
{
const FILE_NAME_ATTR *file_name_attr1;
const FILE_NAME_ATTR *file_name_attr2;
int rc;
ntfs_log_trace("Entering.\n");
rc = ntfs_file_values_compare(data1, data2, NTFS_COLLATION_ERROR,
IGNORE_CASE, vol->upcase, vol->upcase_len);
if (!rc)
rc = ntfs_file_values_compare(data1, data2,
NTFS_COLLATION_ERROR, CASE_SENSITIVE,
vol->upcase, vol->upcase_len);
file_name_attr1 = (const FILE_NAME_ATTR*)data1;
file_name_attr2 = (const FILE_NAME_ATTR*)data2;
rc = ntfs_names_full_collate(
(ntfschar*)&file_name_attr1->file_name,
file_name_attr1->file_name_length,
(ntfschar*)&file_name_attr2->file_name,
file_name_attr2->file_name_length,
CASE_SENSITIVE, vol->upcase, vol->upcase_len);
ntfs_log_trace("Done, returning %i.\n", rc);
return rc;
}
typedef int (*ntfs_collate_func_t)(ntfs_volume *, const void *, const int,
const void *, const int);
static ntfs_collate_func_t ntfs_do_collate0x0[3] = {
ntfs_collate_binary,
ntfs_collate_file_name,
NULL/*ntfs_collate_unicode_string*/,
};
static ntfs_collate_func_t ntfs_do_collate0x1[4] = {
ntfs_collate_ntofs_ulong,
NULL/*ntfs_collate_ntofs_sid*/,
NULL/*ntfs_collate_ntofs_security_hash*/,
NULL/*ntfs_collate_ntofs_ulongs*/,
};
/**
* ntfs_collate - collate two data items using a specified collation rule
* @vol: ntfs volume to which the data items belong
* @cr: collation rule to use when comparing the items
* @data1: first data item to collate
* @data1_len: length in bytes of @data1
* @data2: second data item to collate
* @data2_len: length in bytes of @data2
/*
* Get a pointer to appropriate collation function.
*
* Collate the two data items @data1 and @data2 using the collation rule @cr
* and return -1, 0, or 1 if @data1 is found, respectively, to collate before,
* to match, or to collate after @data2.
*
* For speed we use the collation rule @cr as an index into two tables of
* function pointers to call the appropriate collation function.
*
* Return NTFS_COLLATION_ERROR if error occurred.
* Returns NULL if the needed function is not implemented
*/
int ntfs_collate(ntfs_volume *vol, COLLATION_RULES cr,
const void *data1, const int data1_len,
const void *data2, const int data2_len)
{
int i;
ntfs_log_trace("Entering.\n");
if (!vol || !data1 || !data2 || data1_len < 0 || data2_len < 0) {
ntfs_log_error("Invalid arguments passed.\n");
return NTFS_COLLATION_ERROR;
COLLATE ntfs_get_collate_function(COLLATION_RULES cr)
{
COLLATE collate;
switch (cr) {
case COLLATION_BINARY :
collate = ntfs_collate_binary;
break;
case COLLATION_FILE_NAME :
collate = ntfs_collate_file_name;
break;
case COLLATION_NTOFS_SECURITY_HASH :
collate = ntfs_collate_ntofs_security_hash;
break;
case COLLATION_NTOFS_ULONG :
collate = ntfs_collate_ntofs_ulong;
break;
case COLLATION_NTOFS_ULONGS :
collate = ntfs_collate_ntofs_ulongs;
break;
default :
errno = EOPNOTSUPP;
collate = (COLLATE)NULL;
break;
}
/*
* FIXME: At the moment we only support COLLATION_BINARY,
* COLLATION_NTOFS_ULONG and COLLATION_FILE_NAME so we return error
* for everything else.
*/
if (cr != COLLATION_BINARY && cr != COLLATION_NTOFS_ULONG &&
cr != COLLATION_FILE_NAME)
goto err;
i = le32_to_cpu(cr);
if (i < 0)
goto err;
if (i <= 0x02)
return ntfs_do_collate0x0[i](vol, data1, data1_len,
data2, data2_len);
if (i < 0x10)
goto err;
i -= 0x10;
if (i <= 3)
return ntfs_do_collate0x1[i](vol, data1, data1_len,
data2, data2_len);
err:
ntfs_log_debug("Unknown collation rule.\n");
return NTFS_COLLATION_ERROR;
return (collate);
}

View File

@ -77,7 +77,7 @@ int ffs(int x)
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)daemon.c 8.1 (Berkeley) 6/4/93";
static const char rcsid[] = "$Id: compat.c,v 1.2 2008-07-17 15:01:48 szaka Exp $";
static const char rcsid[] = "$Id: compat.c,v 1.1.1.1.2.1 2008-08-16 15:17:44 jpandre Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@ -164,7 +164,7 @@ int daemon(int nochdir, int noclose) {
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "strsep.c 8.1 (Berkeley) 6/4/93";
static const char rcsid[] = "$Id: compat.c,v 1.2 2008-07-17 15:01:48 szaka Exp $";
static const char rcsid[] = "$Id: compat.c,v 1.1.1.1.2.1 2008-08-16 15:17:44 jpandre Exp $";
#endif /* LIBC_SCCS and not lint */
/*

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,10 @@
/**
* device.c - Low level device io functions. Originated from the Linux-NTFS project.
*
* Copyright (c) 2004-2006 Anton Altaparmakov
* Copyright (c) 2004-2013 Anton Altaparmakov
* Copyright (c) 2004-2006 Szabolcs Szakacsits
* Copyright (c) 2010 Jean-Pierre Andre
* Copyright (c) 2008-2013 Tuxera Inc.
*
* 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
@ -57,12 +59,18 @@
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_DISK_H
#include <sys/disk.h>
#endif
#ifdef HAVE_LINUX_FD_H
#include <linux/fd.h>
#endif
#ifdef HAVE_LINUX_HDREG_H
#include <linux/hdreg.h>
#endif
#ifdef ENABLE_HD
#include <hd.h>
#endif
#include "types.h"
#include "mst.h"
@ -124,6 +132,8 @@ struct ntfs_device *ntfs_device_alloc(const char *name, const long state,
dev->d_ops = dops;
dev->d_state = state;
dev->d_private = priv_data;
dev->d_heads = -1;
dev->d_sectors_per_track = -1;
}
return dev;
}
@ -154,6 +164,25 @@ int ntfs_device_free(struct ntfs_device *dev)
return 0;
}
/*
* Sync the device
*
* returns zero if successful.
*/
int ntfs_device_sync(struct ntfs_device *dev)
{
int ret;
struct ntfs_device_operations *dops;
if (NDevDirty(dev)) {
dops = dev->d_ops;
ret = dops->sync(dev);
} else
ret = 0;
return ret;
}
/**
* ntfs_pread - positioned read from disk
* @dev: device to read from
@ -260,6 +289,9 @@ s64 ntfs_pwrite(struct ntfs_device *dev, const s64 pos, s64 count,
total = written;
break;
}
if (NDevSync(dev) && total && dops->sync(dev)) {
total--; /* on sync error, return partially written */
}
ret = total;
out:
return ret;
@ -533,6 +565,36 @@ s64 ntfs_device_size_get(struct ntfs_device *dev, int block_size)
return (s64)this_floppy.size * 512 / block_size;
}
}
#endif
#ifdef DIOCGMEDIASIZE
{
/* FreeBSD */
off_t size;
if (dev->d_ops->ioctl(dev, DIOCGMEDIASIZE, &size) >= 0) {
ntfs_log_debug("DIOCGMEDIASIZE nr bytes = %llu (0x%llx)\n",
(unsigned long long)size,
(unsigned long long)size);
return (s64)size / block_size;
}
}
#endif
#ifdef DKIOCGETBLOCKCOUNT
{
/* Mac OS X */
uint64_t blocks;
int sector_size;
sector_size = ntfs_device_sector_size_get(dev);
if (sector_size >= 0 && dev->d_ops->ioctl(dev,
DKIOCGETBLOCKCOUNT, &blocks) >= 0)
{
ntfs_log_debug("DKIOCGETBLOCKCOUNT nr blocks = %llu (0x%llx)\n",
(unsigned long long) blocks,
(unsigned long long) blocks);
return blocks * sector_size / block_size;
}
}
#endif
/*
* We couldn't figure it out by using a specialized ioctl,
@ -586,6 +648,132 @@ s64 ntfs_device_partition_start_sector_get(struct ntfs_device *dev)
return -1;
}
static int ntfs_device_get_geo(struct ntfs_device *dev)
{
int err;
if (!dev) {
errno = EINVAL;
return -1;
}
err = EOPNOTSUPP;
#ifdef ENABLE_HD
{
hd_data_t *hddata;
hd_t *hd, *devlist, *partlist = NULL;
str_list_t *names;
hd_res_t *res;
const int d_name_len = strlen(dev->d_name) + 1;
int done = 0;
hddata = calloc(1, sizeof(*hddata));
if (!hddata) {
err = ENOMEM;
goto skip_hd;
}
/* List all "disk" class devices on the system. */
devlist = hd_list(hddata, hw_disk, 1, NULL);
if (!devlist) {
free(hddata);
err = ENOMEM;
goto skip_hd;
}
/*
* Loop over each disk device looking for the device with the
* same unix name as @dev.
*/
for (hd = devlist; hd; hd = hd->next) {
if (hd->unix_dev_name && !strncmp(dev->d_name,
hd->unix_dev_name, d_name_len))
goto got_hd;
if (hd->unix_dev_name2 && !strncmp(dev->d_name,
hd->unix_dev_name2, d_name_len))
goto got_hd;
for (names = hd->unix_dev_names; names;
names = names->next) {
if (names->str && !strncmp(dev->d_name,
names->str, d_name_len))
goto got_hd;
}
}
/*
* Device was not a whole disk device. Unless it is a file it
* is likely to be a partition device. List all "partition"
* class devices on the system.
*/
partlist = hd_list(hddata, hw_partition, 1, NULL);
for (hd = partlist; hd; hd = hd->next) {
if (hd->unix_dev_name && !strncmp(dev->d_name,
hd->unix_dev_name, d_name_len))
goto got_part_hd;
if (hd->unix_dev_name2 && !strncmp(dev->d_name,
hd->unix_dev_name2, d_name_len))
goto got_part_hd;
for (names = hd->unix_dev_names; names;
names = names->next) {
if (names->str && !strncmp(dev->d_name,
names->str, d_name_len))
goto got_part_hd;
}
}
/* Failed to find the device. Stop trying and clean up. */
goto end_hd;
got_part_hd:
/* Get the whole block device the partition device is on. */
hd = hd_get_device_by_idx(hddata, hd->attached_to);
if (!hd)
goto end_hd;
got_hd:
/*
* @hd is now the whole block device either being formatted or
* that the partition being formatted is on.
*
* Loop over each resource of the disk device looking for the
* BIOS legacy geometry obtained from EDD which is what Windows
* needs to boot.
*/
for (res = hd->res; res; res = res->next) {
/* geotype 3 is BIOS legacy. */
if (res->any.type != res_disk_geo ||
res->disk_geo.geotype != 3)
continue;
dev->d_heads = res->disk_geo.heads;
dev->d_sectors_per_track = res->disk_geo.sectors;
done = 1;
}
end_hd:
if (partlist)
hd_free_hd_list(partlist);
hd_free_hd_list(devlist);
hd_free_hd_data(hddata);
free(hddata);
if (done) {
ntfs_log_debug("EDD/BIOD legacy heads = %u, sectors "
"per track = %u\n", dev->d_heads,
dev->d_sectors_per_track);
return 0;
}
}
skip_hd:
#endif
#ifdef HDIO_GETGEO
{ struct hd_geometry geo;
if (!dev->d_ops->ioctl(dev, HDIO_GETGEO, &geo)) {
dev->d_heads = geo.heads;
dev->d_sectors_per_track = geo.sectors;
ntfs_log_debug("HDIO_GETGEO heads = %u, sectors per "
"track = %u\n", dev->d_heads,
dev->d_sectors_per_track);
return 0;
}
err = errno;
}
#endif
errno = err;
return -1;
}
/**
* ntfs_device_heads_get - get number of heads of device
* @dev: open device
@ -597,6 +785,7 @@ s64 ntfs_device_partition_start_sector_get(struct ntfs_device *dev)
* EINVAL Input parameter error
* EOPNOTSUPP System does not support HDIO_GETGEO ioctl
* ENOTTY @dev is a file or a device not supporting HDIO_GETGEO
* ENOMEM Not enough memory to complete the request
*/
int ntfs_device_heads_get(struct ntfs_device *dev)
{
@ -604,20 +793,15 @@ int ntfs_device_heads_get(struct ntfs_device *dev)
errno = EINVAL;
return -1;
}
#ifdef HDIO_GETGEO
{ struct hd_geometry geo;
if (!dev->d_ops->ioctl(dev, HDIO_GETGEO, &geo)) {
ntfs_log_debug("HDIO_GETGEO heads = %u (0x%x)\n",
(unsigned)geo.heads,
(unsigned)geo.heads);
return geo.heads;
if (dev->d_heads == -1) {
if (ntfs_device_get_geo(dev) == -1)
return -1;
if (dev->d_heads == -1) {
errno = EINVAL;
return -1;
}
}
#else
errno = EOPNOTSUPP;
#endif
return -1;
return dev->d_heads;
}
/**
@ -631,6 +815,7 @@ int ntfs_device_heads_get(struct ntfs_device *dev)
* EINVAL Input parameter error
* EOPNOTSUPP System does not support HDIO_GETGEO ioctl
* ENOTTY @dev is a file or a device not supporting HDIO_GETGEO
* ENOMEM Not enough memory to complete the request
*/
int ntfs_device_sectors_per_track_get(struct ntfs_device *dev)
{
@ -638,20 +823,15 @@ int ntfs_device_sectors_per_track_get(struct ntfs_device *dev)
errno = EINVAL;
return -1;
}
#ifdef HDIO_GETGEO
{ struct hd_geometry geo;
if (!dev->d_ops->ioctl(dev, HDIO_GETGEO, &geo)) {
ntfs_log_debug("HDIO_GETGEO sectors_per_track = %u (0x%x)\n",
(unsigned)geo.sectors,
(unsigned)geo.sectors);
return geo.sectors;
if (dev->d_sectors_per_track == -1) {
if (ntfs_device_get_geo(dev) == -1)
return -1;
if (dev->d_sectors_per_track == -1) {
errno = EINVAL;
return -1;
}
}
#else
errno = EOPNOTSUPP;
#endif
return -1;
return dev->d_sectors_per_track;
}
/**
@ -682,6 +862,28 @@ int ntfs_device_sector_size_get(struct ntfs_device *dev)
return sect_size;
}
}
#elif defined(DIOCGSECTORSIZE)
{
/* FreeBSD */
size_t sect_size = 0;
if (!dev->d_ops->ioctl(dev, DIOCGSECTORSIZE, &sect_size)) {
ntfs_log_debug("DIOCGSECTORSIZE sector size = %d bytes\n",
(int) sect_size);
return sect_size;
}
}
#elif defined(DKIOCGETBLOCKSIZE)
{
/* Mac OS X */
uint32_t sect_size = 0;
if (!dev->d_ops->ioctl(dev, DKIOCGETBLOCKSIZE, &sect_size)) {
ntfs_log_debug("DKIOCGETBLOCKSIZE sector size = %d bytes\n",
(int) sect_size);
return sect_size;
}
}
#else
errno = EOPNOTSUPP;
#endif

File diff suppressed because it is too large Load Diff

519
libntfs-3g/ea.c 100644
View File

@ -0,0 +1,519 @@
/**
* ea.c - Processing of EA's
*
* This module is part of ntfs-3g library
*
* Copyright (c) 2014-2021 Jean-Pierre Andre
*
* 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
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
#endif
#include "types.h"
#include "param.h"
#include "layout.h"
#include "attrib.h"
#include "index.h"
#include "dir.h"
#include "ea.h"
#include "misc.h"
#include "logging.h"
#include "xattrs.h"
static const char lxdev[] = "$LXDEV";
static const char lxmod[] = "$LXMOD";
/*
* Create a needed attribute (EA or EA_INFORMATION)
*
* Returns 0 if successful,
* -1 otherwise, with errno indicating why it failed.
*/
static int ntfs_need_ea(ntfs_inode *ni, ATTR_TYPES type, int size, int flags)
{
u8 dummy;
int res;
res = 0;
if (!ntfs_attr_exist(ni,type, AT_UNNAMED,0)) {
if (!(flags & XATTR_REPLACE)) {
/*
* no needed attribute : add one,
* apparently, this does not feed the new value in
* Note : NTFS version must be >= 3
*/
if (ni->vol->major_ver >= 3) {
res = ntfs_attr_add(ni, type,
AT_UNNAMED,0,&dummy,(s64)size);
if (!res) {
NInoFileNameSetDirty(ni);
}
NInoSetDirty(ni);
} else {
errno = EOPNOTSUPP;
res = -1;
}
} else {
errno = ENODATA;
res = -1;
}
}
return (res);
}
/*
* Restore the old EA_INFORMATION or delete the current one,
* when EA cannot be updated.
*
* As this is used in the context of some other error, the caller
* is responsible for returning the proper error, and errno is
* left unchanged.
* Only double errors are logged here.
*/
static void restore_ea_info(ntfs_attr *nai, const EA_INFORMATION *old_ea_info)
{
s64 written;
int olderrno;
olderrno = errno;
if (old_ea_info) {
written = ntfs_attr_pwrite(nai, 0, sizeof(EA_INFORMATION),
old_ea_info);
if ((size_t)written != sizeof(EA_INFORMATION)) {
ntfs_log_error("Could not restore the EA_INFORMATION,"
" possible inconsistency in inode %lld\n",
(long long)nai->ni->mft_no);
}
} else {
if (ntfs_attr_rm(nai)) {
ntfs_log_error("Could not delete the EA_INFORMATION,"
" possible inconsistency in inode %lld\n",
(long long)nai->ni->mft_no);
}
}
errno = olderrno;
}
/*
* Update both EA and EA_INFORMATION
*/
static int ntfs_update_ea(ntfs_inode *ni, const char *value, size_t size,
const EA_INFORMATION *ea_info,
const EA_INFORMATION *old_ea_info)
{
ntfs_attr *na;
ntfs_attr *nai;
int res;
res = 0;
nai = ntfs_attr_open(ni, AT_EA_INFORMATION, AT_UNNAMED, 0);
if (nai) {
na = ntfs_attr_open(ni, AT_EA, AT_UNNAMED, 0);
if (na) {
/*
* Set EA_INFORMATION first, it is easier to
* restore the old value, if setting EA fails.
*/
if (ntfs_attr_pwrite(nai, 0, sizeof(EA_INFORMATION),
ea_info)
!= (s64)sizeof(EA_INFORMATION)) {
res = -errno;
} else {
if (((na->data_size > (s64)size)
&& ntfs_attr_truncate(na, size))
|| (ntfs_attr_pwrite(na, 0, size, value)
!= (s64)size)) {
res = -errno;
if (old_ea_info)
restore_ea_info(nai,
old_ea_info);
}
}
ntfs_attr_close(na);
}
ntfs_attr_close(nai);
} else {
res = -errno;
}
return (res);
}
/*
* Return the existing EA
*
* The EA_INFORMATION is not examined and the consistency of the
* existing EA is not checked.
*
* If successful, the full attribute is returned unchanged
* and its size is returned.
* If the designated buffer is too small, the needed size is
* returned, and the buffer is left unchanged.
* If there is an error, a negative value is returned and errno
* is set according to the error.
*/
int ntfs_get_ntfs_ea(ntfs_inode *ni, char *value, size_t size)
{
s64 ea_size;
void *ea_buf;
int res = 0;
if (ntfs_attr_exist(ni, AT_EA, AT_UNNAMED, 0)) {
ea_buf = ntfs_attr_readall(ni, AT_EA, (ntfschar*)NULL, 0,
&ea_size);
if (ea_buf) {
if (value && (ea_size <= (s64)size))
memcpy(value, ea_buf, ea_size);
free(ea_buf);
res = ea_size;
} else {
ntfs_log_error("Failed to read EA from inode %lld\n",
(long long)ni->mft_no);
errno = ENODATA;
res = -errno;
}
} else {
errno = ENODATA;
res = -errno;
}
return (res);
}
/*
* Set a new EA, and set EA_INFORMATION accordingly
*
* This is roughly the same as ZwSetEaFile() on Windows, however
* the "offset to next" of the last EA should not be cleared.
*
* Consistency of the new EA is first checked.
*
* EA_INFORMATION is set first, and it is restored to its former
* state if setting EA fails.
*
* Returns 0 if successful
* a negative value if an error occurred.
*/
int ntfs_set_ntfs_ea(ntfs_inode *ni, const char *value, size_t size, int flags)
{
EA_INFORMATION ea_info;
EA_INFORMATION *old_ea_info;
s64 old_ea_size;
int res;
size_t offs;
size_t nextoffs;
BOOL ok;
int ea_count;
int ea_packed;
const EA_ATTR *p_ea;
res = -1;
if (value && (size > 0)) {
/* do consistency checks */
offs = 0;
ok = TRUE;
ea_count = 0;
ea_packed = 0;
nextoffs = 0;
while (ok && (offs < size)) {
p_ea = (const EA_ATTR*)&value[offs];
nextoffs = offs + le32_to_cpu(p_ea->next_entry_offset);
/* null offset to next not allowed */
ok = (nextoffs > offs)
&& (nextoffs <= size)
&& !(nextoffs & 3)
&& p_ea->name_length
/* zero sized value are allowed */
&& ((offs + offsetof(EA_ATTR,name)
+ p_ea->name_length + 1
+ le16_to_cpu(p_ea->value_length))
<= nextoffs)
&& ((offs + offsetof(EA_ATTR,name)
+ p_ea->name_length + 1
+ le16_to_cpu(p_ea->value_length))
>= (nextoffs - 3))
&& !p_ea->name[p_ea->name_length];
/* name not checked, as chkdsk accepts any chars */
if (ok) {
if (p_ea->flags & NEED_EA)
ea_count++;
/*
* Assume ea_packed includes :
* 4 bytes for header (flags and lengths)
* + name length + 1
* + value length
*/
ea_packed += 5 + p_ea->name_length
+ le16_to_cpu(p_ea->value_length);
offs = nextoffs;
}
}
/*
* EA and REPARSE_POINT compatibility not checked any more,
* required by Windows 10, but having both may lead to
* problems with earlier versions.
*/
if (ok) {
ea_info.ea_length = cpu_to_le16(ea_packed);
ea_info.need_ea_count = cpu_to_le16(ea_count);
ea_info.ea_query_length = cpu_to_le32(nextoffs);
old_ea_size = 0;
old_ea_info = NULL;
/* Try to save the old EA_INFORMATION */
if (ntfs_attr_exist(ni, AT_EA_INFORMATION,
AT_UNNAMED, 0)) {
old_ea_info = ntfs_attr_readall(ni,
AT_EA_INFORMATION,
(ntfschar*)NULL, 0, &old_ea_size);
}
/*
* no EA or EA_INFORMATION : add them
*/
if (!ntfs_need_ea(ni, AT_EA_INFORMATION,
sizeof(EA_INFORMATION), flags)
&& !ntfs_need_ea(ni, AT_EA, 0, flags)) {
res = ntfs_update_ea(ni, value, size,
&ea_info, old_ea_info);
} else {
res = -errno;
}
if (old_ea_info)
free(old_ea_info);
} else {
errno = EINVAL;
res = -errno;
}
} else {
errno = EINVAL;
res = -errno;
}
return (res);
}
/*
* Remove the EA (including EA_INFORMATION)
*
* EA_INFORMATION is removed first, and it is restored to its former
* state if removing EA fails.
*
* Returns 0, or -1 if there is a problem
*/
int ntfs_remove_ntfs_ea(ntfs_inode *ni)
{
EA_INFORMATION *old_ea_info;
s64 old_ea_size;
int res;
ntfs_attr *na;
ntfs_attr *nai;
res = 0;
if (ni) {
/*
* open and delete the EA_INFORMATION and the EA
*/
nai = ntfs_attr_open(ni, AT_EA_INFORMATION, AT_UNNAMED, 0);
if (nai) {
na = ntfs_attr_open(ni, AT_EA, AT_UNNAMED, 0);
if (na) {
/* Try to save the old EA_INFORMATION */
old_ea_info = ntfs_attr_readall(ni,
AT_EA_INFORMATION,
(ntfschar*)NULL, 0, &old_ea_size);
res = ntfs_attr_rm(na);
NInoFileNameSetDirty(ni);
if (!res) {
res = ntfs_attr_rm(nai);
if (res && old_ea_info) {
/*
* Failed to remove the EA, try to
* restore the EA_INFORMATION
*/
restore_ea_info(nai,
old_ea_info);
}
} else {
ntfs_log_error("Failed to remove the"
" EA_INFORMATION from inode %lld\n",
(long long)ni->mft_no);
}
free(old_ea_info);
ntfs_attr_close(na);
} else {
/* EA_INFORMATION present, but no EA */
res = ntfs_attr_rm(nai);
NInoFileNameSetDirty(ni);
}
ntfs_attr_close(nai);
} else {
errno = ENODATA;
res = -1;
}
NInoSetDirty(ni);
} else {
errno = EINVAL;
res = -1;
}
return (res ? -1 : 0);
}
/*
* Check for the presence of an EA "$LXDEV" (used by WSL)
* and return its value as a device address
*
* Returns zero if successful
* -1 if failed, with errno set
*/
int ntfs_ea_check_wsldev(ntfs_inode *ni, dev_t *rdevp)
{
const EA_ATTR *p_ea;
int bufsize;
char *buf;
int lth;
int res;
int offset;
int next;
BOOL found;
struct {
le32 major;
le32 minor;
} device;
res = -EOPNOTSUPP;
bufsize = 256; /* expected to be enough */
buf = (char*)malloc(bufsize);
if (buf) {
lth = ntfs_get_ntfs_ea(ni, buf, bufsize);
/* retry if short buf */
if (lth > bufsize) {
free(buf);
bufsize = lth;
buf = (char*)malloc(bufsize);
if (buf)
lth = ntfs_get_ntfs_ea(ni, buf, bufsize);
}
}
if (buf && (lth > 0) && (lth <= bufsize)) {
offset = 0;
found = FALSE;
do {
p_ea = (const EA_ATTR*)&buf[offset];
next = le32_to_cpu(p_ea->next_entry_offset);
found = ((next > (int)(sizeof(lxdev) + sizeof(device)))
&& (p_ea->name_length == (sizeof(lxdev) - 1))
&& (p_ea->value_length
== const_cpu_to_le16(sizeof(device)))
&& !memcmp(p_ea->name, lxdev, sizeof(lxdev)));
if (!found)
offset += next;
} while (!found && (next > 0) && (offset < lth));
if (found) {
/* beware of alignment */
memcpy(&device, &p_ea->name[p_ea->name_length + 1],
sizeof(device));
*rdevp = makedev(le32_to_cpu(device.major),
le32_to_cpu(device.minor));
res = 0;
}
}
free(buf);
return (res);
}
int ntfs_ea_set_wsl_not_symlink(ntfs_inode *ni, mode_t type, dev_t dev)
{
le32 mode;
struct {
le32 major;
le32 minor;
} device;
struct EA_WSL {
struct EA_LXMOD { /* always inserted */
EA_ATTR base;
char name[sizeof(lxmod)];
char value[sizeof(mode)];
char stuff[3 & -(sizeof(lxmod) + sizeof(mode))];
} mod;
struct EA_LXDEV { /* char or block devices only */
EA_ATTR base;
char name[sizeof(lxdev)];
char value[sizeof(device)];
char stuff[3 & -(sizeof(lxdev) + sizeof(device))];
} dev;
} attr;
int len;
int res;
memset(&attr, 0, sizeof(attr));
mode = cpu_to_le32((u32)(type | 0644));
attr.mod.base.next_entry_offset
= const_cpu_to_le32(sizeof(attr.mod));
attr.mod.base.flags = 0;
attr.mod.base.name_length = sizeof(lxmod) - 1;
attr.mod.base.value_length = const_cpu_to_le16(sizeof(mode));
memcpy(attr.mod.name, lxmod, sizeof(lxmod));
memcpy(attr.mod.value, &mode, sizeof(mode));
len = sizeof(attr.mod);
if (S_ISCHR(type) || S_ISBLK(type)) {
device.major = cpu_to_le32(major(dev));
device.minor = cpu_to_le32(minor(dev));
attr.dev.base.next_entry_offset
= const_cpu_to_le32(sizeof(attr.dev));
attr.dev.base.flags = 0;
attr.dev.base.name_length = sizeof(lxdev) - 1;
attr.dev.base.value_length = const_cpu_to_le16(sizeof(device));
memcpy(attr.dev.name, lxdev, sizeof(lxdev));
memcpy(attr.dev.value, &device, sizeof(device));
len += sizeof(attr.dev);
}
res = ntfs_set_ntfs_ea(ni, (char*)&attr, len, 0);
return (res);
}

430
libntfs-3g/efs.c 100644
View File

@ -0,0 +1,430 @@
/**
* efs.c - Limited processing of encrypted files
*
* This module is part of ntfs-3g library
*
* Copyright (c) 2009 Martin Bene
* Copyright (c) 2009-2010 Jean-Pierre Andre
*
* 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
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif
#include "types.h"
#include "debug.h"
#include "attrib.h"
#include "inode.h"
#include "dir.h"
#include "efs.h"
#include "index.h"
#include "logging.h"
#include "misc.h"
#include "efs.h"
#include "xattrs.h"
static ntfschar logged_utility_stream_name[] = {
const_cpu_to_le16('$'),
const_cpu_to_le16('E'),
const_cpu_to_le16('F'),
const_cpu_to_le16('S'),
const_cpu_to_le16(0)
} ;
/*
* Get the ntfs EFS info into an extended attribute
*/
int ntfs_get_efs_info(ntfs_inode *ni, char *value, size_t size)
{
EFS_ATTR_HEADER *efs_info;
s64 attr_size = 0;
if (ni) {
if (ni->flags & FILE_ATTR_ENCRYPTED) {
efs_info = (EFS_ATTR_HEADER*)ntfs_attr_readall(ni,
AT_LOGGED_UTILITY_STREAM,(ntfschar*)NULL, 0,
&attr_size);
if (efs_info
&& (le32_to_cpu(efs_info->length) == attr_size)) {
if (attr_size <= (s64)size) {
if (value)
memcpy(value,efs_info,attr_size);
else {
errno = EFAULT;
attr_size = 0;
}
} else
if (size) {
errno = ERANGE;
attr_size = 0;
}
free (efs_info);
} else {
if (efs_info) {
free(efs_info);
ntfs_log_error("Bad efs_info for inode %lld\n",
(long long)ni->mft_no);
} else {
ntfs_log_error("Could not get efsinfo"
" for inode %lld\n",
(long long)ni->mft_no);
}
errno = EIO;
attr_size = 0;
}
} else {
errno = ENODATA;
ntfs_log_trace("Inode %lld is not encrypted\n",
(long long)ni->mft_no);
}
}
return (attr_size ? (int)attr_size : -errno);
}
/*
* Fix all encrypted AT_DATA attributes of an inode
*
* The fix may require making an attribute non resident, which
* requires more space in the MFT record, and may cause some
* attribute to be expelled and the full record to be reorganized.
* When this happens, the search for data attributes has to be
* reinitialized.
*
* Returns zero if successful.
* -1 if there is a problem.
*/
static int fixup_loop(ntfs_inode *ni)
{
ntfs_attr_search_ctx *ctx;
ntfs_attr *na;
ATTR_RECORD *a;
BOOL restart;
int cnt;
int maxcnt;
int res = 0;
maxcnt = 0;
do {
restart = FALSE;
ctx = ntfs_attr_get_search_ctx(ni, NULL);
if (!ctx) {
ntfs_log_error("Failed to get ctx for efs\n");
res = -1;
}
cnt = 0;
while (!restart && !res
&& !ntfs_attr_lookup(AT_DATA, NULL, 0,
CASE_SENSITIVE, 0, NULL, 0, ctx)) {
cnt++;
a = ctx->attr;
na = ntfs_attr_open(ctx->ntfs_ino, AT_DATA,
(ntfschar*)((u8*)a + le16_to_cpu(a->name_offset)),
a->name_length);
if (!na) {
ntfs_log_error("can't open DATA Attribute\n");
res = -1;
}
if (na && !(ctx->attr->flags & ATTR_IS_ENCRYPTED)) {
if (!NAttrNonResident(na)
&& ntfs_attr_make_non_resident(na, ctx)) {
/*
* ntfs_attr_make_non_resident fails if there
* is not enough space in the MFT record.
* When this happens, force making non-resident
* so that some other attribute is expelled.
*/
if (ntfs_attr_force_non_resident(na)) {
res = -1;
} else {
/* make sure there is some progress */
if (cnt <= maxcnt) {
errno = EIO;
ntfs_log_error("Multiple failure"
" making non resident\n");
res = -1;
} else {
ntfs_attr_put_search_ctx(ctx);
ctx = (ntfs_attr_search_ctx*)NULL;
restart = TRUE;
maxcnt = cnt;
}
}
}
if (!restart && !res
&& ntfs_efs_fixup_attribute(ctx, na)) {
ntfs_log_error("Error in efs fixup of AT_DATA Attribute\n");
res = -1;
}
}
if (na)
ntfs_attr_close(na);
}
} while (restart && !res);
if (ctx)
ntfs_attr_put_search_ctx(ctx);
return (res);
}
/*
* Set the efs data from an extended attribute
* Warning : the new data is not checked
* Returns 0, or -1 if there is a problem
*/
int ntfs_set_efs_info(ntfs_inode *ni, const char *value, size_t size,
int flags)
{
int res;
int written;
ntfs_attr *na;
const EFS_ATTR_HEADER *info_header;
res = 0;
if (ni && value && size) {
if (ni->flags & (FILE_ATTR_ENCRYPTED | FILE_ATTR_COMPRESSED)) {
if (ni->flags & FILE_ATTR_ENCRYPTED) {
ntfs_log_trace("Inode %lld already encrypted\n",
(long long)ni->mft_no);
errno = EEXIST;
} else {
/*
* Possible problem : if encrypted file was
* restored in a compressed directory, it was
* restored as compressed.
* TODO : decompress first.
*/
ntfs_log_error("Inode %lld cannot be encrypted and compressed\n",
(long long)ni->mft_no);
errno = EIO;
}
return -1;
}
info_header = (const EFS_ATTR_HEADER*)value;
/* make sure we get a likely efsinfo */
if (le32_to_cpu(info_header->length) != size) {
errno = EINVAL;
return (-1);
}
if (!ntfs_attr_exist(ni,AT_LOGGED_UTILITY_STREAM,
(ntfschar*)NULL,0)) {
if (!(flags & XATTR_REPLACE)) {
/*
* no logged_utility_stream attribute : add one,
* apparently, this does not feed the new value in
*/
res = ntfs_attr_add(ni,AT_LOGGED_UTILITY_STREAM,
logged_utility_stream_name,4,
(u8*)NULL,(s64)size);
} else {
errno = ENODATA;
res = -1;
}
} else {
errno = EEXIST;
res = -1;
}
if (!res) {
/*
* open and update the existing efs data
*/
na = ntfs_attr_open(ni, AT_LOGGED_UTILITY_STREAM,
logged_utility_stream_name, 4);
if (na) {
/* resize attribute */
res = ntfs_attr_truncate(na, (s64)size);
/* overwrite value if any */
if (!res && value) {
written = (int)ntfs_attr_pwrite(na,
(s64)0, (s64)size, value);
if (written != (s64)size) {
ntfs_log_error("Failed to "
"update efs data\n");
errno = EIO;
res = -1;
}
}
ntfs_attr_close(na);
} else
res = -1;
}
if (!res) {
/* Don't handle AT_DATA Attribute(s) if inode is a directory */
if (!(ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)) {
/* iterate over AT_DATA attributes */
/* set encrypted flag, truncate attribute to match padding bytes */
if (fixup_loop(ni))
return -1;
}
ni->flags |= FILE_ATTR_ENCRYPTED;
NInoSetDirty(ni);
NInoFileNameSetDirty(ni);
}
} else {
errno = EINVAL;
res = -1;
}
return (res ? -1 : 0);
}
/*
* Fixup raw encrypted AT_DATA Attribute
* read padding length from last two bytes
* truncate attribute, make non-resident,
* set data size to match padding length
* set ATTR_IS_ENCRYPTED flag on attribute
*
* Return 0 if successful
* -1 if failed (errno tells why)
*/
int ntfs_efs_fixup_attribute(ntfs_attr_search_ctx *ctx, ntfs_attr *na)
{
s64 newsize;
s64 oldsize;
le16 appended_bytes;
u16 padding_length;
ntfs_inode *ni;
BOOL close_ctx = FALSE;
if (!na) {
ntfs_log_error("no na specified for efs_fixup_attribute\n");
goto err_out;
}
if (!ctx) {
ctx = ntfs_attr_get_search_ctx(na->ni, NULL);
if (!ctx) {
ntfs_log_error("Failed to get ctx for efs\n");
goto err_out;
}
close_ctx = TRUE;
if (ntfs_attr_lookup(AT_DATA, na->name, na->name_len,
CASE_SENSITIVE, 0, NULL, 0, ctx)) {
ntfs_log_error("attr lookup for AT_DATA attribute failed in efs fixup\n");
goto err_out;
}
} else {
if (!NAttrNonResident(na)) {
ntfs_log_error("Cannot make non resident"
" when a context has been allocated\n");
goto err_out;
}
}
/* no extra bytes are added to void attributes */
oldsize = na->data_size;
if (oldsize) {
/* make sure size is valid for a raw encrypted stream */
if ((oldsize & 511) != 2) {
ntfs_log_error("Bad raw encrypted stream\n");
goto err_out;
}
/* read padding length from last two bytes of attribute */
if (ntfs_attr_pread(na, oldsize - 2, 2, &appended_bytes) != 2) {
ntfs_log_error("Error reading padding length\n");
goto err_out;
}
padding_length = le16_to_cpu(appended_bytes);
if (padding_length > 511 || padding_length > na->data_size-2) {
errno = EINVAL;
ntfs_log_error("invalid padding length %d for data_size %lld\n",
padding_length, (long long)oldsize);
goto err_out;
}
newsize = oldsize - padding_length - 2;
/*
* truncate attribute to possibly free clusters allocated
* for the last two bytes, but do not truncate to new size
* to avoid losing useful data
*/
if (ntfs_attr_truncate(na, oldsize - 2)) {
ntfs_log_error("Error truncating attribute\n");
goto err_out;
}
} else
newsize = 0;
/*
* Encrypted AT_DATA Attributes MUST be non-resident
* This has to be done after the attribute is resized, as
* resizing down to zero may cause the attribute to be made
* resident.
*/
if (!NAttrNonResident(na)
&& ntfs_attr_make_non_resident(na, ctx)) {
if (!close_ctx
|| ntfs_attr_force_non_resident(na)) {
ntfs_log_error("Error making DATA attribute non-resident\n");
goto err_out;
} else {
/*
* must reinitialize context after forcing
* non-resident. We need a context for updating
* the state, and at this point, we are sure
* the context is not used elsewhere.
*/
ntfs_attr_reinit_search_ctx(ctx);
if (ntfs_attr_lookup(AT_DATA, na->name, na->name_len,
CASE_SENSITIVE, 0, NULL, 0, ctx)) {
ntfs_log_error("attr lookup for AT_DATA attribute failed in efs fixup\n");
goto err_out;
}
}
}
ni = na->ni;
if (!na->name_len) {
ni->data_size = newsize;
ni->allocated_size = na->allocated_size;
}
NInoSetDirty(ni);
NInoFileNameSetDirty(ni);
ctx->attr->data_size = cpu_to_sle64(newsize);
if (sle64_to_cpu(ctx->attr->initialized_size) > newsize)
ctx->attr->initialized_size = ctx->attr->data_size;
ctx->attr->flags |= ATTR_IS_ENCRYPTED;
if (close_ctx)
ntfs_attr_put_search_ctx(ctx);
return (0);
err_out:
if (close_ctx && ctx)
ntfs_attr_put_search_ctx(ctx);
return (-1);
}

View File

@ -5,6 +5,7 @@
* Copyright (c) 2004-2005 Richard Russon
* Copyright (c) 2005-2006 Yura Pakhuchiy
* Copyright (c) 2005-2008 Szabolcs Szakacsits
* Copyright (c) 2007-2021 Jean-Pierre Andre
*
* 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
@ -37,13 +38,14 @@
#endif
#include "attrib.h"
#include "collate.h"
#include "debug.h"
#include "index.h"
#include "collate.h"
#include "mst.h"
#include "dir.h"
#include "logging.h"
#include "bitmap.h"
#include "reparse.h"
#include "misc.h"
/**
@ -64,8 +66,9 @@ void ntfs_index_entry_mark_dirty(ntfs_index_context *ictx)
{
if (ictx->is_in_root)
ntfs_inode_mark_dirty(ictx->actx->ntfs_ino);
else
else if (ictx->ib != NULL) {
ictx->ib_dirty = TRUE;
}
}
static s64 ntfs_ib_vcn_to_pos(ntfs_index_context *icx, VCN vcn)
@ -141,7 +144,7 @@ static void ntfs_index_ctx_free(ntfs_index_context *icx)
{
ntfs_log_trace("Entering\n");
if (!icx->entry)
if (!icx->bad_index && !icx->entry)
return;
if (icx->actx)
@ -189,9 +192,9 @@ void ntfs_index_ctx_reinit(ntfs_index_context *icx)
};
}
static VCN *ntfs_ie_get_vcn_addr(INDEX_ENTRY *ie)
static leVCN *ntfs_ie_get_vcn_addr(INDEX_ENTRY *ie)
{
return (VCN *)((u8 *)ie + le16_to_cpu(ie->length) - sizeof(VCN));
return (leVCN *)((u8 *)ie + le16_to_cpu(ie->length) - sizeof(leVCN));
}
/**
@ -336,7 +339,7 @@ static void ntfs_ie_delete(INDEX_HEADER *ih, INDEX_ENTRY *ie)
static void ntfs_ie_set_vcn(INDEX_ENTRY *ie, VCN vcn)
{
*ntfs_ie_get_vcn_addr(ie) = cpu_to_le64(vcn);
*ntfs_ie_get_vcn_addr(ie) = cpu_to_sle64(vcn);
}
/**
@ -386,42 +389,6 @@ static INDEX_ENTRY *ntfs_ie_dup_novcn(INDEX_ENTRY *ie)
return dup;
}
static int ntfs_ia_check(ntfs_index_context *icx, INDEX_BLOCK *ib, VCN vcn)
{
u32 ib_size = (unsigned)le32_to_cpu(ib->index.allocated_size) + 0x18;
ntfs_log_trace("Entering\n");
if (!ntfs_is_indx_record(ib->magic)) {
ntfs_log_error("Corrupt index block signature: vcn %lld inode "
"%llu\n", (long long)vcn,
(unsigned long long)icx->ni->mft_no);
return -1;
}
if (sle64_to_cpu(ib->index_block_vcn) != vcn) {
ntfs_log_error("Corrupt index block: VCN (%lld) is different "
"from expected VCN (%lld) in inode %llu\n",
(long long)sle64_to_cpu(ib->index_block_vcn),
(long long)vcn,
(unsigned long long)icx->ni->mft_no);
return -1;
}
if (ib_size != icx->block_size) {
ntfs_log_error("Corrupt index block : VCN (%lld) of inode %llu "
"has a size (%u) differing from the index "
"specified size (%u)\n", (long long)vcn,
(unsigned long long)icx->ni->mft_no, ib_size,
icx->block_size);
return -1;
}
return 0;
}
static INDEX_ROOT *ntfs_ir_lookup(ntfs_inode *ni, ntfschar *name,
u32 name_len, ntfs_attr_search_ctx **ctx)
{
@ -467,6 +434,133 @@ static INDEX_ROOT *ntfs_ir_lookup2(ntfs_inode *ni, ntfschar *name, u32 len)
return ir;
}
/*
* Check the consistency of an index block
*
* Make sure the index block does not overflow from the index record.
* The size of block is assumed to have been checked to be what is
* defined in the index root.
*
* Returns 0 if no error was found
* -1 otherwise (with errno unchanged)
*
* |<--->| offsetof(INDEX_BLOCK, index)
* | |<--->| sizeof(INDEX_HEADER)
* | | |
* | | | seq index entries unused
* |=====|=====|=====|===========================|==============|
* | | | | |
* | |<--------->| entries_offset | |
* | |<---------------- index_length ------->| |
* | |<--------------------- allocated_size --------------->|
* |<--------------------------- block_size ------------------->|
*
* size(INDEX_HEADER) <= ent_offset < ind_length <= alloc_size < bk_size
*/
int ntfs_index_block_inconsistent(const INDEX_BLOCK *ib, u32 block_size,
u64 inum, VCN vcn)
{
u32 ib_size = (unsigned)le32_to_cpu(ib->index.allocated_size)
+ offsetof(INDEX_BLOCK, index);
if (!ntfs_is_indx_record(ib->magic)) {
ntfs_log_error("Corrupt index block signature: vcn %lld inode "
"%llu\n", (long long)vcn,
(unsigned long long)inum);
return -1;
}
if (sle64_to_cpu(ib->index_block_vcn) != vcn) {
ntfs_log_error("Corrupt index block: VCN (%lld) is different "
"from expected VCN (%lld) in inode %llu\n",
(long long)sle64_to_cpu(ib->index_block_vcn),
(long long)vcn,
(unsigned long long)inum);
return -1;
}
if (ib_size != block_size) {
ntfs_log_error("Corrupt index block : VCN (%lld) of inode %llu "
"has a size (%u) differing from the index "
"specified size (%u)\n", (long long)vcn,
(unsigned long long)inum, ib_size,
(unsigned int)block_size);
return -1;
}
if (le32_to_cpu(ib->index.entries_offset) < sizeof(INDEX_HEADER)) {
ntfs_log_error("Invalid index entry offset in inode %lld\n",
(unsigned long long)inum);
return -1;
}
if (le32_to_cpu(ib->index.index_length)
<= le32_to_cpu(ib->index.entries_offset)) {
ntfs_log_error("No space for index entries in inode %lld\n",
(unsigned long long)inum);
return -1;
}
if (le32_to_cpu(ib->index.allocated_size)
< le32_to_cpu(ib->index.index_length)) {
ntfs_log_error("Index entries overflow in inode %lld\n",
(unsigned long long)inum);
return -1;
}
return (0);
}
/*
* Check the consistency of an index entry
*
* Make sure data and key do not overflow from entry.
* As a side effect, an entry with zero length is rejected.
* This entry must be a full one (no INDEX_ENTRY_END flag), and its
* length must have been checked beforehand to not overflow from the
* index record.
*
* Returns 0 if no error was found
* -1 otherwise (with errno unchanged)
*/
int ntfs_index_entry_inconsistent(const INDEX_ENTRY *ie,
COLLATION_RULES collation_rule, u64 inum)
{
int ret;
ret = 0;
if (ie->key_length
&& ((le16_to_cpu(ie->key_length) + offsetof(INDEX_ENTRY, key))
> le16_to_cpu(ie->length))) {
ntfs_log_error("Overflow from index entry in inode %lld\n",
(long long)inum);
ret = -1;
} else
if (collation_rule == COLLATION_FILE_NAME) {
if ((offsetof(INDEX_ENTRY, key.file_name.file_name)
+ ie->key.file_name.file_name_length
* sizeof(ntfschar))
> le16_to_cpu(ie->length)) {
ntfs_log_error("File name overflow from index"
" entry in inode %lld\n",
(long long)inum);
ret = -1;
}
} else {
if (ie->data_length
&& ((le16_to_cpu(ie->data_offset)
+ le16_to_cpu(ie->data_length))
> le16_to_cpu(ie->length))) {
ntfs_log_error("Data overflow from index"
" entry in inode %lld\n",
(long long)inum);
ret = -1;
}
}
return (ret);
}
/**
* Find a key in the index block.
*
@ -515,8 +609,19 @@ static int ntfs_ie_lookup(const void *key, const int key_len,
* Not a perfect match, need to do full blown collation so we
* know which way in the B+tree we have to go.
*/
rc = ntfs_collate(icx->ni->vol, icx->cr, key, key_len, &ie->key,
le16_to_cpu(ie->key_length));
if (!icx->collate) {
ntfs_log_error("Collation function not defined\n");
errno = EOPNOTSUPP;
return STATUS_ERROR;
}
/* Make sure key and data do not overflow from entry */
if (ntfs_index_entry_inconsistent(ie, icx->ir->collation_rule,
icx->ni->mft_no)) {
errno = EIO;
return STATUS_ERROR;
}
rc = icx->collate(icx->ni->vol, key, key_len,
&ie->key, le16_to_cpu(ie->key_length));
if (rc == NTFS_COLLATION_ERROR) {
ntfs_log_error("Collation error. Perhaps a filename "
"contains invalid characters?\n");
@ -599,8 +704,11 @@ static int ntfs_ib_read(ntfs_index_context *icx, VCN vcn, INDEX_BLOCK *dst)
return -1;
}
if (ntfs_ia_check(icx, dst, vcn))
if (ntfs_index_block_inconsistent((INDEX_BLOCK*)dst, icx->block_size,
icx->ia_na->ni->mft_no, vcn)) {
errno = EIO;
return -1;
}
return 0;
}
@ -694,25 +802,22 @@ int ntfs_index_lookup(const void *key, const int key_len, ntfs_index_context *ic
if (ni->vol->cluster_size <= icx->block_size)
icx->vcn_size_bits = ni->vol->cluster_size_bits;
else
icx->vcn_size_bits = ni->vol->sector_size_bits;
icx->cr = ir->collation_rule;
if (!ntfs_is_collation_rule_supported(icx->cr)) {
icx->vcn_size_bits = NTFS_BLOCK_SIZE_BITS;
/* get the appropriate collation function */
icx->ir = ir;
icx->collate = ntfs_get_collate_function(ir->collation_rule);
if (!icx->collate) {
err = errno = EOPNOTSUPP;
ntfs_log_perror("Unknown collation rule 0x%x",
(unsigned)le32_to_cpu(icx->cr));
(unsigned)le32_to_cpu(ir->collation_rule));
goto err_out;
}
old_vcn = VCN_INDEX_ROOT_PARENT;
/*
* FIXME: check for both ir and ib that the first index entry is
* within the index block.
*/
ret = ntfs_ie_lookup(key, key_len, icx, &ir->index, &vcn, &ie);
if (ret == STATUS_ERROR) {
err = errno;
goto err_out;
goto err_lookup;
}
icx->ir = ir;
@ -773,6 +878,12 @@ descend_into_child_node:
goto descend_into_child_node;
err_out:
icx->bad_index = TRUE; /* Force icx->* to be freed */
err_lookup:
if (icx->actx) {
ntfs_attr_put_search_ctx(icx->actx);
icx->actx = NULL;
}
free(ib);
if (!err)
err = EIO;
@ -804,17 +915,17 @@ static INDEX_BLOCK *ntfs_ib_alloc(VCN ib_vcn, u32 ib_size,
return NULL;
ib->magic = magic_INDX;
ib->usa_ofs = cpu_to_le16(sizeof(INDEX_BLOCK));
ib->usa_ofs = const_cpu_to_le16(sizeof(INDEX_BLOCK));
ib->usa_count = cpu_to_le16(ib_size / NTFS_BLOCK_SIZE + 1);
/* Set USN to 1 */
*(u16 *)((char *)ib + le16_to_cpu(ib->usa_ofs)) = cpu_to_le16(1);
ib->lsn = cpu_to_le64(0);
*(le16 *)((char *)ib + le16_to_cpu(ib->usa_ofs)) = const_cpu_to_le16(1);
ib->lsn = const_cpu_to_sle64(0);
ib->index_block_vcn = cpu_to_sle64(ib_vcn);
ib->index.entries_offset = cpu_to_le32((ih_size +
le16_to_cpu(ib->usa_count) * 2 + 7) & ~7);
ib->index.index_length = 0;
ib->index.index_length = const_cpu_to_le32(0);
ib->index.allocated_size = cpu_to_le32(ib_size -
(sizeof(INDEX_BLOCK) - ih_size));
ib->index.ih_flags = node_type;
@ -1114,6 +1225,7 @@ static int ntfs_ir_reparent(ntfs_index_context *icx)
INDEX_ENTRY *ie;
INDEX_BLOCK *ib = NULL;
VCN new_ib_vcn;
int ix_root_size;
int ret = STATUS_ERROR;
ntfs_log_trace("Entering\n");
@ -1143,6 +1255,7 @@ static int ntfs_ir_reparent(ntfs_index_context *icx)
if (ntfs_ib_write(icx, ib))
goto clear_bmp;
retry :
ir = ntfs_ir_lookup(icx->ni, icx->name, icx->name_len, &ctx);
if (!ir)
goto clear_bmp;
@ -1151,18 +1264,37 @@ static int ntfs_ir_reparent(ntfs_index_context *icx)
ie = ntfs_ie_get_first(&ir->index);
ie->ie_flags |= INDEX_ENTRY_NODE;
ie->length = cpu_to_le16(sizeof(INDEX_ENTRY_HEADER) + sizeof(VCN));
ie->length = const_cpu_to_le16(sizeof(INDEX_ENTRY_HEADER) + sizeof(VCN));
ir->index.ih_flags = LARGE_INDEX;
ir->index.index_length = cpu_to_le32(le32_to_cpu(ir->index.entries_offset)
+ le16_to_cpu(ie->length));
ir->index.allocated_size = ir->index.index_length;
ix_root_size = sizeof(INDEX_ROOT) - sizeof(INDEX_HEADER)
+ le32_to_cpu(ir->index.allocated_size);
if (ntfs_resident_attr_value_resize(ctx->mrec, ctx->attr,
sizeof(INDEX_ROOT) - sizeof(INDEX_HEADER) +
le32_to_cpu(ir->index.allocated_size)))
ix_root_size)) {
/*
* When there is no space to build a non-resident
* index, we may have to move the root to an extent
*/
if ((errno == ENOSPC)
&& (ctx->al_entry || !ntfs_inode_add_attrlist(icx->ni))) {
ntfs_attr_put_search_ctx(ctx);
ctx = (ntfs_attr_search_ctx*)NULL;
ir = ntfs_ir_lookup(icx->ni, icx->name, icx->name_len,
&ctx);
if (ir
&& !ntfs_attr_record_move_away(ctx, ix_root_size
- le32_to_cpu(ctx->attr->value_length))) {
ntfs_attr_put_search_ctx(ctx);
ctx = (ntfs_attr_search_ctx*)NULL;
goto retry;
}
}
/* FIXME: revert index root */
goto clear_bmp;
}
/*
* FIXME: do it earlier if we have enough space in IR (should always),
* so in error case we wouldn't lose the IB.
@ -1418,18 +1550,20 @@ static int ntfs_ib_split(ntfs_index_context *icx, INDEX_BLOCK *ib)
return ret;
}
static int ntfs_ie_add(ntfs_index_context *icx, INDEX_ENTRY *ie)
/* JPA static */
int ntfs_ie_add(ntfs_index_context *icx, INDEX_ENTRY *ie)
{
INDEX_HEADER *ih;
int allocated_size, new_size;
int ret = STATUS_ERROR;
#ifdef DEBUG
/* removed by JPA to make function usable for security indexes
char *fn;
fn = ntfs_ie_filename_get(ie);
ntfs_log_trace("file: '%s'\n", fn);
ntfs_attr_name_free(&fn);
*/
#endif
while (1) {
@ -1531,19 +1665,32 @@ static int ntfs_ih_takeout(ntfs_index_context *icx, INDEX_HEADER *ih,
INDEX_ENTRY *ie, INDEX_BLOCK *ib)
{
INDEX_ENTRY *ie_roam;
int freed_space;
BOOL full;
int ret = STATUS_ERROR;
ntfs_log_trace("Entering\n");
full = ih->index_length == ih->allocated_size;
ie_roam = ntfs_ie_dup_novcn(ie);
if (!ie_roam)
return STATUS_ERROR;
ntfs_ie_delete(ih, ie);
if (ntfs_icx_parent_vcn(icx) == VCN_INDEX_ROOT_PARENT)
if (ntfs_icx_parent_vcn(icx) == VCN_INDEX_ROOT_PARENT) {
/*
* Recover the space which may have been freed
* while deleting an entry from root index
*/
freed_space = le32_to_cpu(ih->allocated_size)
- le32_to_cpu(ih->index_length);
if (full && (freed_space > 0) && !(freed_space & 7)) {
ntfs_ir_truncate(icx, le32_to_cpu(ih->index_length));
/* do nothing if truncation fails */
}
ntfs_inode_mark_dirty(icx->actx->ntfs_ino);
else
} else
if (ntfs_ib_write(icx, ib))
goto out;
@ -1767,7 +1914,8 @@ out:
*
* Return 0 on success or -1 on error with errno set to the error code.
*/
static int ntfs_index_rm(ntfs_index_context *icx)
/*static JPA*/
int ntfs_index_rm(ntfs_index_context *icx)
{
INDEX_HEADER *ih;
int err, ret = STATUS_OK;
@ -1810,12 +1958,14 @@ err_out:
goto out;
}
int ntfs_index_remove(ntfs_inode *ni, const void *key, const int keylen)
int ntfs_index_remove(ntfs_inode *dir_ni,
ntfs_inode *ni __attribute__((unused)),
const void *key, const int keylen)
{
int ret = STATUS_ERROR;
ntfs_index_context *icx;
icx = ntfs_index_ctx_get(ni, NTFS_INDEX_I30, 4);
icx = ntfs_index_ctx_get(dir_ni, NTFS_INDEX_I30, 4);
if (!icx)
return -1;
@ -1824,12 +1974,6 @@ int ntfs_index_remove(ntfs_inode *ni, const void *key, const int keylen)
if (ntfs_index_lookup(key, keylen, icx))
goto err_out;
if (((FILE_NAME_ATTR *)icx->data)->file_attributes &
FILE_ATTR_REPARSE_POINT) {
errno = EOPNOTSUPP;
goto err_out;
}
ret = ntfs_index_rm(icx);
if (ret == STATUS_ERROR)
goto err_out;
@ -1885,3 +2029,167 @@ out:
}
/*
* Walk down the index tree (leaf bound)
* until there are no subnode in the first index entry
* returns the entry at the bottom left in subnode
*/
static INDEX_ENTRY *ntfs_index_walk_down(INDEX_ENTRY *ie,
ntfs_index_context *ictx)
{
INDEX_ENTRY *entry;
s64 vcn;
entry = ie;
do {
vcn = ntfs_ie_get_vcn(entry);
if (ictx->is_in_root) {
/* down from level zero */
ictx->ir = (INDEX_ROOT*)NULL;
ictx->ib = (INDEX_BLOCK*)ntfs_malloc(ictx->block_size);
ictx->pindex = 1;
ictx->is_in_root = FALSE;
} else {
/* down from non-zero level */
ictx->pindex++;
}
ictx->parent_pos[ictx->pindex] = 0;
ictx->parent_vcn[ictx->pindex] = vcn;
if (!ntfs_ib_read(ictx,vcn,ictx->ib)) {
ictx->entry = ntfs_ie_get_first(&ictx->ib->index);
entry = ictx->entry;
} else
entry = (INDEX_ENTRY*)NULL;
} while (entry && (entry->ie_flags & INDEX_ENTRY_NODE));
return (entry);
}
/*
* Walk up the index tree (root bound)
* until there is a valid data entry in parent
* returns the parent entry or NULL if no more parent
*/
static INDEX_ENTRY *ntfs_index_walk_up(INDEX_ENTRY *ie,
ntfs_index_context *ictx)
{
INDEX_ENTRY *entry;
s64 vcn;
entry = ie;
if (ictx->pindex > 0) {
do {
ictx->pindex--;
if (!ictx->pindex) {
/* we have reached the root */
free(ictx->ib);
ictx->ib = (INDEX_BLOCK*)NULL;
ictx->is_in_root = TRUE;
/* a new search context is to be allocated */
if (ictx->actx)
free(ictx->actx);
ictx->ir = ntfs_ir_lookup(ictx->ni,
ictx->name, ictx->name_len,
&ictx->actx);
if (ictx->ir)
entry = ntfs_ie_get_by_pos(
&ictx->ir->index,
ictx->parent_pos[ictx->pindex]);
else
entry = (INDEX_ENTRY*)NULL;
} else {
/* up into non-root node */
vcn = ictx->parent_vcn[ictx->pindex];
if (!ntfs_ib_read(ictx,vcn,ictx->ib)) {
entry = ntfs_ie_get_by_pos(
&ictx->ib->index,
ictx->parent_pos[ictx->pindex]);
} else
entry = (INDEX_ENTRY*)NULL;
}
ictx->entry = entry;
} while (entry && (ictx->pindex > 0)
&& (entry->ie_flags & INDEX_ENTRY_END));
} else
entry = (INDEX_ENTRY*)NULL;
return (entry);
}
/*
* Get next entry in an index according to collating sequence.
* Must be initialized through a ntfs_index_lookup()
*
* Returns next entry or NULL if none
*
* Sample layout :
*
* +---+---+---+---+---+---+---+---+ n ptrs to subnodes
* | | | 10| 25| 33| | | | n-1 keys in between
* +---+---+---+---+---+---+---+---+ no key in last entry
* | A | A
* | | | +-------------------------------+
* +--------------------------+ | +-----+ |
* | +--+ | |
* V | V |
* +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+
* | 11| 12| 13| 14| 15| 16| 17| | | | 26| 27| 28| 29| 30| 31| 32| |
* +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+
* | |
* +-----------------------+ |
* | |
* +---+---+---+---+---+---+---+---+
* | 18| 19| 20| 21| 22| 23| 24| |
* +---+---+---+---+---+---+---+---+
*/
INDEX_ENTRY *ntfs_index_next(INDEX_ENTRY *ie, ntfs_index_context *ictx)
{
INDEX_ENTRY *next;
le16 flags;
/*
* lookup() may have returned an invalid node
* when searching for a partial key
* if this happens, walk up
*/
if (ie->ie_flags & INDEX_ENTRY_END)
next = ntfs_index_walk_up(ie, ictx);
else {
/*
* get next entry in same node
* there is always one after any entry with data
*/
next = (INDEX_ENTRY*)((char*)ie + le16_to_cpu(ie->length));
++ictx->parent_pos[ictx->pindex];
flags = next->ie_flags;
/* walk down if it has a subnode */
if (flags & INDEX_ENTRY_NODE) {
next = ntfs_index_walk_down(next,ictx);
} else {
/* walk up it has no subnode, nor data */
if (flags & INDEX_ENTRY_END) {
next = ntfs_index_walk_up(next, ictx);
}
}
}
/* return NULL if stuck at end of a block */
if (next && (next->ie_flags & INDEX_ENTRY_END))
next = (INDEX_ENTRY*)NULL;
return (next);
}

View File

@ -5,6 +5,7 @@
* Copyright (c) 2002-2008 Szabolcs Szakacsits
* Copyright (c) 2004-2007 Yura Pakhuchiy
* Copyright (c) 2004-2005 Richard Russon
* Copyright (c) 2009-2010 Jean-Pierre Andre
*
* 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
@ -36,10 +37,13 @@
#include <errno.h>
#endif
#include "param.h"
#include "compat.h"
#include "types.h"
#include "attrib.h"
#include "volume.h"
#include "cache.h"
#include "inode.h"
#include "attrib.h"
#include "debug.h"
#include "mft.h"
#include "attrlist.h"
@ -50,6 +54,7 @@
#include "ntfstime.h"
#include "logging.h"
#include "misc.h"
#include "xattrs.h"
ntfs_inode *ntfs_inode_base(ntfs_inode *ni)
{
@ -149,12 +154,14 @@ static void __ntfs_inode_release(ntfs_inode *ni)
* Return a pointer to the ntfs_inode structure on success or NULL on error,
* with errno set to the error code.
*/
ntfs_inode *ntfs_inode_open(ntfs_volume *vol, const MFT_REF mref)
static ntfs_inode *ntfs_inode_real_open(ntfs_volume *vol, const MFT_REF mref)
{
s64 l;
ntfs_inode *ni = NULL;
ntfs_attr_search_ctx *ctx;
STANDARD_INFORMATION *std_info;
le32 lthle;
int olderrno;
ntfs_log_enter("Entering for inode %lld\n", (long long)MREF(mref));
if (!vol) {
@ -182,28 +189,51 @@ ntfs_inode *ntfs_inode_open(ntfs_volume *vol, const MFT_REF mref)
" %lld", (long long)MREF(mref));
goto put_err_out;
}
lthle = ctx->attr->value_length;
if (le32_to_cpu(lthle) < offsetof(STANDARD_INFORMATION, owner_id)) {
ntfs_log_error("Corrupt STANDARD_INFORMATION in base"
" record %lld\n",
(long long)MREF(mref));
goto put_err_out;
}
std_info = (STANDARD_INFORMATION *)((u8 *)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
ni->flags = std_info->file_attributes;
ni->creation_time = ntfs2utc(std_info->creation_time);
ni->last_data_change_time = ntfs2utc(std_info->last_data_change_time);
ni->last_mft_change_time = ntfs2utc(std_info->last_mft_change_time);
ni->last_access_time = ntfs2utc(std_info->last_access_time);
ni->creation_time = std_info->creation_time;
ni->last_data_change_time = std_info->last_data_change_time;
ni->last_mft_change_time = std_info->last_mft_change_time;
ni->last_access_time = std_info->last_access_time;
/* Insert v3 extensions if present */
/* length may be seen as 48 (v1.x) or 72 (v3.x) */
if (le32_to_cpu(lthle) >= offsetof(STANDARD_INFORMATION, v3_end)) {
set_nino_flag(ni, v3_Extensions);
ni->owner_id = std_info->owner_id;
ni->security_id = std_info->security_id;
ni->quota_charged = std_info->quota_charged;
ni->usn = std_info->usn;
} else {
clear_nino_flag(ni, v3_Extensions);
ni->owner_id = const_cpu_to_le32(0);
ni->security_id = const_cpu_to_le32(0);
}
/* Set attribute list information. */
if (ntfs_attr_lookup(AT_ATTRIBUTE_LIST, AT_UNNAMED, 0, 0, 0, NULL, 0,
ctx)) {
olderrno = errno;
if (ntfs_attr_lookup(AT_ATTRIBUTE_LIST, AT_UNNAMED, 0,
CASE_SENSITIVE, 0, NULL, 0, ctx)) {
if (errno != ENOENT)
goto put_err_out;
/* Attribute list attribute does not present. */
/* restore previous errno to avoid misinterpretation */
errno = olderrno;
goto get_size;
}
NInoSetAttrList(ni);
l = ntfs_get_attribute_value_length(ctx->attr);
if (!l)
goto put_err_out;
if (l > 0x40000) {
if ((u64)l > 0x40000) {
errno = EIO;
ntfs_log_perror("Too large attrlist attribute (%lld), inode "
ntfs_log_perror("Too large attrlist attribute (%llu), inode "
"%lld", (long long)l, (long long)MREF(mref));
goto put_err_out;
}
@ -222,10 +252,13 @@ ntfs_inode *ntfs_inode_open(ntfs_volume *vol, const MFT_REF mref)
goto put_err_out;
}
get_size:
olderrno = errno;
if (ntfs_attr_lookup(AT_DATA, AT_UNNAMED, 0, 0, 0, NULL, 0, ctx)) {
if (errno != ENOENT)
goto put_err_out;
/* Directory or special file. */
/* restore previous errno to avoid misinterpretation */
errno = olderrno;
ni->data_size = ni->allocated_size = 0;
} else {
if (ctx->attr->non_resident) {
@ -241,6 +274,7 @@ get_size:
ni->data_size = le32_to_cpu(ctx->attr->value_length);
ni->allocated_size = (ni->data_size + 7) & ~7;
}
set_nino_flag(ni,KnownSize);
}
ntfs_attr_put_search_ctx(ctx);
out:
@ -279,7 +313,8 @@ err_out:
* EINVAL @ni is invalid (probably it is an extent inode).
* EIO I/O error while trying to write inode to disk.
*/
int ntfs_inode_close(ntfs_inode *ni)
int ntfs_inode_real_close(ntfs_inode *ni)
{
int ret = -1;
@ -299,7 +334,7 @@ int ntfs_inode_close(ntfs_inode *ni)
/* Is this a base inode with mapped extent inodes? */
if (ni->nr_extents > 0) {
while (ni->nr_extents > 0) {
if (ntfs_inode_close(ni->extent_nis[0])) {
if (ntfs_inode_real_close(ni->extent_nis[0])) {
if (errno != EIO)
errno = EBUSY;
goto err;
@ -339,8 +374,10 @@ int ntfs_inode_close(ntfs_inode *ni)
/* Ignore errors, they don't really matter. */
if (tmp_nis)
base_ni->extent_nis = tmp_nis;
} else if (tmp_nis)
} else if (tmp_nis) {
free(tmp_nis);
base_ni->extent_nis = (ntfs_inode**)NULL;
}
/* Allow for error checking. */
i = -1;
break;
@ -362,6 +399,156 @@ err:
return ret;
}
#if CACHE_NIDATA_SIZE
/*
* Free an inode structure when there is not more space
* in the cache
*/
void ntfs_inode_nidata_free(const struct CACHED_GENERIC *cached)
{
ntfs_inode_real_close(((const struct CACHED_NIDATA*)cached)->ni);
}
/*
* Compute a hash value for an inode entry
*/
int ntfs_inode_nidata_hash(const struct CACHED_GENERIC *item)
{
return (((const struct CACHED_NIDATA*)item)->inum
% (2*CACHE_NIDATA_SIZE));
}
/*
* inum comparing for entering/fetching from cache
*/
static int idata_cache_compare(const struct CACHED_GENERIC *cached,
const struct CACHED_GENERIC *wanted)
{
return (((const struct CACHED_NIDATA*)cached)->inum
!= ((const struct CACHED_NIDATA*)wanted)->inum);
}
/*
* Invalidate an inode entry when not needed anymore.
* The entry should have been synced, it may be reused later,
* if it is requested before it is dropped from cache.
*/
void ntfs_inode_invalidate(ntfs_volume *vol, const MFT_REF mref)
{
struct CACHED_NIDATA item;
item.inum = MREF(mref);
item.ni = (ntfs_inode*)NULL;
item.pathname = (const char*)NULL;
item.varsize = 0;
ntfs_invalidate_cache(vol->nidata_cache,
GENERIC(&item),idata_cache_compare,CACHE_FREE);
}
#endif
/*
* Open an inode
*
* When possible, an entry recorded in the cache is reused
*
* **NEVER REOPEN** an inode, this can lead to a duplicated
* cache entry (hard to detect), and to an obsolete one being
* reused. System files are however protected from being cached.
*/
ntfs_inode *ntfs_inode_open(ntfs_volume *vol, const MFT_REF mref)
{
ntfs_inode *ni;
#if CACHE_NIDATA_SIZE
struct CACHED_NIDATA item;
struct CACHED_NIDATA *cached;
/* fetch idata from cache */
item.inum = MREF(mref);
debug_double_inode(item.inum,1);
item.pathname = (const char*)NULL;
item.varsize = 0;
cached = (struct CACHED_NIDATA*)ntfs_fetch_cache(vol->nidata_cache,
GENERIC(&item),idata_cache_compare);
if (cached) {
ni = cached->ni;
/* do not keep open entries in cache */
ntfs_remove_cache(vol->nidata_cache,
(struct CACHED_GENERIC*)cached,0);
} else {
ni = ntfs_inode_real_open(vol, mref);
}
if (!ni) {
debug_double_inode(item.inum, 0);
}
#else
ni = ntfs_inode_real_open(vol, mref);
#endif
return (ni);
}
/*
* Close an inode entry
*
* If cacheing is in use, the entry is synced and kept available
* in cache for further use.
*
* System files (inode < 16 or having the IS_4 flag) are protected
* against being cached.
*/
int ntfs_inode_close(ntfs_inode *ni)
{
int res;
#if CACHE_NIDATA_SIZE
BOOL dirty;
struct CACHED_NIDATA item;
if (ni) {
debug_double_inode(ni->mft_no,0);
/* do not cache system files : could lead to double entries */
if (ni->vol && ni->vol->nidata_cache
&& ((ni->mft_no == FILE_root)
|| ((ni->mft_no >= FILE_first_user)
&& !(ni->mrec->flags & MFT_RECORD_IS_4)))) {
/* If we have dirty metadata, write it out. */
dirty = NInoDirty(ni) || NInoAttrListDirty(ni);
if (dirty) {
res = ntfs_inode_sync(ni);
/* do a real close if sync failed */
if (res)
ntfs_inode_real_close(ni);
} else
res = 0;
if (!res) {
/* feed idata into cache */
item.inum = ni->mft_no;
item.ni = ni;
item.pathname = (const char*)NULL;
item.varsize = 0;
debug_cached_inode(ni);
ntfs_enter_cache(ni->vol->nidata_cache,
GENERIC(&item), idata_cache_compare);
}
} else {
/* cache not ready or system file, really close */
res = ntfs_inode_real_close(ni);
}
} else
res = 0;
#else
res = ntfs_inode_real_close(ni);
#endif
return (res);
}
/**
* ntfs_extent_inode_open - load an extent inode and attach it to its base
* @base_ni: base ntfs inode
@ -387,9 +574,12 @@ err:
* Note, extent inodes are never closed directly. They are automatically
* disposed off by the closing of the base inode.
*/
ntfs_inode *ntfs_extent_inode_open(ntfs_inode *base_ni, const MFT_REF mref)
ntfs_inode *ntfs_extent_inode_open(ntfs_inode *base_ni, const leMFT_REF mref)
{
u64 mft_no = MREF_LE(mref);
VCN extent_vcn;
runlist_element *rl;
ntfs_volume *vol;
ntfs_inode *ni = NULL;
ntfs_inode **extent_nis;
int i;
@ -404,6 +594,37 @@ ntfs_inode *ntfs_extent_inode_open(ntfs_inode *base_ni, const MFT_REF mref)
(unsigned long long)mft_no,
(unsigned long long)base_ni->mft_no);
if (!base_ni->mft_no) {
/*
* When getting extents of MFT, we must be sure
* they are in the MFT part which has already
* been mapped, otherwise we fall into an endless
* recursion.
* Situations have been met where extents locations
* are described in themselves.
* This is a severe error which chkdsk cannot fix.
*/
vol = base_ni->vol;
extent_vcn = mft_no << vol->mft_record_size_bits
>> vol->cluster_size_bits;
rl = vol->mft_na->rl;
if (rl) {
while (rl->length
&& ((rl->vcn + rl->length) <= extent_vcn))
rl++;
}
if (!rl || (rl->lcn < 0)) {
ntfs_log_error("MFT is corrupt, cannot read"
" its unmapped extent record %lld\n",
(long long)mft_no);
ntfs_log_error("Note : chkdsk cannot fix this,"
" try ntfsfix\n");
errno = EIO;
ni = (ntfs_inode*)NULL;
goto out;
}
}
/* Is the extent inode already open and attached to the base inode? */
if (base_ni->nr_extents > 0) {
extent_nis = base_ni->extent_nis;
@ -518,6 +739,8 @@ static int ntfs_inode_sync_standard_information(ntfs_inode *ni)
{
ntfs_attr_search_ctx *ctx;
STANDARD_INFORMATION *std_info;
u32 lth;
le32 lthle;
ntfs_log_trace("Entering for inode %lld\n", (long long)ni->mft_no);
@ -534,10 +757,27 @@ static int ntfs_inode_sync_standard_information(ntfs_inode *ni)
std_info = (STANDARD_INFORMATION *)((u8 *)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
std_info->file_attributes = ni->flags;
std_info->creation_time = utc2ntfs(ni->creation_time);
std_info->last_data_change_time = utc2ntfs(ni->last_data_change_time);
std_info->last_mft_change_time = utc2ntfs(ni->last_mft_change_time);
std_info->last_access_time = utc2ntfs(ni->last_access_time);
if (!test_nino_flag(ni, TimesSet)) {
std_info->creation_time = ni->creation_time;
std_info->last_data_change_time = ni->last_data_change_time;
std_info->last_mft_change_time = ni->last_mft_change_time;
std_info->last_access_time = ni->last_access_time;
}
/* JPA update v3.x extensions, ensuring consistency */
lthle = ctx->attr->value_length;
lth = le32_to_cpu(lthle);
if (test_nino_flag(ni, v3_Extensions)
&& (lth < offsetof(STANDARD_INFORMATION, v3_end)))
ntfs_log_error("bad sync of standard information\n");
if (lth >= offsetof(STANDARD_INFORMATION, v3_end)) {
std_info->owner_id = ni->owner_id;
std_info->security_id = ni->security_id;
std_info->quota_charged = ni->quota_charged;
std_info->usn = ni->usn;
}
ntfs_inode_mark_dirty(ctx->ntfs_ino);
ntfs_attr_put_search_ctx(ctx);
return 0;
@ -551,12 +791,15 @@ static int ntfs_inode_sync_standard_information(ntfs_inode *ni)
*
* Return 0 on success or -1 on error with errno set to the error code.
*/
static int ntfs_inode_sync_file_name(ntfs_inode *ni)
static int ntfs_inode_sync_file_name(ntfs_inode *ni, ntfs_inode *dir_ni)
{
ntfs_attr_search_ctx *ctx = NULL;
ntfs_index_context *ictx;
ntfs_inode *index_ni;
FILE_NAME_ATTR *fn;
FILE_NAME_ATTR *fnx;
REPARSE_POINT *rpp;
le32 reparse_tag;
int err = 0;
ntfs_log_trace("Entering for inode %lld\n", (long long)ni->mft_no);
@ -566,6 +809,17 @@ static int ntfs_inode_sync_file_name(ntfs_inode *ni)
err = errno;
goto err_out;
}
/* Collect the reparse tag, if any */
reparse_tag = const_cpu_to_le32(0);
if (ni->flags & FILE_ATTR_REPARSE_POINT) {
if (!ntfs_attr_lookup(AT_REPARSE_POINT, NULL,
0, CASE_SENSITIVE, 0, NULL, 0, ctx)) {
rpp = (REPARSE_POINT*)((u8 *)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
reparse_tag = rpp->reparse_tag;
}
ntfs_attr_reinit_search_ctx(ctx);
}
/* Walk through all FILE_NAME attributes and update them. */
while (!ntfs_attr_lookup(AT_FILE_NAME, NULL, 0, 0, 0, NULL, 0, ctx)) {
fn = (FILE_NAME_ATTR *)((u8 *)ctx->attr +
@ -580,13 +834,16 @@ static int ntfs_inode_sync_file_name(ntfs_inode *ni)
*/
index_ni = ni;
} else
index_ni = ntfs_inode_open(ni->vol,
if (dir_ni)
index_ni = dir_ni;
else
index_ni = ntfs_inode_open(ni->vol,
le64_to_cpu(fn->parent_directory));
if (!index_ni) {
if (!err)
err = errno;
ntfs_log_perror("Failed to open inode %lld with index",
(long long)le64_to_cpu(fn->parent_directory));
(long long)MREF_LE(fn->parent_directory));
continue;
}
ictx = ntfs_index_ctx_get(index_ni, NTFS_INDEX_I30, 4);
@ -595,7 +852,8 @@ static int ntfs_inode_sync_file_name(ntfs_inode *ni)
err = errno;
ntfs_log_perror("Failed to get index ctx, inode %lld",
(long long)index_ni->mft_no);
if (ni != index_ni && ntfs_inode_close(index_ni) && !err)
if ((ni != index_ni) && !dir_ni
&& ntfs_inode_close(index_ni) && !err)
err = errno;
continue;
}
@ -614,19 +872,40 @@ static int ntfs_inode_sync_file_name(ntfs_inode *ni)
continue;
}
/* Update flags and file size. */
fn = (FILE_NAME_ATTR *)ictx->data;
fn->file_attributes =
(fn->file_attributes & ~FILE_ATTR_VALID_FLAGS) |
fnx = (FILE_NAME_ATTR *)ictx->data;
fnx->file_attributes =
(fnx->file_attributes & ~FILE_ATTR_VALID_FLAGS) |
(ni->flags & FILE_ATTR_VALID_FLAGS);
fn->allocated_size = cpu_to_sle64(ni->allocated_size);
fn->data_size = cpu_to_sle64(ni->data_size);
fn->creation_time = utc2ntfs(ni->creation_time);
fn->last_data_change_time = utc2ntfs(ni->last_data_change_time);
fn->last_mft_change_time = utc2ntfs(ni->last_mft_change_time);
fn->last_access_time = utc2ntfs(ni->last_access_time);
if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)
fnx->data_size = fnx->allocated_size
= const_cpu_to_sle64(0);
else {
fnx->allocated_size = cpu_to_sle64(ni->allocated_size);
fnx->data_size = cpu_to_sle64(ni->data_size);
/*
* The file name record has also to be fixed if some
* attribute update implied the unnamed data to be
* made non-resident
*/
fn->allocated_size = fnx->allocated_size;
}
/* update or clear the reparse tag in the index */
fnx->reparse_point_tag = reparse_tag;
if (!test_nino_flag(ni, TimesSet)) {
fnx->creation_time = ni->creation_time;
fnx->last_data_change_time = ni->last_data_change_time;
fnx->last_mft_change_time = ni->last_mft_change_time;
fnx->last_access_time = ni->last_access_time;
} else {
fnx->creation_time = fn->creation_time;
fnx->last_data_change_time = fn->last_data_change_time;
fnx->last_mft_change_time = fn->last_mft_change_time;
fnx->last_access_time = fn->last_access_time;
}
ntfs_index_entry_mark_dirty(ictx);
ntfs_index_ctx_put(ictx);
if ((ni != index_ni) && ntfs_inode_close(index_ni) && !err)
if ((ni != index_ni) && !dir_ni
&& ntfs_inode_close(index_ni) && !err)
err = errno;
}
/* Check for real error occurred. */
@ -668,11 +947,10 @@ err_out:
* EBUSY - Inode and/or one of its extents is busy, try again later.
* EIO - I/O error while writing the inode (or one of its extents).
*/
int ntfs_inode_sync(ntfs_inode *ni)
static int ntfs_inode_sync_in_dir(ntfs_inode *ni, ntfs_inode *dir_ni)
{
int ret = 0;
int err = 0;
if (!ni) {
errno = EINVAL;
ntfs_log_error("Failed to sync NULL inode\n");
@ -694,7 +972,7 @@ int ntfs_inode_sync(ntfs_inode *ni)
/* Update FILE_NAME's in the index. */
if ((ni->mrec->flags & MFT_RECORD_IN_USE) && ni->nr_extents != -1 &&
NInoFileNameTestAndClearDirty(ni) &&
ntfs_inode_sync_file_name(ni)) {
ntfs_inode_sync_file_name(ni, dir_ni)) {
if (!err || errno == EIO) {
err = errno;
if (err != EIO)
@ -797,6 +1075,28 @@ sync_inode:
return ret;
}
int ntfs_inode_sync(ntfs_inode *ni)
{
return (ntfs_inode_sync_in_dir(ni, (ntfs_inode*)NULL));
}
/*
* Close an inode with an open parent inode
*/
int ntfs_inode_close_in_dir(ntfs_inode *ni, ntfs_inode *dir_ni)
{
int res;
res = ntfs_inode_sync_in_dir(ni, dir_ni);
if (res) {
if (errno != EIO)
errno = EBUSY;
} else
res = ntfs_inode_close(ni);
return (res);
}
/**
* ntfs_inode_add_attrlist - add attribute list to inode and fill it
* @ni: opened ntfs inode to which add attribute list
@ -872,7 +1172,7 @@ int ntfs_inode_add_attrlist(ntfs_inode *ni)
if (ctx->attr->non_resident)
ale->lowest_vcn = ctx->attr->lowest_vcn;
else
ale->lowest_vcn = 0;
ale->lowest_vcn = const_cpu_to_sle64(0);
ale->mft_reference = MK_LE_MREF(ni->mft_no,
le16_to_cpu(ni->mrec->sequence_number));
ale->instance = ctx->attr->instance;
@ -910,7 +1210,7 @@ int ntfs_inode_add_attrlist(ntfs_inode *ni)
/* Add $ATTRIBUTE_LIST to mft record. */
if (ntfs_resident_attr_record_add(ni,
AT_ATTRIBUTE_LIST, NULL, 0, NULL, 0, 0) < 0) {
AT_ATTRIBUTE_LIST, NULL, 0, NULL, 0, const_cpu_to_le16(0)) < 0) {
err = errno;
ntfs_log_perror("Couldn't add $ATTRIBUTE_LIST to MFT");
goto rollback;
@ -1083,7 +1383,7 @@ put_err_out:
*/
void ntfs_inode_update_times(ntfs_inode *ni, ntfs_time_update_flags mask)
{
time_t now;
ntfs_time now;
if (!ni) {
ntfs_log_error("%s(): Invalid arguments.\n", __FUNCTION__);
@ -1094,7 +1394,7 @@ void ntfs_inode_update_times(ntfs_inode *ni, ntfs_time_update_flags mask)
NVolReadOnly(ni->vol) || !mask)
return;
now = time(NULL);
now = ntfs_current_time();
if (mask & NTFS_UPDATE_ATIME)
ni->last_access_time = now;
if (mask & NTFS_UPDATE_MTIME)
@ -1149,3 +1449,162 @@ int ntfs_inode_badclus_bad(u64 mft_no, ATTR_RECORD *attr)
return ret;
}
/*
* Get high precision NTFS times
*
* They are returned in following order : create, update, access, change
* provided they fit in requested size.
*
* Returns the modified size if successfull (or 32 if buffer size is null)
* -errno if failed
*/
int ntfs_inode_get_times(ntfs_inode *ni, char *value, size_t size)
{
ntfs_attr_search_ctx *ctx;
STANDARD_INFORMATION *std_info;
u64 *times;
int ret;
ret = 0;
ctx = ntfs_attr_get_search_ctx(ni, NULL);
if (ctx) {
if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED,
0, CASE_SENSITIVE, 0, NULL, 0, ctx)) {
ntfs_log_perror("Failed to get standard info (inode %lld)",
(long long)ni->mft_no);
} else {
std_info = (STANDARD_INFORMATION *)((u8 *)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
if (value && (size >= 8)) {
times = (u64*)value;
times[0] = sle64_to_cpu(std_info->creation_time);
ret = 8;
if (size >= 16) {
times[1] = sle64_to_cpu(std_info->last_data_change_time);
ret = 16;
}
if (size >= 24) {
times[2] = sle64_to_cpu(std_info->last_access_time);
ret = 24;
}
if (size >= 32) {
times[3] = sle64_to_cpu(std_info->last_mft_change_time);
ret = 32;
}
} else
if (!size)
ret = 32;
else
ret = -ERANGE;
}
ntfs_attr_put_search_ctx(ctx);
}
return (ret ? ret : -errno);
}
/*
* Set high precision NTFS times
*
* They are expected in this order : create, update, access
* provided they are present in input. The change time is set to
* current time.
*
* The times are inserted directly in the standard_information and
* file names attributes to avoid manipulating low precision times
*
* Returns 0 if success
* -1 if there were an error (described by errno)
*/
int ntfs_inode_set_times(ntfs_inode *ni, const char *value, size_t size,
int flags)
{
ntfs_attr_search_ctx *ctx;
STANDARD_INFORMATION *std_info;
FILE_NAME_ATTR *fn;
u64 times[4];
ntfs_time now;
int cnt;
int ret;
ret = -1;
if ((size >= 8) && !(flags & XATTR_CREATE)) {
/* Copy, to avoid alignment issue encountered on ARM */
memcpy(times, value,
(size < sizeof(times) ? size : sizeof(times)));
now = ntfs_current_time();
/* update the standard information attribute */
ctx = ntfs_attr_get_search_ctx(ni, NULL);
if (ctx) {
if (ntfs_attr_lookup(AT_STANDARD_INFORMATION,
AT_UNNAMED, 0, CASE_SENSITIVE,
0, NULL, 0, ctx)) {
ntfs_log_perror("Failed to get standard info (inode %lld)",
(long long)ni->mft_no);
} else {
std_info = (STANDARD_INFORMATION *)((u8 *)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
/*
* Mark times set to avoid overwriting
* them when the inode is closed.
* The inode structure must also be updated
* (with loss of precision) because of cacheing.
* TODO : use NTFS precision in inode, and
* return sub-second times in getattr()
*/
set_nino_flag(ni, TimesSet);
std_info->creation_time = cpu_to_sle64(times[0]);
ni->creation_time
= std_info->creation_time;
if (size >= 16) {
std_info->last_data_change_time = cpu_to_sle64(times[1]);
ni->last_data_change_time
= std_info->last_data_change_time;
}
if (size >= 24) {
std_info->last_access_time = cpu_to_sle64(times[2]);
ni->last_access_time
= std_info->last_access_time;
}
std_info->last_mft_change_time = now;
ni->last_mft_change_time = now;
ntfs_inode_mark_dirty(ctx->ntfs_ino);
NInoFileNameSetDirty(ni);
/* update the file names attributes */
ntfs_attr_reinit_search_ctx(ctx);
cnt = 0;
while (!ntfs_attr_lookup(AT_FILE_NAME,
AT_UNNAMED, 0, CASE_SENSITIVE,
0, NULL, 0, ctx)) {
fn = (FILE_NAME_ATTR*)((u8 *)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
fn->creation_time
= cpu_to_sle64(times[0]);
if (size >= 16)
fn->last_data_change_time
= cpu_to_sle64(times[1]);
if (size >= 24)
fn->last_access_time
= cpu_to_sle64(times[2]);
fn->last_mft_change_time = now;
cnt++;
}
if (cnt)
ret = 0;
else {
ntfs_log_perror("Failed to get file names (inode %lld)",
(long long)ni->mft_no);
}
}
ntfs_attr_put_search_ctx(ctx);
}
} else
if (size < 8)
errno = ERANGE;
else
errno = EEXIST;
return (ret);
}

419
libntfs-3g/ioctl.c 100644
View File

@ -0,0 +1,419 @@
/**
* ioctl.c - Processing of ioctls
*
* This module is part of ntfs-3g library
*
* Copyright (c) 2014-2019 Jean-Pierre Andre
* Copyright (c) 2014 Red Hat, Inc.
*
* 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
*/
#include "config.h"
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#include <syslog.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h>
#endif
#include "compat.h"
#include "debug.h"
#include "bitmap.h"
#include "attrib.h"
#include "inode.h"
#include "layout.h"
#include "volume.h"
#include "index.h"
#include "logging.h"
#include "ntfstime.h"
#include "unistr.h"
#include "dir.h"
#include "security.h"
#include "ioctl.h"
#include "misc.h"
#if defined(FITRIM) && defined(BLKDISCARD)
/* Issue a TRIM request to the underlying device for the given clusters. */
static int fstrim_clusters(ntfs_volume *vol, LCN lcn, s64 length)
{
struct ntfs_device *dev = vol->dev;
uint64_t range[2];
ntfs_log_debug("fstrim_clusters: %lld length %lld\n",
(long long) lcn, (long long) length);
range[0] = lcn << vol->cluster_size_bits;
range[1] = length << vol->cluster_size_bits;
if (dev->d_ops->ioctl(dev, BLKDISCARD, range) == -1) {
ntfs_log_debug("fstrim_one_cluster: ioctl failed: %m\n");
return -errno;
}
return 0;
}
static int read_line(const char *path, char *line, size_t max_bytes)
{
FILE *fp;
fp = fopen(path, "r");
if (fp == NULL)
return -errno;
if (fgets(line, max_bytes, fp) == NULL) {
int ret = -EIO; /* fgets doesn't set errno */
fclose(fp);
return ret;
}
fclose (fp);
return 0;
}
static int read_u64(const char *path, u64 *n)
{
char line[64];
int ret;
ret = read_line(path, line, sizeof line);
if (ret)
return ret;
if (sscanf(line, "%" SCNu64, n) != 1)
return -EINVAL;
return 0;
}
/* Find discard limits for current backing device.
*/
static int fstrim_limits(ntfs_volume *vol,
u64 *discard_alignment,
u64 *discard_granularity,
u64 *discard_max_bytes)
{
struct stat statbuf;
char path1[40]; /* holds "/sys/dev/block/%d:%d" */
char path2[40 + sizeof(path1)]; /* less than 40 bytes more than path1 */
int ret;
/* Stat the backing device. Caller has ensured it is a block device. */
if (stat(vol->dev->d_name, &statbuf) == -1) {
ntfs_log_debug("fstrim_limits: could not stat %s\n",
vol->dev->d_name);
return -errno;
}
/* For whole devices,
* /sys/dev/block/MAJOR:MINOR/discard_alignment
* /sys/dev/block/MAJOR:MINOR/queue/discard_granularity
* /sys/dev/block/MAJOR:MINOR/queue/discard_max_bytes
* will exist.
* For partitions, we also need to check the parent device:
* /sys/dev/block/MAJOR:MINOR/../queue/discard_granularity
* /sys/dev/block/MAJOR:MINOR/../queue/discard_max_bytes
*/
snprintf(path1, sizeof path1, "/sys/dev/block/%d:%d",
major(statbuf.st_rdev), minor(statbuf.st_rdev));
snprintf(path2, sizeof path2, "%s/discard_alignment", path1);
ret = read_u64(path2, discard_alignment);
if (ret) {
if (ret != -ENOENT)
return ret;
else
/* We would expect this file to exist on all
* modern kernels. But for the sake of very
* old kernels:
*/
goto not_found;
}
snprintf(path2, sizeof path2, "%s/queue/discard_granularity", path1);
ret = read_u64(path2, discard_granularity);
if (ret) {
if (ret != -ENOENT)
return ret;
else {
snprintf(path2, sizeof path2,
"%s/../queue/discard_granularity", path1);
ret = read_u64(path2, discard_granularity);
if (ret) {
if (ret != -ENOENT)
return ret;
else
goto not_found;
}
}
}
snprintf(path2, sizeof path2, "%s/queue/discard_max_bytes", path1);
ret = read_u64(path2, discard_max_bytes);
if (ret) {
if (ret != -ENOENT)
return ret;
else {
snprintf(path2, sizeof path2,
"%s/../queue/discard_max_bytes", path1);
ret = read_u64(path2, discard_max_bytes);
if (ret) {
if (ret != -ENOENT)
return ret;
else
goto not_found;
}
}
}
return 0;
not_found:
/* If we reach here then we didn't find the device. This is
* not an error, but set discard_max_bytes = 0 to indicate
* that discard is not available.
*/
*discard_alignment = 0;
*discard_granularity = 0;
*discard_max_bytes = 0;
return 0;
}
static inline LCN align_up(ntfs_volume *vol, LCN lcn, u64 granularity)
{
u64 aligned;
aligned = (lcn << vol->cluster_size_bits) + granularity - 1;
aligned -= aligned % granularity;
return (aligned >> vol->cluster_size_bits);
}
static inline u64 align_down(ntfs_volume *vol, u64 count, u64 granularity)
{
u64 aligned;
aligned = count << vol->cluster_size_bits;
aligned -= aligned % granularity;
return (aligned >> vol->cluster_size_bits);
}
#define FSTRIM_BUFSIZ 4096
/* Trim the filesystem.
*
* Free blocks between 'start' and 'start+len-1' (both byte offsets)
* are found and TRIM requests are sent to the block device. 'minlen'
* is the minimum continguous free range to discard.
*/
static int fstrim(ntfs_volume *vol, void *data, u64 *trimmed)
{
struct fstrim_range *range = data;
u64 start = range->start;
u64 len = range->len;
u64 minlen = range->minlen;
u64 discard_alignment, discard_granularity, discard_max_bytes;
u8 *buf = NULL;
LCN start_buf;
int ret;
ntfs_log_debug("fstrim: start=%llu len=%llu minlen=%llu\n",
(unsigned long long) start,
(unsigned long long) len,
(unsigned long long) minlen);
*trimmed = 0;
/* Fail if user tries to use the fstrim -o/-l/-m options.
* XXX We could fix these limitations in future.
*/
if (start != 0 || len != (uint64_t)-1) {
ntfs_log_error("fstrim: setting start or length is not supported\n");
return -EINVAL;
}
if (minlen > vol->cluster_size) {
ntfs_log_error("fstrim: minlen > cluster size is not supported\n");
return -EINVAL;
}
/* Only block devices are supported. It would be possible to
* support backing files (ie. without using loop) but the
* ioctls used to punch holes in files are completely
* different.
*/
if (!NDevBlock(vol->dev)) {
ntfs_log_error("fstrim: not supported for non-block-device\n");
return -EOPNOTSUPP;
}
ret = fstrim_limits(vol, &discard_alignment,
&discard_granularity, &discard_max_bytes);
if (ret)
return ret;
if (discard_alignment != 0) {
ntfs_log_error("fstrim: backing device is not aligned for discards\n");
return -EOPNOTSUPP;
}
if (discard_max_bytes == 0) {
ntfs_log_error("fstrim: backing device does not support discard (discard_max_bytes == 0)\n");
return -EOPNOTSUPP;
}
/* Sync the device before doing anything. */
ret = ntfs_device_sync(vol->dev);
if (ret)
return ret;
/* Read through the bitmap. */
buf = ntfs_malloc(FSTRIM_BUFSIZ);
if (buf == NULL)
return -errno;
for (start_buf = 0; start_buf < vol->nr_clusters;
start_buf += FSTRIM_BUFSIZ * 8) {
s64 count;
s64 br;
LCN end_buf, start_lcn;
/* start_buf is LCN of first cluster in the current buffer.
* end_buf is LCN of last cluster + 1 in the current buffer.
*/
end_buf = start_buf + FSTRIM_BUFSIZ*8;
if (end_buf > vol->nr_clusters)
end_buf = vol->nr_clusters;
count = (end_buf - start_buf) / 8;
br = ntfs_attr_pread(vol->lcnbmp_na, start_buf/8, count, buf);
if (br != count) {
if (br >= 0)
ret = -EIO;
else
ret = -errno;
goto free_out;
}
/* Trim the clusters in large as possible blocks, but
* not larger than discard_max_bytes, and compatible
* with the supported trim granularity.
*/
for (start_lcn = start_buf; start_lcn < end_buf; ++start_lcn) {
if (!ntfs_bit_get(buf, start_lcn-start_buf)) {
LCN end_lcn;
LCN aligned_lcn;
u64 aligned_count;
/* Cluster 'start_lcn' is not in use,
* find end of this run.
*/
end_lcn = start_lcn+1;
while (end_lcn < end_buf &&
(u64) (end_lcn-start_lcn) << vol->cluster_size_bits
< discard_max_bytes &&
!ntfs_bit_get(buf, end_lcn-start_buf))
end_lcn++;
aligned_lcn = align_up(vol, start_lcn,
discard_granularity);
if (aligned_lcn >= end_lcn)
aligned_count = 0;
else {
aligned_count =
align_down(vol,
end_lcn - aligned_lcn,
discard_granularity);
}
if (aligned_count) {
ret = fstrim_clusters(vol,
aligned_lcn, aligned_count);
if (ret)
goto free_out;
*trimmed += aligned_count
<< vol->cluster_size_bits;
}
start_lcn = end_lcn-1;
}
}
}
ret = 0;
free_out:
free(buf);
return ret;
}
#endif /* FITRIM && BLKDISCARD */
int ntfs_ioctl(ntfs_inode *ni, unsigned long cmd,
void *arg __attribute__((unused)),
unsigned int flags __attribute__((unused)), void *data)
{
int ret = 0;
switch (cmd) {
#if defined(FITRIM) && defined(BLKDISCARD)
case FITRIM:
if (!ni || !data)
ret = -EINVAL;
else {
u64 trimmed;
struct fstrim_range *range = (struct fstrim_range*)data;
ret = fstrim(ni->vol, data, &trimmed);
range->len = trimmed;
}
break;
#else
#warning Trimming not supported : FITRIM or BLKDISCARD not defined
#endif
default :
ret = -EINVAL;
break;
}
return (ret);
}

View File

@ -4,6 +4,7 @@
* Copyright (c) 2002-2004 Anton Altaparmakov
* Copyright (c) 2004 Yura Pakhuchiy
* Copyright (c) 2004-2008 Szabolcs Szakacsits
* Copyright (c) 2008-2009 Jean-Pierre Andre
*
* 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
@ -54,6 +55,12 @@
#define NTFS_LCNALLOC_BSIZE 4096
#define NTFS_LCNALLOC_SKIP NTFS_LCNALLOC_BSIZE
enum {
ZONE_MFT = 1,
ZONE_DATA1 = 2,
ZONE_DATA2 = 4
} ;
static void ntfs_cluster_set_zone_pos(LCN start, LCN end, LCN *pos, LCN tc)
{
ntfs_log_trace("pos: %lld tc: %lld\n", (long long)*pos, (long long)tc);
@ -68,17 +75,44 @@ static void ntfs_cluster_update_zone_pos(ntfs_volume *vol, u8 zone, LCN tc)
{
ntfs_log_trace("tc = %lld, zone = %d\n", (long long)tc, zone);
if (zone == 1)
if (zone == ZONE_MFT)
ntfs_cluster_set_zone_pos(vol->mft_lcn, vol->mft_zone_end,
&vol->mft_zone_pos, tc);
else if (zone == 2)
else if (zone == ZONE_DATA1)
ntfs_cluster_set_zone_pos(vol->mft_zone_end, vol->nr_clusters,
&vol->data1_zone_pos, tc);
else /* zone == 4 */
else /* zone == ZONE_DATA2 */
ntfs_cluster_set_zone_pos(0, vol->mft_zone_start,
&vol->data2_zone_pos, tc);
}
/*
* Unmark full zones when a cluster has been freed in a full zone
*
* Next allocation will reuse the freed cluster
*/
static void update_full_status(ntfs_volume *vol, LCN lcn)
{
if (lcn >= vol->mft_zone_end) {
if (vol->full_zones & ZONE_DATA1) {
ntfs_cluster_update_zone_pos(vol, ZONE_DATA1, lcn);
vol->full_zones &= ~ZONE_DATA1;
}
} else
if (lcn < vol->mft_zone_start) {
if (vol->full_zones & ZONE_DATA2) {
ntfs_cluster_update_zone_pos(vol, ZONE_DATA2, lcn);
vol->full_zones &= ~ZONE_DATA2;
}
} else {
if (vol->full_zones & ZONE_MFT) {
ntfs_cluster_update_zone_pos(vol, ZONE_MFT, lcn);
vol->full_zones &= ~ZONE_MFT;
}
}
}
static s64 max_empty_bit_range(unsigned char *buf, int size)
{
int i, j, run = 0;
@ -87,30 +121,49 @@ static s64 max_empty_bit_range(unsigned char *buf, int size)
ntfs_log_trace("Entering\n");
for (i = 0; i < size; i++, buf++) {
if (*buf == 0) {
run += 8;
continue;
}
for (j = 0; j < 8; j++) {
i = 0;
while (i < size) {
switch (*buf) {
case 0 :
do {
buf++;
run += 8;
i++;
} while ((i < size) && !*buf);
break;
case 255 :
if (run > max_range) {
max_range = run;
start_pos = (s64)i * 8 - run;
}
run = 0;
do {
buf++;
i++;
} while ((i < size) && (*buf == 255));
break;
default :
for (j = 0; j < 8; j++) {
int bit = *buf & (1 << j);
int bit = *buf & (1 << j);
if (bit) {
if (run > max_range) {
max_range = run;
start_pos = i * 8 + j - run;
}
run = 0;
} else
run++;
}
if (bit) {
if (run > max_range) {
max_range = run;
start_pos = (s64)i * 8 + (j - run);
}
run = 0;
} else
run++;
}
i++;
buf++;
}
}
if (run > max_range)
start_pos = i * 8 - run;
start_pos = (s64)i * 8 - run;
return start_pos;
}
@ -245,13 +298,13 @@ runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
if (zone_start < vol->mft_zone_start) {
zone_end = vol->mft_zone_start;
search_zone = 4;
search_zone = ZONE_DATA2;
} else if (zone_start < vol->mft_zone_end) {
zone_end = vol->mft_zone_end;
search_zone = 1;
search_zone = ZONE_MFT;
} else {
zone_end = vol->nr_clusters;
search_zone = 2;
search_zone = ZONE_DATA1;
}
bmp_pos = zone_start;
@ -260,6 +313,9 @@ runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
clusters = count;
rlpos = rlsize = 0;
while (1) {
/* check whether we have exhausted the current zone */
if (search_zone & vol->full_zones)
goto zone_pass_done;
last_read_pos = bmp_pos >> 3;
br = ntfs_attr_pread(vol->lcnbmp_na, last_read_pos,
NTFS_LCNALLOC_BSIZE, buf);
@ -312,12 +368,14 @@ runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
/* Allocate the bitmap bit. */
*byte |= bit;
writeback = 1;
if (vol->free_clusters <= 0)
ntfs_log_error("Non-positive free clusters "
"(%lld)!\n",
if (NVolFreeSpaceKnown(vol)) {
if (vol->free_clusters <= 0)
ntfs_log_error("Non-positive free"
" clusters (%lld)!\n",
(long long)vol->free_clusters);
else
vol->free_clusters--;
else
vol->free_clusters--;
}
/*
* Coalesce with previous run if adjacent LCNs.
@ -371,9 +429,9 @@ runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
used_zone_pos = 1;
if (search_zone == 1)
if (search_zone == ZONE_MFT)
zone_start = vol->mft_zone_pos;
else if (search_zone == 2)
else if (search_zone == ZONE_DATA1)
zone_start = vol->data1_zone_pos;
else
zone_start = vol->data2_zone_pos;
@ -391,13 +449,12 @@ runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
zone_pass_done:
ntfs_log_trace("Finished current zone pass(%i).\n", pass);
if (pass == 1) {
pass = 2;
zone_end = zone_start;
if (search_zone == 1)
if (search_zone == ZONE_MFT)
zone_start = vol->mft_zone_start;
else if (search_zone == 2)
else if (search_zone == ZONE_DATA1)
zone_start = vol->mft_zone_end;
else
zone_start = 0;
@ -413,11 +470,12 @@ zone_pass_done:
/* pass == 2 */
done_zones_check:
done_zones |= search_zone;
if (done_zones < 7) {
vol->full_zones |= search_zone;
if (done_zones < (ZONE_MFT + ZONE_DATA1 + ZONE_DATA2)) {
ntfs_log_trace("Switching zone.\n");
pass = 1;
if (rlpos) {
LCN tc = tc = rl[rlpos - 1].lcn +
LCN tc = rl[rlpos - 1].lcn +
rl[rlpos - 1].length + NTFS_LCNALLOC_SKIP;
if (used_zone_pos)
@ -426,29 +484,29 @@ done_zones_check:
}
switch (search_zone) {
case 1:
case ZONE_MFT:
ntfs_log_trace("Zone switch: mft -> data1\n");
switch_to_data1_zone: search_zone = 2;
switch_to_data1_zone: search_zone = ZONE_DATA1;
zone_start = vol->data1_zone_pos;
zone_end = vol->nr_clusters;
if (zone_start == vol->mft_zone_end)
pass = 2;
break;
case 2:
case ZONE_DATA1:
ntfs_log_trace("Zone switch: data1 -> data2\n");
search_zone = 4;
search_zone = ZONE_DATA2;
zone_start = vol->data2_zone_pos;
zone_end = vol->mft_zone_start;
if (!zone_start)
pass = 2;
break;
case 4:
if (!(done_zones & 2)) {
case ZONE_DATA2:
if (!(done_zones & ZONE_DATA1)) {
ntfs_log_trace("data2 -> data1\n");
goto switch_to_data1_zone;
}
ntfs_log_trace("Zone switch: data2 -> mft\n");
search_zone = 1;
search_zone = ZONE_MFT;
zone_start = vol->mft_zone_pos;
zone_end = vol->mft_zone_end;
if (zone_start == vol->mft_zone_start)
@ -530,6 +588,7 @@ int ntfs_cluster_free_from_rl(ntfs_volume *vol, runlist *rl)
(long long)rl->lcn, (long long)rl->length);
if (rl->lcn >= 0) {
update_full_status(vol,rl->lcn);
if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn,
rl->length)) {
ntfs_log_perror("Cluster deallocation failed "
@ -545,6 +604,43 @@ int ntfs_cluster_free_from_rl(ntfs_volume *vol, runlist *rl)
ret = 0;
out:
vol->free_clusters += nr_freed;
if (NVolFreeSpaceKnown(vol)
&& (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;
}
/*
* Basic cluster run free
* Returns 0 if successful
*/
int ntfs_cluster_free_basic(ntfs_volume *vol, s64 lcn, s64 count)
{
s64 nr_freed = 0;
int ret = -1;
ntfs_log_trace("Entering.\n");
ntfs_log_trace("Dealloc lcn 0x%llx, len 0x%llx.\n",
(long long)lcn, (long long)count);
if (lcn >= 0) {
update_full_status(vol,lcn);
if (ntfs_bitmap_clear_run(vol->lcnbmp_na, lcn,
count)) {
ntfs_log_perror("Cluster deallocation failed "
"(%lld, %lld)",
(long long)lcn,
(long long)count);
goto out;
}
nr_freed += count;
}
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,
@ -583,7 +679,7 @@ int ntfs_cluster_free(ntfs_volume *vol, ntfs_attr *na, VCN start_vcn, s64 count)
ntfs_log_enter("Entering for inode 0x%llx, attr 0x%x, count 0x%llx, "
"vcn 0x%llx.\n", (unsigned long long)na->ni->mft_no,
na->type, (long long)count, (long long)start_vcn);
le32_to_cpu(na->type), (long long)count, (long long)start_vcn);
rl = ntfs_attr_find_vcn(na, start_vcn);
if (!rl) {
@ -609,6 +705,7 @@ int ntfs_cluster_free(ntfs_volume *vol, ntfs_attr *na, VCN start_vcn, s64 count)
if (rl->lcn != LCN_HOLE) {
/* Do the actual freeing of the clusters in this run. */
update_full_status(vol,rl->lcn + delta);
if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn + delta,
to_free))
goto leave;
@ -641,6 +738,7 @@ int ntfs_cluster_free(ntfs_volume *vol, ntfs_attr *na, VCN start_vcn, s64 count)
to_free = count;
if (rl->lcn != LCN_HOLE) {
update_full_status(vol,rl->lcn);
if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn,
to_free)) {
// FIXME: Eeek! We need rollback! (AIA)

View File

@ -84,13 +84,21 @@ static BOOL ntfs_check_restart_page_header(RESTART_PAGE_HEADER *rp, s64 pos)
"position in $LogFile.\n");
return FALSE;
}
/* We only know how to handle version 1.1. */
if (sle16_to_cpu(rp->major_ver) != 1 ||
sle16_to_cpu(rp->minor_ver) != 1) {
/*
* We only know how to handle version 1.1 and 2.0, though
* version 2.0 is probably related to cached metadata in
* Windows 8, and we will refuse to mount.
* Nevertheless, do all the relevant checks before rejecting.
*/
if (((rp->major_ver != const_cpu_to_sle16(1))
|| (rp->minor_ver != const_cpu_to_sle16(1)))
&& ((rp->major_ver != const_cpu_to_sle16(2))
|| (rp->minor_ver != const_cpu_to_sle16(0)))) {
ntfs_log_error("$LogFile version %i.%i is not "
"supported. (This driver supports version "
"1.1 only.)\n", (int)sle16_to_cpu(rp->major_ver),
(int)sle16_to_cpu(rp->minor_ver));
"supported.\n (This driver supports version "
"1.1 and 2.0 only.)\n",
(int)sle16_to_cpu(rp->major_ver),
(int)sle16_to_cpu(rp->minor_ver));
return FALSE;
}
/*
@ -111,7 +119,7 @@ static BOOL ntfs_check_restart_page_header(RESTART_PAGE_HEADER *rp, s64 pos)
/* Verify the position of the update sequence array. */
usa_ofs = le16_to_cpu(rp->usa_ofs);
usa_end = usa_ofs + usa_count * sizeof(u16);
if (usa_ofs < sizeof(RESTART_PAGE_HEADER) ||
if (usa_ofs < offsetof(RESTART_PAGE_HEADER, usn) ||
usa_end > NTFS_BLOCK_SIZE - sizeof(u16)) {
ntfs_log_error("$LogFile restart page specifies "
"inconsistent update sequence array offset.\n");
@ -126,7 +134,7 @@ skip_usa_checks:
*/
ra_ofs = le16_to_cpu(rp->restart_area_offset);
if (ra_ofs & 7 || (have_usa ? ra_ofs < usa_end :
ra_ofs < sizeof(RESTART_PAGE_HEADER)) ||
ra_ofs < offsetof(RESTART_PAGE_HEADER, usn)) ||
ra_ofs > logfile_system_page_size) {
ntfs_log_error("$LogFile restart page specifies "
"inconsistent restart area offset.\n");
@ -279,9 +287,19 @@ static BOOL ntfs_check_log_client_array(RESTART_PAGE_HEADER *rp)
LOG_CLIENT_RECORD *ca, *cr;
u16 nr_clients, idx;
BOOL in_free_list, idx_is_first;
u32 offset_clients;
ntfs_log_trace("Entering.\n");
/* The restart area must be fully within page */
if ((le16_to_cpu(rp->restart_area_offset) + sizeof(RESTART_AREA))
> le32_to_cpu(rp->system_page_size))
goto err_out;
ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset));
offset_clients = le16_to_cpu(rp->restart_area_offset)
+ le16_to_cpu(ra->client_array_offset);
/* The clients' records must begin within page */
if (offset_clients >= le32_to_cpu(rp->system_page_size))
goto err_out;
ca = (LOG_CLIENT_RECORD*)((u8*)ra +
le16_to_cpu(ra->client_array_offset));
/*
@ -300,6 +318,10 @@ check_list:
idx = le16_to_cpu(cr->next_client)) {
if (!nr_clients || idx >= le16_to_cpu(ra->log_clients))
goto err_out;
/* The client record must be fully within page */
if ((offset_clients + (idx + 1)*sizeof(LOG_CLIENT_RECORD))
> le32_to_cpu(rp->system_page_size))
goto err_out;
/* Set @cr to the current log client record. */
cr = ca + idx;
/* The first log client record must not have a prev_client. */
@ -372,7 +394,14 @@ static int ntfs_check_and_load_restart_page(ntfs_attr *log_na,
/*
* Allocate a buffer to store the whole restart page so we can multi
* sector transfer deprotect it.
* For safety, make sure this is consistent with the usa_count
* and shorter than the full log size
*/
if ((le32_to_cpu(rp->system_page_size)
> (u32)(le16_to_cpu(rp->usa_count) - 1)*NTFS_BLOCK_SIZE)
|| (le32_to_cpu(rp->system_page_size)
> le64_to_cpu(log_na->data_size)))
return (EINVAL);
trp = ntfs_malloc(le32_to_cpu(rp->system_page_size));
if (!trp)
return errno;
@ -468,7 +497,7 @@ BOOL ntfs_check_logfile(ntfs_attr *log_na, RESTART_PAGE_HEADER **rp)
u8 *kaddr = NULL;
RESTART_PAGE_HEADER *rstr1_ph = NULL;
RESTART_PAGE_HEADER *rstr2_ph = NULL;
int log_page_size, log_page_mask, err;
int log_page_size, err;
BOOL logfile_is_empty = TRUE;
u8 log_page_bits;
@ -481,7 +510,6 @@ BOOL ntfs_check_logfile(ntfs_attr *log_na, RESTART_PAGE_HEADER **rp)
if (size > (s64)MaxLogFileSize)
size = MaxLogFileSize;
log_page_size = DefaultLogPageSize;
log_page_mask = log_page_size - 1;
/*
* Use generic_ffs() instead of ffs() to enable the compiler to
* optimize log_page_size and log_page_bits into constants.

View File

@ -3,6 +3,7 @@
*
* Copyright (c) 2005 Richard Russon
* Copyright (c) 2005-2008 Szabolcs Szakacsits
* Copyright (c) 2010 Jean-Pierre Andre
*
* 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
@ -388,6 +389,29 @@ out:
}
#endif
/*
* Early logging before the logs are redirected
*
* (not quite satisfactory : this appears before the ntfs-g banner,
* and with a different pid)
*/
void ntfs_log_early_error(const char *format, ...)
{
va_list args;
va_start(args, format);
#ifdef HAVE_SYSLOG_H
openlog("ntfs-3g", LOG_PID, LOG_USER);
ntfs_log_handler_syslog(NULL, NULL, 0,
NTFS_LOG_LEVEL_ERROR, NULL,
format, args);
#else
vfprintf(stderr,format,args);
#endif
va_end(args);
}
/**
* ntfs_log_handler_fprintf - Basic logging handler
* @function: Function in which the log line occurred

View File

@ -5,6 +5,7 @@
* Copyright (c) 2004-2005 Richard Russon
* Copyright (c) 2004-2008 Szabolcs Szakacsits
* Copyright (c) 2005 Yura Pakhuchiy
* Copyright (c) 2014-2021 Jean-Pierre Andre
*
* 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
@ -38,6 +39,9 @@
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#include <time.h>
#include "compat.h"
@ -168,6 +172,15 @@ int ntfs_mft_records_write(const ntfs_volume *vol, const MFT_REF mref,
cnt = vol->mftmirr_size - m;
if (cnt > count)
cnt = count;
if ((m + cnt) > vol->mftmirr_na->initialized_size >>
vol->mft_record_size_bits) {
errno = ESPIPE;
ntfs_log_perror("Trying to write non-allocated mftmirr"
" records (%lld > %lld)", (long long)m + cnt,
(long long)vol->mftmirr_na->initialized_size >>
vol->mft_record_size_bits);
return -1;
}
bmirr = ntfs_malloc(cnt * vol->mft_record_size);
if (!bmirr)
return -1;
@ -206,15 +219,32 @@ int ntfs_mft_records_write(const ntfs_volume *vol, const MFT_REF mref,
return -1;
}
/*
* Check the consistency of an MFT record
*
* Make sure its general fields are safe, then examine all its
* attributes and apply generic checks to them.
* The attribute checks are skipped when a record is being read in
* order to collect its sequence number for creating a new record.
*
* Returns 0 if the checks are successful
* -1 with errno = EIO otherwise
*/
int ntfs_mft_record_check(const ntfs_volume *vol, const MFT_REF mref,
MFT_RECORD *m)
{
ATTR_RECORD *a;
ATTR_TYPES previous_type;
int ret = -1;
u32 offset;
s32 space;
if (!ntfs_is_file_record(m->magic)) {
ntfs_log_error("Record %llu has no FILE magic (0x%x)\n",
(unsigned long long)MREF(mref), *(le32 *)m);
if (!NVolNoFixupWarn(vol))
ntfs_log_error("Record %llu has no FILE magic (0x%x)\n",
(unsigned long long)MREF(mref),
(int)le32_to_cpu(*(le32*)m));
goto err_out;
}
@ -225,13 +255,57 @@ int ntfs_mft_record_check(const ntfs_volume *vol, const MFT_REF mref,
le32_to_cpu(m->bytes_allocated));
goto err_out;
}
if (!NVolNoFixupWarn(vol)
&& (le32_to_cpu(m->bytes_in_use) > vol->mft_record_size)) {
ntfs_log_error("Record %llu has corrupt in-use size "
"(%u > %u)\n", (unsigned long long)MREF(mref),
(int)le32_to_cpu(m->bytes_in_use),
(int)vol->mft_record_size);
goto err_out;
}
if (le16_to_cpu(m->attrs_offset) & 7) {
ntfs_log_error("Attributes badly aligned in record %llu\n",
(unsigned long long)MREF(mref));
goto err_out;
}
a = (ATTR_RECORD *)((char *)m + le16_to_cpu(m->attrs_offset));
if (p2n(a) < p2n(m) || (char *)a > (char *)m + vol->mft_record_size) {
ntfs_log_error("Record %llu is corrupt\n",
(unsigned long long)MREF(mref));
goto err_out;
}
if (!NVolNoFixupWarn(vol)) {
offset = le16_to_cpu(m->attrs_offset);
space = le32_to_cpu(m->bytes_in_use) - offset;
a = (ATTR_RECORD*)((char*)m + offset);
previous_type = AT_STANDARD_INFORMATION;
while ((space >= (s32)offsetof(ATTR_RECORD, resident_end))
&& (a->type != AT_END)
&& (le32_to_cpu(a->type) >= le32_to_cpu(previous_type))) {
if ((le32_to_cpu(a->length) <= (u32)space)
&& !(le32_to_cpu(a->length) & 7)) {
if (!ntfs_attr_inconsistent(a, mref)) {
previous_type = a->type;
offset += le32_to_cpu(a->length);
space -= le32_to_cpu(a->length);
a = (ATTR_RECORD*)((char*)m + offset);
} else
goto err_out;
} else {
ntfs_log_error("Corrupted MFT record %llu\n",
(unsigned long long)MREF(mref));
goto err_out;
}
}
/* We are supposed to reach an AT_END */
if ((space < 4) || (a->type != AT_END)) {
ntfs_log_error("Bad end of MFT record %llu\n",
(unsigned long long)MREF(mref));
goto err_out;
}
}
ret = 0;
err_out:
@ -349,7 +423,7 @@ int ntfs_mft_record_layout(const ntfs_volume *vol, const MFT_REF mref,
* Set the NTFS 3.1+ specific fields while we know that the
* volume version is 3.1+.
*/
mrec->reserved = cpu_to_le16(0);
mrec->reserved = const_cpu_to_le16(0);
mrec->mft_record_number = cpu_to_le32(MREF(mref));
}
mrec->magic = magic_FILE;
@ -357,7 +431,7 @@ int ntfs_mft_record_layout(const ntfs_volume *vol, const MFT_REF mref,
mrec->usa_count = cpu_to_le16(vol->mft_record_size /
NTFS_BLOCK_SIZE + 1);
else {
mrec->usa_count = cpu_to_le16(1);
mrec->usa_count = const_cpu_to_le16(1);
ntfs_log_error("Sector size is bigger than MFT record size. "
"Setting usa_count to 1. If Windows chkdsk "
"reports this as corruption, please email %s "
@ -366,14 +440,14 @@ int ntfs_mft_record_layout(const ntfs_volume *vol, const MFT_REF mref,
"Thank you.\n", NTFS_DEV_LIST);
}
/* Set the update sequence number to 1. */
*(u16*)((u8*)mrec + le16_to_cpu(mrec->usa_ofs)) = cpu_to_le16(1);
mrec->lsn = cpu_to_le64(0ull);
mrec->sequence_number = cpu_to_le16(1);
mrec->link_count = cpu_to_le16(0);
*(le16*)((u8*)mrec + le16_to_cpu(mrec->usa_ofs)) = const_cpu_to_le16(1);
mrec->lsn = const_cpu_to_sle64(0ll);
mrec->sequence_number = const_cpu_to_le16(1);
mrec->link_count = const_cpu_to_le16(0);
/* Aligned to 8-byte boundary. */
mrec->attrs_offset = cpu_to_le16((le16_to_cpu(mrec->usa_ofs) +
(le16_to_cpu(mrec->usa_count) << 1) + 7) & ~7);
mrec->flags = cpu_to_le16(0);
mrec->flags = const_cpu_to_le16(0);
/*
* Using attrs_offset plus eight bytes (for the termination attribute),
* aligned to 8-byte boundary.
@ -381,11 +455,11 @@ int ntfs_mft_record_layout(const ntfs_volume *vol, const MFT_REF mref,
mrec->bytes_in_use = cpu_to_le32((le16_to_cpu(mrec->attrs_offset) + 8 +
7) & ~7);
mrec->bytes_allocated = cpu_to_le32(vol->mft_record_size);
mrec->base_mft_record = cpu_to_le64((MFT_REF)0);
mrec->next_attr_instance = cpu_to_le16(0);
mrec->base_mft_record = const_cpu_to_le64((MFT_REF)0);
mrec->next_attr_instance = const_cpu_to_le16(0);
a = (ATTR_RECORD*)((u8*)mrec + le16_to_cpu(mrec->attrs_offset));
a->type = AT_END;
a->length = cpu_to_le32(0);
a->length = const_cpu_to_le32(0);
/* Finally, clear the unused part of the mft record. */
memset((u8*)a + 8, 0, vol->mft_record_size - ((u8*)a + 8 - (u8*)mrec));
return 0;
@ -548,7 +622,7 @@ static int ntfs_mft_bitmap_find_free_rec(ntfs_volume *vol, ntfs_inode *base_ni)
"data_pos 0x%llx, bit 0x%llx, "
"*byte 0x%hhx, b %u.\n", size,
(long long)data_pos, (long long)bit,
byte ? *byte : -1, b);
(u8) (byte ? *byte : -1), b);
for (; bit < size && data_pos + bit < pass_end;
bit &= ~7ull, bit += 8) {
/*
@ -575,7 +649,7 @@ static int ntfs_mft_bitmap_find_free_rec(ntfs_volume *vol, ntfs_inode *base_ni)
"data_pos 0x%llx, bit 0x%llx, "
"*byte 0x%hhx, b %u.\n", size,
(long long)data_pos, (long long)bit,
byte ? *byte : -1, b);
(u8) (byte ? *byte : -1), b);
data_pos += size;
/*
* If the end of the pass has not been reached yet,
@ -718,7 +792,7 @@ static int ntfs_mft_bitmap_extend_allocation_i(ntfs_volume *vol)
goto undo_alloc;
}
/* Get the size for the new mapping pairs array for this extent. */
mp_size = ntfs_get_size_for_mapping_pairs(vol, rl2, ll);
mp_size = ntfs_get_size_for_mapping_pairs(vol, rl2, ll, INT_MAX);
if (mp_size <= 0) {
ntfs_log_error("Get size for mapping pairs failed for "
"mft bitmap attribute extent.\n");
@ -904,7 +978,6 @@ static int ntfs_mft_bitmap_extend_initialized(ntfs_volume *vol)
ll = ntfs_attr_pwrite(mftbmp_na, old_initialized_size, 8, &ll);
if (ll == 8) {
ntfs_log_debug("Wrote eight initialized bytes to mft bitmap.\n");
vol->free_mft_records += (8 * 8);
ret = 0;
goto out;
}
@ -1067,7 +1140,7 @@ static int ntfs_mft_data_extend_allocation(ntfs_volume *vol)
goto undo_alloc;
}
/* Get the size for the new mapping pairs array for this extent. */
mp_size = ntfs_get_size_for_mapping_pairs(vol, rl2, ll);
mp_size = ntfs_get_size_for_mapping_pairs(vol, rl2, ll, INT_MAX);
if (mp_size <= 0) {
ntfs_log_error("Get size for mapping pairs failed for "
"mft data attribute extent.\n");
@ -1187,7 +1260,7 @@ undo_alloc:
static int ntfs_mft_record_init(ntfs_volume *vol, s64 size)
{
int ret = -1;
ntfs_attr *mft_na, *mftbmp_na;
ntfs_attr *mft_na;
s64 old_data_initialized, old_data_size;
ntfs_attr_search_ctx *ctx;
@ -1196,7 +1269,6 @@ static int ntfs_mft_record_init(ntfs_volume *vol, s64 size)
/* NOTE: Caller must sanity check vol, vol->mft_na and vol->mftbmp_na */
mft_na = vol->mft_na;
mftbmp_na = vol->mftbmp_na;
/*
* The mft record is outside the initialized data. Extend the mft data
@ -1292,14 +1364,13 @@ undo_data_init:
static int ntfs_mft_rec_init(ntfs_volume *vol, s64 size)
{
int ret = -1;
ntfs_attr *mft_na, *mftbmp_na;
ntfs_attr *mft_na;
s64 old_data_initialized, old_data_size;
ntfs_attr_search_ctx *ctx;
ntfs_log_enter("Entering\n");
mft_na = vol->mft_na;
mftbmp_na = vol->mftbmp_na;
if (size > mft_na->allocated_size || size > mft_na->initialized_size) {
errno = EIO;
@ -1351,7 +1422,7 @@ undo_data_init:
goto out;
}
static ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol)
ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol, BOOL mft_data)
{
s64 ll, bit;
ntfs_attr *mft_na, *mftbmp_na;
@ -1359,7 +1430,8 @@ static ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol)
ntfs_inode *ni = NULL;
ntfs_inode *base_ni;
int err;
u16 seq_no, usn;
le16 seq_no, usn;
BOOL forced_mft_data;
ntfs_log_enter("Entering\n");
@ -1368,7 +1440,49 @@ static ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol)
base_ni = mft_na->ni;
bit = ntfs_mft_bitmap_find_free_rec(vol, base_ni);
/*
* The first extent containing $MFT:$AT_DATA is better located
* in record 15 to make sure it can be read at mount time.
* The record 15 is prereserved as a base inode with no
* extents and no name, and it is marked in use.
*/
forced_mft_data = FALSE;
if (mft_data) {
ntfs_inode *ext_ni = ntfs_inode_open(vol, FILE_mft_data);
/*
* If record 15 cannot be opened, it is probably in
* use as an extent. Apply standard procedure for
* further extents.
*/
if (ext_ni) {
/*
* Make sure record 15 is a base extent and it has
* no name. A base inode with no name cannot be in use.
* The test based on base_mft_record fails for
* extents of MFT, so we need a special check.
* If already used, apply standard procedure.
*/
if (!ext_ni->mrec->base_mft_record
&& !ext_ni->mrec->link_count)
forced_mft_data = TRUE;
ntfs_inode_close(ext_ni);
/* Double-check, in case it is used for MFT */
if (forced_mft_data && base_ni->nr_extents) {
int i;
for (i=0; i<base_ni->nr_extents; i++) {
if (base_ni->extent_nis[i]
&& (base_ni->extent_nis[i]->mft_no
== FILE_mft_data))
forced_mft_data = FALSE;
}
}
}
}
if (forced_mft_data)
bit = FILE_mft_data;
else
bit = ntfs_mft_bitmap_find_free_rec(vol, base_ni);
if (bit >= 0)
goto found_free_rec;
@ -1405,25 +1519,36 @@ found_free_rec:
goto undo_mftbmp_alloc;
}
/* Sanity check that the mft record is really not in use. */
if (ntfs_is_file_record(m->magic) && (m->flags & MFT_RECORD_IN_USE)) {
if (!forced_mft_data
&& (ntfs_is_file_record(m->magic)
&& (m->flags & MFT_RECORD_IN_USE))) {
ntfs_log_error("Inode %lld is used but it wasn't marked in "
"$MFT bitmap. Fixed.\n", (long long)bit);
free(m);
goto undo_mftbmp_alloc;
}
/*
* Retrieve the former seq_no and usn so that the new record
* cannot be mistaken for the former one.
* However the original record may just be garbage, so
* use some sensible value when they cannot be retrieved.
*/
seq_no = m->sequence_number;
usn = *(u16*)((u8*)m + le16_to_cpu(m->usa_ofs));
if (le16_to_cpu(m->usa_ofs) <= (NTFS_BLOCK_SIZE - 2))
usn = *(le16*)((u8*)m + (le16_to_cpu(m->usa_ofs) & -2));
else
usn = const_cpu_to_le16(1);
if (ntfs_mft_record_layout(vol, bit, m)) {
ntfs_log_error("Failed to re-format mft record.\n");
free(m);
goto undo_mftbmp_alloc;
}
if (le16_to_cpu(seq_no))
if (seq_no)
m->sequence_number = seq_no;
seq_no = le16_to_cpu(usn);
if (seq_no && seq_no != 0xffff)
*(u16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = usn;
seq_no = usn;
if (seq_no && seq_no != const_cpu_to_le16(0xffff))
*(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = usn;
/* Set the mft record itself in use. */
m->flags |= MFT_RECORD_IN_USE;
/* Now need to open an ntfs inode for the mft record. */
@ -1472,10 +1597,10 @@ found_free_rec:
ntfs_inode_mark_dirty(ni);
/* Initialize time, allocated and data size in ntfs_inode struct. */
ni->data_size = ni->allocated_size = 0;
ni->flags = 0;
ni->flags = const_cpu_to_le32(0);
ni->creation_time = ni->last_data_change_time =
ni->last_mft_change_time =
ni->last_access_time = time(NULL);
ni->last_access_time = ntfs_current_time();
/* Update the default mft allocation position if it was used. */
if (!base_ni)
vol->mft_data_pos = bit + 1;
@ -1521,8 +1646,9 @@ err_out:
* @base_ni is NULL we start where we last stopped and we perform wrap around
* when we reach the end. Note, we do not try to allocate mft records below
* number 24 because numbers 0 to 15 are the defined system files anyway and 16
* to 24 are special in that they are used for storing extension mft records
* for the $DATA attribute of $MFT. This is required to avoid the possibility
* to 24 are used for storing extension mft records or used by chkdsk to store
* its log. However the record number 15 is dedicated to the first extent to
* the $DATA attribute of $MFT. This is required to avoid the possibility
* of creating a run list with a circular dependence which once written to disk
* can never be read in again. Windows will only use records 16 to 24 for
* normal files if the volume is completely out of space. We never use them
@ -1588,7 +1714,9 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, ntfs_inode *base_ni)
MFT_RECORD *m;
ntfs_inode *ni = NULL;
int err;
u16 seq_no, usn;
u32 usa_ofs;
le16 seq_no, usn;
BOOL oldwarn;
if (base_ni)
ntfs_log_enter("Entering (allocating an extent mft record for "
@ -1602,7 +1730,7 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, ntfs_inode *base_ni)
}
if (ntfs_is_mft(base_ni)) {
ni = ntfs_mft_rec_alloc(vol);
ni = ntfs_mft_rec_alloc(vol, FALSE);
goto out;
}
@ -1647,6 +1775,7 @@ retry:
(long long)mftbmp_na->initialized_size);
if (mftbmp_na->initialized_size + 8 > mftbmp_na->allocated_size) {
const s64 old_allocated_size = mftbmp_na->allocated_size;
int ret = ntfs_mft_bitmap_extend_allocation(vol);
if (ret == STATUS_ERROR)
@ -1663,6 +1792,9 @@ retry:
(long long)mftbmp_na->allocated_size,
(long long)mftbmp_na->data_size,
(long long)mftbmp_na->initialized_size);
vol->free_mft_records +=
(mftbmp_na->allocated_size - old_allocated_size) << 3;
}
/*
* We now have sufficient allocated space, extend the initialized_size
@ -1702,10 +1834,22 @@ found_free_rec:
if (!m)
goto undo_mftbmp_alloc;
/*
* As this is allocating a new record, do not expect it to have
* been initialized previously, so do not warn over bad fixups
* (hence avoid warn flooding when an NTFS partition has been wiped).
*/
oldwarn = !NVolNoFixupWarn(vol);
NVolSetNoFixupWarn(vol);
if (ntfs_mft_record_read(vol, bit, m)) {
if (oldwarn)
NVolClearNoFixupWarn(vol);
free(m);
goto undo_mftbmp_alloc;
}
if (oldwarn)
NVolClearNoFixupWarn(vol);
/* Sanity check that the mft record is really not in use. */
if (ntfs_is_file_record(m->magic) && (m->flags & MFT_RECORD_IN_USE)) {
ntfs_log_error("Inode %lld is used but it wasn't marked in "
@ -1714,17 +1858,26 @@ found_free_rec:
goto retry;
}
seq_no = m->sequence_number;
usn = *(u16*)((u8*)m + le16_to_cpu(m->usa_ofs));
/*
* As ntfs_mft_record_read() returns what has been read
* even when the fixups have been found bad, we have to
* check where we fetch the initial usn from.
*/
usa_ofs = le16_to_cpu(m->usa_ofs);
if (!(usa_ofs & 1) && (usa_ofs < NTFS_BLOCK_SIZE)) {
usn = *(le16*)((u8*)m + usa_ofs);
} else
usn = const_cpu_to_le16(1);
if (ntfs_mft_record_layout(vol, bit, m)) {
ntfs_log_error("Failed to re-format mft record.\n");
free(m);
goto undo_mftbmp_alloc;
}
if (le16_to_cpu(seq_no))
if (seq_no)
m->sequence_number = seq_no;
seq_no = le16_to_cpu(usn);
if (seq_no && seq_no != 0xffff)
*(u16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = usn;
seq_no = usn;
if (seq_no && seq_no != const_cpu_to_le16(0xffff))
*(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = usn;
/* Set the mft record itself in use. */
m->flags |= MFT_RECORD_IN_USE;
/* Now need to open an ntfs inode for the mft record. */
@ -1774,10 +1927,10 @@ found_free_rec:
ntfs_inode_mark_dirty(ni);
/* Initialize time, allocated and data size in ntfs_inode struct. */
ni->data_size = ni->allocated_size = 0;
ni->flags = 0;
ni->flags = const_cpu_to_le32(0);
ni->creation_time = ni->last_data_change_time =
ni->last_mft_change_time =
ni->last_access_time = time(NULL);
ni->last_access_time = ntfs_current_time();
/* Update the default mft allocation position if it was used. */
if (!base_ni)
vol->mft_data_pos = bit + 1;
@ -1816,7 +1969,8 @@ int ntfs_mft_record_free(ntfs_volume *vol, ntfs_inode *ni)
{
u64 mft_no;
int err;
u16 seq_no, old_seq_no;
u16 seq_no;
le16 old_seq_no;
ntfs_log_trace("Entering for inode 0x%llx.\n", (long long) ni->mft_no);
@ -1856,7 +2010,11 @@ int ntfs_mft_record_free(ntfs_volume *vol, ntfs_inode *ni)
}
/* Throw away the now freed inode. */
#if CACHE_NIDATA_SIZE
if (!ntfs_inode_real_close(ni)) {
#else
if (!ntfs_inode_close(ni)) {
#endif
vol->free_mft_records++;
return 0;
}
@ -1883,13 +2041,14 @@ sync_rollback:
*/
int ntfs_mft_usn_dec(MFT_RECORD *mrec)
{
u16 usn, *usnp;
u16 usn;
le16 *usnp;
if (!mrec) {
errno = EINVAL;
return -1;
}
usnp = (u16 *)((char *)mrec + le16_to_cpu(mrec->usa_ofs));
usnp = (le16*)((char*)mrec + le16_to_cpu(mrec->usa_ofs));
usn = le16_to_cpup(usnp);
if (usn-- <= 1)
usn = 0xfffe;

View File

@ -1,3 +1,25 @@
/**
* misc.c : miscellaneous :
* - dealing with errors in memory allocation
*
* Copyright (c) 2008 Jean-Pierre Andre
*
* 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
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -5,7 +27,11 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "types.h"
#include "misc.h"
#include "logging.h"
@ -34,3 +60,18 @@ void *ntfs_malloc(size_t size)
return p;
}
void *ntfs_realloc(void *ptr, size_t size)
{
void *p;
p = realloc(ptr, size);
if (!p)
ntfs_log_perror("Failed to realloc %lld bytes",
(long long)size);
return p;
}
void ntfs_free(void *p)
{
free(p);
}

View File

@ -31,6 +31,21 @@
#include "mst.h"
#include "logging.h"
/*
* Basic validation of a NTFS multi-sector record. The record size must be a
* multiple of the logical sector size; and the update sequence array must be
* properly aligned, of the expected length, and must end before the last le16
* in the first logical sector.
*/
static BOOL
is_valid_record(u32 size, u16 usa_ofs, u16 usa_count)
{
return size % NTFS_BLOCK_SIZE == 0 &&
usa_ofs % 2 == 0 &&
usa_count == 1 + (size / NTFS_BLOCK_SIZE) &&
usa_ofs + ((u32)usa_count * 2) <= NTFS_BLOCK_SIZE - 2;
}
/**
* ntfs_mst_post_read_fixup - deprotect multi sector transfer protected data
* @b: pointer to the data to deprotect
@ -47,7 +62,8 @@
* EIO Multi sector transfer error was detected. Magic of the NTFS
* record in @b will have been set to "BAAD".
*/
int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size)
int ntfs_mst_post_read_fixup_warn(NTFS_RECORD *b, const u32 size,
BOOL warn)
{
u16 usa_ofs, usa_count, usn;
u16 *usa_pos, *data_pos;
@ -56,16 +72,18 @@ int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size)
/* Setup the variables. */
usa_ofs = le16_to_cpu(b->usa_ofs);
/* Decrement usa_count to get number of fixups. */
usa_count = le16_to_cpu(b->usa_count) - 1;
/* Size and alignment checks. */
if (size & (NTFS_BLOCK_SIZE - 1) || usa_ofs & 1 ||
(u32)(usa_ofs + (usa_count * 2)) > size ||
(size >> NTFS_BLOCK_SIZE_BITS) != usa_count) {
usa_count = le16_to_cpu(b->usa_count);
if (!is_valid_record(size, usa_ofs, usa_count)) {
errno = EINVAL;
ntfs_log_perror("%s: magic: 0x%08x size: %d usa_ofs: %d "
"usa_count: %d", __FUNCTION__, *(le32 *)b,
size, usa_ofs, usa_count);
if (warn) {
ntfs_log_perror("%s: magic: 0x%08lx size: %ld "
" usa_ofs: %d usa_count: %u",
__FUNCTION__,
(long)le32_to_cpu(*(le32 *)b),
(long)size, (int)usa_ofs,
(unsigned int)usa_count);
}
return -1;
}
/* Position of usn in update sequence array. */
@ -85,7 +103,7 @@ int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size)
/*
* Check for incomplete multi sector transfer(s).
*/
while (usa_count--) {
while (--usa_count) {
if (*data_pos != usn) {
/*
* Incomplete multi sector transfer detected! )-:
@ -95,7 +113,7 @@ int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size)
errno = EIO;
ntfs_log_perror("Incomplete multi-sector transfer: "
"magic: 0x%08x size: %d usa_ofs: %d usa_count:"
" %d data: %d usn: %d", *(le32 *)b, size,
" %d data: %d usn: %d", le32_to_cpu(*(le32 *)b), size,
usa_ofs, usa_count, *data_pos, usn);
b->magic = magic_BAAD;
return -1;
@ -103,10 +121,10 @@ int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size)
data_pos += NTFS_BLOCK_SIZE/sizeof(u16);
}
/* Re-setup the variables. */
usa_count = le16_to_cpu(b->usa_count) - 1;
usa_count = le16_to_cpu(b->usa_count);
data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1;
/* Fixup all sectors. */
while (usa_count--) {
while (--usa_count) {
/*
* Increment position in usa and restore original data from
* the usa into the data buffer.
@ -118,6 +136,16 @@ int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size)
return 0;
}
/*
* Deprotect multi sector transfer protected data
* with a warning if an error is found.
*/
int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size)
{
return (ntfs_mst_post_read_fixup_warn(b,size,TRUE));
}
/**
* ntfs_mst_pre_write_fixup - apply multi sector transfer protection
* @b: pointer to the data to protect
@ -141,7 +169,8 @@ int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size)
int ntfs_mst_pre_write_fixup(NTFS_RECORD *b, const u32 size)
{
u16 usa_ofs, usa_count, usn;
u16 *usa_pos, *data_pos;
le16 le_usn;
le16 *usa_pos, *data_pos;
ntfs_log_trace("Entering\n");
@ -154,18 +183,15 @@ int ntfs_mst_pre_write_fixup(NTFS_RECORD *b, const u32 size)
}
/* Setup the variables. */
usa_ofs = le16_to_cpu(b->usa_ofs);
/* Decrement usa_count to get number of fixups. */
usa_count = le16_to_cpu(b->usa_count) - 1;
/* Size and alignment checks. */
if (size & (NTFS_BLOCK_SIZE - 1) || usa_ofs & 1 ||
(u32)(usa_ofs + (usa_count * 2)) > size ||
(size >> NTFS_BLOCK_SIZE_BITS) != usa_count) {
usa_count = le16_to_cpu(b->usa_count);
if (!is_valid_record(size, usa_ofs, usa_count)) {
errno = EINVAL;
ntfs_log_perror("%s", __FUNCTION__);
return -1;
}
/* Position of usn in update sequence array. */
usa_pos = (u16*)((u8*)b + usa_ofs);
usa_pos = (le16*)((u8*)b + usa_ofs);
/*
* Cyclically increment the update sequence number
* (skipping 0 and -1, i.e. 0xffff).
@ -173,21 +199,21 @@ int ntfs_mst_pre_write_fixup(NTFS_RECORD *b, const u32 size)
usn = le16_to_cpup(usa_pos) + 1;
if (usn == 0xffff || !usn)
usn = 1;
usn = cpu_to_le16(usn);
*usa_pos = usn;
/* Position in data of first u16 that needs fixing up. */
data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1;
le_usn = cpu_to_le16(usn);
*usa_pos = le_usn;
/* Position in data of first le16 that needs fixing up. */
data_pos = (le16*)b + NTFS_BLOCK_SIZE/sizeof(le16) - 1;
/* Fixup all sectors. */
while (usa_count--) {
while (--usa_count) {
/*
* Increment the position in the usa and save the
* original data from the data buffer into the usa.
*/
*(++usa_pos) = *data_pos;
/* Apply fixup to data. */
*data_pos = usn;
*data_pos = le_usn;
/* Increment position in data as well. */
data_pos += NTFS_BLOCK_SIZE/sizeof(u16);
data_pos += NTFS_BLOCK_SIZE/sizeof(le16);
}
return 0;
}
@ -206,7 +232,7 @@ void ntfs_mst_post_write_fixup(NTFS_RECORD *b)
u16 *usa_pos, *data_pos;
u16 usa_ofs = le16_to_cpu(b->usa_ofs);
u16 usa_count = le16_to_cpu(b->usa_count) - 1;
u16 usa_count = le16_to_cpu(b->usa_count);
ntfs_log_trace("Entering\n");
@ -217,7 +243,7 @@ void ntfs_mst_post_write_fixup(NTFS_RECORD *b)
data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1;
/* Fixup all sectors. */
while (usa_count--) {
while (--usa_count) {
/*
* Increment position in usa and restore original data from
* the usa into the data buffer.

View File

@ -0,0 +1,636 @@
/**
* object_id.c - Processing of object ids
*
* This module is part of ntfs-3g library
*
* Copyright (c) 2009-2019 Jean-Pierre Andre
*
* 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
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif
#include "compat.h"
#include "types.h"
#include "debug.h"
#include "attrib.h"
#include "inode.h"
#include "dir.h"
#include "volume.h"
#include "mft.h"
#include "index.h"
#include "lcnalloc.h"
#include "object_id.h"
#include "logging.h"
#include "misc.h"
#include "xattrs.h"
/*
* Endianness considerations
*
* According to RFC 4122, GUIDs should be printed with the most
* significant byte first, and the six fields be compared individually
* for ordering. RFC 4122 does not define the internal representation.
*
* Windows apparently stores the first three fields in little endian
* order, and the last two fields in big endian order.
*
* Here we always copy disk images with no endianness change,
* and, for indexing, GUIDs are compared as if they were a sequence
* of four little-endian unsigned 32 bit integers (as Windows
* does it that way.)
*
* --------------------- begin from RFC 4122 ----------------------
* Consider each field of the UUID to be an unsigned integer as shown
* in the table in section Section 4.1.2. Then, to compare a pair of
* UUIDs, arithmetically compare the corresponding fields from each
* UUID in order of significance and according to their data type.
* Two UUIDs are equal if and only if all the corresponding fields
* are equal.
*
* UUIDs, as defined in this document, can also be ordered
* lexicographically. For a pair of UUIDs, the first one follows the
* second if the most significant field in which the UUIDs differ is
* greater for the first UUID. The second precedes the first if the
* most significant field in which the UUIDs differ is greater for
* the second UUID.
*
* The fields are encoded as 16 octets, with the sizes and order of the
* fields defined above, and with each field encoded with the Most
* Significant Byte first (known as network byte order). Note that the
* field names, particularly for multiplexed fields, follow historical
* practice.
*
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | time_low |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | time_mid | time_hi_and_version |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |clk_seq_hi_res | clk_seq_low | node (0-1) |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | node (2-5) |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* ---------------------- end from RFC 4122 -----------------------
*/
typedef struct {
union {
/* alignment may be needed to evaluate collations */
u32 alignment;
GUID guid;
} object_id;
} OBJECT_ID_INDEX_KEY;
typedef struct {
le64 file_id;
GUID birth_volume_id;
GUID birth_object_id;
GUID domain_id;
} OBJECT_ID_INDEX_DATA; // known as OBJ_ID_INDEX_DATA
struct OBJECT_ID_INDEX { /* index entry in $Extend/$ObjId */
INDEX_ENTRY_HEADER header;
OBJECT_ID_INDEX_KEY key;
OBJECT_ID_INDEX_DATA data;
} ;
static ntfschar objid_index_name[] = { const_cpu_to_le16('$'),
const_cpu_to_le16('O') };
/*
* Set the index for a new object id
*
* Returns 0 if success
* -1 if failure, explained by errno
*/
static int set_object_id_index(ntfs_inode *ni, ntfs_index_context *xo,
const OBJECT_ID_ATTR *object_id)
{
struct OBJECT_ID_INDEX indx;
u64 file_id_cpu;
le64 file_id;
le16 seqn;
seqn = ni->mrec->sequence_number;
file_id_cpu = MK_MREF(ni->mft_no,le16_to_cpu(seqn));
file_id = cpu_to_le64(file_id_cpu);
indx.header.data_offset = const_cpu_to_le16(
sizeof(INDEX_ENTRY_HEADER)
+ sizeof(OBJECT_ID_INDEX_KEY));
indx.header.data_length = const_cpu_to_le16(
sizeof(OBJECT_ID_INDEX_DATA));
indx.header.reservedV = const_cpu_to_le32(0);
indx.header.length = const_cpu_to_le16(
sizeof(struct OBJECT_ID_INDEX));
indx.header.key_length = const_cpu_to_le16(
sizeof(OBJECT_ID_INDEX_KEY));
indx.header.flags = const_cpu_to_le16(0);
indx.header.reserved = const_cpu_to_le16(0);
memcpy(&indx.key.object_id,object_id,sizeof(GUID));
indx.data.file_id = file_id;
memcpy(&indx.data.birth_volume_id,
&object_id->birth_volume_id,sizeof(GUID));
memcpy(&indx.data.birth_object_id,
&object_id->birth_object_id,sizeof(GUID));
memcpy(&indx.data.domain_id,
&object_id->domain_id,sizeof(GUID));
ntfs_index_ctx_reinit(xo);
return (ntfs_ie_add(xo,(INDEX_ENTRY*)&indx));
}
/*
* Open the $Extend/$ObjId file and its index
*
* Return the index context if opened
* or NULL if an error occurred (errno tells why)
*
* The index has to be freed and inode closed when not needed any more.
*/
static ntfs_index_context *open_object_id_index(ntfs_volume *vol)
{
u64 inum;
ntfs_inode *ni;
ntfs_inode *dir_ni;
ntfs_index_context *xo;
/* do not use path_name_to inode - could reopen root */
dir_ni = ntfs_inode_open(vol, FILE_Extend);
ni = (ntfs_inode*)NULL;
if (dir_ni) {
inum = ntfs_inode_lookup_by_mbsname(dir_ni,"$ObjId");
if (inum != (u64)-1)
ni = ntfs_inode_open(vol, inum);
ntfs_inode_close(dir_ni);
}
if (ni) {
xo = ntfs_index_ctx_get(ni, objid_index_name, 2);
if (!xo) {
ntfs_inode_close(ni);
}
} else
xo = (ntfs_index_context*)NULL;
return (xo);
}
/*
* Merge object_id data stored in the index into
* a full object_id struct.
*
* returns 0 if merging successful
* -1 if no data could be merged. This is generally not an error
*/
static int merge_index_data(ntfs_inode *ni,
const OBJECT_ID_ATTR *objectid_attr,
OBJECT_ID_ATTR *full_objectid)
{
OBJECT_ID_INDEX_KEY key;
struct OBJECT_ID_INDEX *entry;
ntfs_index_context *xo;
ntfs_inode *xoni;
int res;
res = -1;
xo = open_object_id_index(ni->vol);
if (xo) {
memcpy(&key.object_id,objectid_attr,sizeof(GUID));
if (!ntfs_index_lookup(&key,
sizeof(OBJECT_ID_INDEX_KEY), xo)) {
entry = (struct OBJECT_ID_INDEX*)xo->entry;
/* make sure inode numbers match */
if (entry
&& (MREF(le64_to_cpu(entry->data.file_id))
== ni->mft_no)) {
memcpy(&full_objectid->birth_volume_id,
&entry->data.birth_volume_id,
sizeof(GUID));
memcpy(&full_objectid->birth_object_id,
&entry->data.birth_object_id,
sizeof(GUID));
memcpy(&full_objectid->domain_id,
&entry->data.domain_id,
sizeof(GUID));
res = 0;
}
}
xoni = xo->ni;
ntfs_index_ctx_put(xo);
ntfs_inode_close(xoni);
}
return (res);
}
/*
* Remove an object id index entry if attribute present
*
* Returns the size of existing object id
* (the existing object_d is returned)
* -1 if failure, explained by errno
*/
static int remove_object_id_index(ntfs_attr *na, ntfs_index_context *xo,
OBJECT_ID_ATTR *old_attr)
{
OBJECT_ID_INDEX_KEY key;
struct OBJECT_ID_INDEX *entry;
s64 size;
int ret;
ret = na->data_size;
if (ret) {
/* read the existing object id attribute */
size = ntfs_attr_pread(na, 0, sizeof(GUID), old_attr);
if (size >= (s64)sizeof(GUID)) {
memcpy(&key.object_id,
&old_attr->object_id,sizeof(GUID));
if (!ntfs_index_lookup(&key,
sizeof(OBJECT_ID_INDEX_KEY), xo)) {
entry = (struct OBJECT_ID_INDEX*)xo->entry;
memcpy(&old_attr->birth_volume_id,
&entry->data.birth_volume_id,
sizeof(GUID));
memcpy(&old_attr->birth_object_id,
&entry->data.birth_object_id,
sizeof(GUID));
memcpy(&old_attr->domain_id,
&entry->data.domain_id,
sizeof(GUID));
if (ntfs_index_rm(xo))
ret = -1;
}
} else {
ret = -1;
errno = ENODATA;
}
}
return (ret);
}
/*
* Update the object id and index
*
* The object_id attribute should have been created and the
* non-duplication of the GUID should have been checked before.
*
* Returns 0 if success
* -1 if failure, explained by errno
* If could not remove the existing index, nothing is done,
* If could not write the new data, no index entry is inserted
* If failed to insert the index, data is removed
*/
static int update_object_id(ntfs_inode *ni, ntfs_index_context *xo,
const OBJECT_ID_ATTR *value, size_t size)
{
OBJECT_ID_ATTR old_attr;
ntfs_attr *na;
int oldsize;
int written;
int res;
res = 0;
na = ntfs_attr_open(ni, AT_OBJECT_ID, AT_UNNAMED, 0);
if (na) {
memset(&old_attr, 0, sizeof(OBJECT_ID_ATTR));
/* remove the existing index entry */
oldsize = remove_object_id_index(na,xo,&old_attr);
if (oldsize < 0)
res = -1;
else {
/* resize attribute */
res = ntfs_attr_truncate(na, (s64)sizeof(GUID));
/* write the object_id in attribute */
if (!res && value) {
written = (int)ntfs_attr_pwrite(na,
(s64)0, (s64)sizeof(GUID),
&value->object_id);
if (written != (s64)sizeof(GUID)) {
ntfs_log_error("Failed to update "
"object id\n");
errno = EIO;
res = -1;
}
}
/* overwrite index data with new value */
memcpy(&old_attr, value,
(size < sizeof(OBJECT_ID_ATTR)
? size : sizeof(OBJECT_ID_ATTR)));
if (!res
&& set_object_id_index(ni,xo,&old_attr)) {
/*
* If cannot index, try to remove the object
* id and log the error. There will be an
* inconsistency if removal fails.
*/
ntfs_attr_rm(na);
ntfs_log_error("Failed to index object id."
" Possible corruption.\n");
}
}
ntfs_attr_close(na);
NInoSetDirty(ni);
} else
res = -1;
return (res);
}
/*
* Add a (dummy) object id to an inode if it does not exist
*
* returns 0 if attribute was inserted (or already present)
* -1 if adding failed (explained by errno)
*/
static int add_object_id(ntfs_inode *ni, int flags)
{
int res;
u8 dummy;
res = -1; /* default return */
if (!ntfs_attr_exist(ni,AT_OBJECT_ID, AT_UNNAMED,0)) {
if (!(flags & XATTR_REPLACE)) {
/*
* no object id attribute : add one,
* apparently, this does not feed the new value in
* Note : NTFS version must be >= 3
*/
if (ni->vol->major_ver >= 3) {
res = ntfs_attr_add(ni, AT_OBJECT_ID,
AT_UNNAMED, 0, &dummy, (s64)0);
NInoSetDirty(ni);
} else
errno = EOPNOTSUPP;
} else
errno = ENODATA;
} else {
if (flags & XATTR_CREATE)
errno = EEXIST;
else
res = 0;
}
return (res);
}
/*
* Delete an object_id index entry
*
* Returns 0 if success
* -1 if failure, explained by errno
*/
int ntfs_delete_object_id_index(ntfs_inode *ni)
{
ntfs_index_context *xo;
ntfs_inode *xoni;
ntfs_attr *na;
OBJECT_ID_ATTR old_attr;
int res;
res = 0;
na = ntfs_attr_open(ni, AT_OBJECT_ID, AT_UNNAMED, 0);
if (na) {
/*
* read the existing object id
* and un-index it
*/
xo = open_object_id_index(ni->vol);
if (xo) {
if (remove_object_id_index(na,xo,&old_attr) < 0)
res = -1;
xoni = xo->ni;
ntfs_index_entry_mark_dirty(xo);
NInoSetDirty(xoni);
ntfs_index_ctx_put(xo);
ntfs_inode_close(xoni);
}
ntfs_attr_close(na);
}
return (res);
}
/*
* Get the ntfs object id into an extended attribute
*
* If present, the object_id from the attribute and the GUIDs
* from the index are returned (formatted as OBJECT_ID_ATTR)
*
* Returns the global size (can be 0, 16 or 64)
* and the buffer is updated if it is long enough
*/
int ntfs_get_ntfs_object_id(ntfs_inode *ni, char *value, size_t size)
{
OBJECT_ID_ATTR full_objectid;
OBJECT_ID_ATTR *objectid_attr;
s64 attr_size;
int full_size;
full_size = 0; /* default to no data and some error to be defined */
if (ni) {
objectid_attr = (OBJECT_ID_ATTR*)ntfs_attr_readall(ni,
AT_OBJECT_ID,(ntfschar*)NULL, 0, &attr_size);
if (objectid_attr) {
/* restrict to only GUID present in attr */
if (attr_size == sizeof(GUID)) {
memcpy(&full_objectid.object_id,
objectid_attr,sizeof(GUID));
full_size = sizeof(GUID);
/* get data from index, if any */
if (!merge_index_data(ni, objectid_attr,
&full_objectid)) {
full_size = sizeof(OBJECT_ID_ATTR);
}
if (full_size <= (s64)size) {
if (value)
memcpy(value,&full_objectid,
full_size);
else
errno = EINVAL;
}
} else {
/* unexpected size, better return unsupported */
errno = EOPNOTSUPP;
full_size = 0;
}
free(objectid_attr);
} else
errno = ENODATA;
}
return (full_size ? (int)full_size : -errno);
}
/*
* Set the object id from an extended attribute
*
* The first 16 bytes are the new object id, they can be followed
* by the birth volume id, the birth object id and the domain id.
* If they are not present, their previous value is kept.
* Only the object id is stored into the attribute, all the fields
* are stored into the index.
*
* Returns 0, or -1 if there is a problem
*/
int ntfs_set_ntfs_object_id(ntfs_inode *ni,
const char *value, size_t size, int flags)
{
OBJECT_ID_INDEX_KEY key;
ntfs_inode *xoni;
ntfs_index_context *xo;
int res;
res = 0;
if (ni && value && (size >= sizeof(GUID))) {
xo = open_object_id_index(ni->vol);
if (xo) {
/* make sure the GUID was not used elsewhere */
memcpy(&key.object_id, value, sizeof(GUID));
if ((ntfs_index_lookup(&key,
sizeof(OBJECT_ID_INDEX_KEY), xo))
|| (MREF_LE(((struct OBJECT_ID_INDEX*)xo->entry)
->data.file_id) == ni->mft_no)) {
ntfs_index_ctx_reinit(xo);
res = add_object_id(ni, flags);
if (!res) {
/* update value and index */
res = update_object_id(ni,xo,
(const OBJECT_ID_ATTR*)value,
size);
}
} else {
/* GUID is present elsewhere */
res = -1;
errno = EEXIST;
}
xoni = xo->ni;
ntfs_index_entry_mark_dirty(xo);
NInoSetDirty(xoni);
ntfs_index_ctx_put(xo);
ntfs_inode_close(xoni);
} else {
res = -1;
}
} else {
errno = EINVAL;
res = -1;
}
return (res ? -1 : 0);
}
/*
* Remove the object id
*
* Returns 0, or -1 if there is a problem
*/
int ntfs_remove_ntfs_object_id(ntfs_inode *ni)
{
int res;
int olderrno;
ntfs_attr *na;
ntfs_inode *xoni;
ntfs_index_context *xo;
int oldsize;
OBJECT_ID_ATTR old_attr;
res = 0;
if (ni) {
/*
* open and delete the object id
*/
na = ntfs_attr_open(ni, AT_OBJECT_ID,
AT_UNNAMED,0);
if (na) {
/* first remove index (old object id needed) */
xo = open_object_id_index(ni->vol);
if (xo) {
oldsize = remove_object_id_index(na,xo,
&old_attr);
if (oldsize < 0) {
res = -1;
} else {
/* now remove attribute */
res = ntfs_attr_rm(na);
if (res
&& (oldsize > (int)sizeof(GUID))) {
/*
* If we could not remove the
* attribute, try to restore the
* index and log the error. There
* will be an inconsistency if
* the reindexing fails.
*/
set_object_id_index(ni, xo,
&old_attr);
ntfs_log_error(
"Failed to remove object id."
" Possible corruption.\n");
}
}
xoni = xo->ni;
ntfs_index_entry_mark_dirty(xo);
NInoSetDirty(xoni);
ntfs_index_ctx_put(xo);
ntfs_inode_close(xoni);
}
olderrno = errno;
ntfs_attr_close(na);
/* avoid errno pollution */
if (errno == ENOENT)
errno = olderrno;
} else {
errno = ENODATA;
res = -1;
}
NInoSetDirty(ni);
} else {
errno = EINVAL;
res = -1;
}
return (res ? -1 : 0);
}

View File

@ -0,0 +1,103 @@
/*
* realpath.c - realpath() aware of device mapper
* Originated from the util-linux project.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include "param.h"
#include "realpath.h"
/* If there is no realpath() on the system, provide a dummy one. */
#ifndef HAVE_REALPATH
char *ntfs_realpath(const char *path, char *resolved_path)
{
strncpy(resolved_path, path, PATH_MAX);
resolved_path[PATH_MAX] = '\0';
return resolved_path;
}
#endif
#ifdef linux
/*
* Converts private "dm-N" names to "/dev/mapper/<name>"
*
* Since 2.6.29 (patch 784aae735d9b0bba3f8b9faef4c8b30df3bf0128) kernel sysfs
* provides the real DM device names in /sys/block/<ptname>/dm/name
*/
static char *
canonicalize_dm_name(const char *ptname, char *canonical)
{
FILE *f;
size_t sz;
char name[MAPPERNAMELTH + 16];
char path[sizeof(name) + 16];
char *res = NULL;
snprintf(path, sizeof(path), "/sys/block/%s/dm/name", ptname);
if (!(f = fopen(path, "r")))
return NULL;
/* read "<name>\n" from sysfs */
if (fgets(name, sizeof(name), f) && (sz = strlen(name)) > 1) {
name[sz - 1] = '\0';
snprintf(path, sizeof(path), "/dev/mapper/%s", name);
res = strcpy(canonical, path);
}
fclose(f);
return res;
}
/*
* Canonicalize a device path
*
* Workaround from "basinilya" for fixing device mapper paths.
*
* Background (Phillip Susi, 2011-04-09)
* - ntfs-3g canonicalizes the device name so that if you mount with
* /dev/mapper/foo, the device name listed in mtab is /dev/dm-n,
* so you can not umount /dev/mapper/foo
* - umount won't even recognize and translate /dev/dm-n to the mount
* point, apparently because of the '-' involved. Editing mtab and
* removing the '-' allows you to umount /dev/dmn successfully.
*
* This code restores the devmapper name after canonicalization,
* until a proper fix is implemented.
*/
char *ntfs_realpath_canonicalize(const char *path, char *canonical)
{
char *p;
if (path == NULL)
return NULL;
if (!ntfs_realpath(path, canonical))
return NULL;
p = strrchr(canonical, '/');
if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
p = canonicalize_dm_name(p+1, canonical);
if (p)
return p;
}
return canonical;
}
#endif

1447
libntfs-3g/reparse.c 100644

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
* Copyright (c) 2002-2005 Richard Russon
* Copyright (c) 2002-2008 Szabolcs Szakacsits
* Copyright (c) 2004 Yura Pakhuchiy
* Copyright (c) 2007-2022 Jean-Pierre Andre
*
* 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
@ -110,6 +111,43 @@ static runlist_element *ntfs_rl_realloc(runlist_element *rl, int old_size,
return realloc(rl, new_size);
}
/*
* Extend a runlist by some entry count
* The runlist may have to be reallocated
*
* Returns the reallocated runlist
* or NULL if reallocation was not possible (with errno set)
* the runlist is left unchanged if the reallocation fails
*/
runlist_element *ntfs_rl_extend(ntfs_attr *na, runlist_element *rl,
int more_entries)
{
runlist_element *newrl;
int last;
int irl;
if (na->rl && rl) {
irl = (int)(rl - na->rl);
last = irl;
while (na->rl[last].length)
last++;
newrl = ntfs_rl_realloc(na->rl,last+1,last+more_entries+1);
if (!newrl) {
errno = ENOMEM;
rl = (runlist_element*)NULL;
} else {
na->rl = newrl;
rl = &newrl[irl];
}
} else {
ntfs_log_error("Cannot extend unmapped runlist");
errno = EIO;
rl = (runlist_element*)NULL;
}
return (rl);
}
/**
* ntfs_rl_are_mergeable - test if two runlists can be joined together
* @dst: original runlist
@ -742,7 +780,7 @@ runlist_element *ntfs_runlists_merge(runlist_element *drl,
* two into one, if that is possible (we check for overlap and discard the new
* runlist if overlap present before returning NULL, with errno = ERANGE).
*/
runlist_element *ntfs_mapping_pairs_decompress_i(const ntfs_volume *vol,
static runlist_element *ntfs_mapping_pairs_decompress_i(const ntfs_volume *vol,
const ATTR_RECORD *attr, runlist_element *old_rl)
{
VCN vcn; /* Current vcn. */
@ -880,11 +918,18 @@ runlist_element *ntfs_mapping_pairs_decompress_i(const ntfs_volume *vol,
"array.\n");
goto err_out;
}
/* chkdsk accepts zero-sized runs only for holes */
if ((lcn != (LCN)-1) && !rl[rlpos].length) {
ntfs_log_debug(
"Invalid zero-sized data run.\n");
goto err_out;
}
/* Enter the current lcn into the runlist element. */
rl[rlpos].lcn = lcn;
}
/* Get to the next runlist element. */
rlpos++;
/* Get to the next runlist element, skipping zero-sized holes */
if (rl[rlpos].length)
rlpos++;
/* Increment the buffer position to the next mapping pair. */
buf += (*buf & 0xf) + ((*buf >> 4) & 0xf) + 1;
}
@ -901,40 +946,45 @@ mpa_err:
"attribute.\n");
goto err_out;
}
/* Setup not mapped runlist element if this is the base extent. */
if (!attr->lowest_vcn) {
VCN max_cluster;
max_cluster = ((sle64_to_cpu(attr->allocated_size) +
/*
* If this is the base of runlist (if 'lowest_vcn' is 0), then
* 'allocated_size' is valid, and we can use it to compute the total
* number of clusters across all extents. If the runlist covers all
* clusters, then it fits into a single extent and we can terminate
* the runlist with LCN_NOENT. Otherwise, we must terminate the runlist
* with LCN_RL_NOT_MAPPED and let the caller look for more extents.
*/
if (!attr->lowest_vcn) {
VCN num_clusters;
num_clusters = ((sle64_to_cpu(attr->allocated_size) +
vol->cluster_size - 1) >>
vol->cluster_size_bits) - 1;
/*
* A highest_vcn of zero means this is a single extent
* attribute so simply terminate the runlist with LCN_ENOENT).
*/
if (deltaxcn) {
vol->cluster_size_bits);
if (num_clusters > vcn) {
/*
* If there is a difference between the highest_vcn and
* the highest cluster, the runlist is either corrupt
* or, more likely, there are more extents following
* this one.
* The runlist doesn't cover all the clusters, so there
* must be more extents.
*/
if (deltaxcn < max_cluster) {
ntfs_log_debug("More extents to follow; deltaxcn = "
"0x%llx, max_cluster = 0x%llx\n",
(long long)deltaxcn,
(long long)max_cluster);
rl[rlpos].vcn = vcn;
vcn += rl[rlpos].length = max_cluster - deltaxcn;
rl[rlpos].lcn = (LCN)LCN_RL_NOT_MAPPED;
rlpos++;
} else if (deltaxcn > max_cluster) {
ntfs_log_debug("Corrupt attribute. deltaxcn = "
"0x%llx, max_cluster = 0x%llx\n",
(long long)deltaxcn,
(long long)max_cluster);
goto mpa_err;
}
ntfs_log_debug("More extents to follow; vcn = 0x%llx, "
"num_clusters = 0x%llx\n",
(long long)vcn,
(long long)num_clusters);
rl[rlpos].vcn = vcn;
vcn += rl[rlpos].length = num_clusters - vcn;
rl[rlpos].lcn = (LCN)LCN_RL_NOT_MAPPED;
rlpos++;
} else if (vcn > num_clusters) {
/*
* There are more VCNs in the runlist than expected, so
* the runlist is corrupt.
*/
ntfs_log_error("Corrupt attribute. vcn = 0x%llx, "
"num_clusters = 0x%llx\n",
(long long)vcn,
(long long)num_clusters);
goto mpa_err;
}
rl[rlpos].lcn = (LCN)LCN_ENOENT;
} else /* Not the base extent. There may be more extents to follow. */
@ -944,13 +994,18 @@ mpa_err:
rl[rlpos].vcn = vcn;
rl[rlpos].length = (s64)0;
/* If no existing runlist was specified, we are done. */
if (!old_rl) {
if (!old_rl || !old_rl[0].length) {
ntfs_log_debug("Mapping pairs array successfully decompressed:\n");
ntfs_debug_runlist_dump(rl);
if (old_rl)
free(old_rl);
return rl;
}
/* Now combine the new and old runlists checking for overlaps. */
old_rl = ntfs_runlists_merge(old_rl, rl);
if (rl[0].length)
old_rl = ntfs_runlists_merge(old_rl, rl);
else
free(rl);
if (old_rl)
return old_rl;
err = errno;
@ -1124,8 +1179,9 @@ rl_err_out:
/**
* ntfs_rl_pwrite - scatter write to disk
* @vol: ntfs volume to write to
* @rl: runlist specifying where to write the data to
* @pos: byte position within runlist @rl at which to begin the write
* @rl: runlist entry specifying where to write the data to
* @ofs: offset in file for runlist element indicated in @rl
* @pos: byte position from runlist beginning at which to begin the write
* @count: number of bytes to write
* @b: data buffer to write to disk
*
@ -1144,9 +1200,9 @@ rl_err_out:
* of invalid arguments.
*/
s64 ntfs_rl_pwrite(const ntfs_volume *vol, const runlist_element *rl,
const s64 pos, s64 count, void *b)
s64 ofs, const s64 pos, s64 count, void *b)
{
s64 written, to_write, ofs, total = 0;
s64 written, to_write, total = 0;
int err = EIO;
if (!vol || !rl || pos < 0 || count < 0) {
@ -1159,9 +1215,11 @@ s64 ntfs_rl_pwrite(const ntfs_volume *vol, const runlist_element *rl,
if (!count)
goto out;
/* Seek in @rl to the run containing @pos. */
for (ofs = 0; rl->length && (ofs + (rl->length <<
vol->cluster_size_bits) <= pos); rl++)
while (rl->length && (ofs + (rl->length <<
vol->cluster_size_bits) <= pos)) {
ofs += (rl->length << vol->cluster_size_bits);
rl++;
}
/* Offset in the run at which to begin writing. */
ofs = pos - ofs;
for (total = 0LL; count; rl++, ofs = 0) {
@ -1230,19 +1288,18 @@ errno_set:
*/
int ntfs_get_nr_significant_bytes(const s64 n)
{
s64 l = n;
u64 l;
int i;
s8 j;
i = 0;
do {
l >>= 8;
i++;
} while (l != 0LL && l != -1LL);
j = (n >> 8 * (i - 1)) & 0xff;
/* If the sign bit is wrong, we need an extra byte. */
if ((n < 0LL && j >= 0) || (n > 0LL && j < 0))
i++;
l = (n < 0 ? ~n : n);
i = 1;
if (l >= 128) {
l >>= 7;
do {
i++;
l >>= 8;
} while (l);
}
return i;
}
@ -1267,7 +1324,7 @@ int ntfs_get_nr_significant_bytes(const s64 n)
* EIO - The runlist is corrupt.
*/
int ntfs_get_size_for_mapping_pairs(const ntfs_volume *vol,
const runlist_element *rl, const VCN start_vcn)
const runlist_element *rl, const VCN start_vcn, int max_size)
{
LCN prev_lcn;
int rls;
@ -1326,7 +1383,7 @@ int ntfs_get_size_for_mapping_pairs(const ntfs_volume *vol,
rl++;
}
/* Do the full runs. */
for (; rl->length; rl++) {
for (; rl->length && (rls <= max_size); rl++) {
if (rl->length < 0 || rl->lcn < LCN_HOLE)
goto err_out;
/* Header byte + length. */
@ -1379,28 +1436,18 @@ int ntfs_write_significant_bytes(u8 *dst, const u8 *dst_max, const s64 n)
{
s64 l = n;
int i;
s8 j;
i = 0;
do {
if (dst > dst_max)
goto err_out;
*dst++ = l;
i++;
while ((l > 0x7f) || (l < -0x80)) {
if (dst > dst_max)
goto err_out;
*dst++ = l & 0xffLL;
l >>= 8;
*dst++ = l;
i++;
} while (l != 0LL && l != -1LL);
j = (n >> 8 * (i - 1)) & 0xff;
/* If the sign bit is wrong, we need an extra byte. */
if (n < 0LL && j >= 0) {
if (dst > dst_max)
goto err_out;
i++;
*dst = (u8)-1;
} else if (n > 0LL && j < 0) {
if (dst > dst_max)
goto err_out;
i++;
*dst = 0;
}
return i;
err_out:
@ -1441,7 +1488,7 @@ err_out:
*/
int ntfs_mapping_pairs_build(const ntfs_volume *vol, u8 *dst,
const int dst_len, const runlist_element *rl,
const VCN start_vcn, VCN *const stop_vcn)
const VCN start_vcn, runlist_element const **stop_rl)
{
LCN prev_lcn;
u8 *dst_max, *dst_next;
@ -1453,8 +1500,8 @@ int ntfs_mapping_pairs_build(const ntfs_volume *vol, u8 *dst,
if (!rl) {
if (start_vcn)
goto val_err;
if (stop_vcn)
*stop_vcn = 0;
if (stop_rl)
*stop_rl = rl;
if (dst_len < 1)
goto nospc_err;
goto ok;
@ -1549,8 +1596,8 @@ int ntfs_mapping_pairs_build(const ntfs_volume *vol, u8 *dst,
dst += 1 + len_len + lcn_len;
}
/* Set stop vcn. */
if (stop_vcn)
*stop_vcn = rl->vcn;
if (stop_rl)
*stop_rl = rl;
ok:
/* Add terminator byte. */
*dst = 0;
@ -1558,8 +1605,8 @@ out:
return ret;
size_err:
/* Set stop vcn. */
if (stop_vcn)
*stop_vcn = rl->vcn;
if (stop_rl)
*stop_rl = rl;
/* Add terminator byte. */
*dst = 0;
nospc_err:
@ -1594,11 +1641,15 @@ errno_set:
int ntfs_rl_truncate(runlist **arl, const VCN start_vcn)
{
runlist *rl;
BOOL is_end = FALSE;
/* BOOL is_end = FALSE; */
if (!arl || !*arl) {
errno = EINVAL;
ntfs_log_perror("rl_truncate error: arl: %p *arl: %p", arl, *arl);
if (!arl)
ntfs_log_perror("rl_truncate error: arl: %p", arl);
else
ntfs_log_perror("rl_truncate error:"
" arl: %p *arl: %p", arl, *arl);
return -1;
}
@ -1633,8 +1684,10 @@ int ntfs_rl_truncate(runlist **arl, const VCN start_vcn)
*/
if (rl->length) {
++rl;
/*
if (!rl->length)
is_end = TRUE;
*/
rl->vcn = start_vcn;
rl->length = 0;
}
@ -1642,7 +1695,7 @@ int ntfs_rl_truncate(runlist **arl, const VCN start_vcn)
/**
* Reallocate memory if necessary.
* FIXME: Below code is broken, because runlist allocations must be
* a multiply of 4096. The code caused crashes and corruptions.
* a multiple of 4096. The code caused crashes and corruptions.
*/
/*
if (!is_end) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -53,6 +53,9 @@
#ifdef HAVE_LINUX_FD_H
#include <linux/fd.h>
#endif
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h>
#endif
#include "types.h"
#include "mst.h"
@ -140,8 +143,26 @@ static int ntfs_device_unix_io_open(struct ntfs_device *dev, int flags)
*(int*)dev->d_private = open(dev->d_name, flags);
if (*(int*)dev->d_private == -1) {
err = errno;
/* if permission error and rw, retry read-only */
if ((err == EACCES) && ((flags & O_RDWR) == O_RDWR))
err = EROFS;
goto err_out;
}
#ifdef HAVE_LINUX_FS_H
/* Check whether the device was forced read-only */
if (NDevBlock(dev) && ((flags & O_RDWR) == O_RDWR)) {
int r;
int state;
r = ioctl(DEV_FD(dev), BLKROGET, &state);
if (!r && state) {
err = EROFS;
if (close(DEV_FD(dev)))
err = errno;
goto err_out;
}
}
#endif
if ((flags & O_RDWR) != O_RDWR)
NDevSetReadOnly(dev);
@ -348,8 +369,8 @@ static int ntfs_device_unix_io_stat(struct ntfs_device *dev, struct stat *buf)
*
* Returns:
*/
static int ntfs_device_unix_io_ioctl(struct ntfs_device *dev, int request,
void *argp)
static int ntfs_device_unix_io_ioctl(struct ntfs_device *dev,
unsigned long request, void *argp)
{
return ioctl(DEV_FD(dev), request, argp);
}

View File

@ -4,6 +4,7 @@
* Copyright (c) 2000-2006 Anton Altaparmakov
* Copyright (c) 2002-2009 Szabolcs Szakacsits
* Copyright (c) 2004-2005 Richard Russon
* Copyright (c) 2010 Jean-Pierre Andre
*
* 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
@ -53,6 +54,11 @@
#include <locale.h>
#endif
#if defined(__sun) && defined (__SVR4)
#include <sys/mnttab.h>
#endif
#include "param.h"
#include "compat.h"
#include "volume.h"
#include "attrib.h"
@ -65,10 +71,13 @@
#include "logfile.h"
#include "dir.h"
#include "logging.h"
#include "cache.h"
#include "realpath.h"
#include "misc.h"
#include "security.h"
const char *ntfs_home =
"Ntfs-3g news, support and information: http://ntfs-3g.org\n";
"News, support and information: https://github.com/tuxera/ntfs-3g/\n";
static const char *invalid_ntfs_msg =
"The device '%s' doesn't seem to have a valid NTFS.\n"
@ -85,13 +94,14 @@ static const char *corrupt_volume_msg =
"for more details.\n";
static const char *hibernated_volume_msg =
"The NTFS partition is hibernated. Please resume and shutdown Windows\n"
"properly, or mount the volume read-only with the 'ro' mount option, or\n"
"mount the volume read-write with the 'remove_hiberfile' mount option.\n"
"For example type on the command line:\n"
"\n"
" mount -t ntfs-3g -o remove_hiberfile %s %s\n"
"\n";
"The NTFS partition is in an unsafe state. Please resume and shutdown\n"
"Windows fully (no hibernation or fast restarting), or mount the volume\n"
"read-only with the 'ro' mount option.\n";
static const char *fallback_readonly_msg =
"Falling back to read-only mount because the NTFS partition is in an\n"
"unsafe state. Please resume and shutdown Windows fully (no hibernation\n"
"or fast restarting.)\n";
static const char *unclean_journal_msg =
"Write access is denied because the disk wasn't safely powered\n"
@ -111,7 +121,7 @@ static const char *fakeraid_msg =
static const char *access_denied_msg =
"Please check '%s' and the ntfs-3g binary permissions,\n"
"and the mounting user ID. More explanation is provided at\n"
"http://ntfs-3g.org/support.html#unprivileged\n";
"https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ\n";
/**
* ntfs_volume_alloc - Create an NTFS volume object and initialise it
@ -163,6 +173,9 @@ static int __ntfs_volume_release(ntfs_volume *v)
{
int err = 0;
if (ntfs_close_secure(v))
ntfs_error_set(&err);
if (ntfs_inode_free(&v->vol_ni))
ntfs_error_set(&err);
/*
@ -197,8 +210,10 @@ static int __ntfs_volume_release(ntfs_volume *v)
ntfs_error_set(&err);
}
ntfs_free_lru_caches(v);
free(v->vol_name);
free(v->upcase);
if (v->locase) free(v->locase);
free(v->attrdef);
free(v);
@ -206,15 +221,24 @@ static int __ntfs_volume_release(ntfs_volume *v)
return errno ? -1 : 0;
}
static void ntfs_attr_setup_flag(ntfs_inode *ni)
static int ntfs_attr_setup_flag(ntfs_inode *ni)
{
STANDARD_INFORMATION *si;
s64 lth;
int r;
si = ntfs_attr_readall(ni, AT_STANDARD_INFORMATION, AT_UNNAMED, 0, NULL);
si = (STANDARD_INFORMATION*)ntfs_attr_readall(ni,
AT_STANDARD_INFORMATION, AT_UNNAMED, 0, &lth);
if (si) {
ni->flags = si->file_attributes;
if ((u64)lth >= offsetof(STANDARD_INFORMATION, owner_id))
ni->flags = si->file_attributes;
free(si);
r = 0;
} else {
ntfs_log_error("Failed to get standard information of $MFT\n");
r = -1;
}
return (r);
}
/**
@ -288,16 +312,19 @@ static int ntfs_mft_load(ntfs_volume *vol)
ntfs_log_error("Failed to get value of $MFT/$ATTR_LIST.\n");
goto io_error_exit;
}
if (l != vol->mft_ni->attr_list_size) {
if ((l != vol->mft_ni->attr_list_size)
|| (l < (s64)offsetof(ATTR_LIST_ENTRY, name))) {
ntfs_log_error("Partial read of $MFT/$ATTR_LIST (%lld != "
"%u).\n", (long long)l,
vol->mft_ni->attr_list_size);
"%u or < %d).\n", (long long)l,
vol->mft_ni->attr_list_size,
(int)offsetof(ATTR_LIST_ENTRY, name));
goto io_error_exit;
}
mft_has_no_attr_list:
ntfs_attr_setup_flag(vol->mft_ni);
if (ntfs_attr_setup_flag(vol->mft_ni))
goto error_exit;
/* We now have a fully setup ntfs inode for $MFT in vol->mft_ni. */
@ -340,6 +367,11 @@ mft_has_no_attr_list:
ntfs_log_perror("ntfs_mapping_pairs_decompress() failed");
goto error_exit;
}
/* Make sure $DATA is the MFT itself */
if (nrl->lcn != vol->mft_lcn) {
ntfs_log_perror("The MFT is not self-contained");
goto error_exit;
}
vol->mft_na->rl = nrl;
/* Get the lowest vcn for the next extent. */
@ -369,6 +401,12 @@ mft_has_no_attr_list:
/* Done with the $Mft mft record. */
ntfs_attr_put_search_ctx(ctx);
ctx = NULL;
/* Update the size fields in the inode. */
vol->mft_ni->data_size = vol->mft_na->data_size;
vol->mft_ni->allocated_size = vol->mft_na->allocated_size;
set_nino_flag(vol->mft_ni, KnownSize);
/*
* The volume is now setup so we can use all read access functions.
*/
@ -427,6 +465,12 @@ static int ntfs_mftmirr_load(ntfs_volume *vol)
ntfs_log_perror("Failed to map runlist of $MFTMirr/$DATA");
goto error_exit;
}
if (vol->mftmirr_na->rl->lcn != vol->mftmirr_lcn) {
ntfs_log_error("Bad $MFTMirr lcn 0x%llx, want 0x%llx\n",
(long long)vol->mftmirr_na->rl->lcn,
(long long)vol->mftmirr_lcn);
goto error_exit;
}
return 0;
@ -454,7 +498,8 @@ error_exit:
* Return the allocated volume structure on success and NULL on error with
* errno set to the error code.
*/
ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long flags)
ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev,
ntfs_mount_flags flags)
{
LCN mft_zone_size, mft_lcn;
s64 br;
@ -478,21 +523,43 @@ ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long flags)
goto error_exit;
/* Create the default upcase table. */
vol->upcase_len = 65536;
vol->upcase = ntfs_malloc(vol->upcase_len * sizeof(ntfschar));
if (!vol->upcase)
vol->upcase_len = ntfs_upcase_build_default(&vol->upcase);
if (!vol->upcase_len || !vol->upcase)
goto error_exit;
/* Default with no locase table and case sensitive file names */
vol->locase = (ntfschar*)NULL;
NVolSetCaseSensitive(vol);
ntfs_upcase_table_build(vol->upcase,
vol->upcase_len * sizeof(ntfschar));
if (flags & MS_RDONLY)
/* by default, all files are shown and not marked hidden */
NVolSetShowSysFiles(vol);
NVolSetShowHidFiles(vol);
NVolClearHideDotFiles(vol);
/* set default compression */
#if DEFAULT_COMPRESSION
NVolSetCompression(vol);
#else
NVolClearCompression(vol);
#endif
if (flags & NTFS_MNT_RDONLY)
NVolSetReadOnly(vol);
/* ...->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 '%s'", dev->d_name);
goto error_exit;
if (!NVolReadOnly(vol) && (errno == EROFS)) {
if ((dev->d_ops->open)(dev, O_RDONLY)) {
ntfs_log_perror("Error opening read-only '%s'",
dev->d_name);
goto error_exit;
} else {
ntfs_log_info("Error opening '%s' read-write\n",
dev->d_name);
NVolSetReadOnly(vol);
}
} else {
ntfs_log_perror("Error opening '%s'", dev->d_name);
goto error_exit;
}
}
/* Attach the device to the volume. */
vol->dev = dev;
@ -525,6 +592,7 @@ ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long flags)
"%s\n", strerror(errno));
/* We now initialize the cluster allocator. */
vol->full_zones = 0;
mft_zone_size = vol->nr_clusters >> 3; /* 12.5% */
/* Setup the mft zone. */
@ -556,6 +624,10 @@ ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long flags)
vol->mft_zone_end = vol->mft_lcn + mft_zone_size;
while (vol->mft_zone_end >= vol->nr_clusters) {
mft_zone_size >>= 1;
if (!mft_zone_size) {
errno = EINVAL;
goto error_exit;
}
vol->mft_zone_end = vol->mft_lcn + mft_zone_size;
}
ntfs_log_debug("mft_zone_end = 0x%llx\n", (long long)vol->mft_zone_end);
@ -626,6 +698,24 @@ static int ntfs_volume_check_logfile(ntfs_volume *vol)
if (!ntfs_check_logfile(na, &rp) || !ntfs_is_logfile_clean(na, rp))
err = EOPNOTSUPP;
/*
* If the latest restart page was identified as version
* 2.0, then Windows may have kept a cached copy of
* metadata for fast restarting, and we should not mount.
* Hibernation will be seen the same way on a non
* Windows-system partition, so we have to use the same
* error code (EPERM).
* The restart page may also be identified as version 2.0
* when access to the file system is terminated abruptly
* by unplugging or power cut, so mounting is also rejected
* after such an event.
*/
if (rp
&& (rp->major_ver == const_cpu_to_le16(2))
&& (rp->minor_ver == const_cpu_to_le16(0))) {
ntfs_log_error("Metadata kept in Windows cache, refused to mount.\n");
err = EPERM;
}
free(rp);
ntfs_attr_close(na);
out:
@ -739,7 +829,8 @@ int ntfs_volume_check_hiberfile(ntfs_volume *vol, int verbose)
errno = EPERM;
goto out;
}
if (memcmp(buf, "hibr", 4) == 0) {
if ((memcmp(buf, "hibr", 4) == 0)
|| (memcmp(buf, "HIBR", 4) == 0)) {
if (verbose)
ntfs_log_error("Windows is hibernated, refused to mount.\n");
errno = EPERM;
@ -758,6 +849,70 @@ out:
return errno ? -1 : 0;
}
/*
* Make sure a LOGGED_UTILITY_STREAM attribute named "$TXF_DATA"
* on the root directory is resident.
* When it is non-resident, the partition cannot be mounted on Vista
* (see http://support.microsoft.com/kb/974729)
*
* We take care to avoid this situation, however this can be a
* consequence of having used an older version (including older
* Windows version), so we had better fix it.
*
* Returns 0 if unneeded or successful
* -1 if there was an error, explained by errno
*/
static int fix_txf_data(ntfs_volume *vol)
{
void *txf_data;
s64 txf_data_size;
ntfs_inode *ni;
ntfs_attr *na;
int res;
res = 0;
ntfs_log_debug("Loading root directory\n");
ni = ntfs_inode_open(vol, FILE_root);
if (!ni) {
ntfs_log_perror("Failed to open root directory");
res = -1;
} else {
/* Get the $TXF_DATA attribute */
na = ntfs_attr_open(ni, AT_LOGGED_UTILITY_STREAM, TXF_DATA, 9);
if (na) {
if (NAttrNonResident(na)) {
/*
* Fix the attribute by truncating, then
* rewriting it.
*/
ntfs_log_debug("Making $TXF_DATA resident\n");
txf_data = ntfs_attr_readall(ni,
AT_LOGGED_UTILITY_STREAM,
TXF_DATA, 9, &txf_data_size);
if (txf_data) {
if (ntfs_attr_truncate(na, 0)
|| (ntfs_attr_pwrite(na, 0,
txf_data_size, txf_data)
!= txf_data_size))
res = -1;
free(txf_data);
}
if (res)
ntfs_log_error("Failed to make $TXF_DATA resident\n");
else
ntfs_log_error("$TXF_DATA made resident\n");
}
ntfs_attr_close(na);
}
if (ntfs_inode_close(ni)) {
ntfs_log_perror("Failed to close root");
res = -1;
}
}
return (res);
}
/**
* ntfs_device_mount - open ntfs volume
* @dev: device to open
@ -769,7 +924,7 @@ out:
* @flags is an optional second parameter. The same flags are used as for
* the mount system call (man 2 mount). Currently only the following flag
* is implemented:
* MS_RDONLY - mount volume read-only
* NTFS_MNT_RDONLY - mount volume read-only
*
* The function opens the device @dev and verifies that it contains a valid
* bootsector. Then, it allocates an ntfs_volume structure and initializes
@ -780,7 +935,7 @@ out:
* Return the allocated volume structure on success and NULL on error with
* errno set to the error code.
*/
ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, ntfs_mount_flags flags)
{
s64 l;
ntfs_volume *vol;
@ -791,9 +946,13 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
ATTR_RECORD *a;
VOLUME_INFORMATION *vinf;
ntfschar *vname;
u32 record_size;
int i, j, eo;
unsigned int k;
u32 u;
BOOL need_fallback_ro;
need_fallback_ro = FALSE;
vol = ntfs_volume_startup(dev, flags);
if (!vol)
return NULL;
@ -817,6 +976,10 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
}
goto error_exit;
}
for (i = 0; (i < l) && (i < FILE_first_user); ++i)
if (ntfs_mft_record_check(vol, FILE_MFT + i,
(MFT_RECORD*)(m + i*vol->mft_record_size)))
goto error_exit;
l = ntfs_attr_mst_pread(vol->mftmirr_na, 0, vol->mftmirr_size,
vol->mft_record_size, m2);
if (l != vol->mftmirr_size) {
@ -826,8 +989,13 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
}
vol->mftmirr_size = l;
}
for (i = 0; (i < l) && (i < FILE_first_user); ++i)
if (ntfs_mft_record_check(vol, FILE_MFT + i,
(MFT_RECORD*)(m2 + i*vol->mft_record_size)))
goto error_exit;
ntfs_log_debug("Comparing $MFTMirr to $MFT...\n");
for (i = 0; i < vol->mftmirr_size; ++i) {
/* Windows 10 does not update the full $MFTMirr any more */
for (i = 0; (i < vol->mftmirr_size) && (i < FILE_first_user); ++i) {
MFT_RECORD *mrec, *mrec2;
const char *ESTR[12] = { "$MFT", "$MFTMirr", "$LogFile",
"$Volume", "$AttrDef", "root directory", "$Bitmap",
@ -843,13 +1011,13 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
mrec = (MFT_RECORD*)(m + i * vol->mft_record_size);
if (mrec->flags & MFT_RECORD_IN_USE) {
if (ntfs_is_baad_recordp(mrec)) {
if (ntfs_is_baad_record(mrec->magic)) {
ntfs_log_error("$MFT error: Incomplete multi "
"sector transfer detected in "
"'%s'.\n", s);
goto io_error_exit;
}
if (!ntfs_is_mft_recordp(mrec)) {
if (!ntfs_is_mft_record(mrec->magic)) {
ntfs_log_error("$MFT error: Invalid mft "
"record for '%s'.\n", s);
goto io_error_exit;
@ -857,19 +1025,22 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
}
mrec2 = (MFT_RECORD*)(m2 + i * vol->mft_record_size);
if (mrec2->flags & MFT_RECORD_IN_USE) {
if (ntfs_is_baad_recordp(mrec2)) {
if (ntfs_is_baad_record(mrec2->magic)) {
ntfs_log_error("$MFTMirr error: Incomplete "
"multi sector transfer "
"detected in '%s'.\n", s);
goto io_error_exit;
}
if (!ntfs_is_mft_recordp(mrec2)) {
if (!ntfs_is_mft_record(mrec2->magic)) {
ntfs_log_error("$MFTMirr error: Invalid mft "
"record for '%s'.\n", s);
goto io_error_exit;
}
}
if (memcmp(mrec, mrec2, ntfs_mft_record_get_data_size(mrec))) {
record_size = ntfs_mft_record_get_data_size(mrec);
if ((record_size <= sizeof(MFT_RECORD))
|| (record_size > vol->mft_record_size)
|| memcmp(mrec, mrec2, record_size)) {
ntfs_log_error("$MFTMirr does not match $MFT (record "
"%d).\n", i);
goto io_error_exit;
@ -912,19 +1083,19 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0);
if (!na) {
ntfs_log_perror("Failed to open ntfs attribute");
ntfs_inode_close(ni);
goto error_exit;
}
/*
* Note: Normally, the upcase table has a length equal to 65536
* 2-byte Unicode characters but allow for different cases, so no
* checks done. Just check we don't overflow 32-bits worth of Unicode
* characters.
* 2-byte Unicode characters. Anyway we currently can only process
* such characters.
*/
if (na->data_size & ~0x1ffffffffULL) {
ntfs_log_error("Error: Upcase table is too big (max 32-bit "
"allowed).\n");
if ((na->data_size - 2) & ~0x1fffeULL) {
ntfs_log_error("Error: Upcase table is invalid (want size even "
"<= 131072).\n");
errno = EINVAL;
goto error_exit;
goto bad_upcase;
}
if (vol->upcase_len != na->data_size >> 1) {
vol->upcase_len = na->data_size >> 1;
@ -932,7 +1103,7 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
free(vol->upcase);
vol->upcase = ntfs_malloc(na->data_size);
if (!vol->upcase)
goto error_exit;
goto bad_upcase;
}
/* Read in the $DATA attribute value into the buffer. */
l = ntfs_attr_pread(na, 0, na->data_size, vol->upcase);
@ -941,7 +1112,7 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
"(%lld != %lld).\n", (long long)l,
(long long)na->data_size);
errno = EIO;
goto error_exit;
goto bad_upcase;
}
/* Done with the $UpCase mft record. */
ntfs_attr_close(na);
@ -949,6 +1120,17 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
ntfs_log_perror("Failed to close $UpCase");
goto error_exit;
}
/* Consistency check of $UpCase, restricted to plain ASCII chars */
k = 0x20;
while ((k < vol->upcase_len)
&& (k < 0x7f)
&& (le16_to_cpu(vol->upcase[k])
== ((k < 'a') || (k > 'z') ? k : k + 'A' - 'a')))
k++;
if (k < 0x7f) {
ntfs_log_error("Corrupted file $UpCase\n");
goto io_error_exit;
}
/*
* Now load $Volume and set the version information and flags in the
@ -1043,9 +1225,9 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
goto error_exit;
for (j = 0; j < (s32)u; j++) {
ntfschar uc = le16_to_cpu(vname[j]);
u16 uc = le16_to_cpu(vname[j]);
if (uc > 0xff)
uc = (ntfschar)'_';
uc = (u16)'_';
vol->vol_name[j] = (char)uc;
}
vol->vol_name[u] = '\0';
@ -1066,10 +1248,10 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
ntfs_log_perror("Failed to open ntfs attribute");
goto error_exit;
}
/* Check we don't overflow 32-bits. */
if (na->data_size > 0xffffffffLL) {
/* Check we don't overflow 24-bits. */
if ((u64)na->data_size > 0xffffffLL) {
ntfs_log_error("Attribute definition table is too big (max "
"32-bit allowed).\n");
"24-bit allowed).\n");
errno = EINVAL;
goto error_exit;
}
@ -1092,25 +1274,53 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
ntfs_log_perror("Failed to close $AttrDef");
goto error_exit;
}
/* Open $Secure. */
if (ntfs_open_secure(vol))
goto error_exit;
/*
* Check for dirty logfile and hibernated Windows.
* We care only about read-write mounts.
*/
if (!(flags & MS_RDONLY)) {
if (!(flags & MS_IGNORE_HIBERFILE) &&
ntfs_volume_check_hiberfile(vol, 1) < 0)
goto error_exit;
if (ntfs_volume_check_logfile(vol) < 0) {
if (!(flags & MS_RECOVER))
if (!(flags & (NTFS_MNT_RDONLY | NTFS_MNT_FORENSIC))) {
if (!(flags & NTFS_MNT_IGNORE_HIBERFILE) &&
ntfs_volume_check_hiberfile(vol, 1) < 0) {
if (flags & NTFS_MNT_MAY_RDONLY)
need_fallback_ro = TRUE;
else
goto error_exit;
ntfs_log_info("The file system wasn't safely "
"closed on Windows. Fixing.\n");
if (ntfs_logfile_reset(vol))
}
if (ntfs_volume_check_logfile(vol) < 0) {
/* Always reject cached metadata for now */
if (!(flags & NTFS_MNT_RECOVER) || (errno == EPERM)) {
if (flags & NTFS_MNT_MAY_RDONLY)
need_fallback_ro = TRUE;
else
goto error_exit;
} else {
ntfs_log_info("The file system wasn't safely "
"closed on Windows. Fixing.\n");
if (ntfs_logfile_reset(vol))
goto error_exit;
}
}
/* make $TXF_DATA resident if present on the root directory */
if (!(flags & NTFS_MNT_RDONLY) && !need_fallback_ro) {
if (fix_txf_data(vol))
goto error_exit;
}
}
if (need_fallback_ro) {
NVolSetReadOnly(vol);
ntfs_log_error("%s", fallback_readonly_msg);
}
return vol;
bad_upcase :
ntfs_attr_close(na);
ntfs_inode_close(ni);
goto error_exit;
io_error_exit:
errno = EIO;
error_exit:
@ -1124,6 +1334,58 @@ error_exit:
return NULL;
}
/*
* Set appropriate flags for showing NTFS metafiles
* or files marked as hidden.
* Not set in ntfs_mount() to avoid breaking existing tools.
*/
int ntfs_set_shown_files(ntfs_volume *vol,
BOOL show_sys_files, BOOL show_hid_files,
BOOL hide_dot_files)
{
int res;
res = -1;
if (vol) {
NVolClearShowSysFiles(vol);
NVolClearShowHidFiles(vol);
NVolClearHideDotFiles(vol);
if (show_sys_files)
NVolSetShowSysFiles(vol);
if (show_hid_files)
NVolSetShowHidFiles(vol);
if (hide_dot_files)
NVolSetHideDotFiles(vol);
res = 0;
}
if (res)
ntfs_log_error("Failed to set file visibility\n");
return (res);
}
/*
* Set ignore case mode
*/
int ntfs_set_ignore_case(ntfs_volume *vol)
{
int res;
res = -1;
if (vol && vol->upcase) {
vol->locase = ntfs_locase_table_build(vol->upcase,
vol->upcase_len);
if (vol->locase) {
NVolClearCaseSensitive(vol);
res = 0;
}
}
if (res)
ntfs_log_error("Failed to set ignore_case mode\n");
return (res);
}
/**
* ntfs_mount - open ntfs volume
* @name: name of device/file to open
@ -1135,7 +1397,7 @@ error_exit:
* @flags is an optional second parameter. The same flags are used as for
* the mount system call (man 2 mount). Currently only the following flags
* is implemented:
* MS_RDONLY - mount volume read-only
* NTFS_MNT_RDONLY - mount volume read-only
*
* The function opens the device or file @name and verifies that it contains a
* valid bootsector. Then, it allocates an ntfs_volume structure and initializes
@ -1150,7 +1412,7 @@ error_exit:
* soon as the function returns.
*/
ntfs_volume *ntfs_mount(const char *name __attribute__((unused)),
unsigned long flags __attribute__((unused)))
ntfs_mount_flags flags __attribute__((unused)))
{
#ifndef NO_NTFS_DEVICE_DEFAULT_IO_OPS
struct ntfs_device *dev;
@ -1166,7 +1428,8 @@ ntfs_volume *ntfs_mount(const char *name __attribute__((unused)),
int eo = errno;
ntfs_device_free(dev);
errno = eo;
}
} else
ntfs_create_lru_caches(vol);
return vol;
#else
/*
@ -1218,18 +1481,6 @@ int ntfs_umount(ntfs_volume *vol, const BOOL force __attribute__((unused)))
#ifdef HAVE_MNTENT_H
#ifndef HAVE_REALPATH
/**
* realpath - If there is no realpath on the system
*/
static char *realpath(const char *path, char *resolved_path)
{
strncpy(resolved_path, path, PATH_MAX);
resolved_path[PATH_MAX] = '\0';
return resolved_path;
}
#endif
/**
* ntfs_mntent_check - desc
*
@ -1253,16 +1504,17 @@ static int ntfs_mntent_check(const char *file, unsigned long *mnt_flags)
err = errno;
goto exit;
}
if (!realpath(file, real_file)) {
if (!ntfs_realpath_canonicalize(file, real_file)) {
err = errno;
goto exit;
}
if (!(f = setmntent(MOUNTED, "r"))) {
f = setmntent("/proc/mounts", "r");
if (!f && !(f = setmntent(MOUNTED, "r"))) {
err = errno;
goto exit;
}
while ((mnt = getmntent(f))) {
if (!realpath(mnt->mnt_fsname, real_fsname))
if (!ntfs_realpath_canonicalize(mnt->mnt_fsname, real_fsname))
continue;
if (!strcmp(real_file, real_fsname))
break;
@ -1286,6 +1538,60 @@ exit:
}
return 0;
}
#else /* HAVE_MNTENT_H */
#if defined(__sun) && defined (__SVR4)
static int ntfs_mntent_check(const char *file, unsigned long *mnt_flags)
{
struct mnttab *mnt = NULL;
char *real_file = NULL, *real_fsname = NULL;
FILE *f;
int err = 0;
real_file = (char*)ntfs_malloc(PATH_MAX + 1);
if (!real_file)
return -1;
real_fsname = (char*)ntfs_malloc(PATH_MAX + 1);
mnt = (struct mnttab*)ntfs_malloc(MNT_LINE_MAX + 1);
if (!real_fsname || !mnt) {
err = errno;
goto exit;
}
if (!ntfs_realpath_canonicalize(file, real_file)) {
err = errno;
goto exit;
}
if (!(f = fopen(MNTTAB, "r"))) {
err = errno;
goto exit;
}
while (!getmntent(f, mnt)) {
if (!ntfs_realpath_canonicalize(mnt->mnt_special, real_fsname))
continue;
if (!strcmp(real_file, real_fsname)) {
*mnt_flags = NTFS_MF_MOUNTED;
if (!strcmp(mnt->mnt_mountp, "/"))
*mnt_flags |= NTFS_MF_ISROOT;
if (hasmntopt(mnt, "ro") && !hasmntopt(mnt, "rw"))
*mnt_flags |= NTFS_MF_READONLY;
break;
}
}
fclose(f);
exit:
free(mnt);
free(real_file);
free(real_fsname);
if (err) {
errno = err;
return -1;
}
return 0;
}
#endif /* defined(__sun) && defined (__SVR4) */
#endif /* HAVE_MNTENT_H */
/**
@ -1317,7 +1623,7 @@ int ntfs_check_if_mounted(const char *file __attribute__((unused)),
unsigned long *mnt_flags)
{
*mnt_flags = 0;
#ifdef HAVE_MNTENT_H
#if defined(HAVE_MNTENT_H) || (defined(__sun) && defined (__SVR4))
return ntfs_mntent_check(file, mnt_flags);
#else
return 0;
@ -1429,7 +1735,7 @@ error_exit:
*
* Return 0 if successful and -1 if not with errno set to the error code.
*/
int ntfs_volume_write_flags(ntfs_volume *vol, const u16 flags)
int ntfs_volume_write_flags(ntfs_volume *vol, const le16 flags)
{
ATTR_RECORD *a;
VOLUME_INFORMATION *c;
@ -1499,6 +1805,10 @@ int ntfs_volume_error(int err)
ret = NTFS_VOLUME_CORRUPT;
break;
case EPERM:
/*
* Hibernation and fast restarting are seen the
* same way on a non Windows-system partition.
*/
ret = NTFS_VOLUME_HIBERNATED;
break;
case EOPNOTSUPP:
@ -1562,3 +1872,142 @@ int ntfs_set_locale(void)
return 0;
}
/*
* Feed the counts of free clusters and free mft records
*/
int ntfs_volume_get_free_space(ntfs_volume *vol)
{
ntfs_attr *na;
int ret;
ret = -1; /* default return */
vol->free_clusters = ntfs_attr_get_free_bits(vol->lcnbmp_na);
if (vol->free_clusters < 0) {
ntfs_log_perror("Failed to read NTFS $Bitmap");
} else {
na = vol->mftbmp_na;
vol->free_mft_records = ntfs_attr_get_free_bits(na);
if (vol->free_mft_records >= 0)
vol->free_mft_records += (na->allocated_size - na->data_size) << 3;
if (vol->free_mft_records < 0)
ntfs_log_perror("Failed to calculate free MFT records");
else {
NVolSetFreeSpaceKnown(vol);
ret = 0;
}
}
return (ret);
}
/**
* ntfs_volume_rename - change the current label on a volume
* @vol: volume to change the label on
* @label: the new label
* @label_len: the length of @label in ntfschars including the terminating NULL
* character, which is mandatory (the value can not exceed 128)
*
* Change the label on the volume @vol to @label.
*/
int ntfs_volume_rename(ntfs_volume *vol, const ntfschar *label, int label_len)
{
ntfs_attr *na;
char *old_vol_name;
char *new_vol_name = NULL;
int new_vol_name_len;
int err;
if (NVolReadOnly(vol)) {
ntfs_log_error("Refusing to change label on read-only mounted "
"volume.\n");
errno = EROFS;
return -1;
}
label_len *= sizeof(ntfschar);
if (label_len > 0x100) {
ntfs_log_error("New label is too long. Maximum %u characters "
"allowed.\n",
(unsigned)(0x100 / sizeof(ntfschar)));
errno = ERANGE;
return -1;
}
na = ntfs_attr_open(vol->vol_ni, AT_VOLUME_NAME, AT_UNNAMED, 0);
if (!na) {
if (errno != ENOENT) {
err = errno;
ntfs_log_perror("Lookup of $VOLUME_NAME attribute "
"failed");
goto err_out;
}
/* The volume name attribute does not exist. Need to add it. */
if (ntfs_attr_add(vol->vol_ni, AT_VOLUME_NAME, AT_UNNAMED, 0,
(const u8*) label, label_len))
{
err = errno;
ntfs_log_perror("Encountered error while adding "
"$VOLUME_NAME attribute");
goto err_out;
}
}
else {
s64 written;
if (NAttrNonResident(na)) {
err = errno;
ntfs_log_error("Error: Attribute $VOLUME_NAME must be "
"resident.\n");
goto err_out;
}
if (na->data_size != label_len) {
if (ntfs_attr_truncate(na, label_len)) {
err = errno;
ntfs_log_perror("Error resizing resident "
"attribute");
goto err_out;
}
}
if (label_len) {
written = ntfs_attr_pwrite(na, 0, label_len, label);
if (written == -1) {
err = errno;
ntfs_log_perror("Error when writing "
"$VOLUME_NAME data");
goto err_out;
}
else if (written != label_len) {
err = EIO;
ntfs_log_error("Partial write when writing "
"$VOLUME_NAME data.");
goto err_out;
}
}
}
new_vol_name_len =
ntfs_ucstombs(label, label_len, &new_vol_name, 0);
if (new_vol_name_len == -1) {
err = errno;
ntfs_log_perror("Error while decoding new volume name");
goto err_out;
}
old_vol_name = vol->vol_name;
vol->vol_name = new_vol_name;
free(old_vol_name);
err = 0;
err_out:
if (na)
ntfs_attr_close(na);
if (err)
errno = err;
return err ? -1 : 0;
}

File diff suppressed because it is too large Load Diff

808
libntfs-3g/xattrs.c 100644
View File

@ -0,0 +1,808 @@
/**
* xattrs.c : common functions to deal with system extended attributes
*
* Copyright (c) 2010-2014 Jean-Pierre Andre
*
* 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
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include "types.h"
#include "param.h"
#include "layout.h"
#include "attrib.h"
#include "index.h"
#include "dir.h"
#include "security.h"
#include "acls.h"
#include "efs.h"
#include "reparse.h"
#include "object_id.h"
#include "ea.h"
#include "misc.h"
#include "logging.h"
#include "xattrs.h"
#if POSIXACLS
#if __BYTE_ORDER == __BIG_ENDIAN
/*
* Posix ACL structures
*/
struct LE_POSIX_ACE {
le16 tag;
le16 perms;
le32 id;
} __attribute__((__packed__));
struct LE_POSIX_ACL {
u8 version;
u8 flags;
le16 filler;
struct LE_POSIX_ACE ace[0];
} __attribute__((__packed__));
#endif
#endif
static const char nf_ns_xattr_ntfs_acl[] = "system.ntfs_acl";
static const char nf_ns_xattr_attrib[] = "system.ntfs_attrib";
static const char nf_ns_xattr_attrib_be[] = "system.ntfs_attrib_be";
static const char nf_ns_xattr_efsinfo[] = "system.ntfs_efsinfo";
static const char nf_ns_xattr_reparse[] = "system.ntfs_reparse_data";
static const char nf_ns_xattr_object_id[] = "system.ntfs_object_id";
static const char nf_ns_xattr_dos_name[] = "system.ntfs_dos_name";
static const char nf_ns_xattr_times[] = "system.ntfs_times";
static const char nf_ns_xattr_times_be[] = "system.ntfs_times_be";
static const char nf_ns_xattr_crtime[] = "system.ntfs_crtime";
static const char nf_ns_xattr_crtime_be[] = "system.ntfs_crtime_be";
static const char nf_ns_xattr_ea[] = "system.ntfs_ea";
static const char nf_ns_xattr_posix_access[] = "system.posix_acl_access";
static const char nf_ns_xattr_posix_default[] = "system.posix_acl_default";
static const char nf_ns_alt_xattr_efsinfo[] = "user.ntfs.efsinfo";
struct XATTRNAME {
enum SYSTEMXATTRS xattr;
const char *name;
} ;
static struct XATTRNAME nf_ns_xattr_names[] = {
{ XATTR_NTFS_ACL, nf_ns_xattr_ntfs_acl },
{ XATTR_NTFS_ATTRIB, nf_ns_xattr_attrib },
{ XATTR_NTFS_ATTRIB_BE, nf_ns_xattr_attrib_be },
{ XATTR_NTFS_EFSINFO, nf_ns_xattr_efsinfo },
{ XATTR_NTFS_REPARSE_DATA, nf_ns_xattr_reparse },
{ XATTR_NTFS_OBJECT_ID, nf_ns_xattr_object_id },
{ XATTR_NTFS_DOS_NAME, nf_ns_xattr_dos_name },
{ XATTR_NTFS_TIMES, nf_ns_xattr_times },
{ XATTR_NTFS_TIMES_BE, nf_ns_xattr_times_be },
{ XATTR_NTFS_CRTIME, nf_ns_xattr_crtime },
{ XATTR_NTFS_CRTIME_BE, nf_ns_xattr_crtime_be },
{ XATTR_NTFS_EA, nf_ns_xattr_ea },
{ XATTR_POSIX_ACC, nf_ns_xattr_posix_access },
{ XATTR_POSIX_DEF, nf_ns_xattr_posix_default },
{ XATTR_UNMAPPED, (char*)NULL } /* terminator */
};
/*
* Make an integer big-endian
*
* Swap bytes on a small-endian computer and does nothing on a
* big-endian computer.
*/
static void fix_big_endian(char *p, int size)
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
int i,j;
int c;
i = 0;
j = size - 1;
while (i < j) {
c = p[i];
p[i++] = p[j];
p[j--] = c;
}
#endif
}
#if POSIXACLS
#if __BYTE_ORDER == __BIG_ENDIAN
/*
* Make a Posix ACL CPU endian
*/
static int le_acl_to_cpu(const struct LE_POSIX_ACL *le_acl, size_t size,
struct POSIX_ACL *acl)
{
int i;
int cnt;
acl->version = le_acl->version;
acl->flags = le_acl->flags;
acl->filler = 0;
cnt = (size - sizeof(struct LE_POSIX_ACL)) / sizeof(struct LE_POSIX_ACE);
for (i=0; i<cnt; i++) {
acl->ace[i].tag = le16_to_cpu(le_acl->ace[i].tag);
acl->ace[i].perms = le16_to_cpu(le_acl->ace[i].perms);
acl->ace[i].id = le32_to_cpu(le_acl->ace[i].id);
}
return (0);
}
/*
* Make a Posix ACL little endian
*/
int cpu_to_le_acl(const struct POSIX_ACL *acl, size_t size,
struct LE_POSIX_ACL *le_acl)
{
int i;
int cnt;
le_acl->version = acl->version;
le_acl->flags = acl->flags;
le_acl->filler = const_cpu_to_le16(0);
cnt = (size - sizeof(struct POSIX_ACL)) / sizeof(struct POSIX_ACE);
for (i=0; i<cnt; i++) {
le_acl->ace[i].tag = cpu_to_le16(acl->ace[i].tag);
le_acl->ace[i].perms = cpu_to_le16(acl->ace[i].perms);
le_acl->ace[i].id = cpu_to_le32(acl->ace[i].id);
}
return (0);
}
#endif
#endif
/*
* Determine whether an extended attribute is mapped to
* internal data (original name in system namespace, or renamed)
*/
enum SYSTEMXATTRS ntfs_xattr_system_type(const char *name,
ntfs_volume *vol)
{
struct XATTRNAME *p;
enum SYSTEMXATTRS ret;
#ifdef XATTR_MAPPINGS
const struct XATTRMAPPING *q;
#endif /* XATTR_MAPPINGS */
p = nf_ns_xattr_names;
while (p->name && strcmp(p->name,name))
p++;
ret = p->xattr;
#ifdef XATTR_MAPPINGS
if (!p->name && vol && vol->xattr_mapping) {
q = vol->xattr_mapping;
while (q && strcmp(q->name,name))
q = q->next;
if (q)
ret = q->xattr;
}
#else /* XATTR_MAPPINGS */
if (!p->name
&& vol
&& vol->efs_raw
&& !strcmp(nf_ns_alt_xattr_efsinfo,name))
ret = XATTR_NTFS_EFSINFO;
#endif /* XATTR_MAPPINGS */
return (ret);
}
#ifdef XATTR_MAPPINGS
/*
* Basic read from a user mapping file on another volume
*/
static int basicread(void *fileid, char *buf, size_t size, off_t offs __attribute__((unused)))
{
return (read(*(int*)fileid, buf, size));
}
/*
* Read from a user mapping file on current NTFS partition
*/
static int localread(void *fileid, char *buf, size_t size, off_t offs)
{
return (ntfs_attr_data_read((ntfs_inode*)fileid,
AT_UNNAMED, 0, buf, size, offs));
}
/*
* Get a single mapping item from buffer
*
* Always reads a full line, truncating long lines
* Refills buffer when exhausted
* Returns pointer to item, or NULL when there is no more
* Note : errors are logged, but not returned
// TODO partially share with acls.c
*/
static struct XATTRMAPPING *getmappingitem(FILEREADER reader, void *fileid,
off_t *poffs, char *buf, int *psrc, s64 *psize)
{
int src;
int dst;
char *pe;
char *ps;
char *pu;
enum SYSTEMXATTRS xattr;
int gotend;
char maptext[LINESZ];
struct XATTRMAPPING *item;
src = *psrc;
dst = 0;
do {
gotend = 0;
while ((src < *psize)
&& (buf[src] != '\n')) {
/* ignore spaces */
if ((dst < LINESZ)
&& (buf[src] != '\r')
&& (buf[src] != '\t')
&& (buf[src] != ' '))
maptext[dst++] = buf[src];
src++;
}
if (src >= *psize) {
*poffs += *psize;
*psize = reader(fileid, buf, (size_t)BUFSZ, *poffs);
src = 0;
} else {
gotend = 1;
src++;
maptext[dst] = '\0';
dst = 0;
}
} while (*psize && ((maptext[0] == '#') || !gotend));
item = (struct XATTRMAPPING*)NULL;
if (gotend) {
/* decompose into system name and user name */
ps = maptext;
pu = strchr(maptext,':');
if (pu) {
*pu++ = 0;
pe = strchr(pu,':');
if (pe)
*pe = 0;
/* check name validity */
if ((strlen(pu) < 6) || strncmp(pu,"user.",5))
pu = (char*)NULL;
xattr = ntfs_xattr_system_type(ps,
(ntfs_volume*)NULL);
if (xattr == XATTR_UNMAPPED)
pu = (char*)NULL;
}
if (pu) {
item = (struct XATTRMAPPING*)ntfs_malloc(
sizeof(struct XATTRMAPPING)
+ strlen(pu));
if (item) {
item->xattr = xattr;
strcpy(item->name,pu);
item->next = (struct XATTRMAPPING*)NULL;
}
} else {
ntfs_log_early_error("Bad xattr mapping item, aborting\n");
}
}
*psrc = src;
return (item);
}
/*
* Read xattr mapping file and split into their attribute.
* Parameters are kept in a chained list.
* Returns the head of list, if any
* Errors are logged, but not returned
*
* If an absolute path is provided, the mapping file is assumed
* to be located in another mounted file system, and plain read()
* are used to get its contents.
* If a relative path is provided, the mapping file is assumed
* to be located on the current file system, and internal IO
* have to be used since we are still mounting and we have not
* entered the fuse loop yet.
*/
static struct XATTRMAPPING *ntfs_read_xattr_mapping(FILEREADER reader,
void *fileid)
{
char buf[BUFSZ];
struct XATTRMAPPING *item;
struct XATTRMAPPING *current;
struct XATTRMAPPING *firstitem;
struct XATTRMAPPING *lastitem;
BOOL duplicated;
int src;
off_t offs;
s64 size;
firstitem = (struct XATTRMAPPING*)NULL;
lastitem = (struct XATTRMAPPING*)NULL;
offs = 0;
size = reader(fileid, buf, (size_t)BUFSZ, (off_t)0);
if (size > 0) {
src = 0;
do {
item = getmappingitem(reader, fileid, &offs,
buf, &src, &size);
if (item) {
/* check no double mapping */
duplicated = FALSE;
for (current=firstitem; current; current=current->next)
if ((current->xattr == item->xattr)
|| !strcmp(current->name,item->name))
duplicated = TRUE;
if (duplicated) {
free(item);
ntfs_log_early_error("Conflicting xattr mapping ignored\n");
} else {
item->next = (struct XATTRMAPPING*)NULL;
if (lastitem)
lastitem->next = item;
else
firstitem = item;
lastitem = item;
}
}
} while (item);
}
return (firstitem);
}
/*
* Build the extended attribute mappings to user namespace
*
* Note : no error is returned. If we refused mounting when there
* is an error it would be too difficult to fix the offending file
*/
struct XATTRMAPPING *ntfs_xattr_build_mapping(ntfs_volume *vol,
const char *xattrmap_path)
{
struct XATTRMAPPING *firstmapping;
struct XATTRMAPPING *mapping;
BOOL user_efs;
BOOL notfound;
ntfs_inode *ni;
int fd;
firstmapping = (struct XATTRMAPPING*)NULL;
notfound = FALSE;
if (!xattrmap_path)
xattrmap_path = XATTRMAPPINGFILE;
if (xattrmap_path[0] == '/') {
fd = open(xattrmap_path,O_RDONLY);
if (fd > 0) {
firstmapping = ntfs_read_xattr_mapping(basicread, (void*)&fd);
close(fd);
} else
notfound = TRUE;
} else {
ni = ntfs_pathname_to_inode(vol, NULL, xattrmap_path);
if (ni) {
firstmapping = ntfs_read_xattr_mapping(localread, ni);
ntfs_inode_close(ni);
} else
notfound = TRUE;
}
if (notfound && strcmp(xattrmap_path, XATTRMAPPINGFILE)) {
ntfs_log_early_error("Could not open \"%s\"\n",xattrmap_path);
}
if (vol->efs_raw) {
user_efs = TRUE;
for (mapping=firstmapping; mapping; mapping=mapping->next)
if (mapping->xattr == XATTR_NTFS_EFSINFO)
user_efs = FALSE;
} else
user_efs = FALSE;
if (user_efs) {
mapping = (struct XATTRMAPPING*)ntfs_malloc(
sizeof(struct XATTRMAPPING)
+ strlen(nf_ns_alt_xattr_efsinfo));
if (mapping) {
mapping->next = firstmapping;
mapping->xattr = XATTR_NTFS_EFSINFO;
strcpy(mapping->name,nf_ns_alt_xattr_efsinfo);
firstmapping = mapping;
}
}
return (firstmapping);
}
void ntfs_xattr_free_mapping(struct XATTRMAPPING *mapping)
{
struct XATTRMAPPING *p, *q;
p = mapping;
while (p) {
q = p->next;
free(p);
p = q;
}
}
#endif /* XATTR_MAPPINGS */
/*
* Get an NTFS attribute into an extended attribute
*
* Returns the non-negative size of attribute if successful,
* or negative, with errno set, when fails
* Note : the size is returned even if no buffer is provided
* for returning the attribute, or if it is zero-sized.
*/
int ntfs_xattr_system_getxattr(struct SECURITY_CONTEXT *scx,
enum SYSTEMXATTRS attr,
ntfs_inode *ni, ntfs_inode *dir_ni,
char *value, size_t size)
{
int res;
int i;
#if POSIXACLS
#if __BYTE_ORDER == __BIG_ENDIAN
struct POSIX_ACL *acl;
#endif
#endif
switch (attr) {
case XATTR_NTFS_ACL :
res = ntfs_get_ntfs_acl(scx, ni, value, size);
break;
#if POSIXACLS
#if __BYTE_ORDER == __BIG_ENDIAN
case XATTR_POSIX_ACC :
acl = (struct POSIX_ACL*)ntfs_malloc(size);
if (acl) {
res = ntfs_get_posix_acl(scx, ni,
nf_ns_xattr_posix_access, (char*)acl, size);
if (res > 0) {
if (cpu_to_le_acl(acl,res,
(struct LE_POSIX_ACL*)value))
res = -errno;
}
free(acl);
} else
res = -errno;
break;
case XATTR_POSIX_DEF :
acl = (struct POSIX_ACL*)ntfs_malloc(size);
if (acl) {
res = ntfs_get_posix_acl(scx, ni,
nf_ns_xattr_posix_default, (char*)acl, size);
if (res > 0) {
if (cpu_to_le_acl(acl,res,
(struct LE_POSIX_ACL*)value))
res = -errno;
}
free(acl);
} else
res = -errno;
break;
#else
case XATTR_POSIX_ACC :
res = ntfs_get_posix_acl(scx, ni, nf_ns_xattr_posix_access,
value, size);
break;
case XATTR_POSIX_DEF :
res = ntfs_get_posix_acl(scx, ni, nf_ns_xattr_posix_default,
value, size);
break;
#endif
#endif
case XATTR_NTFS_ATTRIB :
res = ntfs_get_ntfs_attrib(ni, value, size);
break;
case XATTR_NTFS_ATTRIB_BE :
res = ntfs_get_ntfs_attrib(ni, value, size);
if ((res == 4) && value) {
if (size >= 4)
fix_big_endian(value,4);
else
res = -EINVAL;
}
break;
case XATTR_NTFS_EFSINFO :
if (ni->vol->efs_raw)
res = ntfs_get_efs_info(ni, value, size);
else
res = -EPERM;
break;
case XATTR_NTFS_REPARSE_DATA :
res = ntfs_get_ntfs_reparse_data(ni, value, size);
break;
case XATTR_NTFS_OBJECT_ID :
res = ntfs_get_ntfs_object_id(ni, value, size);
break;
case XATTR_NTFS_DOS_NAME:
if (dir_ni)
res = ntfs_get_ntfs_dos_name(ni, dir_ni, value, size);
else
res = -errno;
break;
case XATTR_NTFS_TIMES:
res = ntfs_inode_get_times(ni, value, size);
break;
case XATTR_NTFS_TIMES_BE:
res = ntfs_inode_get_times(ni, value, size);
if ((res > 0) && value) {
for (i=0; (i+1)*sizeof(u64)<=(unsigned int)res; i++)
fix_big_endian(&value[i*sizeof(u64)],
sizeof(u64));
}
break;
case XATTR_NTFS_CRTIME:
res = ntfs_inode_get_times(ni, value,
(size >= sizeof(u64) ? sizeof(u64) : size));
break;
case XATTR_NTFS_CRTIME_BE:
res = ntfs_inode_get_times(ni, value,
(size >= sizeof(u64) ? sizeof(u64) : size));
if ((res >= (int)sizeof(u64)) && value)
fix_big_endian(value,sizeof(u64));
break;
case XATTR_NTFS_EA :
res = ntfs_get_ntfs_ea(ni, value, size);
break;
default :
errno = EOPNOTSUPP;
res = -errno;
break;
}
return (res);
}
/*
* Set an NTFS attribute from an extended attribute
*
* Returns 0 if successful,
* non-zero, with errno set, when fails
*/
int ntfs_xattr_system_setxattr(struct SECURITY_CONTEXT *scx,
enum SYSTEMXATTRS attr,
ntfs_inode *ni, ntfs_inode *dir_ni,
const char *value, size_t size, int flags)
{
int res;
int i;
char buf[4*sizeof(u64)];
#if POSIXACLS
#if __BYTE_ORDER == __BIG_ENDIAN
struct POSIX_ACL *acl;
#endif
#endif
switch (attr) {
case XATTR_NTFS_ACL :
res = ntfs_set_ntfs_acl(scx, ni, value, size, flags);
break;
#if POSIXACLS
#if __BYTE_ORDER == __BIG_ENDIAN
case XATTR_POSIX_ACC :
acl = (struct POSIX_ACL*)ntfs_malloc(size);
if (acl) {
if (!le_acl_to_cpu((const struct LE_POSIX_ACL*)value,
size, acl)) {
res = ntfs_set_posix_acl(scx ,ni ,
nf_ns_xattr_posix_access,
(char*)acl, size, flags);
} else
res = -errno;
free(acl);
} else
res = -errno;
break;
case XATTR_POSIX_DEF :
acl = (struct POSIX_ACL*)ntfs_malloc(size);
if (acl) {
if (!le_acl_to_cpu((const struct LE_POSIX_ACL*)value,
size, acl)) {
res = ntfs_set_posix_acl(scx ,ni ,
nf_ns_xattr_posix_default,
(char*)acl, size, flags);
} else
res = -errno;
free(acl);
} else
res = -errno;
break;
#else
case XATTR_POSIX_ACC :
res = ntfs_set_posix_acl(scx ,ni , nf_ns_xattr_posix_access,
value, size, flags);
break;
case XATTR_POSIX_DEF :
res = ntfs_set_posix_acl(scx, ni, nf_ns_xattr_posix_default,
value, size, flags);
break;
#endif
#endif
case XATTR_NTFS_ATTRIB :
res = ntfs_set_ntfs_attrib(ni, value, size, flags);
break;
case XATTR_NTFS_ATTRIB_BE :
if (value && (size >= 4)) {
memcpy(buf,value,4);
fix_big_endian(buf,4);
res = ntfs_set_ntfs_attrib(ni, buf, 4, flags);
} else
res = ntfs_set_ntfs_attrib(ni, value, size, flags);
break;
case XATTR_NTFS_EFSINFO :
if (ni->vol->efs_raw)
res = ntfs_set_efs_info(ni, value, size, flags);
else {
errno = EPERM;
res = -EPERM;
}
break;
case XATTR_NTFS_REPARSE_DATA :
res = ntfs_set_ntfs_reparse_data(ni, value, size, flags);
break;
case XATTR_NTFS_OBJECT_ID :
res = ntfs_set_ntfs_object_id(ni, value, size, flags);
break;
case XATTR_NTFS_DOS_NAME:
if (dir_ni)
/* warning : this closes both inodes */
res = ntfs_set_ntfs_dos_name(ni, dir_ni, value,
size, flags);
else {
errno = EINVAL;
res = -errno;
}
break;
case XATTR_NTFS_TIMES:
res = ntfs_inode_set_times(ni, value, size, flags);
break;
case XATTR_NTFS_TIMES_BE:
if (value && (size > 0) && (size <= 4*sizeof(u64))) {
memcpy(buf,value,size);
for (i=0; (i+1)*sizeof(u64)<=size; i++)
fix_big_endian(&buf[i*sizeof(u64)],
sizeof(u64));
res = ntfs_inode_set_times(ni, buf, size, flags);
} else
res = ntfs_inode_set_times(ni, value, size, flags);
break;
case XATTR_NTFS_CRTIME:
res = ntfs_inode_set_times(ni, value,
(size >= sizeof(u64) ? sizeof(u64) : size), flags);
break;
case XATTR_NTFS_CRTIME_BE:
if (value && (size >= sizeof(u64))) {
memcpy(buf,value,sizeof(u64));
fix_big_endian(buf,sizeof(u64));
res = ntfs_inode_set_times(ni, buf, sizeof(u64), flags);
} else
res = ntfs_inode_set_times(ni, value, size, flags);
break;
case XATTR_NTFS_EA :
res = ntfs_set_ntfs_ea(ni, value, size, flags);
break;
default :
errno = EOPNOTSUPP;
res = -errno;
break;
}
return (res);
}
int ntfs_xattr_system_removexattr(struct SECURITY_CONTEXT *scx,
enum SYSTEMXATTRS attr,
ntfs_inode *ni, ntfs_inode *dir_ni)
{
int res;
res = 0;
switch (attr) {
/*
* Removal of NTFS ACL, ATTRIB, EFSINFO or TIMES
* is never allowed
*/
case XATTR_NTFS_ACL :
case XATTR_NTFS_ATTRIB :
case XATTR_NTFS_ATTRIB_BE :
case XATTR_NTFS_EFSINFO :
case XATTR_NTFS_TIMES :
case XATTR_NTFS_TIMES_BE :
case XATTR_NTFS_CRTIME :
case XATTR_NTFS_CRTIME_BE :
res = -EPERM;
break;
#if POSIXACLS
case XATTR_POSIX_ACC :
case XATTR_POSIX_DEF :
if (ni) {
if (!ntfs_allowed_as_owner(scx, ni)
|| ntfs_remove_posix_acl(scx, ni,
(attr == XATTR_POSIX_ACC ?
nf_ns_xattr_posix_access :
nf_ns_xattr_posix_default)))
res = -errno;
} else
res = -errno;
break;
#endif
case XATTR_NTFS_REPARSE_DATA :
if (ni) {
if (!ntfs_allowed_as_owner(scx, ni)
|| ntfs_remove_ntfs_reparse_data(ni))
res = -errno;
} else
res = -errno;
break;
case XATTR_NTFS_OBJECT_ID :
if (ni) {
if (!ntfs_allowed_as_owner(scx, ni)
|| ntfs_remove_ntfs_object_id(ni))
res = -errno;
} else
res = -errno;
break;
case XATTR_NTFS_DOS_NAME:
if (ni && dir_ni) {
if (ntfs_remove_ntfs_dos_name(ni,dir_ni))
res = -errno;
/* ni and dir_ni have been closed */
} else
res = -errno;
break;
case XATTR_NTFS_EA :
res = ntfs_remove_ntfs_ea(ni);
break;
default :
errno = EOPNOTSUPP;
res = -errno;
break;
}
return (res);
}

View File

@ -0,0 +1,195 @@
if REALLYSTATIC
AM_LIBS = $(top_builddir)/libntfs-3g/.libs/libntfs-3g.a $(NTFSPROGS_STATIC_LIBS)
# older builds may need -static instead of newer -all-static
AM_LFLAGS = -static
STATIC_LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
else
AM_LIBS = $(top_builddir)/libntfs-3g/libntfs-3g.la
AM_LFLAGS = $(all_libraries)
LIBTOOL_LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
endif
# Workaround to make REALLYSTATIC work with automake 1.5.
LINK=$(STATIC_LINK) $(LIBTOOL_LINK)
if ENABLE_NTFSPROGS
bin_PROGRAMS = ntfsfix ntfsinfo ntfscluster ntfsls ntfscat ntfscmp
sbin_PROGRAMS = mkntfs ntfslabel ntfsundelete ntfsresize ntfsclone \
ntfscp
EXTRA_PROGRAM_NAMES = ntfswipe ntfstruncate ntfsrecover \
ntfsusermap ntfssecaudit
QUARANTINED_PROGRAM_NAMES = ntfsdump_logfile ntfsmftalloc ntfsmove ntfsck \
ntfsfallocate
man_MANS = mkntfs.8 \
ntfscat.8 \
ntfsclone.8 \
ntfscluster.8 \
ntfscmp.8 \
ntfscp.8 \
ntfsdecrypt.8 \
ntfsfallocate.8 \
ntfsfix.8 \
ntfsinfo.8 \
ntfslabel.8 \
ntfsls.8 \
ntfsprogs.8 \
ntfsresize.8 \
ntfsundelete.8
EXTRA_MANS = ntfsrecover.8 \
ntfssecaudit.8 \
ntfstruncate.8 \
ntfsusermap.8 \
ntfswipe.8
CLEANFILES = $(EXTRA_PROGRAMS)
MAINTAINERCLEANFILES = Makefile.in
if ENABLE_CRYPTO
EXTRA_PROGRAM_NAMES += ntfsdecrypt
endif
if ENABLE_EXTRAS
bin_PROGRAMS += $(EXTRA_PROGRAM_NAMES)
if ENABLE_QUARANTINED
bin_PROGRAMS += $(QUARANTINED_PROGRAM_NAMES)
endif
man_MANS += $(EXTRA_MANS)
else
EXTRA_PROGRAMS = $(EXTRA_PROGRAM_NAMES)
endif
# Set the include path.
AM_CPPFLAGS = -I$(top_srcdir)/include/ntfs-3g $(all_includes)
ntfsfix_SOURCES = ntfsfix.c utils.c utils.h
ntfsfix_LDADD = $(AM_LIBS)
ntfsfix_LDFLAGS = $(AM_LFLAGS)
mkntfs_CPPFLAGS = $(AM_CPPFLAGS) $(MKNTFS_CPPFLAGS)
mkntfs_SOURCES = attrdef.c attrdef.h boot.c boot.h sd.c sd.h mkntfs.c utils.c utils.h
mkntfs_LDADD = $(AM_LIBS) $(MKNTFS_LIBS)
mkntfs_LDFLAGS = $(AM_LFLAGS)
ntfslabel_SOURCES = ntfslabel.c utils.c utils.h
ntfslabel_LDADD = $(AM_LIBS)
ntfslabel_LDFLAGS = $(AM_LFLAGS)
ntfsinfo_SOURCES = ntfsinfo.c utils.c utils.h
ntfsinfo_LDADD = $(AM_LIBS)
ntfsinfo_LDFLAGS = $(AM_LFLAGS)
ntfsundelete_SOURCES = ntfsundelete.c ntfsundelete.h utils.c utils.h list.h
ntfsundelete_LDADD = $(AM_LIBS)
ntfsundelete_LDFLAGS = $(AM_LFLAGS)
ntfsresize_SOURCES = ntfsresize.c utils.c utils.h
ntfsresize_LDADD = $(AM_LIBS)
ntfsresize_LDFLAGS = $(AM_LFLAGS)
ntfsclone_SOURCES = ntfsclone.c utils.c utils.h
ntfsclone_LDADD = $(AM_LIBS)
ntfsclone_LDFLAGS = $(AM_LFLAGS)
ntfscluster_SOURCES = ntfscluster.c ntfscluster.h cluster.c cluster.h utils.c utils.h
ntfscluster_LDADD = $(AM_LIBS)
ntfscluster_LDFLAGS = $(AM_LFLAGS)
ntfsls_SOURCES = ntfsls.c utils.c utils.h list.h
ntfsls_LDADD = $(AM_LIBS)
ntfsls_LDFLAGS = $(AM_LFLAGS)
ntfscat_SOURCES = ntfscat.c ntfscat.h utils.c utils.h
ntfscat_LDADD = $(AM_LIBS)
ntfscat_LDFLAGS = $(AM_LFLAGS)
ntfscp_SOURCES = ntfscp.c utils.c utils.h
ntfscp_LDADD = $(AM_LIBS)
ntfscp_LDFLAGS = $(AM_LFLAGS)
ntfsck_SOURCES = ntfsck.c utils.c utils.h
ntfsck_LDADD = $(AM_LIBS)
ntfsck_LDFLAGS = $(AM_LFLAGS)
ntfscmp_SOURCES = ntfscmp.c utils.c utils.h
ntfscmp_LDADD = $(AM_LIBS)
ntfscmp_LDFLAGS = $(AM_LFLAGS)
ntfsrecover_SOURCES = playlog.c ntfsrecover.c utils.c utils.h ntfsrecover.h
ntfsrecover_LDADD = $(AM_LIBS) $(NTFSRECOVER_LIBS)
ntfsrecover_LDFLAGS = $(AM_LFLAGS)
ntfsusermap_SOURCES = ntfsusermap.c utils.c utils.h
ntfsusermap_LDADD = $(AM_LIBS) $(NTFSRECOVER_LIBS)
ntfsusermap_LDFLAGS = $(AM_LFLAGS)
ntfssecaudit_SOURCES = ntfssecaudit.c utils.c utils.h
ntfssecaudit_LDADD = $(AM_LIBS) $(NTFSRECOVER_LIBS)
ntfssecaudit_LDFLAGS = $(AM_LFLAGS)
# We don't distribute these
ntfstruncate_SOURCES = attrdef.c ntfstruncate.c utils.c utils.h
ntfstruncate_LDADD = $(AM_LIBS)
ntfstruncate_LDFLAGS = $(AM_LFLAGS)
ntfsmftalloc_SOURCES = ntfsmftalloc.c utils.c utils.h
ntfsmftalloc_LDADD = $(AM_LIBS)
ntfsmftalloc_LDFLAGS = $(AM_LFLAGS)
ntfsmove_SOURCES = ntfsmove.c ntfsmove.h utils.c utils.h
ntfsmove_LDADD = $(AM_LIBS)
ntfsmove_LDFLAGS = $(AM_LFLAGS)
ntfswipe_SOURCES = ntfswipe.c ntfswipe.h utils.c utils.h
ntfswipe_LDADD = $(AM_LIBS)
ntfswipe_LDFLAGS = $(AM_LFLAGS)
ntfsdump_logfile_SOURCES= ntfsdump_logfile.c
ntfsdump_logfile_LDADD = $(AM_LIBS)
ntfsdump_logfile_LDFLAGS= $(AM_LFLAGS)
ntfsfallocate_SOURCES = ntfsfallocate.c utils.c utils.h
ntfsfallocate_LDADD = $(AM_LIBS)
ntfsfallocate_LDFLAGS = $(AM_LFLAGS)
if ENABLE_CRYPTO
ntfsdecrypt_SOURCES = ntfsdecrypt.c utils.c utils.h
ntfsdecrypt_LDADD = $(AM_LIBS) $(GNUTLS_LIBS) $(LIBGCRYPT_LIBS)
ntfsdecrypt_LDFLAGS = $(AM_LFLAGS)
ntfsdecrypt_CFLAGS = $(GNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
endif
# Extra targets
strip: $(bin_PROGRAMS) $(sbin_PROGRAMS)
$(STRIP) $^
libs:
(cd ../libntfs-3g && $(MAKE) libs) || exit 1;
extra: extras
extras: libs $(EXTRA_PROGRAMS)
# mkfs.ntfs[.8] hard link
if ENABLE_MOUNT_HELPER
install-exec-hook:
$(INSTALL) -d $(DESTDIR)/$(sbindir)
$(LN_S) -f $(sbindir)/mkntfs $(DESTDIR)$(sbindir)/mkfs.ntfs
install-data-hook:
$(INSTALL) -d $(DESTDIR)$(man8dir)
$(LN_S) -f mkntfs.8 $(DESTDIR)$(man8dir)/mkfs.ntfs.8
uninstall-local:
$(RM) -f $(DESTDIR)/sbin/mkfs.ntfs
$(RM) -f $(DESTDIR)$(man8dir)/mkfs.ntfs.8
endif
endif

168
ntfsprogs/attrdef.c 100644
View File

@ -0,0 +1,168 @@
#include "attrdef.h"
/**
* attrdef_ntfs3x_array
*/
const unsigned char attrdef_ntfs3x_array[2560] = {
0x24, 0x00, 0x53, 0x00, 0x54, 0x00, 0x41, 0x00, 0x4E, 0x00, 0x44, 0x00, 0x41, 0x00, 0x52, 0x00,
0x44, 0x00, 0x5F, 0x00, 0x49, 0x00, 0x4E, 0x00, 0x46, 0x00, 0x4F, 0x00, 0x52, 0x00, 0x4D, 0x00,
0x41, 0x00, 0x54, 0x00, 0x49, 0x00, 0x4F, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x41, 0x00, 0x54, 0x00, 0x54, 0x00, 0x52, 0x00, 0x49, 0x00, 0x42, 0x00, 0x55, 0x00,
0x54, 0x00, 0x45, 0x00, 0x5F, 0x00, 0x4C, 0x00, 0x49, 0x00, 0x53, 0x00, 0x54, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x24, 0x00, 0x46, 0x00, 0x49, 0x00, 0x4C, 0x00, 0x45, 0x00, 0x5F, 0x00, 0x4E, 0x00, 0x41, 0x00,
0x4D, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00,
0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x4F, 0x00, 0x42, 0x00, 0x4A, 0x00, 0x45, 0x00, 0x43, 0x00, 0x54, 0x00, 0x5F, 0x00,
0x49, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x53, 0x00, 0x45, 0x00, 0x43, 0x00, 0x55, 0x00, 0x52, 0x00, 0x49, 0x00, 0x54, 0x00,
0x59, 0x00, 0x5F, 0x00, 0x44, 0x00, 0x45, 0x00, 0x53, 0x00, 0x43, 0x00, 0x52, 0x00, 0x49, 0x00,
0x50, 0x00, 0x54, 0x00, 0x4F, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x24, 0x00, 0x56, 0x00, 0x4F, 0x00, 0x4C, 0x00, 0x55, 0x00, 0x4D, 0x00, 0x45, 0x00, 0x5F, 0x00,
0x4E, 0x00, 0x41, 0x00, 0x4D, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x56, 0x00, 0x4F, 0x00, 0x4C, 0x00, 0x55, 0x00, 0x4D, 0x00, 0x45, 0x00, 0x5F, 0x00,
0x49, 0x00, 0x4E, 0x00, 0x46, 0x00, 0x4F, 0x00, 0x52, 0x00, 0x4D, 0x00, 0x41, 0x00, 0x54, 0x00,
0x49, 0x00, 0x4F, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x44, 0x00, 0x41, 0x00, 0x54, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x24, 0x00, 0x49, 0x00, 0x4E, 0x00, 0x44, 0x00, 0x45, 0x00, 0x58, 0x00, 0x5F, 0x00, 0x52, 0x00,
0x4F, 0x00, 0x4F, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x24, 0x00, 0x49, 0x00, 0x4E, 0x00, 0x44, 0x00, 0x45, 0x00, 0x58, 0x00, 0x5F, 0x00, 0x41, 0x00,
0x4C, 0x00, 0x4C, 0x00, 0x4F, 0x00, 0x43, 0x00, 0x41, 0x00, 0x54, 0x00, 0x49, 0x00, 0x4F, 0x00,
0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x24, 0x00, 0x42, 0x00, 0x49, 0x00, 0x54, 0x00, 0x4D, 0x00, 0x41, 0x00, 0x50, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x24, 0x00, 0x52, 0x00, 0x45, 0x00, 0x50, 0x00, 0x41, 0x00, 0x52, 0x00, 0x53, 0x00, 0x45, 0x00,
0x5F, 0x00, 0x50, 0x00, 0x4F, 0x00, 0x49, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x45, 0x00, 0x41, 0x00, 0x5F, 0x00, 0x49, 0x00, 0x4E, 0x00, 0x46, 0x00, 0x4F, 0x00,
0x52, 0x00, 0x4D, 0x00, 0x41, 0x00, 0x54, 0x00, 0x49, 0x00, 0x4F, 0x00, 0x4E, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x45, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x4C, 0x00, 0x4F, 0x00, 0x47, 0x00, 0x47, 0x00, 0x45, 0x00, 0x44, 0x00, 0x5F, 0x00,
0x55, 0x00, 0x54, 0x00, 0x49, 0x00, 0x4C, 0x00, 0x49, 0x00, 0x54, 0x00, 0x59, 0x00, 0x5F, 0x00,
0x53, 0x00, 0x54, 0x00, 0x52, 0x00, 0x45, 0x00, 0x41, 0x00, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

View File

@ -0,0 +1,7 @@
#ifndef _NTFS_ATTRDEF_H_
#define _NTFS_ATTRDEF_H_
extern const unsigned char attrdef_ntfs3x_array[2560];
#endif /* _NTFS_ATTRDEF_H_ */

103
ntfsprogs/boot.c 100644
View File

@ -0,0 +1,103 @@
/*
* NTFS bootsector, adapted from the vfat one.
*/
/* mkfs.fat.c - utility to create FAT/MS-DOS filesystems
* Copyright (C) 1991 Linus Torvalds <torvalds@klaava.helsinki.fi>
* Copyright (C) 1992-1993 Remy Card <card@masi.ibp.fr>
* Copyright (C) 1993-1994 David Hudson <dave@humbug.demon.co.uk>
* Copyright (C) 1998 H. Peter Anvin <hpa@zytor.com>
* Copyright (C) 1998-2005 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
* Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
* Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This program 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. If not, see <http://www.gnu.org/licenses/>.
* The complete text of the GNU General Public License
* can be found in /usr/share/common-licenses/GPL-3 file.
*/
#include "boot.h"
#define BOOTCODE_SIZE 4136
/* The "boot code" we put into the filesystem... it writes a message and
* tells the user to try again */
#define MSG_OFFSET_OFFSET 3
const unsigned char boot_array[BOOTCODE_SIZE] =
"\xeb\x52\x90" /* jump to code at 0x54 (0x7c54) */
"NTFS \0" /* NTFS signature */
"\0\0\0\0\0\0\0\0\0\0\0\0" /* 72 bytes for device parameters */
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
/* Boot code run at location 0x7c54 */
"\x0e" /* push cs */
"\x1f" /* pop ds */
"\xbe\x71\x7c" /* mov si, offset message_txt (at location 0x7c71) */
/* write_msg: */
"\xac" /* lodsb */
"\x22\xc0" /* and al, al */
"\x74\x0b" /* jz key_press */
"\x56" /* push si */
"\xb4\x0e" /* mov ah, 0eh */
"\xbb\x07\x00" /* mov bx, 0007h */
"\xcd\x10" /* int 10h */
"\x5e" /* pop si */
"\xeb\xf0" /* jmp write_msg */
/* key_press: */
"\x32\xe4" /* xor ah, ah */
"\xcd\x16" /* int 16h */
"\xcd\x19" /* int 19h */
"\xeb\xfe" /* foo: jmp foo */
/* message_txt: */
"This is not a bootable disk. Please insert a bootable floppy and\r\n"
"press any key to try again ... \r\n"
/* At location 0xd4, 298 bytes to reach 0x1fe */
/* 298 = 4 blocks of 72 then 10 */
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0"
/* Boot signature at 0x1fe */
"\x55\xaa";

7
ntfsprogs/boot.h 100644
View File

@ -0,0 +1,7 @@
#ifndef _NTFS_BOOT_H_
#define _NTFS_BOOT_H_
extern const unsigned char boot_array[4136];
#endif /* _NTFS_BOOT_H_ */

132
ntfsprogs/cluster.c 100644
View File

@ -0,0 +1,132 @@
/**
* cluster - Part of the Linux-NTFS project.
*
* Copyright (c) 2002-2003 Richard Russon
* Copyright (c) 2014 Jean-Pierre Andre
*
* This function will locate the owner of any given sector or cluster range.
*
* This program 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 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 Linux-NTFS
* distribution in the file COPYING); if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "cluster.h"
#include "utils.h"
#include "logging.h"
/**
* cluster_find
*/
int cluster_find(ntfs_volume *vol, LCN c_begin, LCN c_end, cluster_cb *cb, void *data)
{
int j;
int result = -1;
struct mft_search_ctx *m_ctx = NULL;
ntfs_attr_search_ctx *a_ctx = NULL;
s64 count;
BOOL found;
ATTR_RECORD *rec;
runlist *runs;
if (!vol || !cb)
return -1;
m_ctx = mft_get_search_ctx(vol);
m_ctx->flags_search = FEMR_IN_USE | FEMR_BASE_RECORD;
count = 0;
while (mft_next_record(m_ctx) == 0) {
if (!(m_ctx->flags_match & FEMR_BASE_RECORD))
continue;
ntfs_log_verbose("Inode: %llu\n", (unsigned long long)
m_ctx->inode->mft_no);
a_ctx = ntfs_attr_get_search_ctx(m_ctx->inode, NULL);
found = FALSE;
while ((rec = find_attribute(AT_UNUSED, a_ctx))) {
if (!rec->non_resident) {
ntfs_log_verbose("0x%02x skipped - attr is resident\n",
(int)le32_to_cpu(a_ctx->attr->type));
continue;
}
runs = ntfs_mapping_pairs_decompress(vol, a_ctx->attr, NULL);
if (!runs) {
ntfs_log_error("Couldn't read the data runs.\n");
goto done;
}
ntfs_log_verbose("\t[0x%02X]\n",
(int)le32_to_cpu(a_ctx->attr->type));
ntfs_log_verbose("\t\tVCN\tLCN\tLength\n");
for (j = 0; runs[j].length > 0; j++) {
LCN a_begin = runs[j].lcn;
LCN a_end = a_begin + runs[j].length - 1;
if (a_begin < 0)
continue; // sparse, discontiguous, etc
ntfs_log_verbose("\t\t%lld\t%lld-%lld (%lld)\n",
(long long)runs[j].vcn,
(long long)runs[j].lcn,
(long long)(runs[j].lcn +
runs[j].length - 1),
(long long)runs[j].length);
//dprint list
if ((a_begin > c_end) || (a_end < c_begin))
continue; // before or after search range
if ((*cb) (m_ctx->inode, a_ctx->attr, runs+j, data))
return 1;
found = TRUE;
}
}
ntfs_attr_put_search_ctx(a_ctx);
a_ctx = NULL;
if (found)
count++;
}
if (count > 1)
ntfs_log_info("* %lld inodes found\n",(long long)count);
else
ntfs_log_info("* %s inode found\n", (count ? "one" : "no"));
result = 0;
done:
ntfs_attr_put_search_ctx(a_ctx);
mft_put_search_ctx(m_ctx);
return result;
}

View File

@ -0,0 +1,39 @@
/*
* cluster - Part of the Linux-NTFS project.
*
* Copyright (c) 2003 Richard Russon
*
* This function will locate the owner of any given sector or cluster range.
*
* This program 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 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 Linux-NTFS
* 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 _CLUSTER_H_
#define _CLUSTER_H_
#include "types.h"
#include "volume.h"
typedef struct {
int x;
} ntfs_cluster;
typedef int (cluster_cb)(ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run, void *data);
int cluster_find(ntfs_volume *vol, LCN c_begin, LCN c_end, cluster_cb *cb, void *data);
#endif /* _CLUSTER_H_ */

Some files were not shown because too many files have changed in this diff Show More