[OpenAFS-devel] Emailing: openafs-1.2.11-bkbox.patch

Noel Burton-Krahn noel@bkbox.com
Mon, 13 Oct 2003 10:58:05 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C39178.E1578C20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hi All,

Here's a patch against the current OpenAFS CVS HEAD that fixes a number of
bugs on the Windows side of things

To apply:

patch -p0 < openafs-1.2.11-bkbox.patch

Summary of changes:

1. This actually compiles.  I had to change some includes and libraries

2. Excel (and some other apps) do not like OpenAFS drives.

Some programs (like Excel) try to enumerate netbios directories.  At the
root, they try to connect to a drive's IPC$ share.  The current OpenAFS
Netbios code returns "Not Implemented" to the IPC$ request.  That reply
confuses some applications.  I've changed the reply to "Access Denied" and
their problems go away.  This fixes my earlier problems that I tried to
resolve with "lmhosts".

3. Integrated Login fails

The NSIS install does not put afslogin.dll in the  registry, so it is no
longer run at boot time.  Good riddance!

(see
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Netwo
rkProvider\AuthentProviderPath)

3. Restoring network drives in afscreds.

afscreds does not always restore network drives.  You'll notice that after
setup runs the first time, you may have to explicitly check the network
drive box.  Now afscreds always tries to restore network drives.  To
reproduce the problem:

1. uncheck network drives in afscreds
2. stop afscreds
3. disconnect network drives in explorer
4. start afscreds

before the patch, the drives would not get reconnected.


This patch is completely free, courtesy of www.bkbox.com.

Noel Burton-Krahn
noel@bkbox.com





------=_NextPart_000_0008_01C39178.E1578C20
Content-Type: application/octet-stream;
	name="openafs-1.2.11-bkbox.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="openafs-1.2.11-bkbox.patch"

diff -u -r1.5 NTMakefile
--- src/WINNT/afsadmsvr/NTMakefile	12 Aug 2003 04:06:37 -0000	1.5
+++ src/WINNT/afsadmsvr/NTMakefile	10 Oct 2003 20:00:32 -0000
@@ -106,7 +106,6 @@
            /pack 8 \
            /W3 \
            /WX \
-	   /no_robust \
            /nologo
=20
 .SUFFIXES: .h .idl
diff -u -r1.7 afslogon.c
--- src/WINNT/afsd/afslogon.c	25 Aug 2003 18:24:22 -0000	1.7
+++ src/WINNT/afsd/afslogon.c	10 Oct 2003 20:00:33 -0000
@@ -24,7 +24,7 @@
 #include <sys/types.h>
 #include <fcntl.h>
=20
-DWORD LogonOption,TraceOption;
+DWORD LogonOption=3D0,TraceOption=3D0;
=20
 HANDLE hDLL;
=20
diff -u -r1.12 smb.c
--- src/WINNT/afsd/smb.c	25 Aug 2003 18:24:22 -0000	1.12
+++ src/WINNT/afsd/smb.c	10 Oct 2003 20:00:35 -0000
@@ -1862,7 +1862,13 @@
 		NTStatus =3D 0xC00000CCL;	/* Bad network name */
 	}
 	else if (code =3D=3D CM_ERROR_NOIPC) {
-		NTStatus =3D 0xC00000CCL;	/* Bad network name */
+	        // NBK=20
+		NTStatus =3D 0xC0000022L;	/* Access denied */ /* works, but long =
timeout */
+		//NO: NTStatus =3D 0xC0000033L;	/* Object name invalid */
+		//NO: NTStatus =3D 0xC09820FFL;	/* SMB no support */
+
+		// original
+		//NTStatus =3D 0xC00000CCL;	/* Bad network name */
 	}
 	else if (code =3D=3D CM_ERROR_CLOCKSKEW) {
 		NTStatus =3D 0xC0000133L;	/* Time difference at DC */
@@ -1986,8 +1992,13 @@
 		error =3D 6;
 	}
 	else if (code =3D=3D CM_ERROR_NOIPC) {
-		class =3D 1;
-		error =3D 66;
+	        // NBK
+	        class =3D 2;
+                error =3D 4;	/* bad access */
+
+		/* original */
+		//class =3D 1;
+		//error =3D 66;
 	}
 	else if (code =3D=3D CM_ERROR_CLOCKSKEW) {
 		class =3D 1;	/* invalid function */
diff -u -r1.4 main.cpp
--- src/WINNT/client_creds/main.cpp	8 Jan 2002 20:44:41 -0000	1.4
+++ src/WINNT/client_creds/main.cpp	10 Oct 2003 20:00:39 -0000
@@ -248,6 +248,47 @@
       else if (!IsServerInstalled())
          Message (MB_ICONHAND, IDS_UNCONFIG_TITLE, IDS_UNCONFIG_DESC);
       }
+
+   // NBK - restore drive map list on startup, just like afswiz.cpp =
does
+   if (IsServiceRunning()) {
+       // NBK - debug
+       //FILE *fdebug =3D fopen("c:/tmp/afscreds.log", "a");
+       //fprintf(fdebug, "afscreds.exe:WinMain");
+       //fflush(fdebug);
+
+       DRIVEMAPLIST List;
+       QueryDriveMapList (&List);
+       size_t cInactive =3D 0;
+  =20
+       for (size_t iDrive =3D 0; iDrive < 26; ++iDrive)
+	   {
+	       // NBK - debug
+	       //fprintf(fdebug, "ActivateDriveMap chDrive=3D%c\n",=20
+	       //       List.aDriveMap[iDrive].chDrive);
+
+	       if (!List.aDriveMap[iDrive].szMapping[0])
+		   continue;
+	       if (List.aDriveMap[iDrive].fActive)
+		   continue;
+	  =20
+	       DWORD status;
+	       TCHAR *szSubmountReq =3D 0;
+	       (void)ActivateDriveMap (List.aDriveMap[iDrive].chDrive, =
List.aDriveMap[iDrive].szMapping, szSubmountReq, =
List.aDriveMap[iDrive].fPersistent, &status);
+	       // NBK - debug
+	       //fprintf(fdebug, "ActivateDriveMap chDrive=3D%c =
mapping=3D%s\n",=20
+	       //       List.aDriveMap[iDrive].chDrive,=20
+	       //       List.aDriveMap[iDrive].szMapping);
+	       //fflush(fdebug);
+	   }
+       // NBK - debug
+       //fclose(fdebug);
+   }
+
+  =20
+
+
+
+
    if (IsServiceRunning() && fShow)
       {
       Main_Show (TRUE);
Index: src/WINNT/client_creds/shortcut.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/openafs/src/WINNT/client_creds/shortcut.cpp,v
retrieving revision 1.3
diff -u -r1.3 shortcut.cpp
--- src/WINNT/client_creds/shortcut.cpp	14 Mar 2003 20:07:55 -0000	1.3
+++ src/WINNT/client_creds/shortcut.cpp	10 Oct 2003 20:00:39 -0000
@@ -18,8 +18,8 @@
 #include <windowsx.h>
 #include <shlobj.h>
 #include <shellapi.h>
-#include <shobjidl.h>
-#include <shlguid.h>
+//#include <shobjidl.h>
+//#include <shlguid.h>
 #include "shortcut.h"
=20
=20
diff -u -r1.5 NTMakefile
--- src/WINNT/client_exp/NTMakefile	14 Mar 2003 20:07:58 -0000	1.5
+++ src/WINNT/client_exp/NTMakefile	10 Oct 2003 20:00:39 -0000
@@ -60,7 +60,7 @@
 	$(DESTDIR)\lib\afs\TaLocale.lib
=20
 $(DLLFILE): $(DLLOBJS)
-	$(DLLCONLINK) /DEF:afs_shl_ext.def $(DLLLIBS)
+	$(DLLMFCLINK) /DEF:afs_shl_ext.def $(DLLLIBS)
 	$(DLLPREP)
=20
 =
#########################################################################=
###
diff -u -r1.5 OpenAFS.nsi
--- src/WINNT/install/NSIS/OpenAFS.nsi	4 Sep 2003 03:30:30 -0000	1.5
+++ src/WINNT/install/NSIS/OpenAFS.nsi	10 Oct 2003 20:00:44 -0000
@@ -710,7 +710,7 @@
  SetOutPath "$INSTDIR\Common"
=20
   SetOutPath "$INSTDIR\Common"
-  File "${AFS_WININSTALL_DIR}\Msvcr71.dll"
+  ;File "${AFS_WININSTALL_DIR}\Msvcr71.dll"
      =20
   =20
    ;Store install folder
@@ -1085,7 +1085,7 @@
   RMDir /r "$INSTDIR\Client\Program"
   RMDir /r "$INSTDIR\Client"
  =20
-  Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
+  ;Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
   Delete /REBOOTOK "$INSTDIR\Common\*"
   RMDir /r "$INSTDIR\Common"
=20
@@ -1479,7 +1479,7 @@
    File "${AFS_SERVER_BUILDDIR}\afscfgadmin.dll"
    File "${AFS_SERVER_BUILDDIR}\afskasadmin.dll"
    File "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll"
-   File "${AFS_WININSTALL_DIR}\Msvcr71.dll"
+   ;File "${AFS_WININSTALL_DIR}\Msvcr71.dll"
=20
    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman

------=_NextPart_000_0008_01C39178.E1578C20--