windows-updates-20011121
authorJames Peterson <jimpeter@us.ibm.com>
Wed, 21 Nov 2001 06:44:28 +0000 (06:44 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 21 Nov 2001 06:44:28 +0000 (06:44 +0000)
missed updates needed for next release

src/WINNT/afsd/NTMakefile
src/WINNT/afsd/cm_ioctl.c
src/WINNT/afsd/smb.h
src/WINNT/afsd/smb3.h
src/WINNT/client_config/drivemap.cpp
src/WINNT/client_creds/advtab.cpp
src/auth/ktc_nt.c
src/kauth/user_nt.c
src/libafsauthent/afsauthent.def

index 4e5af5a..84f6618 100644 (file)
@@ -5,6 +5,7 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
+AFSDEV_NETGUI = 1
 !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
 !INCLUDE ..\..\config\NTMakefile.version
 
index 17399bf..8ae0766 100644 (file)
@@ -1356,6 +1356,7 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
        afs_uuid_t uuid;
        int flags;
        char sessionKey[8];
+       char *smbname;
 
        saveDataPtr = ioctlp->inDatap;
 
@@ -1400,6 +1401,13 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
                uname = tp;
                tp += strlen(tp) + 1;
 
+        if (flags & PIOCTL_LOGON) {
+                 /* SMB user name with which to associate tokens */
+                 smbname = tp;
+                 fprintf(stderr, "SMB name = %s\n", smbname);
+                 tp += strlen(tp) + 1;
+        }
+
 #ifndef DJGPP   /* for win95, session key is back in pioctl */
                /* uuid */
                memcpy(&uuid, tp, sizeof(uuid));
@@ -1410,8 +1418,7 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
                cellp = cm_rootCellp;
 
        if (flags & PIOCTL_LOGON) {
-          userp = smb_FindCMUserByName(/*ioctlp->fidp->vcp,*/ uname,
-                                                              ioctlp->fidp->vcp->rname);
+          userp = smb_FindCMUserByName(smbname, ioctlp->fidp->vcp->rname);
        }
        
        /* store the token */
@@ -1876,3 +1883,15 @@ long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp) {
 }
 #endif /* DJGPP */
 
+long cm_IoctlGetSMBName(smb_ioctl_t *ioctlp, cm_user_t *userp)
+{
+  smb_user_t *uidp = ioctlp->uidp;
+
+  if (uidp && uidp->unp) {
+    memcpy(ioctlp->outDatap, uidp->unp->name, strlen(uidp->unp->name));
+    ioctlp->outDatap += strlen(uidp->unp->name);
+       }
+
+  return 0;
+}
+
index e3a9c20..8afe8d4 100644 (file)
@@ -208,6 +208,10 @@ typedef struct smb_ioctl {
 
         /* fid pointer */
         struct smb_fid *fidp;
+
+  /* uid pointer */
+  smb_user_t *uidp;
+
 } smb_ioctl_t;
 
 /* flags for smb_ioctl_t */
index 937ed42..136ffab 100644 (file)
@@ -164,6 +164,7 @@ extern long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
 extern int smb_V3MatchMask(char *namep, char *maskp, int flags);
 
 extern void smb3_Init();
+extern cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine);
 
 #ifdef DJGPP
 #define DELETE (0x00010000)
index 19531d3..75d9139 100644 (file)
@@ -907,7 +907,7 @@ void TestAndDoUnMapShare()
        DoUnMapShare(FALSE);    
 }
 
-void DoUnMapShare(BOOL force)
+void DoUnMapShare(BOOL drivemap)       //disconnect drivemap 
 {
        TCHAR szMachine[ MAX_PATH],szPath[MAX_PATH];
        DWORD rc=28;
@@ -933,9 +933,10 @@ void DoUnMapShare(BOOL force)
                                if (strstr(_strlwr(lpnrLocal[i].lpRemoteName),szPath))
                                {
                                        if ((lpnrLocal[i].lpLocalName) && (strlen(lpnrLocal[i].lpLocalName)>0))
-                                               if (force)
+                                       {
+                                               if (drivemap)
                                                        WNetCancelConnection(lpnrLocal[i].lpLocalName,TRUE);
-                                       else
+                                       } else
                                                WNetCancelConnection(lpnrLocal[i].lpRemoteName,TRUE);
                                        DEBUG_EVENT1("AFS DriveUnMap","UnMap-Remote=%x",res);
                                }
index 0dcf7f5..760fc1d 100644 (file)
@@ -204,9 +204,9 @@ void Advanced_OnChangeService (HWND hDlg, WORD wCmd)
 
             case IDC_SERVICE_STOP:
                SERVICE_STATUS Status;
-               if (ControlService (hService, SERVICE_CONTROL_STOP, &Status))
-                                  TestAndDoUnMapShare();
-                  fSuccess = TRUE;
+                          TestAndDoUnMapShare();
+               ControlService (hService, SERVICE_CONTROL_STOP, &Status);
+               fSuccess = TRUE;
                break;
             }
 
