374 Commits

Author SHA1 Message Date
relan
8cffe412ea Include config.h before all other headers.
The defines in config.h may affect OS and FUSE API and ABI, so make sure
to include it before everything else.
2025-06-14 11:11:09 +03:00
relan
498a23ea3d Check for ublio only on FreeBSD hosts. 2025-06-14 11:11:02 +03:00
relan
75becf3606 Fix binary compatibility between fuse and others.
CFLAGS from fuse.pc may affect ABI, e.g. enable 64-bit inode numbers on
Mac OS X 10.5. Propagate FUSE CFLAGS to all other components to ensure
binary compatibility.
2025-06-11 13:47:33 +03:00
relan
cf2d9bd161 Update copyright years. 2023-03-02 22:32:35 +03:00
relan
d8d66f9a65 Implement valid size handling.
Handle valid size on truncate, read and write operations.
2022-12-29 13:28:22 +03:00
relan
d7e780da26 Maintain valid_size in exfat_node. 2022-12-29 12:48:59 +03:00
relan
f24489a88d Rename newsize to uoffset.
Because that's what it actually is: the unsigned version of offset.
2022-12-29 12:48:59 +03:00
relan
57912599d8 Do not treat device opening error as FS error.
This makes more sense, e.g. when the user mistyped the device name or
does not have enough privileges.
2022-12-29 12:19:40 +03:00
relan
cdd8f98023 Fix a couple of typos in comments. 2022-10-04 21:54:01 +03:00
relan
da00dc5d05 Make error handling in find_slot() more robust.
check_slot() can potentially return any value besides 0, -EIO and
-EINVAL.
2021-10-23 14:40:58 +03:00
relan
f826fee074 CI: switch to Debian 11 with GCC 11.
Also enable warnings as errors and GCC's static analyzer.
2021-10-09 11:11:15 +03:00
relan
ab19b44cd3 Duplicate debug messages into syslog.
May be helpful when running detached from tty.
2021-07-04 10:25:54 +03:00
Dave Vasilevsky
c1132b5e2a Properly get disk size on NetBSD. 2021-06-30 21:02:25 +03:00
relan
02b793c0bd Move match_option() to libexfat/utils.c.
To be used in a later patch.
2021-04-10 10:46:32 +03:00
relan
4e6606bb5f Fix cluster bitmap traversal on big endian machines.
We define bitmap_t to unsigned char on big endian systems to avoid byte
order conversions. But bitwise complement causes integer promotion and
makes the condition always false. Truncate the result after complementing
zero.
2020-05-04 18:53:09 +03:00
relan
f15b0e4676 Fix more comparisons between signed and unsigned values.
Found by gcc 7.4.0.
2020-05-04 18:53:09 +03:00
noctis
00cd408632 Fix file contiguous judgement.
Signed-off-by: noctis <noctis.AKM@gmail.com>
2020-05-04 18:49:27 +03:00
relan
96ff4f2968 Add platform macros for illumos.
With this change fuse-exfat reportedly works on OpenIndiana.
2020-05-04 14:04:28 +03:00
relan
66e3a25514 Validate UTF-8 byte sequence.
The 2nd and subsequent bytes in a UTF-8 byte sequence must look like
10xxxxxx. The missing checks could lead to crash later.
2020-03-07 09:20:26 +03:00
relan
4610ce90f9 Rename UTF-related functions.
Avoid conflicts with Android's libutils. Those functions should have had
the "exfat" prefix from the very beginning...
2020-02-29 11:46:41 +03:00
relan
6893176e00 Fix comparisons between signed and unsigned values. 2020-02-29 11:40:56 +03:00
relan
02a35baff3 Suppress warnings about unused parameters. 2020-02-29 10:56:27 +03:00
relan
dd1da06e6e Check offset in exfat_generic_pread()/exfat_generic_pwrite().
A negative offset makes no sense for those functions.
2020-02-29 10:54:57 +03:00
relan
360084b62e Fix some signedness warnings. 2019-08-17 19:51:27 +03:00
relan
fdf4e96dc3 Fix unaligned accesses to packed struct members. 2019-07-25 06:59:12 +03:00
relan
8396b05b33 Soil super block after successful mount.
Leave volume state untouched until we are ready to serve writes.
2019-07-08 20:55:58 +03:00
Nathan Hunsperger
75f28b558a Add support for timezone offsets.
Timestamps are stored in local time. exFAT includes timezone offset
fields to allow timestamps to remain correct when mounted under a
different timezone. The timezone offset is now used to calculate the
correct timestamp on read, and set on write.
2019-04-20 21:14:49 +03:00
relan
f9c0f1b75b Repairing: implement unknown entry type fix. 2018-09-15 07:52:46 +03:00
relan
53728e5a79 Repairing: implement invalid node checksum fix. 2018-09-15 07:52:46 +03:00
relan
1950a3ed38 Repairing: implement invalid VBR checksum fix. 2018-09-15 07:52:46 +03:00
relan
42fb638ab2 Repairing: pass struct exfat to verify_vbr_checksum().
Repair hooks need struct exfat.
2018-09-15 07:52:46 +03:00
relan
eb68016c54 Repairing: add repair hooks file. 2018-09-15 07:51:11 +03:00
relan
0b4f9a46a2 Repairing: add "repair=n" option.
Values:
  0 = do not repair
  1 = ask
  2 = repair automatically
