View | Details | Raw Unified | Return to bug 120420
Collapse All | Expand All

(-)fusefs-kmod/Makefile (-16 / +16 lines)
Lines 6-18 Link Here
6
#
6
#
7
7
8
PORTNAME=	fusefs
8
PORTNAME=	fusefs
9
DISTVERSION=	0.3.9-pre1
9
PORTVERSION=	0.3.9.20080208
10
PORTREVISION=	3
11
CATEGORIES=	sysutils kld
10
CATEGORIES=	sysutils kld
12
MASTER_SITES=	http://fuse4bsd.creo.hu/downloads/ \
11
MASTER_SITES=	http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archive/
13
		http://am-productions.biz/docs/
14
PKGNAMESUFFIX=	-kmod
12
PKGNAMESUFFIX=	-kmod
15
DISTNAME=	fuse4bsd-${DISTVERSION}
13
DISTNAME=	${HG_SHORTREV}
14
DIST_SUBDIR=	fuse4bsd
16
15
17
MAINTAINER=	amistry@am-productions.biz
16
MAINTAINER=	amistry@am-productions.biz
18
COMMENT=	Kernel module for fuse
17
COMMENT=	Kernel module for fuse
Lines 23-37 Link Here
23
BUILD_DEPENDS+=	deplate:${PORTSDIR}/textproc/ruby-deplate
22
BUILD_DEPENDS+=	deplate:${PORTSDIR}/textproc/ruby-deplate
24
.endif
23
.endif
25
24
26
USE_BZIP2=	yes
25
USE_RC_SUBR=	fusefs
27
MAKE_ENV=	BINDIR="${PREFIX}/sbin" MANDIR="${PREFIX}/man/man"
26
MAKE_ENV=	BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \
27
		KMODDIR="${KMODDIR}" SRC_BASE="${SRC_BASE}"
28
WRKSRC=		${WRKDIR}/fuse4bsd-${HG_SHORTREV}
29
DISABLE_SIZE=	yes
28
30
29
SRC_BASE?=	/usr/src
31
SRC_BASE?=	/usr/src
30
KMODDIR=	${PREFIX}/modules
32
KMODDIR=	${PREFIX}/modules
31
MAKE_ARGS=	KMODDIR=${KMODDIR}
32
MODULE_PATH=	`/sbin/sysctl -n kern.module_path`;${KMODDIR}
33
USE_RC_SUBR=	fusefs
34
SETUP=		setup.sh
33
SETUP=		setup.sh
34
HG_SHORTREV=	498acaef33b0
35
35
36
MAN8=		mount_fusefs.8
36
MAN8=		mount_fusefs.8
37
TXT_DOCS=	doc.text
37
TXT_DOCS=	doc.text
Lines 66-73 Link Here
66
IGNORE=		requires the userland sources to be installed. Set SRC_BASE if it is not in /usr/src
66
IGNORE=		requires the userland sources to be installed. Set SRC_BASE if it is not in /usr/src
67
.endif
67
.endif
68
68
69
.if !defined(WITH_AUTOSETUP)
69
.if defined(WITH_AUTOSETUP)
70
SUB_FILES=	pkg-message
70
SUB_FILES+=	${SETUP}
71
.else
72
SUB_FILES+=	pkg-message
71
.endif
73
.endif
72
74
73
post-patch:
75
post-patch:
Lines 88-97 Link Here
88
post-install:
90
post-install:
89
	@${LN} -fs ${PREFIX}/sbin/mount_fusefs /usr/sbin
91
	@${LN} -fs ${PREFIX}/sbin/mount_fusefs /usr/sbin
90
.if defined(WITH_AUTOSETUP) && !defined(PACKAGE_BUILDING)
92
.if defined(WITH_AUTOSETUP) && !defined(PACKAGE_BUILDING)
91
	@${SED} -e 's|@@PREFIX@@|${PREFIX}|g' \
93
	@${ECHO} "Modifying global startup config files and loading module..."
92
		${FILESDIR}/${SETUP} > ${WRKDIR}/${SETUP}
94
	@${SH} ${WRKDIR}/${SETUP}
93
	@${ECHO} "Modifying global startup config files and loading module...";
94
	${SH} ${WRKDIR}/${SETUP}
95
.else
95
.else
96
	@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}
96
	@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}