index e447f5e..cc952dd 100644 (file)
@@ -333,6 +333,19 @@ int ktc_SetToken(
        strcpy(tp, client->name);
        tp += temp+1;
 
+    /* we need the SMB user name to associate the tokens with in the
+    integrated logon case. */
+    if (flags & AFS_SETTOK_LOGON) {
+    if (client->smbname == NULL)
+      temp = 0;
+    else
+           temp = strlen(client->smbname);
+        if (temp == 0 || temp >= MAXKTCNAMELEN)
+          return KTC_INVAL;
+           strcpy(tp, client->smbname);
+          tp += temp+1;
+    }
+           
        /* uuid */
        status = UuidCreate((UUID *)&uuid);
        memcpy(tp, &uuid, sizeof(uuid));
index c37c66d..e427b3d 100644 (file)
@@ -86,6 +86,22 @@ afs_int32 ka_UserAuthenticateGeneral(
        afs_int32 spare,
        char **reasonP)
 {
+  return ka_UserAuthenticateGeneral2(flags, name, instance, realm, password, NULL,
+                                    lifetime, password_expiresP, spare, reasonP);
+}
+  
+afs_int32 ka_UserAuthenticateGeneral2(
+       afs_int32 flags,
+       char *name,
+       char *instance,
+       char *realm,
+       char *password,
+       char *smbname,
+       Date lifetime,
+       afs_int32 *password_expiresP,
+       afs_int32 spare,
+       char **reasonP)
+{
        int code;
        struct ktc_encryptionKey key1, key2;
        char *ticket = NULL;
@@ -147,6 +163,8 @@ afs_int32 ka_UserAuthenticateGeneral(
        strcpy(client.name, name);
        strcpy(client.instance, instance);
        strcpy(client.cell, upperRealm);
+       if (smbname)
+         strcpy(client.smbname, smbname);
 
        token.startTime = 0;            /* XXX */
        token.endTime = expirationTime;
@@ -317,8 +335,8 @@ static check_response
 
     /* Check and extract server's name */
     if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
-       return(INTK_BADPW);
-    }
+               return(INTK_BADPW);
+       }
 
     (void) strncpy(s_service, ptr, sizeof(s_service)-1);
     s_service[sizeof(s_service)-1] = '\0';
@@ -326,8 +344,8 @@ static check_response
 
     /* Check and extract server's instance */
     if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
-       return(INTK_BADPW);
-    }
+               return(INTK_BADPW);
+       }
 
     (void) strncpy(s_instance,ptr, sizeof(s_instance)-1);
     s_instance[sizeof(s_instance)-1] = '\0';
@@ -335,8 +353,8 @@ static check_response
 
     /* Check and extract server's realm */
     if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
-       return(INTK_BADPW);
-    }
+               return(INTK_BADPW);
+       }
 
     (void) strncpy(s_realm,ptr, sizeof(s_realm));
     s_realm[sizeof(s_realm)-1] = '\0';
@@ -351,7 +369,7 @@ static check_response
     if ((ticket_len < 0) ||
        ((ticket_len + (ptr - (char *) cip->dat)) > (int) cip->length)) {
        return(INTK_BADPW);
-    }
+       }
 
     /* Check returned server name, instance, and realm fields */
     /*
index 46a00d8..20fd119 100644 (file)
@@ -77,6 +77,7 @@ EXPORTS
        ktc_OldPioctl                                   @76
        pioctl                                          @77
        rx_Init                                         @78
+       ka_UserAuthenticateGeneral2                     @79