Skip to contentSkip to conversation

sshfs and target directory

PATCH Marc Weber 2 participants 3 messages Dec 22, 2009 – Dec 23, 2009 2 messages not in the archive Kernel automounter

lore
Share & tools
lore

Marc Weber

author
#0 lore raw

summary:

sshfs mounting user@host: works but user@host:/ does not.

I had to apply this patch:

modules/parse_sun.c +1 -1
index 65417e1..35d9edc 100644
@@ -827,7 +827,7 @@ static int validate_location(char *loc)
 			    *ptr == '-' || *ptr == '.' || *ptr == '_' ||
 			    *ptr == ',' || *ptr == '(' || *ptr == ')' ||
 			    *ptr == '#' || *ptr == '@' || *ptr == ':' ||
-			    *ptr == '[' || *ptr == ']'))
+			    *ptr == '[' || *ptr == ']' || *ptr == '/' ))
 				return 0;
 			ptr++;
 		}

in order to make this work which doesn't mount /root but /

rootlap -fstype=fuse,rw,nodev,nonempty,noatime,max_read=65536,uid=1008,gid=100 \/nix\/store\/yfmbrb7d7hh9n6dyidypw7k1xcixxmmz-sshfs-wrapped\/bin/\sshfs-wrapped\#root@host\:\/

I'm not sure whether this is the perfect patch.

Probably the problem is that the trailing :/ triggers check_colon to return 1 in validate_location which is then failing in the loop I patched above because "/" was not a valid character.

Marc Weber

maintainer
#1 lore raw
Quoted 24 lines · Marc Weber

summary:

sshfs mounting user@host: works but user@host:/ does not.

I had to apply this patch:

modules/parse_sun.c +1 -1
index 65417e1..35d9edc 100644
@@ -827,7 +827,7 @@ static int validate_location(char *loc)
 			    *ptr == '-' || *ptr == '.' || *ptr == '_' ||
 			    *ptr == ',' || *ptr == '(' || *ptr == ')' ||
 			    *ptr == '#' || *ptr == '@' || *ptr == ':' ||
-			    *ptr == '[' || *ptr == ']'))
+			    *ptr == '[' || *ptr == ']' || *ptr == '/' ))
 				return 0;
 			ptr++;
 		}

in order to make this work which doesn't mount /root but /

Quoted 7 lines

rootlap -fstype=fuse,rw,nodev,nonempty,noatime,max_read=65536,uid=1008,gid=100 \/nix\/store\/yfmbrb7d7hh9n6dyidypw7k1xcixxmmz-sshfs-wrapped\/bin/\sshfs-wrapped\#root@host\:\/

I'm not sure whether this is the perfect patch.

Probably the problem is that the trailing :/ triggers check_colon to return 1 in validate_location which is then failing in the loop I patched above because "/" was not a valid character.

Yes, this has come up recently and it's a bit painful.

If *ptr is a "/" then that is not valid in this case so we can do that.

But if you add a ":" escape to the beginning of the mount location this check will not be made. I can't remember the sshfs syntax but something like :sshfs#<user>@<host: should work OK.

Ian

Quoted 7 lines

Marc Weber

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

A message that is not in the archive (sent off-list or not yet received): 1261585222-sup-7226@nixos

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw

Sry, I missed posting this mail to the list in the first place. Doing so now. Additional note:
[email protected] bounced as well so I don't know how to contact the maintainer of the official howto.

Quoted 6 lines

You asked about where we can put example scripts before.
I add a contrib directory to the distribution but there isn't a web site. I have the domain name autofs.net but I don't have the time or inclination to put together and maintain a web site. Last I I posted to the list hinting at wanting someone interested in doing this I didn't get any responses.

I must have missed that.
I think it's bad that many people start blogging about autofs because tehre is no uniq place to look for information.
So if you can setup any wiki (which shoud be done in 5 min) I'll try to put up at least pointers to

a) the mailinglist archives
http://linux.kernel.org/pipermail/autofs

b) the howto
http://www.linux-consulting.com/Amd_AutoFS/autofs.html
(I sent in email to Alvin. But I had to search for the newer mail address on this list..)

c) my script ;-)

d) Whatever you think is missing.

But in this case adding that line to the man page would have been enough :)

If you think it's worth starting a small wiki just for keeping things in one place let me know about your server features and I'll try to find a wiki which can be run on it.

Marc Weber