9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] upgrading a 3rd edition network -- fairly long message
Date: Thu,  2 May 2002 22:56:12 +0200	[thread overview]
Message-ID: <200205022056.g42KuCw27202@zamenhof.cs.utwente.nl> (raw)
In-Reply-To: Your message of "Wed, 01 May 2002 20:38:47 -0600." <eddfb4546648469b26092e00810bd735@acl.lanl.gov>

[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]

> 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.

[-- Attachment #2: u9fs.diff --]
[-- Type: text/plain , Size: 2267 bytes --]

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);

  reply	other threads:[~2002-05-02 20:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-02  2:38 dpx
2002-05-02 20:56 ` Axel Belinfante [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-05-02 22:28 Russ Cox
2002-05-02 21:31 Russ Cox
2002-05-02 21:47 ` Axel Belinfante
2002-05-02 22:25   ` John Packer
2002-05-02 21:18 dpx
2002-05-02 21:26 ` Axel Belinfante
2002-05-02 21:16 Russ Cox
2002-04-30 10:10 forsyth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200205022056.g42KuCw27202@zamenhof.cs.utwente.nl \
    --to=axel.belinfante@cs.utwente.nl \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).