Resource chain mangling fix
authorMiro Jurisic <meeroh@mit.edu>
Fri, 22 Jan 1999 21:21:42 +0000 (21:21 +0000)
committerMiro Jurisic <meeroh@mit.edu>
Fri, 22 Jan 1999 21:21:42 +0000 (21:21 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11120 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/DNR.c

index e44146db15a2ffec65f073fcf8d3df0ae862482d..2a9b2da88ff38140a42bceaa1897214fb0ad7600 100644 (file)
@@ -232,12 +232,17 @@ short OpenOurRF(void)
 OSErr OpenResolver(char *fileName)
 {
        short                   refnum;
+       short                   saveResFile;
        OSErr                   rc;
        
        if (gDNRCodePtr != nil)
                /* resolver already loaded in */
                return(noErr);
                
+       /* Remember the resource file so that we do not switch current res file
+          under the caller */
+       saveResFile = CurResFile ();
+               
        /* open the MacTCP driver to get DNR resources. Search for it based on
           creator & type rather than simply file name */       
        refnum = OpenOurRF();
@@ -250,6 +255,7 @@ OSErr OpenResolver(char *fileName)
        if (gDNRCodeHndl == nil)
        {
                /* can't open DNR */
+               UseResFile (saveResFile);
                return(ResError());
        }
        
@@ -276,6 +282,8 @@ OSErr OpenResolver(char *fileName)
                DisposeHandle(gDNRCodeHndl);
                gDNRCodePtr = nil;
        }
+
+       UseResFile (saveResFile);
        return(rc);
 }