Index: CvsManager.cpp =================================================================== RCS file: /scotty/cvsmanager/CvsManager.cpp,v retrieving revision 1.79 diff -c -r1.79 CvsManager.cpp *** CvsManager.cpp 28 Aug 2012 10:06:32 -0000 1.79 --- CvsManager.cpp 19 Sep 2012 07:23:38 -0000 *************** *** 59,64 **** --- 59,65 ---- #define MHMAXARRYSTR 99999 #endif #include "version.h" + #include "cvsflt.h" #include "CvsManager.h" #include "CvsMgrStats.h" #include "../licenselib/MHLicense.h" *************** *** 1660,1665 **** --- 1661,1697 ---- #endif } + #ifdef _WIN32 + void add_to_ci_directory_list(const char *repos_str,const char *repos_dir, const char *repos_name) + { + DWORD fa = GetFileAttributesA(repos_dir); + if(fa==0xFFFFFFFF || !(fa&FILE_ATTRIBUTE_DIRECTORY)) + { + CServerIo::trace(3,"!Case Insensitive Register: %s (directory not exist)",repos_name); + if(g_bTestMode) + printf("!Case Insensitive Register: %s (directory not exist)\n",repos_dir); + CServerIo::log(CServerIo::logError,DISPLAY_NAMEA" register case insensitive:\n %s: %s\n directory: %s\n status: %s\n",repos_str,repos_name,repos_dir,"no directory with that name"); + } + else + { + if(!CvsAddPosixDirectoryA(repos_dir,FALSE)) + { + CServerIo::trace(3,"Case Insensitive Register: %s (fail)",repos_name); + if(g_bTestMode) + printf("Case Insensitive Register: %s (fail)\n",repos_dir); + CServerIo::log(CServerIo::logError,DISPLAY_NAMEA" register case insensitive:\n %s: %s\n directory: %s\n status: %s\n",repos_str,repos_name,repos_dir,"fail"); + } + else + { + CServerIo::trace(3,"Case Insensitive Register: %s (ok)",repos_name); + if(g_bTestMode) + printf("Case Insensitive Register: %s (ok)\n",repos_dir); + CServerIo::log(CServerIo::logNotice,DISPLAY_NAMEA" register case insensitive:\n %s: %s\n directory: %s\n status: %s\n",repos_str,repos_name,repos_dir,"ok"); + } + } + } + #endif + int run_server() { #if ((CVSNT_PRODUCT_MAJOR==2) && (CVSNT_PRODUCT_MINOR==8) && (CVSNT_PRODUCT_PATCHLEVEL>=2) && (CVSNT_PRODUCT_BUILD>4135)) *************** *** 1680,1685 **** --- 1712,1720 ---- time_t global_session_time_t; const char *global_session_time; int server_count=10; + #ifdef _WIN32 + int case_insensitive_server=0; + #endif License_t license; #ifdef HAVE_UNISON CSocketIO unison_sock; *************** *** 1987,1992 **** --- 2022,2079 ---- sprintf(cvs_port,"%d",cvs_port_num); + #ifdef _WIN32 + /* register each repository directory as case insensitive */ + if(CGlobalSettings::GetGlobalValue("cvsnt","PServer","CaseSensitive",case_insensitive_server)) + case_insensitive_server=0; + + if (case_insensitive_server) + { + if(CvsOpenFilter()) + { + char token[1024],repos_dir[MAX_PATH]; + for(int n=0;(!CGlobalSettings::EnumGlobalValues("cvsnt","PServer",n,token,sizeof(token),repos_dir,sizeof(repos_dir)));n++,*repos_dir='\0') + { + if(!strncasecmp(token,"Repository",10) && *repos_dir && isdigit(token[10]) && isdigit(token[strlen(token)-1])) + { + char tmp[32]; + int repos_online; + char repos_name[MAX_PATH]; + int prefixnum; + + prefixnum = atoi(token+10); + + if(ISDIRSEP(repos_dir[strlen(repos_dir)-1])) + repos_dir[strlen(repos_dir)-1]='\0'; + for (int kk=0;kk50) *************** *** 2148,2153 **** --- 2235,2259 ---- SetEnvironmentVariable(_T("TMP"),cvs::wide(szTmp)); if(g_bTestMode) printf("Temporary folder set to %s\n",szTmp); + + if ((case_insensitive_server)&&(strlen(szTmp)>0)) + { + if(CvsOpenFilter()) + { + CServerIo::trace(3,"Case Insensitive Temp Register: %s",szTmp); + add_to_ci_directory_list("variable",szTmp,"%TEMP%"); + CvsCloseFilter(); + } + else + { + CServerIo::trace(3,"Case Insensitive Cannot Register Temp: cannot open driver (cvsflt)"); + if(g_bTestMode) + printf("Case Insensitive Cannot Register Temp: cannot open driver (cvsflt)\n"); + CServerIo::log(CServerIo::logError,DISPLAY_NAMEA" register case insensitive temp:\n status: %s\n","unable to open cvsflt"); + } + + } // case_insensitive_server + #endif #ifdef HAVE_MDNS Index: CvsManager.vcproj =================================================================== RCS file: /scotty/cvsmanager/CvsManager.vcproj,v retrieving revision 1.14 diff -c -r1.14 CvsManager.vcproj *** CvsManager.vcproj 17 May 2012 08:02:27 -0000 1.14 --- CvsManager.vcproj 19 Sep 2012 06:05:24 -0000 *************** *** 20,26 **** --- 181,188 ---- Index: build.h =================================================================== RCS file: /cvs/cvsnt/build.h,v retrieving revision 1.1.2.173.4.349 diff -c -r1.1.2.173.4.349 build.h *** build.h 18 Sep 2012 12:06:53 -0000 1.1.2.173.4.349 --- build.h 19 Sep 2012 08:15:47 -0000 *************** *** 1 **** ! #define CVSNT_PRODUCT_BUILD 4651 --- 1 ---- ! #define CVSNT_PRODUCT_BUILD 4652 Index: cvsnt.sln =================================================================== RCS file: /cvs/cvsnt/cvsnt.sln,v retrieving revision 1.19.2.81.4.23 diff -c -r1.19.2.81.4.23 cvsnt.sln *** cvsnt.sln 12 Sep 2012 00:43:11 -0000 1.19.2.81.4.23 --- cvsnt.sln 19 Sep 2012 08:15:39 -0000 *************** *** 21,27 **** {C2CD3641-0F72-4C10-852B-CAA694D28E86} = {C2CD3641-0F72-4C10-852B-CAA694D28E86} {3ED9E859-7F8B-4FBE-8589-5B7C4886471D} = {3ED9E859-7F8B-4FBE-8589-5B7C4886471D} {86C5205D-21BC-4CDE-86BE-7AC921D0C6A5} = {86C5205D-21BC-4CDE-86BE-7AC921D0C6A5} - {86C5205D-21BC-4CDE-86BE-7AC921D0C6A5} = {86C5205D-21BC-4CDE-86BE-7AC921D0C6A5} {5D695560-5DD9-4EF5-9B2E-D609D1A05324} = {5D695560-5DD9-4EF5-9B2E-D609D1A05324} {CCE61C64-AC44-40E2-8E75-034C8F60834F} = {CCE61C64-AC44-40E2-8E75-034C8F60834F} {00725064-BF63-4724-9FB4-740EABE62CEC} = {00725064-BF63-4724-9FB4-740EABE62CEC} --- 21,26 ---- *************** *** 397,402 **** --- 396,402 ---- EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CvsManager", "..\..\..\march-hare\cvsmanager\CvsManager.vcproj", "{EC9C11AE-2862-4E33-817C-008D9DC1B477}" ProjectSection(ProjectDependencies) = postProject + {18BE4128-D152-4D38-9516-69B6450059C5} = {18BE4128-D152-4D38-9516-69B6450059C5} {BCF71D75-2C0F-4B0F-967E-20D2EE52AB08} = {BCF71D75-2C0F-4B0F-967E-20D2EE52AB08} {5F0B4A94-9332-45D5-881E-F9F4C4CD03F6} = {5F0B4A94-9332-45D5-881E-F9F4C4CD03F6} {B94D88FC-69AB-488E-BC7F-AAA565AA8074} = {B94D88FC-69AB-488E-BC7F-AAA565AA8074} *************** *** 493,498 **** --- 493,502 ---- ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cvsfltlib", "..\..\..\march-hare\cvsflt\cvsfltlib\cvsfltlib.vcproj", "{18BE4128-D152-4D38-9516-69B6450059C5}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug *************** *** 874,879 **** --- 878,889 ---- {CEA8E982-E089-410B-91F5-4435E6D57CDE}.Release.Build.0 = Release|Win32 {CEA8E982-E089-410B-91F5-4435E6D57CDE}.Releasex64.ActiveCfg = Releasex64|Win32 {CEA8E982-E089-410B-91F5-4435E6D57CDE}.Releasex64.Build.0 = Releasex64|Win32 + {18BE4128-D152-4D38-9516-69B6450059C5}.Debug.ActiveCfg = Debug|Win32 + {18BE4128-D152-4D38-9516-69B6450059C5}.Debug.Build.0 = Debug|Win32 + {18BE4128-D152-4D38-9516-69B6450059C5}.Release.ActiveCfg = Release|Win32 + {18BE4128-D152-4D38-9516-69B6450059C5}.Release.Build.0 = Release|Win32 + {18BE4128-D152-4D38-9516-69B6450059C5}.Releasex64.ActiveCfg = Release|Win32 + {18BE4128-D152-4D38-9516-69B6450059C5}.Releasex64.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection Index: osx/BuildNo.xcconfig =================================================================== RCS file: /cvs/cvsnt/osx/BuildNo.xcconfig,v retrieving revision 1.1.2.17 diff -c -r1.1.2.17 BuildNo.xcconfig *** osx/BuildNo.xcconfig 18 Sep 2012 12:06:54 -0000 1.1.2.17 --- osx/BuildNo.xcconfig 19 Sep 2012 08:15:47 -0000 *************** *** 2,10 **** // BuildNo.xcconfig // cvsnt // ! // Created by genbuild on 18.08.2012 // ! CVSNT_Version_Buildnumber = 4651 CVSNT_Version_Major = 2 CVSNT_Version_Minor = 8 CVSNT_Version_Rel = 02 --- 2,10 ---- // BuildNo.xcconfig // cvsnt // ! // Created by genbuild on 19.08.2012 // ! CVSNT_Version_Buildnumber = 4652 CVSNT_Version_Major = 2 CVSNT_Version_Minor = 8 CVSNT_Version_Rel = 02 Index: src/main.cpp =================================================================== RCS file: /cvs/cvsnt/src/main.c,v retrieving revision 1.71.2.151.6.81 diff -c -r1.71.2.151.6.81 main.cpp *** src/main.cpp 12 Sep 2012 00:43:11 -0000 1.71.2.151.6.81 --- src/main.cpp 19 Sep 2012 06:38:31 -0000 *************** *** 2063,2069 **** #ifdef _WIN32 /* Mark case insensitive, if needed */ ! if(!filenames_case_insensitive && current_parsed_root) add_to_ci_directory_list(current_parsed_root->directory); #endif --- 2063,2069 ---- #ifdef _WIN32 /* Mark case insensitive, if needed */ ! if(!filenames_case_insensitive && current_parsed_root && __case_sensitive()>1) add_to_ci_directory_list(current_parsed_root->directory); #endif Index: src/server.cpp =================================================================== RCS file: /cvs/cvsnt/src/server.c,v retrieving revision 1.106.2.210.6.133 diff -c -r1.106.2.210.6.133 server.cpp *** src/server.cpp 2 Jul 2012 06:27:19 -0000 1.106.2.210.6.133 --- src/server.cpp 19 Sep 2012 06:38:30 -0000 *************** *** 1340,1346 **** { parse_config( current_parsed_root->directory ); #ifdef _WIN32 ! if(!filenames_case_insensitive) add_to_ci_directory_list(current_parsed_root->directory); #endif } --- 1340,1346 ---- { parse_config( current_parsed_root->directory ); #ifdef _WIN32 ! if(!filenames_case_insensitive && __case_sensitive()>1) add_to_ci_directory_list(current_parsed_root->directory); #endif } *************** *** 5943,5949 **** fn_root(server_temp_dir)); } #ifdef _WIN32 ! if(!filenames_case_insensitive) add_to_ci_directory_list(server_temp_dir); #endif } --- 5943,5949 ---- fn_root(server_temp_dir)); } #ifdef _WIN32 ! if(!filenames_case_insensitive && __case_sensitive()>1) add_to_ci_directory_list(server_temp_dir); #endif } Index: windows-NT/posixdir/cvsflt/cvsflt.cpp =================================================================== RCS file: /cvs/cvsnt/windows-NT/posixdir/cvsflt/cvsflt.cpp,v retrieving revision 1.1.2.5.4.3 diff -c -r1.1.2.5.4.3 cvsflt.cpp *** windows-NT/posixdir/cvsflt/cvsflt.cpp 18 Sep 2012 11:08:41 -0000 1.1.2.5.4.3 --- windows-NT/posixdir/cvsflt/cvsflt.cpp 19 Sep 2012 04:31:53 -0000 *************** *** 129,135 **** return CvsAddPosixDirectoryW(AtoW(dir), temp); } ! BOOL CvsAddPosixDirectoryW(LPCWSTR dir, BOOL temp) { DWORD dwRet,BufLen; LPVOID Buf; --- 129,135 ---- return CvsAddPosixDirectoryW(AtoW(dir), temp); } ! BOOL CvsAddPosixDirectoryIntW(LPCWSTR dir, BOOL temp) { DWORD dwRet,BufLen; LPVOID Buf; *************** *** 150,155 **** --- 150,191 ---- } GlobalFree((HGLOBAL)Buf); return bRet; + } + + BOOL CvsAddPosixDirectoryW(LPCWSTR dir, BOOL temp) + { + BOOL bRetShort = FALSE, bRetLong = FALSE; + // create buffers for the short and long version of this name + DWORD add_short_len=0, add_long_len=0, add_result; + add_result = GetShortPathNameW(dir,NULL,add_short_len); + if (add_result>0) + { + PVOID add_short_str=NULL; + add_long_len=add_result*sizeof(WCHAR); + add_short_str = (LPVOID)GlobalAlloc(GPTR,add_result*sizeof(WCHAR)); + if (add_short_str) + { + add_result = GetShortPathNameW(dir,(LPWSTR)add_short_str,add_short_len); + if (add_result>0) + bRetLong=CvsAddPosixDirectoryIntW((LPWSTR)add_short_str,temp); + GlobalFree(add_short_str); + } + } + add_result = GetLongPathNameW(dir,NULL,add_long_len); + if (add_result>0) + { + PVOID add_long_str=NULL; + add_long_len=add_result*sizeof(WCHAR); + add_long_str = (LPVOID)GlobalAlloc(GPTR,add_long_len); + if (add_long_str) + { + add_result = GetLongPathNameW(dir,(LPWSTR)add_long_str,add_long_len); + if (add_result>0) + bRetShort=CvsAddPosixDirectoryIntW((LPWSTR)add_long_str,temp); + GlobalFree(add_long_str); + } + } + return (bRetLong || bRetShort); } BOOL CvsRemovePosixDirectoryA(LPCSTR dir, BOOL temp) Index: windows-NT/posixdir/setci/setci.cpp =================================================================== RCS file: /cvs/cvsnt/windows-NT/posixdir/setci/setci.cpp,v retrieving revision 1.1.2.5 diff -c -r1.1.2.5 setci.cpp *** windows-NT/posixdir/setci/setci.cpp 20 Oct 2005 15:15:33 -0000 1.1.2.5 --- windows-NT/posixdir/setci/setci.cpp 19 Sep 2012 05:58:54 -0000 *************** *** 46,65 **** if(!wcscmp(argv[1],L"-a")) { ! DWORD fa = GetFileAttributes(argv[2]); if(fa==0xFFFFFFFF || !(fa&FILE_ATTRIBUTE_DIRECTORY)) { ! fprintf(stderr, "%S is not a directory",argv[2]); return -1; } ! if(!CvsAddPosixDirectory(argv[2],FALSE)) { fprintf(stderr,"Call to driver failed (%08x)\n",GetLastError()); return -1; } } else if(!wcscmp(argv[1],L"-d")) { ! if(!CvsRemovePosixDirectory(argv[2],FALSE)) { fprintf(stderr,"Call to driver failed (%08x)\n",GetLastError()); return -1; --- 46,82 ---- if(!wcscmp(argv[1],L"-a")) { ! // remove trailing directory separator ! _TCHAR *dir_add_end, *dir_to_add=argv[2]; ! dir_add_end = dir_to_add+wcslen(dir_to_add); ! while ((*dir_add_end==L'\0')||(*dir_add_end==L'\\')||(*dir_add_end==L'/')) ! dir_add_end--; ! if (*dir_add_end!=L'\0') ! *dir_add_end=L'\0'; ! ! DWORD fa = GetFileAttributes(dir_to_add); if(fa==0xFFFFFFFF || !(fa&FILE_ATTRIBUTE_DIRECTORY)) { ! fprintf(stderr, "%S is not a directory",dir_to_add); return -1; } ! ! if(!CvsAddPosixDirectory(dir_to_add,FALSE)) { fprintf(stderr,"Call to driver failed (%08x)\n",GetLastError()); return -1; } } else if(!wcscmp(argv[1],L"-d")) { ! // remove trailing directory separator ! _TCHAR *dir_rm_end, *dir_to_rm=argv[2]; ! dir_to_rm = dir_to_rm+wcslen(dir_to_rm); ! while ((*dir_rm_end==L'\0')||(*dir_rm_end==L'\\')||(*dir_rm_end==L'/')) ! dir_rm_end--; ! if (*dir_rm_end!=L'\0') ! *dir_rm_end=L'\0'; ! ! if(!CvsRemovePosixDirectory(dir_to_rm,FALSE)) { fprintf(stderr,"Call to driver failed (%08x)\n",GetLastError()); return -1;