Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jul 2007 15:47:46 +0200 (CEST)
From:      Martin Matuska <mm@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        vanilla@FreeBSD.org
Subject:   ports/114580: [PATCH] fuesfs/libs 2.7.0
Message-ID:  <20070714134746.43C79429F6@mail.vx.sk>
Resent-Message-ID: <200707141350.l6EDo3WV012075@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         114580
>Category:       ports
>Synopsis:       [PATCH] fuesfs/libs 2.7.0
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 14 13:50:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 6.2-STABLE
>Organization:
>Environment:
FreeBSD 6.2-STABLE i386 and amd64
>Description:
The update of sysutils/fusefs-libs to 2.7.0 made this port useless.
All depending ports don't work anymore and exit with the text:

fuse: unknown option: subtype=[progname]

where [progname] is the name of the userland daemon (e.g. sshfs or curlftpfs)

This is because of a linux-specific change in fusefs-libs between 2.7.0-rc1 
and 2.7.0 final with the CVS log entry: 
"Add fs subtype support to libfuse and fusermount"

The attached patch reverts this change and fixes this problem. To support
fusefs-libs without the patch below fusefs-kmod needs to be changed.

Maintainer please approve.
>How-To-Repeat:
>Fix:
Index: ports/sysutils/fusefs-libs/files/patch-subtype
===================================================================
RCS file: ports/sysutils/fusefs-libs/files/patch-subtype
diff -N ports/sysutils/fusefs-libs/files/patch-subtype
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/sysutils/fusefs-libs/files/patch-subtype	14 Jul 2007 13:39:39 -0000
@@ -0,0 +1,138 @@
+--- ../fuse-2.7.0/include/fuse_common.h	Mon Jul  2 13:32:15 2007
++++ include/fuse_common.h	Wed Apr 25 18:14:26 2007
+@@ -160,20 +160,8 @@
+ int fuse_parse_cmdline(struct fuse_args *args, char **mountpoint,
+                        int *multithreaded, int *foreground);
+ 
+-/**
+- * Go into the background
+- *
+- * @param foreground if true, stay in the foreground
+- * @return 0 on success, -1 on failure
+- */
+-int fuse_daemonize(int foreground);
+ 
+-/**
+- * Get the version of the library
+- *
+- * @return the version
+- */
+-int fuse_version(void);
++int fuse_daemonize(int foreground);
+ 
+ /* ----------------------------------------------------------- *
+  * Signal handling                                             *
+--- ../fuse-2.7.0/lib/helper.c	Mon Jul  2 13:32:17 2007
++++ lib/helper.c	Wed Apr 25 18:14:26 2007
+@@ -29,7 +29,7 @@
+ struct helper_opts {
+     int singlethread;
+     int foreground;
+-    int nodefault_subtype;
++    int fsname;
+     char *mountpoint;
+ };
+ 
+@@ -40,8 +40,7 @@
+     FUSE_HELPER_OPT("debug",       foreground),
+     FUSE_HELPER_OPT("-f",          foreground),
+     FUSE_HELPER_OPT("-s",          singlethread),
+-    FUSE_HELPER_OPT("fsname=",     nodefault_subtype),
+-    FUSE_HELPER_OPT("subtype=",    nodefault_subtype),
++    FUSE_HELPER_OPT("fsname=",     fsname),
+ 
+     FUSE_OPT_KEY("-h",          KEY_HELP),
+     FUSE_OPT_KEY("--help",      KEY_HELP),
+@@ -51,7 +50,6 @@
+     FUSE_OPT_KEY("-d",          FUSE_OPT_KEY_KEEP),
+     FUSE_OPT_KEY("debug",       FUSE_OPT_KEY_KEEP),
+     FUSE_OPT_KEY("fsname=",     FUSE_OPT_KEY_KEEP),
+-    FUSE_OPT_KEY("subtype=",    FUSE_OPT_KEY_KEEP),
+     FUSE_OPT_END
+ };
+ 
+@@ -119,24 +117,24 @@
+     }
+ }
+ 
+-static int add_default_subtype(const char *progname, struct fuse_args *args)
++static int add_default_fsname(const char *progname, struct fuse_args *args)
+ {
+     int res;
+-    char *subtype_opt;
++    char *fsname_opt;
+     const char *basename = strrchr(progname, '/');
+     if (basename == NULL)
+         basename = progname;
+     else if (basename[1] != '\0')
+         basename++;
+ 
+-    subtype_opt = (char *) malloc(strlen(basename) + 64);
+-    if (subtype_opt == NULL) {
++    fsname_opt = (char *) malloc(strlen(basename) + 64);
++    if (fsname_opt == NULL) {
+         fprintf(stderr, "fuse: memory allocation failed\n");
+         return -1;
+     }
+-    sprintf(subtype_opt, "-osubtype=%s", basename);
+-    res = fuse_opt_add_arg(args, subtype_opt);
+-    free(subtype_opt);
++    sprintf(fsname_opt, "-ofsname=%s", basename);
++    res = fuse_opt_add_arg(args, fsname_opt);
++    free(fsname_opt);
+     return res;
+ }
+ 
+@@ -151,8 +149,8 @@
+     if (res == -1)
+         return -1;
+ 
+-    if (!hopts.nodefault_subtype) {
+-        res = add_default_subtype(args->argv[0], args);
++    if (!hopts.fsname) {
++        res = add_default_fsname(args->argv[0], args);
+         if (res == -1)
+             goto err;
+     }
+@@ -331,11 +329,6 @@
+ {
+     fprintf(stderr, "fuse_main(): This function does not exist\n");
+     return -1;
+-}
+-
+-int fuse_version(void)
+-{
+-    return FUSE_VERSION;
+ }
+ 
+ #include "fuse_compat.h"
+--- ../fuse-2.7.0/lib/mount_util.c	Mon Jul  2 13:32:17 2007
++++ lib/mount_util.c	Thu May  3 13:56:37 2007
+@@ -193,20 +193,3 @@
+     }
+     return 0;
+ }
+-
+-int fuse_mnt_check_fuseblk(void)
+-{
+-    char buf[256];
+-    FILE *f = fopen("/proc/filesystems", "r");
+-    if (!f)
+-        return 1;
+-
+-    while (fgets(buf, sizeof(buf), f))
+-        if (strstr(buf, "fuseblk\n")) {
+-            fclose(f);
+-            return 1;
+-        }
+-
+-    fclose(f);
+-    return 0;
+-}
+--- ../fuse-2.7.0/lib/mount_util.h	Mon Jul  2 13:32:17 2007
++++ lib/mount_util.h	Wed May  2 16:34:03 2007
+@@ -14,4 +14,3 @@
+ char *fuse_mnt_resolve_path(const char *progname, const char *orig);
+ int fuse_mnt_check_empty(const char *progname, const char *mnt,
+                          mode_t rootmode, off_t rootsize);
+-int fuse_mnt_check_fuseblk(void);
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070714134746.43C79429F6>