From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200205022056.g42KuCw27202@zamenhof.cs.utwente.nl> To: 9fans@cse.psu.edu Subject: Re: [9fans] upgrading a 3rd edition network -- fairly long message In-reply-to: Your message of "Wed, 01 May 2002 20:38:47 -0600." References: From: Axel Belinfante Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_2643753650" Date: Thu, 2 May 2002 22:56:12 +0200 Topicbox-Message-UUID: 85800f22-eaca-11e9-9e20-41e7f4b1d025 This is a multipart MIME message. --==_Exmh_2643753650 Content-Type: text/plain; charset=us-ascii > Thanks a bunch. I followed your notes Amen. I managed to upgrade without problems by just following the notes -- this is simply great! In addition to the notes, I diff-ed /n/myfs/adm/timezone with /n/dist/adm/timezone, and noticed that CET had been updated (probably I skipped an update). Next time I probably would also mv adm/timezone to 3e_adm/timezone. > By the way, I was able to create files in the root of the fileserver > mounted on the bootstrap machine, rather than typing at the fileserver > console. Same here. The trick seems to be the number of arguments given to 9fs: 9fs super (the fs is named super) does not allow me to create files, but 9fs super /n/super does. Still have to finish reinstalling local applications and clean out the /3e_* stuff, get the remote printer access working again... (and have again serial mouse support, to be able to use the cpu/auth server also as terminal -- without mouse rio is nicely view-only, until the screensaver kicks in... :-) I have not yet installed 4e drawterm; 3e drawterm exits with 'bad message type in devmnt' when I try to connect it to 4e cpu/auth -- I assume this is to be expected (or should 3e drawterm still work?) I made a crude attempt at folding my attach message '-l user' aname hack back into 4e u9fs; it seems to work; I attach the diffs below; 'review' comments are welcome. Axel. --==_Exmh_2643753650 Content-Type: text/plain ; name="u9fs.diff"; charset=us-ascii Content-Description: u9fs.diff Content-Disposition: attachment; filename="u9fs.diff" diff -rbuw original/authrhosts.c ./authrhosts.c --- original/authrhosts.c Sat Mar 2 19:05:51 2002 +++ ./authrhosts.c Thu May 2 22:33:21 2002 @@ -24,7 +24,7 @@ { USED(tx); - if(ruserok(remotehostname, 0, rx->uname, rx->uname) < 0){ + if(ruserok(remotehostname, 0, rx->uname, rx->luname) < 0){ fprint(2, "ruserok(%s, %s) not okay\n", remotehostname, rx->uname); return "u9fs: rhosts authentication failed"; } diff -rbuw original/fcall.h ./fcall.h --- original/fcall.h Sat Mar 2 19:05:52 2002 +++ ./fcall.h Thu May 2 22:18:28 2002 @@ -20,6 +20,7 @@ char *uname; /* Tattach, Tauth */ char *aname; /* Tattach, Tauth */ + char *luname; /* local name */ u32int perm; /* Tcreate */ diff -rbuw original/u9fs.c ./u9fs.c --- original/u9fs.c Sat Mar 2 19:05:53 2002 +++ ./u9fs.c Thu May 2 22:39:20 2002 @@ -353,6 +353,31 @@ seterror(tx, e); } +char* +stripusername(char *aname, char **username) +{ + char *p = aname; + char *e; + while(*p && isspace(*p)) + p++; + if (strncmp(p, "-l", 2) != 0) + return aname; + p++; + p++; + if (! isspace(*p)) + return aname; + while(*p && isspace(*p)) + p++; + *username = p; + while(*p && !isspace(*p)) + p++; + e = p; + while(*p && isspace(*p)) + p++; + *e = '\0'; + return p; +} + void rattach(Fcall *rx, Fcall *tx) { @@ -360,9 +385,16 @@ Fid *fid; User *u; + rx->luname = nil; + if(rx->aname == nil) rx->aname = ""; + rx->aname = stripusername(rx->aname, &rx->luname); + fprint(2, "aname %s uname %s luname %s\n", rx->aname, rx->uname, rx->luname?rx->luname:""); + if(rx->luname == nil) + rx->luname = rx->uname; + if(strcmp(rx->aname, "device") == 0){ if(connected && !devallowed){ seterror(tx, Especial0); @@ -376,7 +408,7 @@ } } - if(strcmp(rx->uname, "none") == 0){ + if(strcmp(rx->luname, "none") == 0){ if(authed == 0){ seterror(tx, Eauth); return; @@ -401,9 +433,9 @@ } if(defaultuser) - rx->uname = defaultuser; + rx->luname = defaultuser; - if((u = uname2user(rx->uname)) == nil || u->id == 0){ + if((u = uname2user(rx->luname)) == nil || u->id == 0){ /* we don't know anyone named root... */ seterror(tx, Eunknownuser); freefid(fid); --==_Exmh_2643753650--