From 3a84c7c309997b8984d840eef1d01fc3ca2b3326 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 22 Jun 2005 16:15:17 +0000 Subject: [PATCH] added changes from Mark Wilkinson to support mount options, list all contributors in AUTHORS, added pod tests git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl/trunk@16 6e4b0b00-1209-0410-87b2-b275959b5705 --- AUTHORS | 6 ++++-- Fuse.pm | 27 +++++++++++++++++++++++++-- Fuse.xs | 8 +++++--- test/pod.t | 10 ++++++++++ 4 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 test/pod.t diff --git a/AUTHORS b/AUTHORS index 4ffb10a..2ea4ebf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,5 +1,7 @@ Perl bindings ------------- -Mark Glines -Dobrica Pavlinusic +Mark Glines - original author of perl bindings +Dobrica Pavlinusic - current maintainer +Richard Dawe - lot of improvements +Mark Wilkinson - added mount options diff --git a/Fuse.pm b/Fuse.pm index 0173468..f651b31 100644 --- a/Fuse.pm +++ b/Fuse.pm @@ -81,9 +81,11 @@ sub main { my (@names) = qw(getattr readlink getdir mknod mkdir unlink rmdir symlink rename link chmod chown truncate utime open read write statfs flush release fsync setxattr getxattr listxattr removexattr); + my (@validOpts) = qw(allow_other); my ($tmp) = 0; my (%mapping) = map { $_ => $tmp++ } (@names); - my (%otherargs) = (debug=>0, mountpoint=>""); + my (%optmap) = map { $_ => 1 } (@validOpts); + my (%otherargs) = (debug=>0, mountpoint=>"", mountopts=>""); while(my $name = shift) { my ($subref) = shift; if(exists($otherargs{$name})) { @@ -96,7 +98,12 @@ sub main { $subs[$mapping{$name}] = $subref; } } - perl_fuse_main($otherargs{debug},$otherargs{mountpoint},@subs); + foreach my $opt ( split(/,/,$otherargs{mountopts}) ) { + if ( ! exists($optmap{$opt}) ) { + croak "Use of an invalid mountopt argument"; + } + } + perl_fuse_main($otherargs{debug},$otherargs{mountpoint},$otherargs{mountopts},@subs); } # Autoload methods go after =cut, and are processed by the autosplit program. @@ -174,6 +181,22 @@ specify this. An example would be '/mnt'. =back +mountopts => string + +=over 1 + +This is a comma seperated list of mount options to pass to the FUSE kernel +module. + +At present, it allows the specification of the allow_other +argument when mounting the new FUSE filesystem. To use this, you will also +need 'user_allow_other' in /etc/fuse.conf as per the FUSE documention + + mountopts => "allow_other" or + mountopts => "" + +=back + unthreaded => boolean =over 1 diff --git a/Fuse.xs b/Fuse.xs index 9ead042..318d355 100644 --- a/Fuse.xs +++ b/Fuse.xs @@ -777,19 +777,21 @@ perl_fuse_main(...) struct fuse_operations fops = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; int i, fd, varnum = 0, debug, have_mnt; char *mountpoint; + char *mountopts; STRLEN n_a; STRLEN l; INIT: - if(items != 27) { + if(items != 28) { fprintf(stderr,"Perl<->C inconsistency or internal error\n"); XSRETURN_UNDEF; } CODE: debug = SvIV(ST(0)); mountpoint = SvPV_nolen(ST(1)); + mountopts = SvPV_nolen(ST(2)); /* FIXME: reevaluate multithreading support when perl6 arrives */ for(i=0;i "Test::Pod 1.00 required for testing POD" if $@; + +all_pod_files_ok(); -- 2.20.1