[prev in list] [next in list] [prev in thread] [next in thread]
List: fuse-devel
Subject: Re: [fuse-devel] Adding non standard options to /etc/mtab
From: nf2 <nf2 () scheinwelt ! at>
Date: 2007-10-08 18:54:24
Message-ID: 470A7CE0.4000808 () scheinwelt ! at
[Download RAW message or body]
nf2 wrote:
> I would like to add non standard options when mounting a fuse
> filesystem. The basic idea that they should show up in /etc/mtab to be
> read by desktop vfs libraries and filemanagers. Their purpose is to turn
> .Trash and preview rendering on/off, which is sometimes desirable:
>
> -o notrash,nopreviews
>
> I have already patched fusermount to let them through, but now i get:
>
> fusermount: mount failed: Invalid argument
>
> Hmm...
>
>
Ah - found it myself. The FUSE kernel module also needs a little "fix".
Here is a little patch which enables the option
-o add_kernel_opt=xxxxx
But, of course, setting arbitrary options might be a security problem...
Don't know...
Norbert
["fuse_2.6.6_add_kernel_opt.patch" (text/x-patch)]
diff -u -r /tmp/fuse-2.6.5/kernel/inode.c fuse-2.6.5/kernel/inode.c
--- /tmp/fuse-2.6.5/kernel/inode.c 2007-02-04 14:34:51.000000000 +0100
+++ fuse-2.6.5/kernel/inode.c 2007-10-08 20:17:00.000000000 +0200
@@ -399,7 +399,8 @@
break;
default:
- return 0;
+ //return 0;
+ break;
}
}
diff -u -r /tmp/fuse-2.6.5/lib/mount.c fuse-2.6.5/lib/mount.c
--- /tmp/fuse-2.6.5/lib/mount.c 2007-01-02 18:10:33.000000000 +0100
+++ fuse-2.6.5/lib/mount.c 2007-10-08 20:37:04.000000000 +0200
@@ -35,6 +35,7 @@
KEY_RO,
KEY_HELP,
KEY_VERSION,
+ ADD_KERNEL_OPT
};
struct mount_opts {
@@ -75,6 +76,7 @@
FUSE_OPT_KEY("--help", KEY_HELP),
FUSE_OPT_KEY("-V", KEY_VERSION),
FUSE_OPT_KEY("--version", KEY_VERSION),
+ FUSE_OPT_KEY("add_kernel_opt=", ADD_KERNEL_OPT),
FUSE_OPT_END
};
@@ -128,6 +130,13 @@
case KEY_KERN:
return fuse_opt_add_opt(&mo->kernel_opts, arg);
+ case ADD_KERNEL_OPT:
+ {
+ char * eqpos = strchr(arg, '=');
+ if (eqpos && strlen(eqpos+1)>0)
+ return fuse_opt_add_opt(&mo->kernel_opts, eqpos+1);
+ break;
+ }
case KEY_HELP:
mount_help();
mo->ishelp = 1;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
fuse-devel mailing list
fuse-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic