I was poking around with the source code to OpenAFS 1.2.4, and I believe that I may 
have come up with a possible solution to the "NO MORE FILES" problem with OpenAFS. 
This problem seems to be occurring because the SMB portion of the AFS Client is 
negotiating with Windows 2000/XP (my testing was with XP) to use a lower version of 
the SMB protocol. I was able to produce the exact same "NO MORE FILES" error message 
when connected to a Samba 2.2.1a server after adding the line "max protocol=LANMAN2" 
to the smb.conf file, which forced Samba to use an older protocol. After removing the 
code which negotiated at the lower version of the protocol, the AFS client would crash 
any time I tried to perform a directory listing on an AFS drive. I poked around a 
little more and found a statement which was not checking to see if a string as NULL 
before doing a string compare against it. After adding a check for a NULL string, I 
did not experience any additional problems.

The following are the outputs of diff -u with the changes I made to the OpenAFS 1.2.4 
source code. I applied these patches to the source for OpenAFS 1.2.5 and they seemed 
to work fine. So far, I have only tried these patches on Windows XP. If these patches 
do not cause additional problems, maybe they could be added to CVS.

Ryan Lantzer

src\winnt\afsd\smb.c

--- smb.c.orig  Wed Nov 14 22:38:46 2001
+++ smb.c       Wed Jul 10 16:39:45 2002
@@ -9,6 +9,8 @@
 
 //#define NOSERVICE 1
 
+#define NOMOREFILESFIX 1
+
 #include <afs/param.h>
 #include <afs/stds.h>
 
@@ -2276,6 +2278,7 @@
                 namep += entryLength;
                 tcounter++;            /* which proto entry we're looking at */
         }
+#ifndef NOMOREFILESFIX
        /* 
         * NOTE: We can determine what OS (NT4.0, W2K, W9X, etc)
         * the client is running by reading the protocol signature.
@@ -2310,6 +2313,8 @@
                       */
               }
        }
+// NOMOREFILESFIX
+#endif
 
         if (NTProtoIndex != -1) {
                protoIndex = NTProtoIndex;


src\winnt\afsd\smb3.c

--- smb3.c.orig Wed Nov 14 22:38:48 2001
+++ smb3.c      Wed Jul 10 16:51:02 2002
@@ -1148,6 +1148,8 @@
                spacep = cm_GetSpace();
                smb_StripLastComponent(spacep->data, &lastComp,
                                        (char *)(&p->parmsp[3]));
+            /* Make sure that lastComp is not NULL */
+            if (lastComp)
                if (strcmp(lastComp, "\\desktop.ini") == 0) {
                        code = cm_NameI(cm_rootSCachep, spacep->data,
                                        CM_FLAG_CASEFOLD


-----Original Message-----
From: Lantzer, Ryan 
Sent: Monday, April 15, 2002 3:33 PM
To: '[EMAIL PROTECTED]'
Subject: Windows client problem with Jbuilder5/Acrobat (NO MORE FILES problem)


I've experienced a similar problem with OpenAFS 1.2.3 and Windows XP. When I log in 
with a drive letter mapped to a directory on AFS, and I have the user's Desktop 
redirected to a folder on this drive, I get a "there are no more files" error message 
when I try to right-click on the Desktop and select New->(Folder, Shortcut, or any of 
the document types). I believe that Explorer may be trying to peform a "FindFile" call 
on the default filename for the new file. Oddly, this does not happen when trying to 
create a new file in any other Explorer window.

I presume that the Jbuilder5 application is also trying to perform a "FindFile" 
operation to make sure filename it is trying to create doesn't already exist.

I wrote a short C++ program to test out the MFC CFileFind::FindFile() call on 
filenames that didn't exist. On Windows XP with OpenAFS 1.2.2b installed, I ran this 
app to find a non-existant file on the C: drive, and it returned an error code which 
indicated that the file was not found. When I ran it on a non-existant file on a drive 
mapped to AFS, it returned an error code which indicated that there are no more files 
(which should only be returned by the CFileFind::FindNextFile() call when there are no 
more files to be found).

I ran the same app on Windows NT 4.0 with Transarc AFS 3.6 installed, and I received 
the file not found error code both against the C: drive and against a drive mapped to 
AFS.

The following is the C++ code for the program I wrote. I compiled it with MS Visual 
C++ 6.0 with the project configured to use MFC.

Ryan Lantzer

int main()
{
 CFileFind finder;
 int retval;
 char filename[200];

 printf("Enter filename: ");
 scanf("%s",filename);

 BOOL bWorking = finder.FindFile(filename);
 if (bWorking)
 {
  printf("Found the file %s\n",filename);
 }
 else
 {
  retval=GetLastError();
  switch(retval)
  {
   case ERROR_FILE_NOT_FOUND:
    printf("File not found\n");
    break;
   case ERROR_NO_MORE_FILES:
    printf("There are no more files\n");
    break;
   default:
    printf("Some unrecognized error occured. Returned %d\n",retval);
  }
 }

 return 0;
}


-----Original Message-----
From: Matthew Cocker [EMAIL PROTECTED] 
Sent: Mon, 15 Apr 2002 09:56:08 +1200 
Subject: Windows client problem with Jbuilder5/Acrobat 


Hi

A while ago I emailed the list with a problem with the windows client and 
Acrobat Reader and Jbuilder (out of disk or similar errors). There was a 
bug fix on the development tree that we applied to the latest stable 
source. This fixed the Acrobat error but Jbuilder5 will still not create a 
project in AFS space. We ran a whole lot of debug utilities and the only 
differences we see when comparing creating a new project on the local C: 
drive and in AFS space is shown below.

When using JBuilder 5 to create a project in AFS we are presented with the 
error "there are no more files".
The problem appears to be when JBuilder checks to see if the project file 
already exists.
Using FileMon we gathered the following data:

This is what happens on a NTFS drive:
5 2:29:43 PM java.exe:1264 IRP_MJ_CREATE I:\temp\ SUCCESS Attributes: Any 
Options: Open Directory
6 2:29:43 PM java.exe:1264 IRP_MJ_DIRECTORY_CONTROL I:\temp\ NO SUCH FILE 
FileBothDirectoryInformation: untitled3.jpx
This is what happens on AFS:
129 2:30:16 PM java.exe:1264 IRP_MJ_CREATE G:\r\e\regg002\temp\ SUCCESS 
Attributes: Any Options: Open Directory
130 2:30:16 PM java.exe:1264 IRP_MJ_DIRECTORY_CONTROL G:\r\e\regg002\temp\ 
NO MORE FILES FileBothDirectoryInformation: untitled3.jpx
NTFS returns "no such file" while AFS returns "no more files".
JBuilder appears to be expecting "no such file".
We have tried this on both AFS 1.2.2b and AFS 1.3.1 clients under Windows 2000.

Any suggestions

Cheers

Matt Cocker 
_______________________________________________
OpenAFS-devel mailing list
[EMAIL PROTECTED]
https://lists.openafs.org/mailman/listinfo/openafs-devel

Reply via email to