This is a patch for exportfs and its manpage. It fixes the issue in exportfs, that if you specify -n (no none) or -N (other namespace) after -a (authenticate), that these options have no effect. This was due to the fact that -a was handled in and not after the argument processing. In the manpage the wrong stated '-n' is corrected to be the real '-N' and '-n' is now documented. Notes: Thu May 5 13:31:13 EDT 2005 rsc I fixed this, and also the opening of srvfd. Your code looked fine except for the use of 'y' and 'n' as flag values -- in Plan 9 we tend to use a simple int with 0 or 1. I also updated the man pages to describe -B too. Reference: /n/sources/patch/applied/exportfs-abugs Date: Thu May 5 18:27:10 CES 2005 Reviewed-by: rsc --- /sys/src/cmd/exportfs/exportfs.c Thu May 5 18:26:34 2005 +++ /sys/src/cmd/exportfs/exportfs.c Thu May 5 18:26:29 2005 @@ -67,7 +67,7 @@ void main(int argc, char **argv) { - char buf[ERRMAX], ebuf[ERRMAX]; + char buf[ERRMAX], ebuf[ERRMAX], isauth; Fsrpc *r; int n, fd; char *dbfile, *srv, *file, *na, *nsfile, *keyspec; @@ -80,24 +80,12 @@ na = nil; nsfile = nil; keyspec = ""; + isauth = 'n'; ai = nil; ARGBEGIN{ case 'a': - /* - * We use p9any so we don't have to visit this code again, with the - * cost that this code is incompatible with the old world, which - * requires p9sk2. (The two differ in who talks first, so compatibility - * is awkward.) - */ - ai = auth_proxy(0, auth_getkey, "proto=p9any role=server %s", keyspec); - if(ai == nil) - fatal("auth_proxy: %r"); - if(nonone && strcmp(ai->cuid, "none") == 0) - fatal("exportfs by none disallowed"); - if(auth_chuid(ai, nsfile) < 0) - fatal("auth_chuid: %r"); - putenv("service", "exportfs"); + isauth = 'y'; break; case 'k': @@ -172,6 +160,23 @@ usage(); }ARGEND USED(argc, argv); + + if(isauth == 'y'){ + /* + * We use p9any so we don't have to visit this code again, with the + * cost that this code is incompatible with the old world, which + * requires p9sk2. (The two differ in who talks first, so compatibility + * is awkward.) + */ + ai = auth_proxy(0, auth_getkey, "proto=p9any role=server %s", keyspec); + if(ai == nil) + fatal("auth_proxy: %r"); + if(nonone && strcmp(ai->cuid, "none") == 0) + fatal("exportfs by none disallowed"); + if(auth_chuid(ai, nsfile) < 0) + fatal("auth_chuid: %r"); + putenv("service", "exportfs"); + } if(na){ if(srv == nil) --- /sys/man/4/exportfs Thu May 5 18:26:53 2005 +++ /sys/man/4/exportfs Thu May 5 18:26:49 2005 @@ -72,8 +72,12 @@ by default (see .IR namespace (6)). The -.B -n +.B -N option gives an alternative name space file. +.PP +The +.B -n +option disallows the export to the user none. .PP The .B -R