From: Vivenzio P. <viv...@gm...> - 2011-11-17 10:42:46
|
Hi, What I forgot to mention: The remote system is Solaris and does *not* restrict chown. That's why it it possible that ownership gets changed to a uid not known on the remote host. (In Linux, this is typically forbidden.) But nonetheless, I see this as misbehaviour, since from "sshfs logic", preserving ownership should mean "if uid/gid mapping is defined and can be applied, strictly follow this mapping; otherwise preserve uid/gid". BR, Vivenzio -------- Original-Nachricht -------- Datum: Thu, 17 Nov 2011 09:35:23 +0100 Von: viv...@gm... An: fus...@li... Betreff: Bug in ID mapping if permissions shall be preserved? Hi, I have the following problem with sshfs under Linux: I mount a remote directory via sshfs, remote user has "ruid", "rgid". Local user has "luid", "lgid". sshfs mount is done with following command: $ sshfs ruser@rhost: mount-dir -ofollow_symlinks -o idmap=user -o uid=luid,gid=lgid Copying file over from/to local/remote side works fine (also user mapping is ok), except in the case when permissions/ownership shall be preserved. Example: Assume I have mounted sshfs on ~/ruser, so that the home directory of ruser on rhost is seen as a subdirectory in my local home dir. $ cd # go to local home dir $ echo "hello, remote world" > testfile $ chmod 600 testfile $ ll testfile -rw------- 1 luser users 20 Nov 17 09:21 testfile $ mv testfile ruser mv: preserving permissions for `ruser/testfile': Permission denied $ cat ruser/testfile cat: ruser/testfile: Permission denied $ ls -l ruser/testfile -rw------- 1 luser 1000 20 Nov 17 09:21 ruser/testfile As mv command by default wants to preserve ownership and permissions (I could have used "cp -p" with the same result), the file is copied to remote host, however uid/gid mapping is not done! IMO, the "preserve ownership" shall preserve the ownership in a "logic" way: As remote files of ruser are seen with uid of luser, uid (and gid) shall be mapped also when trying to "preserve ownership". The last "ls -l ruser/testfile" (executed on local host) shows luser as owner, however if I login on rhost as ruser, I see luid as owner which is unknown on rhost and leads to above "permission denied" messages. In other words, uid/gid _is_ preserved, however from the "sshfs POV" this is not correct (as uid/gid mapping is not done and leads to errors). Could you tell me if there is a solution to the problem (haven't found this case by googleing it) or if this is a bug that can be fixed? Kind regards, Vivenzio -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de -- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone |