#21 ftpfs uid/gid non functional in 0.7

closed-fixed
nobody
None
5
2002-11-26
2002-10-10
No

The uid/gid options in ftpfs don't work anymore in 0.7

The first problem I encountered, the suid mount.lufs
doesn't work with uid/gid at all:

If I test with localfs:
/sbin/mount.lufs none ./mounted/ -o
fs=localfs,uid=1000,gid=1000

running this command as a user:
kernel: (parse_options) - only root can use uid option!
kernel: (parse_options) - only root can use gid option!
but running as root is fine.

Well, it's a good thing that the suid mount.lufs
doesn't allow setting any uid/gid .. but it should
allow setting uid/gid of the user running the command
(I am 1000 1000)

Now for the real problem, with ftpfs, using uid and gid
options, be it as user or as root, won't work.
I see
kernel: (parse_options) - uid: 1000
kernel: (parse_options) - gid: 1000
in the kernel messages
but the files in mounted fs are:
-rw-rw-rw- 1 bin bin 23108 Sep 17 2001
ase.txt

Discussion

  • Florin Malita

    Florin Malita - 2002-10-10

    Logged In: YES
    user_id=154306

    well, it's a feature ;)
    starting 0.7.0, the permissions mapping has changed:
    previously, the mounting user was the owner of the whole
    mounted filesystem and the individual file/dir permissions were
    tweaked so they reflected the real remote perms. now, the file
    permissions are left alone, while the owner is set depending on
    the remote owner: if the remote user is the owner, then the file
    will be owned by the local mounting user, otherwise the file will
    be owned by a neutral user (uid=2). same for groups.

    this allows for a more natural permissions mapping, but it
    seems creates some problems too.

    so only files that your remote user actually owns will be owned
    by you locally. you can still tweak permissions using
    fmask/dmask.

     
  • Timothee Besset

    Timothee Besset - 2002-10-10

    Logged In: YES
    user_id=2063

    Ok, ftpfs totally fails to retrieve the user/group
    information from the server then. I see:

    [694](execute)executing TYPE I
    [694](get_response)line: 200 Type set to I.

    [694](execute)executing RETR /etc/passwd
    [694](get_response)line: 550 Permission denied.

    The server is a windows machine, I doubt anything like that
    is going to work. An option to override all the user/group
    with the user/group of the mounting user would be nice.

     
  • Florin Malita

    Florin Malita - 2002-10-11

    Logged In: YES
    user_id=154306

    well, it's a feature ;)
    starting 0.7.0, the permissions mapping has changed:
    previously, the mounting user was the owner of the whole
    mounted filesystem and the individual file/dir permissions were
    tweaked so they reflected the real remote perms. now, the file
    permissions are left alone, while the owner is set depending on
    the remote owner: if the remote user is the owner, then the file
    will be owned by the local mounting user, otherwise the file will
    be owned by a neutral user (uid=2). same for groups.

    this allows for a more natural permissions mapping, but it
    seems creates some problems too.

    so only files that your remote user actually owns will be owned
    by you locally. you can still tweak permissions using
    fmask/dmask.

     
  • Timothee Besset

    Timothee Besset - 2002-10-11

    Logged In: YES
    user_id=2063

    err why did you repost that first comment?

     
  • Florin Malita

    Florin Malita - 2002-10-11

    Logged In: YES
    user_id=154306

    oops! hit the reload button by mistake... opera's feature :)

     
  • Timothee Besset

    Timothee Besset - 2002-11-21

    Logged In: YES
    user_id=2063

    this bug is still there, and very annoying
    the ftp server I'm connecting to doesn't let me read any
    passwd file

    I don't want to use what the ftp server would provide, I
    just want to use my uid and gid

    actually right now ftpfs is not functional at all with the
    server I'm trying to reach. even mounting as root doesn't
    work. I get this when listing the mounted dir:
    ls: mounted.ftpfs/foo: Unknown error 512

     
  • Timothee Besset

    Timothee Besset - 2002-11-21

    Logged In: YES
    user_id=2063

    the 'Unknown error 512' is due to channels=1 option. If I
    take this option out I get a directory listing. I might open
    a different bug item with this if I get more info.

    I tried forcing the cred.uid cred.gid to my user in
    FSCtl::mount but it doesn't seem to set the correct
    ownership, so I think the problem is elsewhere

     
  • Timothee Besset

    Timothee Besset - 2002-11-26
    • status: open --> closed-fixed
     
  • Timothee Besset

    Timothee Besset - 2002-11-26

    Logged In: YES
    user_id=2063

    I saw the fs_own option in 0.8.1
    awesome! was just what I needed
    now I have correct owner

     

Log in to post a comment.