]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-freelance-import-20041122
authorJeffrey Altman <jaltman@mit.edu>
Tue, 7 Dec 2004 05:54:43 +0000 (05:54 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 7 Dec 2004 05:54:43 +0000 (05:54 +0000)
Fix the afs_freelance.ini import code.
Check both the Client install directory and the %WINDIR% directory
for afs_freelance.ini

(cherry picked from commit 50ca88be2a8dcce74ba9386d0161c39e46e1d57c)

src/WINNT/afsd/afsd_init.c
src/WINNT/afsd/cm_freelance.c

index e7911fa3df42cae8f438a60457c5989818a29a89..8ee00e54d45e7561d3216eb7375d8a2ff321a8e6 100644 (file)
@@ -108,16 +108,16 @@ void afsd_initUpperCaseTable()
 void
 afsi_start()
 {
-       char wd[100];
-       char t[100], u[100], *p, *path;
-       int zilch;
-       int code;
+    char wd[100];
+    char t[100], u[100], *p, *path;
+    int zilch;
+    int code;
     DWORD dwLow, dwHigh;
-       HKEY parmKey;
-       DWORD dummyLen;
+    HKEY parmKey;
+    DWORD dummyLen;
     DWORD maxLogSize = 100 * 1024;
 
-       afsi_file = INVALID_HANDLE_VALUE;
+    afsi_file = INVALID_HANDLE_VALUE;
     if (getenv("TEMP"))
     {
         StringCbCopyA(wd, sizeof(wd), getenv("TEMP"));
@@ -125,21 +125,22 @@ afsi_start()
     else
     {
         code = GetWindowsDirectory(wd, sizeof(wd));
-        if (code == 0) return;
+        if (code == 0) 
+            return;
     }
-       StringCbCatA(wd, sizeof(wd), "\\afsd_init.log");
-       GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
-       afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
+    StringCbCatA(wd, sizeof(wd), "\\afsd_init.log");
+    GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
+    afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
                            OPEN_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);
 
     code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName,
                          0, KEY_QUERY_VALUE, &parmKey);
-       if (code == ERROR_SUCCESS) {
+    if (code == ERROR_SUCCESS) {
         dummyLen = sizeof(maxLogSize);
         code = RegQueryValueEx(parmKey, "MaxLogSize", NULL, NULL,
                                 (BYTE *) &maxLogSize, &dummyLen);
         RegCloseKey (parmKey);
-       }
+    }
 
     if (maxLogSize) {
         dwLow = GetFileSize( afsi_file, &dwHigh );
index 6ea93601fa2117a4718399470051b0b21f105933..f0358af12d61c85d3380a01c3e548f95b75bde30 100644 (file)
@@ -618,6 +618,13 @@ long cm_InitLocalMountPoints() {
     strcat(hdir, AFS_FREELANCE_INI);
     // open the ini file for reading
     fp = fopen(hdir, "r");
+    if (!fp) {
+        /* look in the Windows directory where we used to store the file */
+        GetWindowsDirectory(hdir, sizeof(hdir));
+        strcat(hdir,"\\");
+        strcat(hdir, AFS_FREELANCE_INI);
+        fp = fopen(hdir, "r");
+    }
 
 #if !defined(DJGPP)
     RegCreateKeyEx( HKEY_LOCAL_MACHINE,