[OpenAFS-devel] OpenAFS, MR-AFS-scanner

Jimmy Engelbrecht jimmy@e.kth.se
20 Feb 2001 15:47:16 +0100


When the MR-AFS-scanner was introduced into OpenAFS some errors where
introduced, I think the current version of OpenAFS newer was tested
without a scanner defined. It is also possible that strlen(0x0) on
some operatingsystems don't segfaults. The problem occurs when no
scanner is defined in BosConfig. However the following patch solves
the problem.

Tested on "Digital UNIX 4.0d"

Patch written by haba@pdc.kth.se && jimmy@e.kth.se

We are also working on Tru64 5.1, and we hope to send fixes soon.

/Jimmy


--- fsbnodeops.c~	Mon Feb 12 18:11:07 2001
+++ fsbnodeops.c	Tue Feb 20 14:05:05 2001
@@ -285,7 +285,7 @@
 	bailout = 1;
     }
 
-    if (strlen(ascancmd)) {
+    if (ascancmd && strlen(ascancmd)) {
        if (ConstructLocalBinPath(ascancmd, &scanCmdpath)) {
             bozo_Log("BNODE: command path invalid '%s'\n", ascancmd);
             bailout = 1;
@@ -320,7 +320,7 @@
 	    bailout = 1;
 	}
 
-        if (strlen(ascancmd)) {
+        if (ascancmd && strlen(ascancmd)) {
 	    sscanf(scanCmdpath, "%s", cmdname);
 #ifdef AFS_NT40_ENV
 	    AppendExecutableExtension(cmdname);
@@ -342,7 +342,7 @@
     te->filecmd = fileCmdpath;
     te->volcmd = volCmdpath;
     te->salcmd = salCmdpath;
-    if (strlen(ascancmd))
+    if (ascancmd && strlen(ascancmd))
        te->scancmd = scanCmdpath;
     else 
        te->scancmd = (char *)0;