[X2go-dev] SSHFS and Permissions
--[ UxBoD ]--
uxbod at splatnix.net
Mon Jan 31 13:09:51 CET 2011
Hello all,
I have been working on making removable media available to Windows via a Samba share and hit a very strange problem. When you initially save a file to the share it would complain about having insufficient permissions, though if you were to save it again straight away it would work.
The problem has been tracked down to how the SSHFS is mounted from within x2gomountdirs. The original command was:
sshfs -o ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log
for which I have changed it too:
sshfs -o uid=$uid -o gid=$gid -o ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log
with those two new variables being set via:
my (undef,undef,$uid,$gid) = getpwuid($<);
and the resulting mount have the ownership of the users primary id and group.
Is there any reason why this approach was not used ? or it worked quite happily as the mount is 777 anyway ?
--
Thanks, Phil
More information about the x2go-dev
mailing list