2018-09-15 07:18:41 +03:00
LongPingWEI
e5dd2e1e85 Android: convert Android.mk to Android.bp. 2018-04-02 20:44:32 +03:00
Pablo Mendez Hernandez
346c5db708 Android: fix logcat support building in AOSP.
Building failed this way:

log.c:51:51: error: use of undeclared identifier fmt
        __android_log_vprint(ANDROID_LOG_FATAL, PACKAGE, fmt, aq);
                                                         ^
log.c:79:51: error: use of undeclared identifier fmt
        __android_log_vprint(ANDROID_LOG_ERROR, PACKAGE, fmt, aq);
                                                         ^
log.c:105:50: error: use of undeclared identifier fmt
        __android_log_vprint(ANDROID_LOG_WARN, PACKAGE, fmt, aq);
                                                        ^
2018-04-02 20:44:32 +03:00
relan
0fbd9108a5 Android: print log messages to logcat.
Android does not have syslog.
2018-04-02 20:44:32 +03:00
liminghao
242bae5be3 Android: support building exfat-utils.
Build mkexfatfs, exfatfsck, dumpexfat and exfatlabel for Android.

Signed-off-by: liminghao <liminghao@xiaomi.com>
2018-04-02 20:44:32 +03:00
Tomohiro Kusumi
8b95b7829d Fix predefined macro for DragonFlyBSD.
__DragonFlyBSD__ is not defined in DragonFlyBSD. It's __DragonFly__
without "BSD".
2018-04-02 20:19:57 +03:00
Oleksii Samorukov
b3a89e347b Fix FreeBSD support, add UBLIO support. 2018-04-02 20:19:31 +03:00
relan
ca712e7ba8 Update copyright years. 2018-02-03 10:29:39 +03:00
m4rkusxxl
21fab6b208 Fix searching for free slots in the root directory.
When we need to place n entries and slot at position x is occupied, we
should check x+1 instead of jumping to x+n. Otherwise we may end up
putting new entries beyond a 0x00 entry, which Windows 10 interprets as
an end-of-directory mark and does not look farther.
2018-01-19 09:44:43 +03:00
relan
0672058787 Fix compilation on GNU/HURD. 2017-12-16 15:46:13 +03:00
Edward Betts
1a7c0d0f8e Correct spelling mistake in a comment. 2017-09-05 17:38:15 +03:00
relan
2f6a54823b Fix clusters bitmap size.
The last two clusters were erroneously considered invalid. Note that
clusters numbering starts with 2.
2017-05-02 20:19:57 +03:00
relan
53cdfb64cc Clean up unused parameters in libexfat. 2017-04-01 09:39:47 +03:00
relan
85b52b3327 Fix crash when started with stdin, stdout or stderr closed. 2017-03-31 08:23:59 +03:00
relan
717d36e85b Check clusters count validity.
Other checks heavily depend on clusters count value.
2017-03-21 09:57:28 +03:00
relan
abab1c28f2 Check that file or directory size does not exceed clusters heap. 2017-03-21 09:46:00 +03:00
relan
82b6c58cc9 Refactor error handling in exfat_mount().
Free struct exfat members in a separate function that can be called both
from exfat_unmount() and exfat_mount().
2017-03-19 21:24:09 +03:00
relan
688a6fb6a4 Remove excessive check in free_cluster().
Cluster validity has already been checked.
2017-03-19 19:10:38 +03:00