Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

obexfs with nokia E90

2008-01-19
2013-05-01
  • Andy Lavarre
    Andy Lavarre
    2008-01-19

    Has anyone succeeded in making a mounted obexfs visible to the user (vice only root)? If so, how?

    I would like to mount the Nokia E90 as a file system. This can be done as root with obexfs, but the contents cannot be seen by a non-root user. This is because by default only the user mounting with fuse can see the fs and, despite the assertions, I cannot get it to mount as user, only as root. That is why the options user and allow_other are needed.

    -----

    Unfortunately there are no man pages for fuse, fusermount, or obexfs that I have found.

    There *is a Wiki:

        http://dev.zuckschwerdt.org/openobex/wiki/ObexFs

    so I have worked through all their examples, but cannot get any of them to work except the obexautofs commands, and then only as root.

    Below is the summary and details of my analysis, which may be useful in documenting the program more fully.

    Thanks in advance, Andy Lavarre

    Summary
    # =================== /etc/fstab usage =============================
    # I have correctly adapted the Wiki examples to the parameters for my system, using my actual MAC address and the actual target directory in both /etc/fstab and the discussions below.
    # I have installed the required fuse, openobex, obexftp, and obexfs files as well as having invoked modprobe fuse.
    # Indeed, I can mount obexfs as root, so all that is alright, but cannot make it visible or mountable by a non-root user.

    # Any attempt to mount as user fails with
    #    fusermount: mount failed: Operation not permitted

    # Any attempt to change user permissions fail with "Function not implemented"

    # Any obexfs entries in /etc/fstab run without error but fail to mount the target.

    #obexfs#-b00-1A-89-BF-67-53 /mnt/nokia_e90 fuse allow_other 0 0       
    #obexfs#-b00-1A-89-BF-67-53 /mnt/nokia_e90 fuse user,fsname=obexfs#-b00-1A-89-BF-67-53 0 0
    #obexfs#-b00-1A-89-BF-67-53 /mnt/nokia_e90 fuse user,fsname=obexfs#-b00-1A-89-BF-67-53 1000 100    #
    #obexfs#-b00-1A-89-BF-67-53\040-B11 /mnt/nokia_e90 fuse allow_other 0 0
    # =================================================================
    # All of the obexautofs /etc/fstab entries without a hash work when invoked as root,

    #Any /etc/fstab attempt to set permissions to other than root are ignored, e.g.:
    #    obexautofs /mnt/nokia_e90 fuse user 1000 100
    #    obexautofs /mnt/nokia_e90 fuse user,allow_other 1000 100   
    #    obexautofs /mnt/nokia_e90 fuse user,allow_other,fsname=obexfs#-b00-1A-89-BF-67-53 1000 100

    #Those /etc/fstab entries with the user parameter allow the user to attempt to mount the filesystem but fail with
    #    fusermount: mount failed: Operation not permitted
        #obexautofs /mnt/nokia_e90 fuse user 0 0
        #obexautofs /mnt/nokia_e90 fuse user,allow_other 0 0
        #obexautofs /mnt/nokia_e90 fuse user,allow_other,fsname=obexfs#-b00-1A-89-BF-67-53 0 0

    #Those /etc/fstab entries with the allow_other parameter allow the user to to see the first tier of the filesystem, but no deeper.
        #obexautofs /mnt/nokia_e90 fuse user,allow_other 0 0
        #obexautofs /mnt/nokia_e90 fuse allow_other 0 0   

    #Those with the fsname parameter allegedly allow the user to unmount,
    #    but since we can't MOUNT as user we haven't been able to test.
        #obexautofs /mnt/nokia_e90 fuse allow_other,fsname=obexfs#-b00-1A-89-BF-67-53 0 0
        #obexautofs /mnt/nokia_e90 fuse user,allow_other,fsname=obexfs#-b00-1A-89-BF-67-53 0 0
    # ================ Details ==============================

        As I understand things, one can either build a complex "mount" statement, or embed the specification in /etc/fstab and then call that specification with simply

        mount {target directory}

    e.g. (for my SuSE 10.2 system),

        mount /mnt/nokia_e90

    This looks up the target directory in the second field of the obexfs or obexautofs entries in /etc/fstab and sends the corresponding fields to mount.

    And, yes Virginia, case and slashes count; the mount target in the CLI must match the mount target in the fstab entry.

        The complex mount commands are of the form

        mount -t fuse {device name} {target directory} 

        where {device name} is either an {obex device name} or an obexautofs command.

        + The {obex device name} is of the form

        obexfs#{MAC address}\040-B{Channel Number}

        where the \040 is the octal form of a space. Spaces in mount point name (especially before -B option) must be replaced with their octal character code (040) preceded by \ (backslash).

            - The examples show the MAC address delimited with hyphens rather than colons, as in:

        00-1A-89-BF-67-53

            vice

        00:1A:89:BF:67:53

            although alternating these apparently has no effect.

        + The obexautofs /etc/fstab entry is simply:

        obexautofs#

             - Unfortunately this does not work on SuSE 10.2 with the hash mark. It DOES work if you remove the hash mark.

        + Using obexautofs requires configuring /etc/autofs/auto.misc to include:

        obex -fstype=fuse,allow_other :obexautofs#
        myobex -fstype=fuse,allow_other :obexfs#-b {MAC addres} -B {Channel number}

        The fstab entries are of the form

        {obex device name} {target directory} fuse {fuse options} {umask}
        {dmask}

        where the {obex device name} has been described above.

        Alternatively obexfs offers its own set of commands that are shells to invoke underlying fusermount commands. These are all of the form

        obexfs -b{MAC address} -B{Channel number} {target directory}

    I have tried a variety of mount trials in both ways with obexfs, obexautofs, and mount -t fuse.

        Only one of the obexfs or obexautofs trials works, and they do not allow user to see the directory.

        These can only be run as root. Trying to run them as user fails.

        None of the obexfs# (with the hash mark) trials succeed. They run without error, but fail to mount the target directory (/etc/mtab does not contain an entry for the target directory). Additionally, the logs dmesg and messages contain no entries indicating a problem.

        None of the mount trials succeed. They run without error, but fail to mount the target directory.

    I have tried setting user permissions and owner to user and then invoking the root mount. This just wrests the target away from user so that it is no longer visible.

    I have seen that, theoretically, adding allow_user to an fstab entry should give the desired result, but I cannot show this since all the mount commands fail.

    Details of the individual trials (there were many!) available on request.

    Best regards, Andy Lavarre

     
    • Andy Lavarre
      Andy Lavarre
      2008-01-19

      I have a typo in my message (although not in the actual /etc/fstab entry):

      + The {obex device name} is of the form 

      obexfs#{MAC address}\040-B{Channel Number}

      Correct this to

      + The {obex device name} is of the form 

      obexfs#-b{MAC address}\040-B{Channel Number}