Compare commits

...

25 Commits

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
40 changed files with 388 additions and 260 deletions

11
README
View File

@ -24,7 +24,7 @@ available in Windows 10 can also be read through a plugin.
News, support answers, problem submission instructions, support and discussion
forums, and other information are available on the project web site at
https://github.com/tuxera/ntfs-3g
https://github.com/tuxera/ntfs-3g/wiki
The project has been funded, supported and maintained since 2008 by Tuxera:
@ -47,8 +47,13 @@ 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 unpack the source tarball and 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

View File

@ -24,7 +24,7 @@
# Autoconf
AC_PREREQ(2.59)
AC_INIT([ntfs-3g],[2021.8.22],[ntfs-3g-devel@lists.sf.net])
AC_INIT([ntfs-3g],[2022.10.3],[ntfs-3g-devel@lists.sf.net])
LIBNTFS_3G_VERSION="89"
AC_CONFIG_SRCDIR([src/ntfs-3g.c])
@ -228,7 +228,7 @@ esac
if test "x${enable_ntfs_3g}" != "xyes"; then
with_fuse="none"
elif test "x${with_fuse}" == "x"; then
elif test "x${with_fuse}" = "x"; then
AC_MSG_CHECKING([fuse compatibility])
case "${target_os}" in
linux*|solaris*)

View File

@ -2223,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

View File

@ -670,11 +670,10 @@ int fuse_kern_mount(const char *mountpoint, struct fuse_args *args)
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__

View File

