]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE10-drive-letter-tabs-for-submounts-containing-string-afs-20010119
authorDave Koziol <dkoziol@dragonflymobile.com>
Tue, 6 Mar 2001 21:02:08 +0000 (21:02 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 6 Mar 2001 21:02:08 +0000 (21:02 +0000)
"The following patch is to addresses problems with the Drive Letters tabs in
the AFS Client and AFS Control Panel when using submounts which start with
the letters afs.  We had a test cell up and running with a name that started
with afs01 and this caused the afs client to misbehave."

(cherry picked from commit b05deccb9f57df04cc933a94dec2be96dcbadb87)

src/WINNT/client_config/drivemap.cpp

index 0fadf3ad5e3574f293f057023fd8a2659077255c..0b08e8eae86b733c49c647ffbe4c7974d839d5f1 100644 (file)
@@ -684,9 +684,14 @@ void AdjustAfsPath (LPTSTR pszTarget, LPCTSTR pszSource, BOOL fWantAFS, BOOL fWa
       lstrcpy (pszTarget, (fWantAFS) ? TEXT("/afs") : TEXT(""));
    else if ((*pszSource != TEXT('/')) && (*pszSource != TEXT('\\')))
       wsprintf (pszTarget, TEXT("/afs/%s"), pszSource);
-   else if (fWantAFS && lstrncmpi (&pszSource[1], TEXT("afs"), 3))
+   // We don't want to strip afs off the start if it is part of something for example afscell.company.com
+   else if (fWantAFS && (lstrncmpi (&pszSource[1], TEXT("afs"), 3)) || !((pszSource[4] == TEXT('/')) ||
+                                                                         (pszSource[4] == TEXT('\\')) ||
+                                                                         (lstrlen(pszSource) == 4)))
       wsprintf (pszTarget, TEXT("/afs%s"), pszSource);
-   else if (!fWantAFS && !lstrncmpi (&pszSource[1], TEXT("afs"), 3))
+   else if (!fWantAFS && (!lstrncmpi (&pszSource[1], TEXT("afs"), 3) || ((pszSource[4] == TEXT('/')) ||
+                                                                        (pszSource[4] == TEXT('\\')) ||
+                                                                        (lstrlen(pszSource) == 4))))
       lstrcpy (pszTarget, &pszSource[4]);
    else
       lstrcpy (pszTarget, pszSource);