shithub: riscv

Download patch

ref: 8fb212515dc6e0a8f0cc3b76f7946bb26b8c357d
parent: 85a414751a1b9ba09dd7a72eee8746d81a7dcf53
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Mar 13 23:48:26 EDT 2014

import: make import -p work with explicit service in dialstring (thanks mischief)

mischief → ; import -p tcp!9.offblast.org!17007 / /n/9
mischief → -> import: can't mount /: EOF receiving fversion reply
mischief → on the console
mischief → bmo Mar 13 18:55:30 dialing tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 reconnected to tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 connected from 199.191.58.44
mischief → bmo Mar 13 18:55:34 exiting...bmo Mar 13 18:55:30 dialing tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 reconnected to tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 connected from 199.191.58.44
mischief → bmo Mar 13 18:55:34 exiting...
mischief → aan is dialing the *exportfs* port because i explicitly specified it

--- a/sys/src/cmd/import.c
+++ b/sys/src/cmd/import.c
@@ -389,7 +389,8 @@
 
 	if ((s = strrchr(buf, '!')) == nil)
 		sysfatal("filter: illegally formatted port %s", buf);
-	snprint(addr, sizeof(addr), "%s", netmkaddr(host, "tcp", s+1));
+	strecpy(addr, addr+sizeof(addr), netmkaddr(host, "tcp", s+1));
+	strecpy(strrchr(addr, '!'), addr+sizeof(addr), s);
 
 	if(debug)
 		fprint(2, "filter: remote %s\n", addr);