From 7281dfcbca367a0b7e0ab9439acccc213248d5f1 Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Fri, 3 Mar 2023 15:10:41 +0100 Subject: [PATCH] New upstream version 1.4.0 --- .cirrus.yml | 19 +++- .gitignore | 1 + Android.bp | 2 +- ChangeLog | 19 ++++ Makefile.am | 4 +- attrib/Makefile.am | 27 ++++++ attrib/exfatattrib.8 | 90 ++++++++++++++++++ attrib/main.c | 198 ++++++++++++++++++++++++++++++++++++++++ configure.ac | 11 ++- dump/Makefile.am | 2 +- dump/dumpexfat.8 | 2 +- dump/main.c | 4 +- fsck/Makefile.am | 2 +- fsck/exfatfsck.8 | 2 +- fsck/main.c | 20 ++-- fuse/Makefile.am | 6 +- fuse/main.c | 94 +++++++++++++++---- fuse/mount.exfat-fuse.8 | 2 +- label/Makefile.am | 2 +- label/exfatlabel.8 | 2 +- label/main.c | 4 +- libexfat/Makefile.am | 2 +- libexfat/byteorder.h | 2 +- libexfat/cluster.c | 9 +- libexfat/compiler.h | 2 +- libexfat/exfat.h | 3 +- libexfat/exfatfs.h | 2 +- libexfat/io.c | 45 ++++++--- libexfat/log.c | 2 +- libexfat/lookup.c | 2 +- libexfat/mount.c | 6 +- libexfat/node.c | 18 ++-- libexfat/platform.h | 2 +- libexfat/repair.c | 2 +- libexfat/time.c | 2 +- libexfat/utf.c | 2 +- libexfat/utils.c | 2 +- mkfs/Makefile.am | 2 +- mkfs/cbm.c | 2 +- mkfs/cbm.h | 2 +- mkfs/fat.c | 2 +- mkfs/fat.h | 2 +- mkfs/main.c | 4 +- mkfs/mkexfat.c | 2 +- mkfs/mkexfat.h | 2 +- mkfs/mkexfatfs.8 | 2 +- mkfs/rootdir.c | 2 +- mkfs/rootdir.h | 2 +- mkfs/uct.c | 2 +- mkfs/uct.h | 2 +- mkfs/uctc.c | 2 +- mkfs/uctc.h | 2 +- mkfs/vbr.c | 2 +- mkfs/vbr.h | 2 +- 54 files changed, 548 insertions(+), 104 deletions(-) create mode 100644 attrib/Makefile.am create mode 100644 attrib/exfatattrib.8 create mode 100644 attrib/main.c diff --git a/.cirrus.yml b/.cirrus.yml index 2685902..1d28023 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -23,7 +23,7 @@ --- task: matrix: - - name: debian + - name: debian-fuse2 container: image: gcc:11-bullseye install_script: | @@ -32,9 +32,18 @@ task: env: EXTRA_CFLAGS: -fanalyzer + - name: debian-fuse3 + container: + image: gcc:11-bullseye + install_script: | + apt-get update + apt-get install -y libfuse3-dev + env: + EXTRA_CFLAGS: -fanalyzer + - name: macos macos_instance: - image: big-sur-base + image: ghcr.io/cirruslabs/macos-ventura-base:latest install_script: | brew update --preinstall brew install automake macfuse @@ -47,7 +56,9 @@ task: compile_script: | autoreconf --install - ./configure CFLAGS="-Wall -Wextra -Werror $EXTRA_CFLAGS" + ./configure CFLAGS="-Wall -Wextra -Werror \ + -fsanitize=address,undefined \ + $EXTRA_CFLAGS" make -k test_script: | @@ -55,3 +66,5 @@ task: mkfs/mkexfatfs -i 12345678 foo.img fsck/exfatfsck foo.img echo 'f1b3a11f781533f5b69086596be38367d0ebfb77 foo.img' | shasum -c + label/exfatlabel foo.img ○○○○○○○○○○○○○○○ + echo '4720462db953d5b2094c884f4b3098a138790533 foo.img' | shasum -c diff --git a/.gitignore b/.gitignore index 9903983..c533860 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ Makefile # make *.o +/attrib/exfatattrib /dump/dumpexfat /fsck/exfatfsck /fuse/mount.exfat-fuse diff --git a/Android.bp b/Android.bp index f26e30c..9739004 100644 --- a/Android.bp +++ b/Android.bp @@ -25,7 +25,7 @@ cc_defaults { "-Wno-error", "-D_FILE_OFFSET_BITS=64", "-DPACKAGE=\"exfat\"", - "-DVERSION=\"1.3.0\"", + "-DVERSION=\"1.4.0\"", ], shared_libs: ["liblog"], } diff --git a/ChangeLog b/ChangeLog index 9e20bf5..7413996 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +1.4.0 (2023-03-02) + +* Added exfatattrib utility which prints or changes file attributes [Will +Thompson]. +* Added FUSE 3 support. FUSE 2 continues to be supported. +* Added support for timezone offsets [Nathan Hunsperger]. +* Fixed device opening error being reported as FS error. +* Fixed possible data leakage when uninitialized clusters were allocated using +NtSetInformationFile() call under Windows and FS was not unmounted correctly. +* Improved compatibility with autoconf 2.70. +* Fixed disk size reading on NetBSD [Dave Vasilevsky]. +* Fixed "automounted" option handling on FreeBSD [Iouri V. Ivliev]. +* Allowed to specify the "nonempty" mount option. +* Fixed file data contiguity handling bug which could cause performance +degradation [noctis]. +* Fixed possible crashes on invalid UTF-8 sequences. +* Fixed a situation when FS could be erroneously marked as dirty (not cleanly +unmounted). + 1.3.0 (2018-09-15) * exfatfsck can now repair some errors. diff --git a/Makefile.am b/Makefile.am index 067f481..3d0b459 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ # Automake source. # # Free exFAT implementation. -# Copyright (C) 2010-2018 Andrew Nayenko +# Copyright (C) 2010-2023 Andrew Nayenko # # 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 @@ -20,4 +20,4 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -SUBDIRS = libexfat dump fsck fuse label mkfs +SUBDIRS = libexfat attrib dump fsck fuse label mkfs diff --git a/attrib/Makefile.am b/attrib/Makefile.am new file mode 100644 index 0000000..e1eaa85 --- /dev/null +++ b/attrib/Makefile.am @@ -0,0 +1,27 @@ +# +# Makefile.am (08.11.20) +# Automake source. +# +# Free exFAT implementation. +# Copyright (C) 2020 Endless OS Foundation LLC +# +# 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; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +sbin_PROGRAMS = exfatattrib +dist_man8_MANS = exfatattrib.8 +exfatattrib_SOURCES = main.c +exfatattrib_CPPFLAGS = -I$(top_srcdir)/libexfat +exfatattrib_LDADD = ../libexfat/libexfat.a diff --git a/attrib/exfatattrib.8 b/attrib/exfatattrib.8 new file mode 100644 index 0000000..7ec88a2 --- /dev/null +++ b/attrib/exfatattrib.8 @@ -0,0 +1,90 @@ +.\" Copyright (C) 2020-2023 Endless OS Foundation +.\" +.TH EXFATATTRIB 8 "November 2020" +.SH NAME +.B exfatattrib +\- Set or display exFAT file attributes +.SH SYNOPSIS +.B exfatattrib +[ +.B \-r +| +.B \-R +| +.B \-i +| +.B \-I +| +.B \-s +| +.B \-S +| +.B \-a +| +.B \-A +] +.B \-d +.I device +.I file +.SH DESCRIPTION +.B exfatattrib +sets or displays attributes of a file on an exFAT file system. + +.I device +is the path to an unmounted disk partition or disk image file containing an +exFAT file system. + +.I file +is the path of a file within that file system. + +If run with no command line options, the current attributes of +.I file +are displayed; otherwise, the specified attributes are set or cleared. It is an +error to set and clear the same flag. + +.SH COMMAND LINE OPTIONS +Command line options available: + +.TP +.BI \-d " device" +The path to an unmounted disk partition or disk image file containing an exFAT +file system. This option is required. +.TP +.BI -r +Set read\-only flag +.TP +.BI \-R +Clear read\-only flag +.TP +.BI \-i +Set hidden flag (mnemonic: \fBi\fRnvisible) +.TP +.BI \-I +Clear hidden flag +.TP +.BI \-s +Set system flag +.TP +.BI \-S +Clear system flag +.TP +.BI \-a +Set archive flag +.TP +.BI \-A +Clear archive flag +.TP +.BI \-h +Display this help message +.TP +.BI \-V +Print version and copyright. + +.SH EXIT CODES +Zero is returned if errors were not found. Any other code means an error. + +.SH AUTHOR +Will Thompson + +.SH SEE ALSO +.BR chmod(1) diff --git a/attrib/main.c b/attrib/main.c new file mode 100644 index 0000000..53d0ba4 --- /dev/null +++ b/attrib/main.c @@ -0,0 +1,198 @@ +/* + main.c (08.11.20) + Prints or changes exFAT file attributes + + Free exFAT implementation. + Copyright (C) 2020-2023 Endless OS Foundation LLC + + 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; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include +#include +#include +#include + +static void usage(const char* prog) +{ + fprintf(stderr, + "Display current attributes:\n" + " %1$s -d \n" + "\n" + "Set attributes:\n" + " %1$s [FLAGS] -d \n" + "\n" + "Flags:\n" + " -r Set read-only flag\n" + " -R Clear read-only flag\n" + " -i Set hidden flag\n" + " -I Clear hidden flag\n" + " -s Set system flag\n" + " -S Clear system flag\n" + " -a Set archive flag\n" + " -A Clear archive flag\n" + "\n" + " -h Display this help message\n" + " -V Display version information\n", + prog); + exit(1); +} + +static void print_attribute(uint16_t attribs, uint16_t attrib, + const char* label) +{ + printf("%9s: %s\n", label, (attribs & attrib) ? "yes" : "no"); +} + +static int attribute(struct exfat* ef, struct exfat_node* node, + uint16_t add_flags, uint16_t clear_flags) +{ + if ((add_flags | clear_flags) != 0) + { + uint16_t attrib = node->attrib; + + attrib |= add_flags; + attrib &= ~clear_flags; + + if (node->attrib != attrib) + { + int ret; + + node->attrib = attrib; + node->is_dirty = true; + + ret = exfat_flush_node(ef, node); + if (ret != 0) + { + char buffer[EXFAT_UTF8_NAME_BUFFER_MAX]; + + exfat_get_name(node, buffer); + exfat_error("failed to flush changes to '%s': %s", buffer, + strerror(-ret)); + return 1; + } + } + } + else + { + print_attribute(node->attrib, EXFAT_ATTRIB_RO, "Read-only"); + print_attribute(node->attrib, EXFAT_ATTRIB_HIDDEN, "Hidden"); + print_attribute(node->attrib, EXFAT_ATTRIB_SYSTEM, "System"); + print_attribute(node->attrib, EXFAT_ATTRIB_ARCH, "Archive"); + /* read-only attributes */ + print_attribute(node->attrib, EXFAT_ATTRIB_VOLUME, "Volume"); + print_attribute(node->attrib, EXFAT_ATTRIB_DIR, "Directory"); + } + + return 0; +} + +int main(int argc, char* argv[]) +{ + int opt; + int ret; + const char* spec = NULL; + const char* options = ""; + const char* file_path = NULL; + struct exfat ef; + struct exfat_node* node; + uint16_t add_flags = 0; + uint16_t clear_flags = 0; + + while ((opt = getopt(argc, argv, "d:rRiIsSaAhV")) != -1) + { + switch (opt) + { + case 'V': + printf("exfatattrib %s\n", VERSION); + puts("Copyright (C) 2011-2023 Andrew Nayenko"); + puts("Copyright (C) 2020-2023 Endless OS Foundation LLC"); + return 0; + /* + The path to the unmounted exFAT partition is a (mandatory) named + option rather than a positional parameter. If the FUSE file system + ever gains an ioctl to get and set attributes, this option could be + made optional, and this tool taught to use the ioctl. + */ + case 'd': + spec = optarg; + break; + case 'r': + add_flags |= EXFAT_ATTRIB_RO; + break; + case 'R': + clear_flags |= EXFAT_ATTRIB_RO; + break; + /* "-h[elp]" is taken; i is the second letter of "hidden" and + its synonym "invisible" */ + case 'i': + add_flags |= EXFAT_ATTRIB_HIDDEN; + break; + case 'I': + clear_flags |= EXFAT_ATTRIB_HIDDEN; + break; + case 's': + add_flags |= EXFAT_ATTRIB_SYSTEM; + break; + case 'S': + clear_flags |= EXFAT_ATTRIB_SYSTEM; + break; + case 'a': + add_flags |= EXFAT_ATTRIB_ARCH; + break; + case 'A': + clear_flags |= EXFAT_ATTRIB_ARCH; + break; + default: + usage(argv[0]); + } + } + + if ((add_flags & clear_flags) != 0) + { + exfat_error("can't set and clear the same flag"); + return 1; + } + + if (spec == NULL || argc - optind != 1) + usage(argv[0]); + + file_path = argv[optind]; + + if ((add_flags | clear_flags) == 0) + options = "ro"; + + ret = exfat_mount(&ef, spec, options); + if (ret != 0) + { + exfat_error("failed to mount %s: %s", spec, strerror(-ret)); + return 1; + } + + ret = exfat_lookup(&ef, &node, file_path); + if (ret != 0) + { + exfat_error("failed to look up '%s': %s", file_path, strerror(-ret)); + exfat_unmount(&ef); + return 1; + } + + ret = attribute(&ef, node, add_flags, clear_flags); + + exfat_put_node(&ef, node); + exfat_unmount(&ef); + + return ret; +} diff --git a/configure.ac b/configure.ac index b675be5..45d01c3 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # Autoconf source. # # Free exFAT implementation. -# Copyright (C) 2010-2018 Andrew Nayenko +# Copyright (C) 2010-2023 Andrew Nayenko # # 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 @@ -21,13 +21,12 @@ # AC_INIT([Free exFAT implementation], - [1.3.0], + [1.4.0], [relan@users.noreply.github.com], [exfat], [https://github.com/relan/exfat]) AM_INIT_AUTOMAKE([1.11.2 -Wall -Werror foreign subdir-objects]) AC_PROG_CC -AC_PROG_CC_C99 AC_PROG_RANLIB AM_PROG_AR AC_SYS_LARGEFILE @@ -38,7 +37,10 @@ PKG_CHECK_MODULES([UBLIO], [libublio], [ AC_DEFINE([USE_UBLIO], [1], [Define if block devices are not supported.]) ], [:]) -PKG_CHECK_MODULES([FUSE], [fuse]) +PKG_CHECK_MODULES([FUSE3], [fuse3], + [AC_DEFINE([FUSE_USE_VERSION], [30], [Required FUSE API version.])], + [PKG_CHECK_MODULES([FUSE2], [fuse >= 2.6], + [AC_DEFINE([FUSE_USE_VERSION], [26], [Required FUSE API version.])])]) case "$host_os" in *-gnu) AC_DEFINE([_XOPEN_SOURCE], [500], [Enable pread() and pwrite().]) @@ -48,6 +50,7 @@ esac AC_CONFIG_HEADERS([libexfat/config.h]) AC_CONFIG_FILES([ libexfat/Makefile + attrib/Makefile dump/Makefile fsck/Makefile fuse/Makefile diff --git a/dump/Makefile.am b/dump/Makefile.am index d081f7b..1c28ea6 100644 --- a/dump/Makefile.am +++ b/dump/Makefile.am @@ -3,7 +3,7 @@ # Automake source. # # Free exFAT implementation. -# Copyright (C) 2011-2018 Andrew Nayenko +# Copyright (C) 2011-2023 Andrew Nayenko # # 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 diff --git a/dump/dumpexfat.8 b/dump/dumpexfat.8 index 06022a5..beaecb7 100644 --- a/dump/dumpexfat.8 +++ b/dump/dumpexfat.8 @@ -1,4 +1,4 @@ -.\" Copyright (C) 2011-2018 Andrew Nayenko +.\" Copyright (C) 2011-2023 Andrew Nayenko .\" .TH DUMPEXFAT 8 "July 2016" .SH NAME diff --git a/dump/main.c b/dump/main.c index 4f562f3..af6b12d 100644 --- a/dump/main.c +++ b/dump/main.c @@ -3,7 +3,7 @@ Prints detailed information about exFAT volume. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 @@ -226,7 +226,7 @@ int main(int argc, char* argv[]) break; case 'V': printf("dumpexfat %s\n", VERSION); - puts("Copyright (C) 2011-2018 Andrew Nayenko"); + puts("Copyright (C) 2011-2023 Andrew Nayenko"); return 0; default: usage(argv[0]); diff --git a/fsck/Makefile.am b/fsck/Makefile.am index 34d0f6c..ec0d601 100644 --- a/fsck/Makefile.am +++ b/fsck/Makefile.am @@ -3,7 +3,7 @@ # Automake source. # # Free exFAT implementation. -# Copyright (C) 2011-2018 Andrew Nayenko +# Copyright (C) 2011-2023 Andrew Nayenko # # 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 diff --git a/fsck/exfatfsck.8 b/fsck/exfatfsck.8 index a641b6c..445f25b 100644 --- a/fsck/exfatfsck.8 +++ b/fsck/exfatfsck.8 @@ -1,4 +1,4 @@ -.\" Copyright (C) 2011-2018 Andrew Nayenko +.\" Copyright (C) 2011-2023 Andrew Nayenko .\" .TH EXFATFSCK 8 "September 2018" .SH NAME diff --git a/fsck/main.c b/fsck/main.c index 6a42092..399f432 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -3,7 +3,7 @@ exFAT file system checker. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 @@ -25,6 +25,7 @@ #include #include #include +#include #define exfat_debug(format, ...) do {} while (0) @@ -123,12 +124,17 @@ static void dirck(struct exfat* ef, const char* path) free(entry_path); } -static void fsck(struct exfat* ef, const char* spec, const char* options) +static bool fsck(struct exfat* ef, const char* spec, const char* options) { - if (exfat_mount(ef, spec, options) != 0) + int rc; + + rc = exfat_mount(ef, spec, options); + if (rc == -ENODEV) + return false; /* failed to open the device, checking haven't started */ + if (rc != 0) { fputs("File system checking stopped. ", stdout); - return; + return true; } exfat_print_info(ef->sb, exfat_count_free_clusters(ef)); @@ -139,6 +145,7 @@ static void fsck(struct exfat* ef, const char* spec, const char* options) printf("Totally %"PRIu64" directories and %"PRIu64" files.\n", directories_count, files_count); fputs("File system checking finished. ", stdout); + return true; } static void usage(const char* prog) @@ -175,7 +182,7 @@ int main(int argc, char* argv[]) options = "repair=0,ro"; break; case 'V': - puts("Copyright (C) 2011-2018 Andrew Nayenko"); + puts("Copyright (C) 2011-2023 Andrew Nayenko"); return 0; default: usage(argv[0]); @@ -187,7 +194,8 @@ int main(int argc, char* argv[]) spec = argv[optind]; printf("Checking file system on %s.\n", spec); - fsck(&ef, spec, options); + if (!fsck(&ef, spec, options)) + return 1; if (exfat_errors != 0) { printf("ERRORS FOUND: %d, FIXED: %d.\n", diff --git a/fuse/Makefile.am b/fuse/Makefile.am index be27dc9..013d307 100644 --- a/fuse/Makefile.am +++ b/fuse/Makefile.am @@ -3,7 +3,7 @@ # Automake source. # # Free exFAT implementation. -# Copyright (C) 2010-2018 Andrew Nayenko +# Copyright (C) 2010-2023 Andrew Nayenko # # 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 @@ -24,8 +24,8 @@ sbin_PROGRAMS = mount.exfat-fuse dist_man8_MANS = mount.exfat-fuse.8 mount_exfat_fuse_SOURCES = main.c mount_exfat_fuse_CPPFLAGS = -I$(top_srcdir)/libexfat -mount_exfat_fuse_CFLAGS = $(FUSE_CFLAGS) -mount_exfat_fuse_LDADD = ../libexfat/libexfat.a $(FUSE_LIBS) +mount_exfat_fuse_CFLAGS = $(FUSE2_CFLAGS) $(FUSE3_CFLAGS) +mount_exfat_fuse_LDADD = ../libexfat/libexfat.a $(FUSE2_LIBS) $(FUSE3_LIBS) install-exec-hook: ln -sf $(sbin_PROGRAMS) $(DESTDIR)$(sbindir)/mount.exfat diff --git a/fuse/main.c b/fuse/main.c index 3143693..f7aacb4 100644 --- a/fuse/main.c +++ b/fuse/main.c @@ -3,7 +3,7 @@ FUSE-based exFAT implementation. Requires FUSE 2.6 or later. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 @@ -21,7 +21,6 @@ */ #include -#define FUSE_USE_VERSION 26 #include #include #include @@ -55,7 +54,11 @@ static void set_node(struct fuse_file_info* fi, struct exfat_node* node) fi->keep_cache = 1; } -static int fuse_exfat_getattr(const char* path, struct stat* stbuf) +static int fuse_exfat_getattr(const char* path, struct stat* stbuf +#if FUSE_USE_VERSION >= 30 + , UNUSED struct fuse_file_info* fi +#endif + ) { struct exfat_node* node; int rc; @@ -71,7 +74,11 @@ static int fuse_exfat_getattr(const char* path, struct stat* stbuf) return 0; } -static int fuse_exfat_truncate(const char* path, off_t size) +static int fuse_exfat_truncate(const char* path, off_t size +#if FUSE_USE_VERSION >= 30 + , UNUSED struct fuse_file_info* fi +#endif + ) { struct exfat_node* node; int rc; @@ -96,7 +103,11 @@ static int fuse_exfat_truncate(const char* path, off_t size) static int fuse_exfat_readdir(const char* path, void* buffer, fuse_fill_dir_t filler, UNUSED off_t offset, - UNUSED struct fuse_file_info* fi) + UNUSED struct fuse_file_info* fi +#if FUSE_USE_VERSION >= 30 + , UNUSED enum fuse_readdir_flags flags +#endif + ) { struct exfat_node* parent; struct exfat_node* node; @@ -117,8 +128,13 @@ static int fuse_exfat_readdir(const char* path, void* buffer, return -ENOTDIR; } +#if FUSE_USE_VERSION < 30 filler(buffer, ".", NULL, 0); filler(buffer, "..", NULL, 0); +#else + filler(buffer, ".", NULL, 0, 0); + filler(buffer, "..", NULL, 0, 0); +#endif rc = exfat_opendir(&ef, parent, &it); if (rc != 0) @@ -134,7 +150,11 @@ static int fuse_exfat_readdir(const char* path, void* buffer, name, node->is_contiguous ? "contiguous" : "fragmented", node->size, node->start_cluster); exfat_stat(&ef, node, &stbuf); +#if FUSE_USE_VERSION < 30 filler(buffer, name, &stbuf, 0); +#else + filler(buffer, name, &stbuf, 0, 0); +#endif exfat_put_node(&ef, node); } exfat_closedir(&ef, &it); @@ -147,11 +167,28 @@ static int fuse_exfat_open(const char* path, struct fuse_file_info* fi) struct exfat_node* node; int rc; - exfat_debug("[%s] %s", __func__, path); + exfat_debug("[%s] %s flags %#x%s%s%s%s%s", __func__, path, fi->flags, + fi->flags & O_RDONLY ? " O_RDONLY" : "", + fi->flags & O_WRONLY ? " O_WRONLY" : "", + fi->flags & O_RDWR ? " O_RDWR" : "", + fi->flags & O_APPEND ? " O_APPEND" : "", + fi->flags & O_TRUNC ? " O_TRUNC" : ""); rc = exfat_lookup(&ef, &node, path); if (rc != 0) return rc; + /* FUSE 2.x will call fuse_exfat_truncate() explicitly */ +#if FUSE_USE_VERSION >= 30 + if (fi->flags & O_TRUNC) + { + rc = exfat_truncate(&ef, node, 0, true); + if (rc != 0) + { + exfat_put_node(&ef, node); + return rc; + } + } +#endif set_node(fi, node); return 0; } @@ -195,14 +232,14 @@ static int fuse_exfat_flush(UNUSED const char* path, struct fuse_file_info* fi) This handler may be called by FUSE on close() syscall. FUSE also deals with removals of open files, so we don't free clusters on close but only on rmdir and unlink. If the FUSE implementation does not call this - handler we will flush node on release. See fuse_exfat_relase() above. + handler we will flush node on release. See fuse_exfat_release() above. */ exfat_debug("[%s] %s", __func__, path); return exfat_flush_node(&ef, get_node(fi)); } static int fuse_exfat_fsync(UNUSED const char* path, UNUSED int datasync, - UNUSED struct fuse_file_info *fi) + UNUSED struct fuse_file_info* fi) { int rc; @@ -279,13 +316,21 @@ static int fuse_exfat_mkdir(const char* path, UNUSED mode_t mode) return exfat_mkdir(&ef, path); } -static int fuse_exfat_rename(const char* old_path, const char* new_path) +static int fuse_exfat_rename(const char* old_path, const char* new_path +#if FUSE_USE_VERSION >= 30 + , UNUSED unsigned int flags +#endif + ) { exfat_debug("[%s] %s => %s", __func__, old_path, new_path); return exfat_rename(&ef, old_path, new_path); } -static int fuse_exfat_utimens(const char* path, const struct timespec tv[2]) +static int fuse_exfat_utimens(const char* path, const struct timespec tv[2] +#if FUSE_USE_VERSION >= 30 + , UNUSED struct fuse_file_info* fi +#endif + ) { struct exfat_node* node; int rc; @@ -302,7 +347,11 @@ static int fuse_exfat_utimens(const char* path, const struct timespec tv[2]) return rc; } -static int fuse_exfat_chmod(UNUSED const char* path, mode_t mode) +static int fuse_exfat_chmod(UNUSED const char* path, mode_t mode +#if FUSE_USE_VERSION >= 30 + , UNUSED struct fuse_file_info* fi +#endif + ) { const mode_t VALID_MODE_MASK = S_IFREG | S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO; @@ -313,7 +362,11 @@ static int fuse_exfat_chmod(UNUSED const char* path, mode_t mode) return 0; } -static int fuse_exfat_chown(UNUSED const char* path, uid_t uid, gid_t gid) +static int fuse_exfat_chown(UNUSED const char* path, uid_t uid, gid_t gid +#if FUSE_USE_VERSION >= 30 + , UNUSED struct fuse_file_info* fi +#endif + ) { exfat_debug("[%s] %s %u:%u", __func__, path, uid, gid); if (uid != ef.uid || gid != ef.gid) @@ -345,7 +398,16 @@ static int fuse_exfat_statfs(UNUSED const char* path, struct statvfs* sfs) return 0; } -static void* fuse_exfat_init(struct fuse_conn_info* fci) +static void* fuse_exfat_init( +#ifdef FUSE_CAP_BIG_WRITES + struct fuse_conn_info* fci +#else + UNUSED struct fuse_conn_info* fci +#endif +#if FUSE_USE_VERSION >= 30 + , UNUSED struct fuse_config* cfg +#endif + ) { exfat_debug("[%s]", __func__); #ifdef FUSE_CAP_BIG_WRITES @@ -550,10 +612,10 @@ int main(int argc, char* argv[]) int opt; int rc; - printf("FUSE exfat %s\n", VERSION); + printf("FUSE exfat %s (libfuse%d)\n", VERSION, FUSE_USE_VERSION / 10); fuse_options = strdup("allow_other," -#if defined(__linux__) || defined(__FreeBSD__) +#if FUSE_USE_VERSION < 30 && (defined(__linux__) || defined(__FreeBSD__)) "big_writes," #endif #if defined(__linux__) @@ -600,7 +662,7 @@ int main(int argc, char* argv[]) case 'V': free(exfat_options); free(fuse_options); - puts("Copyright (C) 2010-2018 Andrew Nayenko"); + puts("Copyright (C) 2010-2023 Andrew Nayenko"); return 0; case 'v': break; diff --git a/fuse/mount.exfat-fuse.8 b/fuse/mount.exfat-fuse.8 index e0925b2..d89f0e2 100644 --- a/fuse/mount.exfat-fuse.8 +++ b/fuse/mount.exfat-fuse.8 @@ -1,4 +1,4 @@ -.\" Copyright (C) 2010-2016 Andrew Nayenko +.\" Copyright (C) 2010-2023 Andrew Nayenko .\" .TH EXFAT-FUSE 8 "November 2015" .SH NAME diff --git a/label/Makefile.am b/label/Makefile.am index 5e94c22..1cc834d 100644 --- a/label/Makefile.am +++ b/label/Makefile.am @@ -3,7 +3,7 @@ # Automake source. # # Free exFAT implementation. -# Copyright (C) 2011-2018 Andrew Nayenko +# Copyright (C) 2011-2023 Andrew Nayenko # # 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 diff --git a/label/exfatlabel.8 b/label/exfatlabel.8 index 4f55510..8fac3a5 100644 --- a/label/exfatlabel.8 +++ b/label/exfatlabel.8 @@ -1,4 +1,4 @@ -.\" Copyright (C) 2011-2018 Andrew Nayenko +.\" Copyright (C) 2011-2023 Andrew Nayenko .\" .TH EXFATLABEL 8 "September 2017" .SH NAME diff --git a/label/main.c b/label/main.c index 398498a..5afe73f 100644 --- a/label/main.c +++ b/label/main.c @@ -3,7 +3,7 @@ Prints or changes exFAT volume label. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 @@ -34,7 +34,7 @@ int main(int argc, char* argv[]) if (strcmp(*pp, "-V") == 0) { printf("exfatlabel %s\n", VERSION); - puts("Copyright (C) 2011-2018 Andrew Nayenko"); + puts("Copyright (C) 2011-2023 Andrew Nayenko"); return 0; } diff --git a/libexfat/Makefile.am b/libexfat/Makefile.am index d639e13..7819535 100644 --- a/libexfat/Makefile.am +++ b/libexfat/Makefile.am @@ -3,7 +3,7 @@ # Automake source. # # Free exFAT implementation. -# Copyright (C) 2010-2018 Andrew Nayenko +# Copyright (C) 2010-2023 Andrew Nayenko # # 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 diff --git a/libexfat/byteorder.h b/libexfat/byteorder.h index ba54410..98b93c7 100644 --- a/libexfat/byteorder.h +++ b/libexfat/byteorder.h @@ -3,7 +3,7 @@ Endianness stuff. exFAT uses little-endian byte order. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/cluster.c b/libexfat/cluster.c index 0f2e91b..4ee6135 100644 --- a/libexfat/cluster.c +++ b/libexfat/cluster.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 @@ -426,9 +426,14 @@ int exfat_truncate(struct exfat* ef, struct exfat_node* node, uint64_t size, if (erase) { - rc = erase_range(ef, node, node->size, size); + rc = erase_range(ef, node, node->valid_size, size); if (rc != 0) return rc; + node->valid_size = size; + } + else + { + node->valid_size = MIN(node->valid_size, size); } exfat_update_mtime(node); diff --git a/libexfat/compiler.h b/libexfat/compiler.h index 88d3d7c..4865828 100644 --- a/libexfat/compiler.h +++ b/libexfat/compiler.h @@ -4,7 +4,7 @@ showstopper. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/exfat.h b/libexfat/exfat.h index 939fec0..0e146e8 100644 --- a/libexfat/exfat.h +++ b/libexfat/exfat.h @@ -4,7 +4,7 @@ implementation. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 @@ -89,6 +89,7 @@ struct exfat_node bool is_cached : 1; bool is_dirty : 1; bool is_unlinked : 1; + uint64_t valid_size; uint64_t size; time_t mtime, atime; le16_t name[EXFAT_NAME_MAX + 1]; diff --git a/libexfat/exfatfs.h b/libexfat/exfatfs.h index b9ea268..3618d4d 100644 --- a/libexfat/exfatfs.h +++ b/libexfat/exfatfs.h @@ -3,7 +3,7 @@ Definitions of structures and constants used in exFAT file system. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/io.c b/libexfat/io.c index 0fc35d2..7af5316 100644 --- a/libexfat/io.c +++ b/libexfat/io.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 @@ -390,27 +390,43 @@ ssize_t exfat_pwrite(struct exfat_dev* dev, const void* buffer, size_t size, ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node, void* buffer, size_t size, off_t offset) { - uint64_t newsize = offset; + uint64_t uoffset = offset; cluster_t cluster; char* bufp = buffer; off_t lsize, loffset, remainder; if (offset < 0) return -EINVAL; - if (newsize >= node->size) + if (uoffset >= node->size) return 0; if (size == 0) return 0; - cluster = exfat_advance_cluster(ef, node, newsize / CLUSTER_SIZE(*ef->sb)); + if (uoffset + size > node->valid_size) + { + ssize_t bytes = 0; + + if (uoffset < node->valid_size) + { + bytes = exfat_generic_pread(ef, node, buffer, + node->valid_size - uoffset, offset); + if (bytes < 0 || (size_t) bytes < node->valid_size - uoffset) + return bytes; + } + memset(buffer + bytes, 0, + MIN(size - bytes, node->size - node->valid_size)); + return MIN(size, node->size - uoffset); + } + + cluster = exfat_advance_cluster(ef, node, uoffset / CLUSTER_SIZE(*ef->sb)); if (CLUSTER_INVALID(*ef->sb, cluster)) { exfat_error("invalid cluster 0x%x while reading", cluster); return -EIO; } - loffset = newsize % CLUSTER_SIZE(*ef->sb); - remainder = MIN(size, node->size - newsize); + loffset = uoffset % CLUSTER_SIZE(*ef->sb); + remainder = MIN(size, node->size - uoffset); while (remainder > 0) { if (CLUSTER_INVALID(*ef->sb, cluster)) @@ -432,13 +448,13 @@ ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node, } if (!(node->attrib & EXFAT_ATTRIB_DIR) && !ef->ro && !ef->noatime) exfat_update_atime(node); - return MIN(size, node->size - newsize) - remainder; + return MIN(size, node->size - uoffset) - remainder; } ssize_t exfat_generic_pwrite(struct exfat* ef, struct exfat_node* node, const void* buffer, size_t size, off_t offset) { - uint64_t newsize = offset; + uint64_t uoffset = offset; int rc; cluster_t cluster; const char* bufp = buffer; @@ -446,29 +462,29 @@ ssize_t exfat_generic_pwrite(struct exfat* ef, struct exfat_node* node, if (offset < 0) return -EINVAL; - if (newsize > node->size) + if (uoffset > node->size) { - rc = exfat_truncate(ef, node, newsize, true); + rc = exfat_truncate(ef, node, uoffset, true); if (rc != 0) return rc; } - if (newsize + size > node->size) + if (uoffset + size > node->size) { - rc = exfat_truncate(ef, node, newsize + size, false); + rc = exfat_truncate(ef, node, uoffset + size, false); if (rc != 0) return rc; } if (size == 0) return 0; - cluster = exfat_advance_cluster(ef, node, newsize / CLUSTER_SIZE(*ef->sb)); + cluster = exfat_advance_cluster(ef, node, uoffset / CLUSTER_SIZE(*ef->sb)); if (CLUSTER_INVALID(*ef->sb, cluster)) { exfat_error("invalid cluster 0x%x while writing", cluster); return -EIO; } - loffset = newsize % CLUSTER_SIZE(*ef->sb); + loffset = uoffset % CLUSTER_SIZE(*ef->sb); remainder = size; while (remainder > 0) { @@ -487,6 +503,7 @@ ssize_t exfat_generic_pwrite(struct exfat* ef, struct exfat_node* node, bufp += lsize; loffset = 0; remainder -= lsize; + node->valid_size = MAX(node->valid_size, uoffset + size - remainder); cluster = exfat_next_cluster(ef, node, cluster); } if (!(node->attrib & EXFAT_ATTRIB_DIR)) diff --git a/libexfat/log.c b/libexfat/log.c index 22e5ccd..dd2063b 100644 --- a/libexfat/log.c +++ b/libexfat/log.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/lookup.c b/libexfat/lookup.c index 50ad31f..bb7b124 100644 --- a/libexfat/lookup.c +++ b/libexfat/lookup.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/mount.c b/libexfat/mount.c index f0ca0e3..86fb84d 100644 --- a/libexfat/mount.c +++ b/libexfat/mount.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 @@ -198,7 +198,7 @@ int exfat_mount(struct exfat* ef, const char* spec, const char* options) mode = EXFAT_MODE_RW; ef->dev = exfat_open(spec, mode); if (ef->dev == NULL) - return -EIO; + return -ENODEV; if (exfat_get_mode(ef->dev) == EXFAT_MODE_RO) { if (mode == EXFAT_MODE_ANY) @@ -305,7 +305,7 @@ int exfat_mount(struct exfat* ef, const char* spec, const char* options) ef->root->start_cluster = le32_to_cpu(ef->sb->rootdir_cluster); ef->root->fptr_cluster = ef->root->start_cluster; ef->root->name[0] = cpu_to_le16('\0'); - ef->root->size = rootdir_size(ef); + ef->root->valid_size = ef->root->size = rootdir_size(ef); if (ef->root->size == 0) { exfat_free(ef); diff --git a/libexfat/node.c b/libexfat/node.c index 9cffbcb..88b1357 100644 --- a/libexfat/node.c +++ b/libexfat/node.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 @@ -144,6 +144,7 @@ static void init_node_meta1(struct exfat_node* node, static void init_node_meta2(struct exfat_node* node, const struct exfat_entry_meta2* meta2) { + node->valid_size = le64_to_cpu(meta2->valid_size); node->size = le64_to_cpu(meta2->size); node->start_cluster = le32_to_cpu(meta2->start_cluster); node->fptr_cluster = node->start_cluster; @@ -206,8 +207,7 @@ static bool check_entries(const struct exfat_entry* entry, int n) } static bool check_node(const struct exfat* ef, struct exfat_node* node, - le16_t actual_checksum, const struct exfat_entry_meta1* meta1, - const struct exfat_entry_meta2* meta2) + le16_t actual_checksum, const struct exfat_entry_meta1* meta1) { int cluster_size = CLUSTER_SIZE(*ef->sb); uint64_t clusters_heap_size = @@ -234,12 +234,11 @@ static bool check_node(const struct exfat* ef, struct exfat_node* node, cannot be greater than file size. See SetFileValidData() function description in MSDN. */ - if (le64_to_cpu(meta2->valid_size) > node->size) + if (node->valid_size > node->size) { exfat_get_name(node, buffer); exfat_error("'%s' has valid size (%"PRIu64") greater than size " - "(%"PRIu64")", buffer, le64_to_cpu(meta2->valid_size), - node->size); + "(%"PRIu64")", buffer, node->valid_size, node->size); ret = false; } @@ -328,7 +327,7 @@ static int parse_file_entries(struct exfat* ef, struct exfat_node* node, init_node_meta2(node, meta2); init_node_name(node, entries + 2, mandatory_entries - 2); - if (!check_node(ef, node, exfat_calc_checksum(entries, n), meta1, meta2)) + if (!check_node(ef, node, exfat_calc_checksum(entries, n), meta1)) return -EIO; return 0; @@ -659,7 +658,8 @@ int exfat_flush_node(struct exfat* ef, struct exfat_node* node) NULL, &meta1->atime_tzo); meta1->adate = edate; meta1->atime = etime; - meta2->size = meta2->valid_size = cpu_to_le64(node->size); + meta2->valid_size = cpu_to_le64(node->valid_size); + meta2->size = cpu_to_le64(node->size); meta2->start_cluster = cpu_to_le32(node->start_cluster); meta2->flags = EXFAT_FLAG_ALWAYS1; /* empty files must not be marked as contiguous */ @@ -1128,7 +1128,7 @@ int exfat_rename(struct exfat* ef, const char* old_path, const char* new_path) exfat_put_node(ef, existing); if (rc != 0) { - /* free clusters even if something went wrong; overwise they + /* free clusters even if something went wrong; otherwise they will be just lost */ exfat_cleanup_node(ef, existing); exfat_put_node(ef, dir); diff --git a/libexfat/platform.h b/libexfat/platform.h index d42e1ee..9bd125a 100644 --- a/libexfat/platform.h +++ b/libexfat/platform.h @@ -4,7 +4,7 @@ same kernel can use different libc implementations. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/repair.c b/libexfat/repair.c index 8e8e962..615b8d1 100644 --- a/libexfat/repair.c +++ b/libexfat/repair.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/time.c b/libexfat/time.c index e2a3b23..3ab2a15 100644 --- a/libexfat/time.c +++ b/libexfat/time.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/utf.c b/libexfat/utf.c index 96f4608..b1d09e7 100644 --- a/libexfat/utf.c +++ b/libexfat/utf.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/libexfat/utils.c b/libexfat/utils.c index 3a1154e..0d97b65 100644 --- a/libexfat/utils.c +++ b/libexfat/utils.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2018 Andrew Nayenko + Copyright (C) 2010-2023 Andrew Nayenko 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 diff --git a/mkfs/Makefile.am b/mkfs/Makefile.am index 4d3c9d6..f2314de 100644 --- a/mkfs/Makefile.am +++ b/mkfs/Makefile.am @@ -3,7 +3,7 @@ # Automake source. # # Free exFAT implementation. -# Copyright (C) 2011-2018 Andrew Nayenko +# Copyright (C) 2011-2023 Andrew Nayenko # # 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 diff --git a/mkfs/cbm.c b/mkfs/cbm.c index ad5accc..a542389 100644 --- a/mkfs/cbm.c +++ b/mkfs/cbm.c @@ -3,7 +3,7 @@ Clusters Bitmap creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/cbm.h b/mkfs/cbm.h index 3803b79..f66911a 100644 --- a/mkfs/cbm.h +++ b/mkfs/cbm.h @@ -3,7 +3,7 @@ Clusters Bitmap creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/fat.c b/mkfs/fat.c index c5174a7..3a44b03 100644 --- a/mkfs/fat.c +++ b/mkfs/fat.c @@ -3,7 +3,7 @@ File Allocation Table creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/fat.h b/mkfs/fat.h index fbecaa2..7f93fc9 100644 --- a/mkfs/fat.h +++ b/mkfs/fat.h @@ -3,7 +3,7 @@ File Allocation Table creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/main.c b/mkfs/main.c index 0762024..d7f0526 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -3,7 +3,7 @@ Creates exFAT file system. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 @@ -228,7 +228,7 @@ int main(int argc, char* argv[]) } break; case 'V': - puts("Copyright (C) 2011-2018 Andrew Nayenko"); + puts("Copyright (C) 2011-2023 Andrew Nayenko"); return 0; default: usage(argv[0]); diff --git a/mkfs/mkexfat.c b/mkfs/mkexfat.c index eadbe96..5f92ffc 100644 --- a/mkfs/mkexfat.c +++ b/mkfs/mkexfat.c @@ -3,7 +3,7 @@ FS creation engine. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/mkexfat.h b/mkfs/mkexfat.h index 963b3e5..cecbb8a 100644 --- a/mkfs/mkexfat.h +++ b/mkfs/mkexfat.h @@ -3,7 +3,7 @@ FS creation engine. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/mkexfatfs.8 b/mkfs/mkexfatfs.8 index 6d3c653..57665a9 100644 --- a/mkfs/mkexfatfs.8 +++ b/mkfs/mkexfatfs.8 @@ -1,4 +1,4 @@ -.\" Copyright (C) 2011-2018 Andrew Nayenko +.\" Copyright (C) 2011-2023 Andrew Nayenko .\" .TH MKEXFATFS 8 "January 2014" .SH NAME diff --git a/mkfs/rootdir.c b/mkfs/rootdir.c index 4f9b0e8..c687c1b 100644 --- a/mkfs/rootdir.c +++ b/mkfs/rootdir.c @@ -3,7 +3,7 @@ Root directory creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/rootdir.h b/mkfs/rootdir.h index 87f437f..58d10c5 100644 --- a/mkfs/rootdir.h +++ b/mkfs/rootdir.h @@ -3,7 +3,7 @@ Root directory creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/uct.c b/mkfs/uct.c index 98cdce8..c85cf1c 100644 --- a/mkfs/uct.c +++ b/mkfs/uct.c @@ -3,7 +3,7 @@ Upper Case Table creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/uct.h b/mkfs/uct.h index ce619ec..ae41c6e 100644 --- a/mkfs/uct.h +++ b/mkfs/uct.h @@ -3,7 +3,7 @@ Upper Case Table creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/uctc.c b/mkfs/uctc.c index 518219c..e553246 100644 --- a/mkfs/uctc.c +++ b/mkfs/uctc.c @@ -3,7 +3,7 @@ Upper Case Table contents. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/uctc.h b/mkfs/uctc.h index bd5ebb2..ac26970 100644 --- a/mkfs/uctc.h +++ b/mkfs/uctc.h @@ -3,7 +3,7 @@ Upper Case Table declaration. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/vbr.c b/mkfs/vbr.c index e40081f..6113584 100644 --- a/mkfs/vbr.c +++ b/mkfs/vbr.c @@ -3,7 +3,7 @@ Volume Boot Record creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 diff --git a/mkfs/vbr.h b/mkfs/vbr.h index c1f59a6..2ac6381 100644 --- a/mkfs/vbr.h +++ b/mkfs/vbr.h @@ -3,7 +3,7 @@ Volume Boot Record creation code. Free exFAT implementation. - Copyright (C) 2011-2018 Andrew Nayenko + Copyright (C) 2011-2023 Andrew Nayenko 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 -- 2.39.2