i'm not sure if this patch is of general use. i needed it for rangboom, where the agent posts the imported shared ns in /srv. i have regression-tested it for some common cases. Notes: Sat Jul 14 18:45:53 EDT 2007 geoff I'm not sure either. It does seem that not authenticating and being able to mount from /srv should be independent capabilities. Reference: /n/sources/patch/applied/cfs-on-posted-fd Date: Mon Jul 2 01:36:22 CES 2007 Signed-off-by: fst@9netics.com Reviewed-by: geoff --- /sys/src/cmd/cfs/cfs.c Mon Jul 2 01:21:56 2007 +++ /sys/src/cmd/cfs/cfs.c Mon Jul 2 01:21:52 2007 @@ -235,11 +235,17 @@ mountinit(char *server, char *mountpoint) { int p[2]; + int err, noauth = 0; /* * grab a channel and call up the file server */ - s.fd[0] = s.fd[1] = dial(netmkaddr(server, 0, "9fs"), 0, 0, 0); + if (strncmp(server, "/srv/", 5) == 0) { + s.fd[0] = s.fd[1] = open(server, ORDWR); + noauth = 1; + } else { + s.fd[0] = s.fd[1] = dial(netmkaddr(server, 0, "9fs"), 0, 0, 0); + } if(s.fd[0] < 0) error("opening data"); @@ -252,7 +258,11 @@ case 0: break; default: - if(amount(p[1], mountpoint, MREPL|MCREATE, "") < 0) + if (noauth) + err = mount(p[1], -1, mountpoint, MREPL|MCREATE, ""); + else + err = amount(p[1], mountpoint, MREPL|MCREATE, ""); + if (err < 0) error("mount failed"); exits(0); case -1: