Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 2021 20:56:26 GMT
From:      Oleksii Samorukov <samm@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: d30a15797673 - main - sysutils/fusefs-exfat: Pass "automounted" option into kernel and remove user option
Message-ID:  <202111242056.1AOKuQH5082114@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by samm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d30a15797673e67199fe8a3fcbf437c5235237a9

commit d30a15797673e67199fe8a3fcbf437c5235237a9
Author:     Oleksii Samorukov <samm@FreeBSD.org>
AuthorDate: 2021-11-24 20:53:27 +0000
Commit:     Oleksii Samorukov <samm@FreeBSD.org>
CommitDate: 2021-11-24 20:56:11 +0000

    sysutils/fusefs-exfat: Pass "automounted" option into kernel and remove user option
    
    Based on upstream patches from the project repository
    
    PR: 255213
    Reported by: fbsd@any.com.ru
---
 sysutils/fusefs-exfat/Makefile                     |  1 +
 sysutils/fusefs-exfat/files/patch-fuse_main.c      | 25 +++++++++++++
 sysutils/fusefs-exfat/files/patch-libexfat_exfat.h | 10 ++++++
 sysutils/fusefs-exfat/files/patch-libexfat_mount.c | 42 ++++++++++++++++++++++
 sysutils/fusefs-exfat/files/patch-libexfat_utils.c | 18 ++++++++++
 5 files changed, 96 insertions(+)

diff --git a/sysutils/fusefs-exfat/Makefile b/sysutils/fusefs-exfat/Makefile
index 9f874866eb38..8c9f4d9df17c 100644
--- a/sysutils/fusefs-exfat/Makefile
+++ b/sysutils/fusefs-exfat/Makefile
@@ -3,6 +3,7 @@
 PORTNAME=	exfat
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.3.0
+PORTREVISION=	1
 CATEGORIES=	sysutils
 PKGNAMEPREFIX=	fusefs-
 
diff --git a/sysutils/fusefs-exfat/files/patch-fuse_main.c b/sysutils/fusefs-exfat/files/patch-fuse_main.c
new file mode 100644
index 000000000000..aa2e853d16dd
--- /dev/null
+++ b/sysutils/fusefs-exfat/files/patch-fuse_main.c
@@ -0,0 +1,25 @@
+--- fuse/main.c.orig	2021-11-24 20:45:02 UTC
++++ fuse/main.c
+@@ -451,7 +451,7 @@ static char* add_ro_option(char* options, bool ro)
+ 	return ro ? add_option(options, "ro", NULL) : options;
+ }
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__)
+ static char* add_user_option(char* options)
+ {
+ 	struct passwd* pw;
+@@ -492,12 +492,10 @@ static char* add_fuse_options(char* options, const cha
+ 	options = add_ro_option(options, ro);
+ 	if (options == NULL)
+ 		return NULL;
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__)
+ 	options = add_user_option(options);
+ 	if (options == NULL)
+ 		return NULL;
+-#endif
+-#if defined(__linux__)
+ 	options = add_blksize_option(options, CLUSTER_SIZE(*ef.sb));
+ 	if (options == NULL)
+ 		return NULL;
diff --git a/sysutils/fusefs-exfat/files/patch-libexfat_exfat.h b/sysutils/fusefs-exfat/files/patch-libexfat_exfat.h
new file mode 100644
index 000000000000..2b5d7cf8473e
--- /dev/null
+++ b/sysutils/fusefs-exfat/files/patch-libexfat_exfat.h
@@ -0,0 +1,10 @@
+--- libexfat/exfat.h.orig	2018-09-15 05:03:24 UTC
++++ libexfat/exfat.h
+@@ -201,6 +201,7 @@ le16_t exfat_calc_name_hash(const struct exfat* ef, co
+ void exfat_humanize_bytes(uint64_t value, struct exfat_human_bytes* hb);
+ void exfat_print_info(const struct exfat_super_block* sb,
+ 		uint32_t free_clusters);
++bool exfat_match_option(const char* options, const char* option_name);
+ 
+ int utf16_to_utf8(char* output, const le16_t* input, size_t outsize,
+ 		size_t insize);
diff --git a/sysutils/fusefs-exfat/files/patch-libexfat_mount.c b/sysutils/fusefs-exfat/files/patch-libexfat_mount.c
new file mode 100644
index 000000000000..66d6096e3131
--- /dev/null
+++ b/sysutils/fusefs-exfat/files/patch-libexfat_mount.c
@@ -0,0 +1,42 @@
+--- libexfat/mount.c.orig	2018-09-15 05:03:24 UTC
++++ libexfat/mount.c
+@@ -79,18 +79,6 @@ static int get_int_option(const char* options, const c
+ 	return strtol(p, NULL, base);
+ }
+ 
+-static bool match_option(const char* options, const char* option_name)
+-{
+-	const char* p;
+-	size_t length = strlen(option_name);
+-
+-	for (p = strstr(options, option_name); p; p = strstr(p + 1, option_name))
+-		if ((p == options || p[-1] == ',') &&
+-				(p[length] == ',' || p[length] == '\0'))
+-			return true;
+-	return false;
+-}
+-
+ static void parse_options(struct exfat* ef, const char* options)
+ {
+ 	int opt_umask;
+@@ -102,7 +90,7 @@ static void parse_options(struct exfat* ef, const char
+ 	ef->uid = get_int_option(options, "uid", 10, geteuid());
+ 	ef->gid = get_int_option(options, "gid", 10, getegid());
+ 
+-	ef->noatime = match_option(options, "noatime");
++	ef->noatime = exfat_match_option(options, "noatime");
+ 
+ 	switch (get_int_option(options, "repair", 10, 0))
+ 	{
+@@ -205,9 +193,9 @@ int exfat_mount(struct exfat* ef, const char* spec, co
+ 
+ 	parse_options(ef, options);
+ 
+-	if (match_option(options, "ro"))
++	if (exfat_match_option(options, "ro"))
+ 		mode = EXFAT_MODE_RO;
+-	else if (match_option(options, "ro_fallback"))
++	else if (exfat_match_option(options, "ro_fallback"))
+ 		mode = EXFAT_MODE_ANY;
+ 	else
+ 		mode = EXFAT_MODE_RW;
diff --git a/sysutils/fusefs-exfat/files/patch-libexfat_utils.c b/sysutils/fusefs-exfat/files/patch-libexfat_utils.c
new file mode 100644
index 000000000000..0bb23430d4a9
--- /dev/null
+++ b/sysutils/fusefs-exfat/files/patch-libexfat_utils.c
@@ -0,0 +1,18 @@
+--- libexfat/utils.c.orig	2018-09-15 05:03:24 UTC
++++ libexfat/utils.c
+@@ -178,3 +178,15 @@ void exfat_print_info(const struct exfat_super_block* 
+ 	exfat_humanize_bytes(avail_space, &hb);
+ 	printf("Available space      %10"PRIu64" %s\n", hb.value, hb.unit);
+ }
++
++bool exfat_match_option(const char* options, const char* option_name)
++{
++	const char* p;
++	size_t length = strlen(option_name);
++
++	for (p = strstr(options, option_name); p; p = strstr(p + 1, option_name))
++		if ((p == options || p[-1] == ',') &&
++				(p[length] == ',' || p[length] == '\0'))
++			return true;
++	return false;
++}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111242056.1AOKuQH5082114>