@ -216,6 +216,7 @@ s64 ntfs_get_attribute_value(const ntfs_volume *vol,
if (total + (rl[i].length << vol->cluster_size_bits) >=
sle64_to_cpu(a->data_size)) {
unsigned char *intbuf = NULL;
s64 intlth;
/*
* We have reached the last run so we were going to
* overflow when executing the ntfs_pread() which is
@ -229,8 +230,18 @@ s64 ntfs_get_attribute_value(const ntfs_volume *vol,
* We have reached the end of data size so we were
* going to overflow in the same fashion.
* Temporary fix: same as above.
*
* For safety, limit the amount to read to the
* needed size, knowing that the whole attribute
* size has been checked to be <= 0x40000.
*/
intbuf = ntfs_malloc(rl[i].length << vol->cluster_size_bits);
intlth = (sle64_to_cpu(a->data_size) - total
+ vol->cluster_size - 1)
>> vol->cluster_size_bits;
if (rl[i].length < intlth)
intlth = rl[i].length;
intbuf = (u8*)ntfs_malloc(intlth
<< vol->cluster_size_bits);
if (!intbuf) {
free(rl);
return 0;
@ -246,14 +257,15 @@ s64 ntfs_get_attribute_value(const ntfs_volume *vol,
* - Yes we can, in sparse files! But not necessarily
* size of 16, just run length.
*/
r = ntfs_pread(vol->dev, rl[i].lcn <<
vol->cluster_size_bits, rl[i].length <<
vol->cluster_size_bits, intbuf);
if (r != rl[i].length << vol->cluster_size_bits) {
r = ntfs_pread(vol->dev,
rl[i].lcn << vol->cluster_size_bits,
intlth << vol->cluster_size_bits,
intbuf);
if (r != intlth << vol->cluster_size_bits) {
#define ESTR "Error reading attribute value"
if (r == -1)
ntfs_log_perror(ESTR);
else if (r < rl[i].length <<
else if (r < intlth <<
vol->cluster_size_bits) {
ntfs_log_debug(ESTR ": Ran out of input data.\n");
errno = EIO;
@ -414,7 +426,16 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type,
na = ntfs_calloc(sizeof(ntfs_attr));
if (!na)
goto out;
if (!name_len)
name = (ntfschar*)NULL;
if (name && name != AT_UNNAMED && name != NTFS_INDEX_I30) {
/* A null char leads to a short name and unallocated bytes */
if (ntfs_ucsnlen(name, name_len) != name_len) {
ntfs_log_error("Null character in attribute name"
" of inode %lld\n",(long long)ni->mft_no);
errno = EIO;
goto err_out;
}
name = ntfs_ucsndup(name, name_len);
if (!name)
goto err_out;
@ -432,8 +453,20 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type,
if (!name) {
if (a->name_length) {
name = ntfs_ucsndup((ntfschar*)((u8*)a + le16_to_cpu(
a->name_offset)), a->name_length);
ntfschar *attr_name;
attr_name = (ntfschar*)((u8*)a
+ le16_to_cpu(a->name_offset));
/* A null character leads to illegal memory access */
if (ntfs_ucsnlen(attr_name, a->name_length)
!= a->name_length) {
ntfs_log_error("Null character in attribute"
" name in inode %lld\n",
(long long)ni->mft_no);
errno = EIO;
goto put_err_out;
}
name = ntfs_ucsndup(attr_name, a->name_length);
if (!name)
goto put_err_out;
newname = name;

View File

@ -66,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)

View File

@ -287,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));
/*
@ -308,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. */
@ -380,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;

View File

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 Richard Russon
* Copyright (c) 2004-2008 Szabolcs Szakacsits
* Copyright (c) 2005 Yura Pakhuchiy
* Copyright (c) 2014-2018 Jean-Pierre Andre
* 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
@ -978,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;
}
@ -1529,8 +1528,17 @@ found_free_rec:
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 = *(le16*)((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);
@ -1767,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)
@ -1783,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

View File

@ -5,7 +5,7 @@
* Copyright (c) 2002-2005 Richard Russon
* Copyright (c) 2002-2008 Szabolcs Szakacsits
* Copyright (c) 2004 Yura Pakhuchiy
* Copyright (c) 2007-2010 Jean-Pierre Andre
* 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
@ -918,11 +918,18 @@ static 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;
}
@ -987,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;

View File

@ -1189,8 +1189,9 @@ char *ntfs_uppercase_mbs(const char *low,
free(upp);
upp = (char*)NULL;
errno = EILSEQ;
} else {
*t = 0;
}
*t = 0;
}
return (upp);
}

View File

@ -77,7 +77,7 @@
#include "security.h"
const char *ntfs_home =
"News, support and information: http://tuxera.com\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"
@ -121,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://tuxera.com/community/ntfs-3g-faq/#unprivileged\n";
"https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ\n";
/**
* ntfs_volume_alloc - Create an NTFS volume object and initialise it

View File

@ -23,13 +23,27 @@ EXTRA_PROGRAM_NAMES = ntfswipe ntfstruncate ntfsrecover \
QUARANTINED_PROGRAM_NAMES = ntfsdump_logfile ntfsmftalloc ntfsmove ntfsck \
ntfsfallocate
man_MANS = mkntfs.8 ntfsfix.8 ntfslabel.8 ntfsinfo.8 \
ntfsundelete.8 ntfsresize.8 ntfsprogs.8 ntfsls.8 \
ntfsclone.8 ntfscluster.8 ntfscat.8 ntfscp.8 \
ntfscmp.8 ntfswipe.8 ntfstruncate.8 \
ntfsdecrypt.8 ntfsfallocate.8 ntfsrecover.8 \
ntfsusermap.8 ntfssecaudit.8
EXTRA_MANS =
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)
@ -44,6 +58,7 @@ 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

View File

@ -285,7 +285,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR badblocks (8),

View File

@ -776,8 +776,20 @@ static ntfs_time mkntfs_time(void)
ts.tv_sec = 0;
ts.tv_nsec = 0;
if (!opts.use_epoch_time)
ts.tv_sec = time(NULL);
if (!opts.use_epoch_time) {
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv = { 0, 0, };
if (!gettimeofday(&tv, NULL)) {
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * 1000L;
}
else
#endif
{
ts.tv_sec = time(NULL);
}
}
return timespec2ntfs(ts);
}

View File

@ -126,7 +126,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
Read \fBlibntfs\fR(8) for details how to access encrypted files.

View File

@ -616,7 +616,8 @@ static BOOL check_file_record(u8 *buffer, u16 buflen)
// Remove update seq & check it.
usa = *(u16*)(buffer+usa_ofs); // The value that should be at the end of every sector.
assert_u32_equal(usa_count-1, buflen/NTFS_BLOCK_SIZE, "USA length");
if (assert_u32_equal(usa_count-1, buflen/NTFS_BLOCK_SIZE, "USA length"))
return (1);
for (i=1;i<usa_count;i++) {
u16 *fixup = (u16*)(buffer+NTFS_BLOCK_SIZE*i-2); // the value at the end of the sector.
u16 saved_val = *(u16*)(buffer+usa_ofs+2*i); // the actual data value that was saved in the us array.

View File

@ -387,7 +387,7 @@ is part of the
package and is available at:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfsresize (8)

View File

@ -117,7 +117,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfsinfo (8),

View File

@ -67,7 +67,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfsinfo (8),

View File

@ -113,7 +113,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g
.hy
.SH SEE ALSO
.BR ntfsprogs (8)

View File

@ -120,7 +120,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
Read \fBntfs-3g\fR(8) for details on option efs_raw,

View File

@ -128,7 +128,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfs-3g (8),

View File

@ -75,7 +75,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR mkntfs (8),

View File

@ -83,7 +83,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfsprogs (8)

View File

@ -112,7 +112,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR mkntfs (8),

View File

@ -166,7 +166,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfsprogs (8)

View File

@ -74,7 +74,7 @@ are part of the
package which can be downloaded from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfs\-3g (8)

View File

@ -164,7 +164,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfs-3g (8),

View File

@ -305,7 +305,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR fdisk (8),

View File

@ -160,7 +160,7 @@ of 1 when an error was detected.
Please see
.RS
.sp
http://www.tuxera.com/community/ntfs-3g-faq/
https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ/
.sp
.RE
for common questions and known issues.

View File

@ -116,7 +116,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfs-3g (8),

View File

@ -317,7 +317,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfsinfo (8),

View File

@ -62,8 +62,6 @@ Map the users defined on the Windows system present on /dev/sda1 :
.sp
.RE
.PP
A detailed example, with screen displays is available on
http://jp-andre.pagesperso-orange.fr/ntfsusermap.html
.SH EXIT CODES
.B ntfsusermap
exits with a value of 0 when no error was detected, and with a value
@ -72,7 +70,7 @@ of 1 when an error was detected.
Please see
.RS
.sp
http://www.tuxera.com/community/ntfs-3g-faq/
https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ/
.sp
.RE
for common questions and known issues.

View File

@ -126,7 +126,7 @@ is part of the
package and is available from:
.br
.nh
http://www.tuxera.com/community/
https://github.com/tuxera/ntfs-3g/wiki/
.hy
.SH SEE ALSO
.BR ntfs-3g (8),

View File

@ -262,7 +262,7 @@ static const char *usage_msg =
"\n"
"Copyright (C) 2005-2007 Yura Pakhuchiy\n"
"Copyright (C) 2006-2009 Szabolcs Szakacsits\n"
"Copyright (C) 2007-2021 Jean-Pierre Andre\n"
"Copyright (C) 2007-2022 Jean-Pierre Andre\n"
"Copyright (C) 2009-2020 Erik Larsson\n"
"\n"
"Usage: %s [-o option[,...]] <device|image_file> <mount_point>\n"
@ -300,13 +300,13 @@ static const char *setuid_msg =
"external FUSE library. Either remove the setuid/setgid bit from the binary\n"
"or rebuild NTFS-3G with integrated FUSE support and make it setuid root.\n"
"Please see more information at\n"
"http://tuxera.com/community/ntfs-3g-faq/#unprivileged\n";
"https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ\n";
static const char *unpriv_fuseblk_msg =
"Unprivileged user can not mount NTFS block devices using the external FUSE\n"
"library. Either mount the volume as root, or rebuild NTFS-3G with integrated\n"
"FUSE support and make it setuid root. Please see more information at\n"
"http://tuxera.com/community/ntfs-3g-faq/#unprivileged\n";
"https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ\n";
#endif
@ -4398,7 +4398,7 @@ static const char *fuse26_kmod_msg =
" message to disappear then you should upgrade to at least kernel\n"
" version 2.6.20, or request help from your distribution to fix\n"
" the kernel problem. The below web page has more information:\n"
" http://tuxera.com/community/ntfs-3g-faq/#fuse26\n"
" https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ\n"
"\n";
static void mknod_dev_fuse(const char *dev)

View File

@ -4,7 +4,7 @@
.\" Copyright (c) 2009-2014 Jean-Pierre Andre
.\" This file may be copied under the terms of the GNU Public License.
.\"
.TH NTFS-3G 8 "Mar 2014" "ntfs-3g @VERSION@"
.TH NTFS-3G 8 "Aug 2021" "ntfs-3g @VERSION@"
.SH NAME
ntfs-3g \- Third Generation Read/Write NTFS Driver
.SH SYNOPSIS
@ -35,7 +35,7 @@ It comes in two variants \fBntfs-3g\fR and \fBlowntfs-3g\fR with
a few differences mentioned below in relevant options descriptions.
.PP
The \fIvolume\fR to be mounted can be either a block device or
an image file.
an image file, either by using the mount command or starting the drive.
.SS Windows hibernation and fast restarting
On computers which can be dual-booted into Windows or Linux, Windows has
to be fully shut down before booting into Linux, otherwise the NTFS file
@ -70,7 +70,7 @@ and
.B dmask
options.
.PP
Doing so, Windows users have full access to the files created by
Doing so, all Windows users have full access to the files created by
.B ntfs-3g.
.PP
But, by setting the \fBpermissions\fR option, you can benefit from the full
@ -96,9 +96,9 @@ data stream and can have many named data streams. The size of a file is the
size of its unnamed data stream. By default, \fBntfs-3g\fR will only read
the unnamed data stream.
.PP
By using the options "streams_interface=windows", with the ntfs-3g driver
By using the option \fBstreams_interface=windows\fP, with the ntfs-3g driver
(not possible with lowntfs-3g), you will be able to read any named data
streams, simply by specifying the stream's name after a colon.
streams, simply by specifying the stream name after a colon.
For example:
.RS
.sp
@ -107,45 +107,10 @@ cat some.mp3:artist
.RE
Named data streams act like normal files, so you can read from them, write to
them and even delete them (using rm). You can list all the named data streams
a file has by getting the "ntfs.streams.list" extended attribute.
a file has by getting the \fBntfs.streams.list\fP extended attribute.
.SH OPTIONS
Below is a summary of the options that \fBntfs-3g\fR accepts.
.TP
\fBuid=\fP\fIvalue\fP and \fBgid=\fP\fIvalue\fP
Set the owner and the group of files and directories. The values are numerical.
The defaults are the uid and gid of the current process.
.TP
.BI umask= value
Set the bitmask of the file and directory permissions that are not
present. The value is given in octal. The default value is 0 which
means full access to everybody.
.TP
.BI fmask= value
Set the bitmask of the file permissions that are not present.
The value is given in octal. The default value is 0 which
means full access to everybody.
.TP
.BI dmask= value
Set the bitmask of the directory permissions that are not
present. The value is given in octal. The default value is 0 which
means full access to everybody.
.TP
.BI usermapping= file-name
Use file \fIfile-name\fP as the user mapping file instead of the default
\fB.NTFS-3G/UserMapping\fP. If \fIfile-name\fP defines a full path, the
file must be located on a partition previously mounted. If it defines a
relative path, it is interpreted relative to the root of NTFS partition
being mounted.
.P
.RS
When a user mapping file is defined, the options \fBuid=\fP, \fBgid=\fP,
\fBumask=\fP, \fBfmask=\fP, \fBdmask=\fP and \fBsilent\fP are ignored.
.RE
.TP
.B permissions
Set standard permissions on created files and use standard access control.
This option is set by default when a user mapping file is present.
.TP
.B acl
Enable setting Posix ACLs on created files and use them for access control.
This option is only available on specific builds. It is set by default
@ -153,46 +118,11 @@ when a user mapping file is present and the
.B permissions
mount option is not set.
.TP
.B inherit
When creating a new file, set its initial protections
according to inheritance rules defined in parent directory. These rules
deviate from Posix specifications, but yield a better Windows
compatibility. The \fBpermissions\fR option or a valid user mapping file
is required for this option to be effective.
.TP
.B ro
Mount filesystem read\-only. Useful if Windows is hibernated or the
NTFS journal file is unclean.
.TP
.BI locale= value
This option can be useful when wanting a language specific locale environment.
It is however discouraged as it leads to files with untranslatable chars
to not be visible.
.TP
.B force
This option is obsolete. It has been superseded by the \fBrecover\fR and
\fBnorecover\fR options.
.TP
.B recover
Recover and try to mount a partition which was not unmounted properly by
Windows. The Windows logfile is cleared, which may cause inconsistencies.
Currently this is the default option.
.TP
.B norecover
Do not try to mount a partition which was not unmounted properly by Windows.
.TP
.B ignore_case \fP(only with lowntfs-3g)
Ignore character case when accessing a file (\fBFOO\fR, \fBFoo\fR, \fBfoo\fR,
etc. designate the same file). All files are displayed with lower case in
directory listings.
.TP
.B remove_hiberfile
When the NTFS volume is hibernated, a read-write mount is denied and
a read-only mount is forced. One needs either to resume Windows and
shutdown it properly, or use this option which will remove the Windows
hibernation file. Please note, this means that the saved Windows
session will be completely lost. Use this option under your own
responsibility.
.B allow_other
This option overrides the security measure restricting file access
to the user mounting the filesystem. This option is only
allowed to root, but this restriction can be overridden by
the \fBuser_allow_other\fP option in the /etc/fuse.conf file.
.TP
.B atime, noatime, relatime
The
@ -201,7 +131,7 @@ option updates inode access time for each access.
The
.B noatime
option disables inode access time updates which can speed up
option disables inode access time updates, which can speed up
file operations and prevent sleeping (notebook) disks spinning
up too often thus saving energy and disk lifetime.
@ -217,6 +147,23 @@ this option doesn't break applications that need to know
if a file has been read since the last time it was modified.
This is the default behaviour.
.TP
.B big_writes
This option prevents fuse from splitting write buffers into 4K chunks,
enabling big write buffers to be transferred from the application in a
single step (up to some system limit, generally 128K bytes).
.TP
.B compression
This option enables creating new transparently compressed files in
directories marked for compression. A directory is marked for compression by
setting the bit 11 (value 0x00000800) in its Windows attribute. In such a
directory, new files are created compressed and new subdirectories are
themselves marked for compression. The option and the flag have no effect
on existing files. Currently this is the default option.
.TP
.B debug
Makes ntfs-3g (or lowntfs-3g) to print a lot of debug output from libntfs-3g
and FUSE.
.TP
.B delay_mtime[= value]
Only update the file modification time and the file change time of a file
when it is closed or when the indicated delay since the previous update has
@ -225,22 +172,26 @@ This is mainly useful for big files which are kept open for a long
time and written to without changing their size, such as databases or file
system images mounted as loop.
.TP
.B show_sys_files
Show the metafiles in directory listings. Otherwise the default behaviour is
to hide the metafiles, which are special files used to store the NTFS
structure. Please note that even when this option is specified, "$MFT" may
not be visible due to a glibc bug. Furthermore, irrespectively of
show_sys_files, all files are accessible by name, for example you can always
do
"ls \-l '$UpCase'".
.BI dmask= value
Set the bitmask of the directory permissions that are not
present. The value is given in octal. The default value is 0 which
means full access to everybody.
.TP
.B hide_hid_files
Hide the hidden files and directories in directory listings, the hidden files
and directories being the ones whose NTFS attribute have the hidden flag set.
The hidden files will not be selected when using wildcards in commands,
but all files and directories remain accessible by full name, for example you
can always display the Windows trash bin directory by :
"ls \-ld '$RECYCLE.BIN'".
.B efs_raw
This option should only be used in backup or restore situation.
It changes the apparent size of files and the behavior of read and
write operation so that encrypted files can be saved and restored
without being decrypted. The \fBuser.ntfs.efsinfo\fP extended attribute
has also to be saved and restored for the file to be decrypted.
.TP
.BI fmask= value
Set the bitmask of the file permissions that are not present.
The value is given in octal. The default value is 0 which
means full access to everybody.
.TP
.B force
This option is obsolete. It has been superseded by the \fBrecover\fR and
\fBnorecover\fR options.
.TP
.B hide_dot_files
Set the hidden flag in the NTFS attribute for created files and directories
@ -250,13 +201,141 @@ they do not appear in Windows directory displays either.
When a file is renamed or linked with a new name, the hidden flag is
adjusted to the latest name.
.TP
.B hide_hid_files
Hide the hidden files and directories in directory listings, the hidden files
and directories being the ones whose NTFS attribute have the hidden flag set.
The hidden files will not be selected when using wildcards in commands,
but all files and directories remain accessible by full name, for example you
can always display the Windows trash bin directory by :
"ls \-ld '$RECYCLE.BIN'".
.TP
.B ignore_case \fP(only with lowntfs-3g)
Ignore character case when accessing a file (\fBFOO\fR, \fBFoo\fR, \fBfoo\fR,
etc. designate the same file). All files are displayed with lower case in
directory listings.
.TP
.B inherit
When creating a new file, set its initial protections
according to inheritance rules defined in parent directory. These rules
deviate from Posix specifications, but yield a better Windows
compatibility. The \fBpermissions\fR (or **acl**) option or a valid user
mapping file is required for this option to be effective.
.TP
.BI locale= value
This option can be useful when wanting a language specific locale environment.
It is however discouraged as it leads to files with untranslatable characters
to not be visible.
.TP
.BI max_read= value
With this option the maximum size of read operations can be set.
The default is infinite. Note that the size of read requests is
limited anyway by the system (usually to 128kbyte).
.TP
.B no_def_opts
By default ntfs-3g acts as if \fBsilent\fP (ignore permission errors when
permissions are not enabled),
\fBallow_other\fP (allow any user to access files) and \fBnonempty\fP
(allow mounting on non-empty directories) were set, and \fBno_def_opts\fP
cancels these default options.
.TP
.B no_detach
Makes ntfs-3g to not detach from terminal and print some debug output.
.TP
.B nocompression
This option disables creating new transparently compressed files in directories
marked for compression. Existing compressed files can still be read and
updated.
.TP
.B norecover
Do not try to mount a partition which was not unmounted properly by Windows.
.TP
.B permissions
Set standard permissions on created files and use standard access control.
This option is set by default when a user mapping file is present.
.TP
.B posix_nlink
Compute the count of hard links of a file or directory according to
the Posix specifications. When this option is not set, a count of 1
the POSIX specifications. When this option is not set, a count of 1
is set for directories, and the short name of files is accounted for.
Using the option entails some penalty as the count is not stored and
has to be computed.
.TP
.B recover
Recover and try to mount a partition which was not unmounted properly by
Windows. The Windows logfile is cleared, which may cause inconsistencies.
Currently this is the default option.
.TP
.B remove_hiberfile
When the NTFS volume is hibernated, a read-write mount is denied and
a read-only mount is forced. One needs either to resume Windows and
shutdown it properly, or use this option which will remove the Windows
hibernation file. Please note, this means that the saved Windows
session will be completely lost. Use this option under your own
responsibility.
.TP
.B ro
Mount the filesystem read\-only. Useful if Windows is hibernated or the
NTFS journal file is unclean.
.TP
.B show_sys_files
Show the metafiles in directory listings. Otherwise the default behaviour is
to hide the metafiles, which are special files used to store the NTFS
structure. Please note that even when this option is specified, "$MFT" may
not be visible due to a glibc bug. Furthermore, irrespectively of
\fBshow_sys_files\fP, all files are accessible by name, for example you can
always do
"ls \-l '$UpCase'".
.TP
.B silent
Do nothing, without returning any error, on chmod and chown operations
and on permission checking errors,
when the \fBpermissions\fR option is not set and no user mapping file
is defined. This option is on by default, and when set off (through option
\fBno_def_opts\fR) ownership and permissions parameters have to be set.
.TP
.BI special_files= mode
This option selects a mode for representing a special file to be created
(symbolic link, socket, fifo, character or block device). The \fImode\fP can
be \fBinterix\fR or \fBwsl\fR, and existing files in either mode are
recognized irrespective of the selected mode. Interix is the traditional
mode, used by default, and wsl is interoperable with Windows WSL, but
it is not compatible with Windows versions earlier than Windows 10.
Neither mode are interoperable with Windows.
.TP
.BI streams_interface= mode
This option controls how the user can access Alternate Data Streams (ADS) or in
other words, named data streams. The \fImode\fP can be set to one of \fBnone\fR,
\fBwindows\fR or \fBxattr\fR. If the option is set to \fBnone\fR, the user
will have no access to the named data streams. If it is set to \fBwindows\fR
(not possible with lowntfs-3g), then the user can access them just like in
Windows (eg. cat file:stream). If it's set to \fBxattr\fR, then the named
data streams are mapped to extended attributes and a user can manipulate them
using \fB{get,set}fattr\fR utilities. The default is \fBxattr\fR.
.TP
\fBuid=\fP\fIvalue\fP and \fBgid=\fP\fIvalue\fP
Set the owner and the group of files and directories. The values are numerical.
The defaults are the uid and gid of the current process.
.TP
.BI umask= value
Set the bitmask of the file and directory permissions that are not
present. The value is given in octal. The default value is 0 which
means full access to everybody.
.TP
.BI usermapping= file-name
Use file \fIfile-name\fP as the user mapping file instead of the default
\fB.NTFS-3G/UserMapping\fP. If \fIfile-name\fP defines a full path, the
file must be located on a partition previously mounted. If it defines a
relative path, it is interpreted relative to the root of NTFS partition
being mounted.
.P
.RS
When a user mapping file is defined, the options \fBuid=\fP, \fBgid=\fP,
\fBumask=\fP, \fBfmask=\fP, \fBdmask=\fP and \fBsilent\fP are ignored.
.RE
.TP
.B user_xattr
Same as \fBstreams_interface=\fP\fIxattr\fP.
.TP
.B windows_names
This option prevents files, directories and extended attributes to be
created with a name not allowed by windows, because
@ -277,92 +356,15 @@ with no suffix or followed by a dot.
.sp
Existing such files can still be read (and renamed).
.RE
.TP
.B allow_other
This option overrides the security measure restricting file access
to the user mounting the filesystem. This option is only
allowed to root, but this restriction can be overridden by
the 'user_allow_other' option in the /etc/fuse.conf file.
.TP
.BI max_read= value
With this option the maximum size of read operations can be set.
The default is infinite. Note that the size of read requests is
limited anyway to 32 pages (which is 128kbyte on i386).
.TP
.B silent
Do nothing, without returning any error, on chmod and chown operations
and on permission checking errors,
when the \fBpermissions\fR option is not set and no user mapping file
is defined. This option is on by default, and when set off (through option
\fBno_def_opts\fR) ownership and permissions parameters have to be set.
.TP
.B no_def_opts
By default ntfs-3g acts as if "silent" (ignore permission errors when
permissions are not enabled),
"allow_other" (allow any user to access files) and "nonempty"
(allow mounting on non-empty directories) were set, and "no_def_opts"
cancels these default options.
.TP
.BI streams_interface= value
This option controls how the user can access Alternate Data Streams (ADS) or
in other words, named data streams. It can be set to, one of \fBnone\fR,
\fBwindows\fR or \fBxattr\fR. If the option is set to \fBnone\fR, the user
will have no access to the named data streams. If it is set to \fBwindows\fR
(not possible with lowntfs-3g), then the user can access them just like in
Windows (eg. cat file:stream). If it's set to \fBxattr\fR, then the named
data streams are mapped to xattrs and user can manipulate them using
\fB{get,set}fattr\fR utilities. The default is \fBxattr\fR.
.TP
.B user_xattr
Same as \fBstreams_interface=\fP\fIxattr\fP.
.TP
.BI special_files= value
This option selects a mode for representing a special file to be created
(symbolic link, socket, fifo, character or block device). The mode can
be \fBinterix\fR or \fBwsl\fR, and existing files in either mode are
recognized irrespective of the selected mode. Interix is the traditional
mode, used by default, and wsl is interoperable with Windows WSL, but
it is not compatible with Windows versions earlier than Windows 10.
.TP
.B efs_raw
This option should only be used in backup or restore situation.
It changes the apparent size of files and the behavior of read and
write operation so that encrypted files can be saved and restored
without being decrypted. The \fBuser.ntfs.efsinfo\fP extended attribute
has also to be saved and restored for the file to be decrypted.
.TP
.B compression
This option enables creating new transparently compressed files in
directories marked for compression. A directory is marked for compression by
setting the bit 11 (value 0x00000800) in its Windows attribute. In such a
directory, new files are created compressed and new subdirectories are
themselves marked for compression. The option and the flag have no effect
on existing files. Currently this is the default option.
.TP
.B nocompression
This option disables creating new transparently compressed files in directories
marked for compression. Existing compressed files can still be read and
updated.
.TP
.B big_writes
This option prevents fuse from splitting write buffers into 4K chunks,
enabling big write buffers to be transferred from the application in a
single step (up to some system limit, generally 128K bytes).
.TP
.B debug
Makes ntfs-3g to print a lot of debug output from libntfs-3g and FUSE.
.TP
.B no_detach
Makes ntfs-3g to not detach from terminal and print some debug output.
.SH USER MAPPING
NTFS uses specific ids to record the ownership of files instead of
the \fBuid\fP and \fBgid\fP used by Linux. As a consequence a mapping
between the ids has to be defined for ownerships to be recorded into
NTFS and recognized.
the \fBuid\fP (user id) and \fBgid\fP (group id) used by Linux. As a
consequence a mapping between the ids has to be defined for ownerships
to be recorded into NTFS files and recognized.
.P
By default, this mapping is fetched from the file \fB.NTFS-3G/UserMapping\fP
located in the NTFS partition. The option \fBusermapping=\fP may be used
to define another location. When the option permissions is set and
to define another location. When the option **permissions** is set and
no mapping file is found, a default mapping is used.
.P
Each line in the user mapping file defines a mapping. It is organized
@ -379,15 +381,15 @@ both cases, files created on Linux will appear to Windows as owned by a
foreign user, and files created on Windows will appear to Linux as owned by
root. Just copy the example below and replace the 9 and 10-digit numbers by
any number not greater than 4294967295. The resulting behavior is the same as
the one with the option permission set with no ownership option and no user
mapping file available.
the one with the option \fBpermission\fP set with no ownership option and no
user mapping file available.
.RS
.sp
.B ::S-1-5-21-3141592653-589793238-462643383-10000
.sp
.RE
If a strong interoperation with Windows is needed, the mapping has to be
defined for each user and group known in both system, and the \fBSID\fPs used
defined for each user and group known to both system, and the \fBSID\fPs used
by Windows has to be collected. This will lead to a user mapping file like :
.RS
.sp
@ -454,15 +456,18 @@ manual page.
Please see
.RS
.sp
http://www.tuxera.com/support/
https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ
.sp
.RE
for common questions and known issues.
If you would find a new one in the latest release of
the software then please send an email describing it
in detail. You can contact the
development team on the ntfs\-3g\-devel@lists.sf.net
address.
the software then please post an ntfs-3g issue describing it in detail
so that the development team can be aware of the issue and take care of it:
.RS
.sp
https://github.com/tuxera/ntfs-3g/issues
.sp
.RE
.SH AUTHORS
.B ntfs-3g
was based on and a major improvement to ntfsmount and libntfs which were
@ -472,7 +477,8 @@ Linux-NTFS team developer Szabolcs Szakacsits (szaka@tuxera.com).
.SH THANKS
Several people made heroic efforts, often over five or more
years which resulted the ntfs-3g driver. Most importantly they are
Anton Altaparmakov, Jean-Pierre André, Richard Russon, Szabolcs Szakacsits,
Anton Altaparmakov, Jean-Pierre André, Erik Larsson, Richard Russon,
Szabolcs Szakacsits,
Yura Pakhuchiy, Yuval Fledel, and the author of the groundbreaking FUSE
filesystem development framework, Miklos Szeredi.
.SH SEE ALSO

View File

@ -197,7 +197,7 @@ static const char *usage_msg =
"\n"
"Copyright (C) 2005-2007 Yura Pakhuchiy\n"
"Copyright (C) 2006-2009 Szabolcs Szakacsits\n"
"Copyright (C) 2007-2021 Jean-Pierre Andre\n"
"Copyright (C) 2007-2022 Jean-Pierre Andre\n"
"Copyright (C) 2009-2020 Erik Larsson\n"
"\n"
"Usage: %s [-o option[,...]] <device|image_file> <mount_point>\n"
@ -235,13 +235,13 @@ static const char *setuid_msg =
"external FUSE library. Either remove the setuid/setgid bit from the binary\n"
"or rebuild NTFS-3G with integrated FUSE support and make it setuid root.\n"
"Please see more information at\n"
"http://tuxera.com/community/ntfs-3g-faq/#unprivileged\n";
"https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ\n";
static const char *unpriv_fuseblk_msg =
"Unprivileged user can not mount NTFS block devices using the external FUSE\n"
"library. Either mount the volume as root, or rebuild NTFS-3G with integrated\n"
"FUSE support and make it setuid root. Please see more information at\n"
"http://tuxera.com/community/ntfs-3g-faq/#unprivileged\n";
"https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ\n";
#endif
@ -4106,7 +4106,7 @@ static const char *fuse26_kmod_msg =
" message to disappear then you should upgrade to at least kernel\n"
" version 2.6.20, or request help from your distribution to fix\n"
" the kernel problem. The below web page has more information:\n"
" http://tuxera.com/community/ntfs-3g-faq/#fuse26\n"
" https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ\n"
"\n";
static void mknod_dev_fuse(const char *dev)

View File

@ -63,14 +63,18 @@ Unclassified FUSE error.
Please see
.RS
.sp
http://tuxera.com/community/ntfs-3g-faq/
https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ
.sp
.RE
for common questions and known issues.
If you think you have found an undocumented problem in the latest release of
the software then please send an email describing it in detail.
You can contact the development team on the ntfs\-3g\-devel@lists.sf.net
address.
the software then please post an ntfs-3g issue describing it in detail
so that the development team can be aware of the issue and take care of it:
.RS
.sp
https://github.com/tuxera/ntfs-3g/issues
.sp
.RE
.SH AUTHORS
.B ntfs-3g.probe
was written by Szabolcs Szakacsits.

View File

@ -128,6 +128,10 @@ const struct DEFOPTION optionlist[] = {
{ "efs_raw", OPT_EFS_RAW, FLGOPT_BOGUS },
{ "posix_nlink", OPT_POSIX_NLINK, FLGOPT_BOGUS },
{ "special_files", OPT_SPECIAL_FILES, FLGOPT_STRING },
{ "--help", OPT_HELP, FLGOPT_BOGUS },
{ "-h", OPT_HELP, FLGOPT_BOGUS },
{ "--version", OPT_VERSION, FLGOPT_BOGUS },
{ "-V", OPT_VERSION, FLGOPT_BOGUS },
{ (const char*)NULL, 0, 0 } /* end marker */
} ;
@ -521,6 +525,8 @@ char *parse_mount_options(ntfs_fuse_context_t *ctx,
* mounted or not.
* (falling through to default)
*/
case OPT_HELP : /* Could lead to unclean condition */
case OPT_VERSION : /* Could lead to unclean condition */
default :
ntfs_log_error("'%s' is an unsupported option.\n",
poptl->name);

View File

@ -94,6 +94,8 @@ enum {
OPT_EFS_RAW,
OPT_POSIX_NLINK,
OPT_SPECIAL_FILES,
OPT_HELP,
OPT_VERSION,
} ;
/* Option flags */