Perl bindings
-------------
-Mark Glines <mark@glines.org>
-Dobrica Pavlinusic <dpavlin@rot13.org>
+Mark Glines <mark@glines.org> - original author of perl bindings
+Dobrica Pavlinusic <dpavlin@rot13.org> - current maintainer
+Richard Dawe <rich@phekda.gotadsl.co.uk> - lot of improvements
+Mark Wilkinson <mark.wilkinson@2pmtech.com> - added mount options
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})) {
$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.
=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
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<N_CALLBACKS;i++) {
- SV *var = ST(i+2);
+ SV *var = ST(i+3);
if((var != &PL_sv_undef) && SvROK(var)) {
if(SvTYPE(SvRV(var)) == SVt_PVCV) {
void **tmp1 = (void**)&_available_ops, **tmp2 = (void**)&fops;
}
}
/* FIXME: need to pass fusermount arguments */
- fd = fuse_mount(mountpoint,NULL);
+ fd = fuse_mount(mountpoint,mountopts);
if(fd < 0)
croak("could not mount fuse filesystem!");
fuse_loop(fuse_new(fd,debug ? "debug" : NULL,&fops));
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+
+all_pod_files_ok();