97
.endif
97
.endif
(-)fusefs-kmod/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (fuse4bsd-0.3.9-pre1.tar.bz2) = d427d6c831794f6d62ce1aef9f254f9e
1
MD5 (fuse4bsd/498acaef33b0.tar.gz) = 9fd12d284be9450dae0ec5e718a5bc8e
2
SHA256 (fuse4bsd-0.3.9-pre1.tar.bz2) = e339fce188b3667ca267f8d672d3f9657d61e384d54997a93d64ddd178fd55d7
2
SHA256 (fuse4bsd/498acaef33b0.tar.gz) = 70ec94c6700f6395316c68d60ba0307236b20cddd6aeeedd4597870e7670ff2a
3
SIZE (fuse4bsd-0.3.9-pre1.tar.bz2) = 112627
3
SIZE (fuse4bsd/498acaef33b0.tar.gz) = 116037
(-)fusefs-kmod/files/fusefs.in (-3 / +3 lines)
Lines 40-52 Link Here
40
		return 1
40
		return 1
41
	fi
41
	fi
42
	echo "Stopping ${name}."
42
	echo "Stopping ${name}."
43
# Unmount FUSE filesystems in reverse order (in case they are nested) with
43
# Unmount FUSE filesystems in reverse order (in case they are nested) to
44
# a delay of one second after, to allow 'umount' finish.
44
# allow recent FUSE implementation to synchronize disks before shutdown.
45
	mount | sed -e '1!G;h;$!d' | while read dev d1 mountpoint d2; do
45
	mount | sed -e '1!G;h;$!d' | while read dev d1 mountpoint d2; do
46
		case "$dev" in
46
		case "$dev" in
47
		/dev/fuse[0-9]*)
47
		/dev/fuse[0-9]*)
48
			echo "fusefs: unmounting ${mountpoint}."
48
			echo "fusefs: unmounting ${mountpoint}."
49
			umount $mountpoint ; sleep 1
49
			umount $mountpoint
50
			;;
50
			;;
51
		esac
51
		esac
52
	done
52
	done
(-)fusefs-kmod/files/patch-fuse_io.c (-11 lines)
Removed Link Here
1
--- fuse_module/fuse_io.c.orig	Tue Jun 19 09:35:22 2007
2
+++ fuse_module/fuse_io.c	Thu Dec 13 02:46:05 2007
3
@@ -148,7 +148,7 @@
4
 	}
5
 
6
 	if (uio->uio_resid == 0)
7
-		return (0);
8
+		goto out;
9
 
10
 	if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) {
11
 		if ((err = VOP_GETATTR(vp, &va, cred, td)))
(-)fusefs-kmod/files/patch-fuse_module_Makefile (-18 lines)
Removed Link Here
1
--- fuse_module/Makefile.orig	2007-06-19 14:35:22.000000000 +0200
2
+++ fuse_module/Makefile	2007-08-16 18:31:50.000000000 +0200
3
@@ -21,7 +21,14 @@
4
 .endif
5
 
6
 .if defined(KERNCONF)
7
-KERNCONFDIR= /usr/obj/usr/src/sys/${KERNCONF}
8
+.if !defined(MAKEOBJDIRPREFIX)
9
+MAKEOBJDIRPREFIX=/usr/obj
10
+.endif
11
+.if !defined(SRC_BASE)
12
+SRC_BASE=/usr/src
13
+.endif
14
+KERNCONF1!= echo ${KERNCONF} | sed -e 's/ .*//g'
15
+KERNCONFDIR= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF1}
16
 .endif
17
 
18
 .if defined(KERNCONFDIR)
(-)fusefs-kmod/files/patch-fuse_module_fuse.h (-36 lines)
Removed Link Here
1
--- fuse_module/fuse.h.orig	Tue Jun 19 14:35:22 2007
2
+++ fuse_module/fuse.h	Sat Jul 14 13:23:37 2007
3
@@ -33,6 +33,24 @@
4
 #endif
5
 #endif
6
 
