appl/arlalib.c's arlalib_get_cred() problems

Assar Westerlund assar at sics.se
Thu Jun 18 22:51:15 CEST 1998


John Hawkinson <jhawk at bbnplanet.com> writes:

> Pursuant to <5lhg5g3hjn.fsf at assaris.sics.se>, arlalib_get_cred()
> in appl/arlalib.c has the same problem that arlad/arla.c used
> to have when calling get_cred()

It would seem to me that you need to fix all the arlalib_* functions
to take the cell as an argument.

> Also, it would be nice if the default cell could be obtained from the
> AFSCELL environment variable before checking the ThisCell file,
> like in the TransArc utilities.

That's easy.  Patch appended.

> Ideally arlad -t would also use arlalib_get_cred()...

Right.  Got to move the arlalib to a real library.

> On an unrelated note, I find that the instruction in INSTALL for
> installation on Solaris need some help.  One shouldn't have to mknod
> stuff by hand; the appropriate invokation of add_drv and editting
> /etc/devlink.tab should be sufficient. I haven't quite figured out
> what's necessary yet.

I haven't been able to figure out how this should work so I weaseled
out and just did the mknod.  Once you know what's necessary to get it
done automatically...

> Also, kthkrb's kafs seems to assume that afs will have a fixed
> syscall number. This is inconsistent with INSTALL, which
> implies you can pick any unused number (and you ought to be
> able to) for /etc/name_to_sysnum.

Yes, adding some way of specifying the system call to use to kafs is
on my todo-list.

As long as you're not using Transarc AFS you should of course use
105.  I added some text about that in INSTALL.

/assar


Index: lib/ko/kocell.c
===================================================================
RCS file: /usr/local/cvsroot/arla/lib/ko/kocell.c,v
retrieving revision 1.9
diff -u -w -u -w -r1.9 kocell.c
--- kocell.c	1998/06/09 18:25:51	1.9
+++ kocell.c	1998/06/18 20:50:25
@@ -284,6 +284,8 @@
 void
 cell_init (int cellcachesize)
 {
+    char *env;
+
     if (thiscell != NULL) {
 	fprintf(stderr, "cell_init: Already initlized\n");
 	return;
@@ -294,17 +296,22 @@
 
     cellnamehtab = hashtabnew (cellcachesize, cellnamecmp, cellnamehash);
     cellnumhtab  = hashtabnew (cellcachesize, cellnumcmp,  cellnumhash);
-    if (readthiscell (SYSCONFDIR "/" THISCELLFILENAME)) {
-	fprintf(stderr, "Falling back on: " TRANSARCSYSCONFDIR); 
+
+    env = getenv ("AFSCELL");
+    if (env != NULL) {
+	thiscell = strdup (env);
+    } else if (readthiscell (SYSCONFDIR "/" THISCELLFILENAME)) {
+	fprintf(stderr, "Falling back on: " TRANSARCSYSCONFDIR "\n"); 
 	if (readthiscell(TRANSARCSYSCONFDIR "/" THISCELLFILENAME)) {
 	    fprintf(stderr, "Don't know where I am\n");
 	    exit(1);
 	}
     }
+
     if (readcellservdb (SYSCONFDIR "/" CELLFILENAME)) {
-	fprintf(stderr, "Falling back on: " TRANSARCSYSCONFDIR); 
+	fprintf(stderr, "Falling back on: " TRANSARCSYSCONFDIR "\n");
 	if (readcellservdb(TRANSARCSYSCONFDIR "/" CELLFILENAME)) {
-	    fprintf(stderr, "Cant read the CellServDB file," \
+	    fprintf(stderr, "Can't read the CellServDB file," \
 		    "will use DNS AFSDB entries\n");
 	}
     }





More information about the Arla-drinkers mailing list