FreeBSD Bugzilla – Attachment 244667 Details for
Bug 273586
sysutils/fuse-ext2: the default_permissions and allow_other options cannot be disabled.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch the described bug
0001-sysutils-fuse-ext2-fix-default_permissions-and-allow.patch (text/plain), 3.23 KB, created by
Alan Somers
on 2023-09-05 21:42:25 UTC
(
hide
)
Description:
Patch the described bug
Filename:
MIME Type:
Creator:
Alan Somers
Created:
2023-09-05 21:42:25 UTC
Size:
3.23 KB
patch
obsolete
>From 85e2da118e59a61e0cb1c1dbaab874ad19017dfc Mon Sep 17 00:00:00 2001 >From: Alan Somers <asomers@FreeBSD.org> >Date: Tue, 5 Sep 2023 15:31:36 -0600 >Subject: [PATCH] sysutils/fuse-ext2: fix default_permissions and allow_other > >These options, intended to be default settings, were in fact always >enabled and could not be disabled by the user. This patch allows the >user to disable them. > >https://github.com/alperakcan/fuse-ext2/issues/95 > >PR: 273586 >Sponsored by: Axcient >--- > sysutils/fusefs-ext2/Makefile | 2 +- > .../files/patch-fuse-ext2_fuse-ext2.c | 61 +++++++++++++++++++ > 2 files changed, 62 insertions(+), 1 deletion(-) > create mode 100644 sysutils/fusefs-ext2/files/patch-fuse-ext2_fuse-ext2.c > >diff --git a/sysutils/fusefs-ext2/Makefile b/sysutils/fusefs-ext2/Makefile >index da807194a9e8..6c8fa3450627 100644 >--- a/sysutils/fusefs-ext2/Makefile >+++ b/sysutils/fusefs-ext2/Makefile >@@ -1,7 +1,7 @@ > PORTNAME= fusefs-ext2 > PORTVERSION= 0.0.10 > DISTVERSIONPREFIX= v >-PORTREVISION= 4 >+PORTREVISION= 5 > CATEGORIES= sysutils > > MAINTAINER= ehaupt@FreeBSD.org >diff --git a/sysutils/fusefs-ext2/files/patch-fuse-ext2_fuse-ext2.c b/sysutils/fusefs-ext2/files/patch-fuse-ext2_fuse-ext2.c >new file mode 100644 >index 000000000000..6b12035108f4 >--- /dev/null >+++ b/sysutils/fusefs-ext2/files/patch-fuse-ext2_fuse-ext2.c >@@ -0,0 +1,61 @@ >+--- fuse-ext2/fuse-ext2.c.orig 2019-05-09 08:29:33 UTC >++++ fuse-ext2/fuse-ext2.c >+@@ -18,15 +18,14 @@ >+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA >+ */ >+ >++#include <stdbool.h> >+ #include "fuse-ext2.h" >+ >+ static const char *HOME = "http://github.com/alperakcan/fuse-ext2/"; >+ >+ #if __FreeBSD__ == 10 >+-static char def_opts[] = "allow_other,default_permissions,local,"; >+ static char def_opts_rd[] = "noappledouble,"; >+ #else >+-static char def_opts[] = "allow_other,default_permissions,"; >+ static char def_opts_rd[] = ""; >+ #endif >+ >+@@ -171,8 +170,10 @@ static int parse_options (int argc, char *argv[], stru >+ static char * parse_mount_options (const char *orig_opts, struct extfs_data *opts) >+ { >+ char *options, *s, *opt, *val, *ret; >++ bool allow_other = true; >++ bool default_permissions = true; >+ >+- ret = malloc(strlen(def_opts) + strlen(def_opts_rd) + strlen(orig_opts) + 256 + PATH_MAX); >++ ret = malloc(strlen(def_opts_rd) + strlen(orig_opts) + 256 + PATH_MAX); >+ if (!ret) { >+ return NULL; >+ } >+@@ -231,6 +232,14 @@ static char * parse_mount_options (const char *orig_op >+ #if __FreeBSD__ == 10 >+ strcat(ret, "force,"); >+ #endif >++ } else if (!strcmp(opt, "noallow_other")) { >++ allow_other = false; >++ strcat(ret, opt); >++ strcat(ret, ","); >++ } else if (!strcmp(opt, "nodefault_permissions")) { >++ default_permissions = false; >++ strcat(ret, opt); >++ strcat(ret, ","); >+ } else { /* Probably FUSE option. */ >+ strcat(ret, opt); >+ if (val) { >+@@ -246,7 +255,13 @@ static char * parse_mount_options (const char *orig_op >+ opts->readonly = 1; >+ } >+ >+- strcat(ret, def_opts); >++ if (allow_other) >++ strcat(ret, "allow_other,"); >++ if (default_permissions) >++ strcat(ret, "default_permissions,"); >++#if __FreeBSD__ == 10 >++ strcat(ret, "local,"); >++#endif >+ if (opts->readonly == 1) { >+ strcat(ret, def_opts_rd); >+ strcat(ret, "ro,"); >-- >2.40.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
asomers
:
maintainer-approval?
(
ehaupt
)
Actions:
View
|
Diff
Attachments on
bug 273586
: 244667