7
+#ifndef USE_PRIVILEGE_API
8
+/*
9
+ * __FreeBSD_version bump was omitted for introduction of
10
+ * the privilege API (both when it's been added and when the
11
+ * legacy API has been removed), so here we just use the first
12
+ * value of __FreeBSD_version after adding the priv stuff.
13
+ */
14
+#if __FreeBSD_version >= 700025
15
+#define USE_PRIVILEGE_API 1
16
+#else
17
+#define USE_PRIVILEGE_API 0
18
+#endif
19
+#endif
20
+#if ! USE_PRIVILEGE_API
21
+#define priv_check(td, priv) suser(td)
22
+#define priv_check_cred(cred, priv, flag) suser_cred(cred, SUSER_ALLOWJAIL)
23
+#endif
24
+
25
 /*
26
  * Appearance of new FUSE operations is not always in par with version
27
  * numbering... At least, 7.3 is a sufficient condition for having
28
@@ -210,7 +228,7 @@
29
 void fprettyprint(struct fuse_iov *fiov, size_t dlen);
30
 #endif
31
 
32
-#if _DEBUG || _DEBUG2G || _DEBUG3G || defined(INVARIANTS)
33
+#if _DEBUG || _DEBUG2G || _DEBUG3G || defined(INVARIANTS) || FUSELIB_CONFORM_BIOREAD
34
 int isbzero(void *buf, size_t len);
35
 #endif
36
 
(-)fusefs-kmod/files/patch-fuse_vfsops.c (-63 lines)
Removed Link Here
1
--- fuse_module/fuse_vfsops.c	Sat Jul 14 13:13:55 2007
2
+++ fuse_module/fuse_vfsops.c	Sat Jul 14 13:13:55 2007
3
@@ -23,6 +23,20 @@
4
 #include "fuse_session.h"
5
 #include "fuse_vnode.h"
6
 
7
+#if USE_PRIVILEGE_API
8
+#include <sys/priv.h>
9
+#endif
10
+
11
+
12
+/* This will do for privilege types for now */
13
+#ifndef PRIV_VFS_FUSE_ALLOWOTHER
14
+#define PRIV_VFS_FUSE_ALLOWOTHER PRIV_VFS_MOUNT_NONUSER
15
+#endif
16
+#ifndef PRIV_VFS_FUSE_MOUNT_NONUSER
17
+#define PRIV_VFS_FUSE_MOUNT_NONUSER PRIV_VFS_MOUNT_NONUSER
18
+#endif
19
+
20
+
21
 static int fuse_init_handler(struct fuse_ticket *tick, struct uio *uio);
22
 static void fuse_send_init(struct fuse_data *data, struct thread *td);
23
 static vfs_hash_cmp_t fuse_vnode_bgdrop_cmp;
