1 #include <plan9.h> 2 #include <fcall.h> 3 #include <u9fs.h> 4 5 /* 6 * return whether the user is authenticated. 7 * uses berkeley-style rhosts ``authentication''. 8 * this is only a good idea behind a firewall, 9 * where you trust your network, and even then 10 * not such a great idea. it's grandfathered. 11 */ 12 13 static char* 14 rhostsauth(Fcall *rx, Fcall *tx) 15 { 16 USED(rx); 17 USED(tx); 18 19 return "u9fs rhostsauth: no authentication required"; 20 } 21 22 static char* 23 rhostsattach(Fcall *rx, Fcall *tx) 24 { 25 USED(tx); 26 27 if(ruserok(remotehostname, 0, rx->uname, rx->uname) < 0){ 28 fprint(2, "ruserok(%s, %s) not okay\n", remotehostname, rx->uname); 29 return "u9fs: rhosts authentication failed"; 30 } 31 return 0; 32 } 33 34 Auth authrhosts = { 35 "rhosts", 36 rhostsauth, 37 rhostsattach, 38 }; 39