Commit Graph

38 Commits

Author SHA1 Message Date
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é
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é
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é
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
Erik Larsson
9893ea9ee6 Merge endianness fixes.
Conflicts:
	libntfs-3g/attrib.c
2016-01-28 09:22:42 +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
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é
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é
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é
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é
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é
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é
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
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
jpandre
ee18659989 Avoided possible double openings of root directory 2010-01-04 08:12:17 +00:00
jpandre
6271663b4e Skip extended attribute related functions when not supported locally 2009-12-19 09:20:59 +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
d990f7996c Changed the interfaces to use extended attributes 2009-12-17 08:24:13 +00:00
jpandre
195945cdc0 Evaluated file names collations in a single parsing 2009-12-16 09:45:28 +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
52d5e40f93 Fixed memory allocation for translating junction points 2009-12-09 10:48:35 +00:00
jpandre
22ecdf8298 Fixed synchronization of attribs and timestamps to parent directory 2009-11-25 14:37:00 +00:00
jpandre
1fecf5d891 Fixed the return code after removing a reparse index 2009-11-24 14:22:09 +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
jpandre
b78d895575 Added indexing of reparse data into $Extend/$Reparse 2009-11-03 14:35:53 +00:00
jpandre
9836e3f22d Checked NTFS version before setting a reparse point 2009-04-03 06:55:28 +00:00
jpandre
86c1f05336 Fixed misplaced parentheses when checking a junction point 2009-03-23 16:12:06 +00:00
jpandre
935b1beca8 Fixed creating new reparse points (Faisal Puthuparackat) 2009-03-02 20:26:18 +00:00
jpandre
b73ba7f15c Avoided errno pollution when removing a reparse point 2009-01-17 08:39:23 +00:00
jpandre
ca6466c6bb Mapped a few NTFS internal data to extended attributes 2009-01-05 13:56:05 +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
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