24
@@ -207,10 +221,8 @@ fuse_mount(struct mount *mp, struct thre
25
 	KASSERT(fuse_useco >= 0,
26
 	        ("negative fuse usecount despite Giant"));
27
 
28
-	if (mp->mnt_flag & MNT_UPDATE) {
29
-		uprintf("fuse: updating mounts is not supported\n");
30
+	if (mp->mnt_flag & MNT_UPDATE)
31
 		return (EOPNOTSUPP);
32
-	}
33
 
34
 	mp->mnt_flag |= MNT_SYNCHRONOUS; 
35
 	/* Get the new options passed to mount */
36
@@ -293,10 +305,8 @@ fuse_mount(struct mount *mp, struct thre
37
 
38
 	if (fdata_kick_get(data))
39
 		err = ENOTCONN;
40
-	if (mntopts & FSESS_DAEMON_CAN_SPY && suser(td)) {
41
-		uprintf("only root can use \"allow_other\"\n");
42
-		err = EPERM;
43
-	}
44
+	if (mntopts & FSESS_DAEMON_CAN_SPY)
45
+	    err = priv_check(td, PRIV_VFS_FUSE_ALLOWOTHER);
46
 
47
 	slock = &data->mhierlock;
48
 	/* Note that sx_try_xlock returns 0 on _failure_ */
49
@@ -334,10 +344,9 @@ fuse_mount(struct mount *mp, struct thre
50
 			 */
51
 			err = EINVAL;
52
 	} else {
53
-		if (suser(td) &&
54
-	            td->td_ucred->cr_uid != data->daemoncred->cr_uid)
55
-			/* we are not allowed to do the first mount */
56
-			err = EPERM;
57
+		if (td->td_ucred->cr_uid != data->daemoncred->cr_uid)
58
+			/* are we allowed to do the first mount? */
59
+			err = priv_check(td, PRIV_VFS_FUSE_MOUNT_NONUSER);
60
 	}
61
 
62
 	if (err) {
63
(-)fusefs-kmod/files/patch-fuse_vnops.c (-106 lines)
Removed Link Here
1
--- fuse_module/fuse_vnops.c	Sat Jul 14 13:14:27 2007
2
+++ fuse_module/fuse_vnops.c	Sat Jul 14 13:14:27 2007
3
@@ -42,6 +42,10 @@
4
 #include "fuse_vnode.h"
5
 #include "fuse_io.h"
6
 
7
+#if USE_PRIVILEGE_API
8
+#include <sys/priv.h>
9
+#endif
10
+
11
 /* function prototype for iterators over filehandles (of a vp) */
12
 typedef int fuse_metrics_t(struct vnode *vp, struct thread *td,
13
                            struct ucred *cred, struct fuse_filehandle *fufh,
14
@@ -63,7 +67,9 @@ struct fuse_access_param {
15
 #define FACCESS_CHOWN      0x08 /* do permission check for owner changing */
16
 #define FACCESS_NOCHECKSPY 0x10 /* don't check if daemon is allowed to spy on
17
                                    user */
18
-#define FACCESS_XQUERIES FACCESS_STICKY | FACCESS_CHOWN
19
+#define FACCESS_SETGID     0x12 /* do permission check for setting setgid flag */
20
+
21
+#define FACCESS_XQUERIES FACCESS_STICKY | FACCESS_CHOWN | FACCESS_SETGID
22
 
23
 #define FVP_ACCESS_NOOP   0x01 /* vnode based control flag for doing access check */
24
 
25
@@ -855,6 +861,7 @@ fuse_access(ap)
26
 
27
 /*
28
  * Attribute caching hasn't yet been implemented.
29
+ * [... Update: it _has been_ implemented.]
30
  * However, within one function we don't wanna query attributes
31
  * several times. Now it's enough pull the attributes once, and throw
32
  * it into the following routine with various modes.
33
@@ -929,12 +936,16 @@ fuse_access_i(struct vnode *vp, mode_t m
34
 			    mode == VWRITE) {
35
 				if (cred->cr_uid != facp->xuid &&
36
 				    cred->cr_uid != VTOVA(vp)->va_uid)
37
-					    err = suser_cred(cred, SUSER_ALLOWJAIL);
38
+	    				err = priv_check_cred(cred,
39
+					                      PRIV_VFS_ADMIN,
40
+					                      0);
41
 			}
42
 			/*
43
 			 * We return here because this flags is exlusive
44
 			 * with the others
45
 			 */
46
+			KASSERT(facp->facc_flags == FACCESS_STICKY,
47
+			        ("sticky access check comes in mixed"));
48
 			return (err);
49
 		}
50
 
51
@@ -947,10 +958,21 @@ fuse_access_i(struct vnode *vp, mode_t m
52
 			    (cred->cr_gid != facp->xgid &&
53
 			         facp->xgid != (gid_t)VNOVAL &&
54
 			         ! groupmember(facp->xgid, cred)))
55
-				err = suser_cred(cred, SUSER_ALLOWJAIL);
56
-			return (err);
57
+				err = priv_check_cred(cred, PRIV_VFS_CHOWN, 0);
58
+			if (err)
59
+				return (err);
60
 		}
61
 
62
+		if (facp->facc_flags & FACCESS_SETGID) {
63
+			gid_t sgid = facp->xgid;
64
+
65
+			if (sgid == (gid_t)VNOVAL)
66
+				sgid = VTOVA(vp)->va_gid;
67
+
68
+			if (! groupmember(sgid, cred))
69
+				err = priv_check_cred(cred, PRIV_VFS_SETGID, 0);
70
+			return (err);
71
+		}
72
 
73
 	} else {
74
 #if FUSE_HAS_ACCESS
75
@@ -1234,7 +1256,13 @@ fuse_lookup(ap)
76
 		 */
77
 		if (nameiop == RENAME && wantparent && islastcn) {
78
 			DEBUG("something to rename...\n");
79
-			if ((err = fuse_access_i(dvp, VWRITE, cred, td, &facp)))
80
+
81
+			facp.xuid = fattr->uid;
82
+			facp.facc_flags |= FACCESS_STICKY;
83
+			err = fuse_access_i(dvp, VWRITE, cred, td, &facp);
84
+			facp.facc_flags &= ~FACCESS_XQUERIES;
85
+
86
+			if (err)
87
 				goto out;
88
 
89
 			/*
90
@@ -2948,8 +2976,14 @@ fuse_setattr(ap)
91
 	}
92
 
93
 	if (vap->va_mode != (mode_t)VNOVAL) {
94
+#if _DEBUG
95
 		if (vap->va_mode & S_IFMT)
96
-			DEBUG("fuse_setattr -- weird: format bits in mode field, 0%o\n", vap->va_mode);
97
+			DEBUG("fuse_setattr -- weird: "
98
+			      "format bits in mode field, 0%o\n",
99
+			      vap->va_mode);
100
+#endif
101
+		if (vap->va_mode & S_ISGID)
102
+			facp.facc_flags |= FACCESS_SETGID;
103
 		fsai->FUSEATTR(mode) = vap->va_mode & ALLPERMS;
104
 		fsai->valid |= FATTR_MODE;
105
 	}
106
(-)fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c (-21 lines)
Removed Link Here
1
--- mount_fusefs/mount_fusefs.c.orig	Tue Jun 19 09:35:22 2007
2
+++ mount_fusefs/mount_fusefs.c	Thu Dec 13 02:44:12 2007
3
@@ -70,6 +70,8 @@
4
 	{ "user_id=",            0, 0x00, 1 },
5
 	{ "group_id=",           0, 0x00, 1 },
6
 	{ "large_read",          0, 0x00, 1 },
7
+	/* "nonempty", just the first two chars are stripped off during parsing */
8
+	{ "nempty",              0, 0x00, 1 },
9
 	MOPT_STDOPTS,
10
 	MOPT_END
11
 };
12
@@ -469,7 +471,8 @@
13
 int
14
 init_backgrounded(void)
15
 {
16
-	int ibg, len;
17
+	int ibg;
18
+	size_t len;
19
 
20
 	len = sizeof(ibg);
21
 
(-)fusefs-kmod/files/pkg-message.in (-3 / +2 lines)
Lines 13-20 Link Here
13
named "mount_<fstype>", which is not created by all the fusefs ports.
13
named "mount_<fstype>", which is not created by all the fusefs ports.
14
14
15
Note that the rc.d script will unmount all fuse filesystems when called with
15
Note that the rc.d script will unmount all fuse filesystems when called with
16
"stop", so it can unload the kernel module, and as a temporary workaround to
16
"stop" (in reverse order in case of nested mounts), so it can unload the
17
flush cache in drivers like NTFS-3G (sysutils/fusefs-ntfs) at shutdown (until
17
kernel module.
18
a proper solution is implemented).
19
18
20
==============================================================================
19
==============================================================================
(-)fusefs-kmod/files/setup.sh (-52 lines)
Removed Link Here
1
#!/bin/sh
2
#
3
# Automatically setup the loading of the module without polluting /boot/modules
4
SYSCTL_CONFIG=/etc/sysctl.conf
5
LOADER_CONFIG=/etc/rc.conf
6
7
sysctl kern.module_path | grep "[:space:;=]@@PREFIX@@/modules[;]\?\b" > /dev/null 2>&1; RESULT=$?
8
if [ ${RESULT} -eq 1 ]; then
9
	MODULE_PATH="`sysctl -n kern.module_path`;@@PREFIX@@/modules"
10
	sysctl "kern.module_path=${MODULE_PATH}"
11
else
12
	MODULE_PATH=`sysctl -n kern.module_path`
13
fi
14
15
grep "kern\.module_path" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
16
if [ ${RESULT} -eq 0 ]; then
17
	# Variable present
18
	grep "kern\.module_path" ${SYSCTL_CONFIG} | grep "[:space:;=]@@PREFIX@@/modules[;]\?\b" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
19
	if [ ${RESULT} -eq 1 ]; then
20
		# Not present in variable, so add
21
		ESC_PREFIX=`echo '@@PREFIX@@' | sed -e 's/\//\\\\\//g'`
22
		sed -i .orig -e 's/kern\.module_path[:space:]*=[:space:]*["]*\([[:alnum:][:space:]\.,;\/_-]*\)["]*/kern\.module_path="\1;'${ESC_PREFIX}'\/modules"/g' ${SYSCTL_CONFIG}
23
	fi
24
else
25
	# Not present.
26
	echo kern.module_path="${MODULE_PATH}" >> ${SYSCTL_CONFIG}
27
fi
28
29
30
kldstat -n fuse > /dev/null 2>&1; RESULT=$?
31
if [ ${RESULT} -eq 0 ]; then
32
	kldunload -n fuse > /dev/null 2>&1; RESULT=$?
33
	if [ ${RESULT} -ne 0 ]; then
34
		echo 'NOTICE: Failed to unload the Fuse module!'
35
		echo 'NOTICE: Is fuse.ko in use?'
36
	fi
37
fi
38
39
grep fusefs_enable ${LOADER_CONFIG} > /dev/null 2>&1; RESULT=$?
40
if [ ${RESULT} -eq 0 ]; then
41
	# Present, we should leave it alone
42
#	sed -e s/fusefs_enable.*/fuse_load=\"YES\"/g -i.orig ${LOADER_CONFIG}
43
else
44
	# Not present. First time install, so lets start it up
45
	echo 'fusefs_enable="YES"' >> ${LOADER_CONFIG}
46
fi
47
48
@@PREFIX@@/etc/rc.d/fusefs start > /dev/null 2>&1 ; RESULT=$?
49
if [ ${RESULT} -ne 0 ]; then
50
	echo 'NOTICE: Failed to load the Fuse module!'
51
	echo 'NOTICE: Unload and load Fuse module manually, or reboot.'
52
fi
(-)fusefs-kmod/files/setup.sh.in (+52 lines)
Added Link Here
1
#!/bin/sh
2
#
3
# Automatically setup the loading of the module without polluting /boot/modules
4
SYSCTL_CONFIG=/etc/sysctl.conf
5
LOADER_CONFIG=/etc/rc.conf
6
7
sysctl kern.module_path | grep "[:space:;=]%%PREFIX%%/modules[;]\?\b" > /dev/null 2>&1; RESULT=$?
8
if [ ${RESULT} -eq 1 ]; then
9
	MODULE_PATH="`sysctl -n kern.module_path`;%%PREFIX%%/modules"
10
	sysctl "kern.module_path=${MODULE_PATH}"
11
else
12
	MODULE_PATH=`sysctl -n kern.module_path`
13
fi
14
15
grep "kern\.module_path" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
16
if [ ${RESULT} -eq 0 ]; then
17
	# Variable present
18
	grep "kern\.module_path" ${SYSCTL_CONFIG} | grep "[:space:;=]%%PREFIX%%/modules[;]\?\b" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
19
	if [ ${RESULT} -eq 1 ]; then
20
		# Not present in variable, so add
21
		ESC_PREFIX=`echo '%%PREFIX%%' | sed -e 's/\//\\\\\//g'`
22
		sed -i .orig -e 's/kern\.module_path[:space:]*=[:space:]*["]*\([[:alnum:][:space:]\.,;\/_-]*\)["]*/kern\.module_path="\1;'${ESC_PREFIX}'\/modules"/g' ${SYSCTL_CONFIG}
23
	fi
24
else
25
	# Not present.
26
	echo kern.module_path="${MODULE_PATH}" >> ${SYSCTL_CONFIG}
27
fi
28
29
30
kldstat -n fuse > /dev/null 2>&1; RESULT=$?
31
if [ ${RESULT} -eq 0 ]; then
32
	kldunload -n fuse > /dev/null 2>&1; RESULT=$?
33
	if [ ${RESULT} -ne 0 ]; then
34
		echo 'NOTICE: Failed to unload the Fuse module!'
35
		echo 'NOTICE: Is fuse.ko in use?'
36
	fi
37
fi
38
39
grep fusefs_enable ${LOADER_CONFIG} > /dev/null 2>&1; RESULT=$?
40
if [ ${RESULT} -eq 0 ]; then
41
	# Present, we should leave it alone
42
#	sed -e s/fusefs_enable.*/fuse_load=\"YES\"/g -i.orig ${LOADER_CONFIG}
43
else
44
	# Not present. First time install, so lets start it up
45
	echo 'fusefs_enable="YES"' >> ${LOADER_CONFIG}
46
fi
47
48
kldload fuse > /dev/null 2>&1 ; RESULT=$?
49
if [ ${RESULT} -ne 0 ]; then
50
	echo 'NOTICE: Failed to load the Fuse module!'
51
	echo 'NOTICE: Unload and load Fuse module manually, or reboot.'
52
fi

Return to bug 120420