Fossil SCM
Some changes for Windows.
Commit
119f97133522f661dcac7d5a846e7bd29b211c56677f032a218ebbcf142db3b1
Parent
1ff19a468d762eb…
2 files changed
+2
-2
+14
-7
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1859,11 +1859,11 @@ | ||
| 1859 | 1859 | SIZE_T nWrite = 0; |
| 1860 | 1860 | if( WriteProcessMemory(hProcess, pAddress, p, nSize, &nWrite) ){ |
| 1861 | 1861 | CloseHandle(hProcess); |
| 1862 | 1862 | if( nWrite!=nSize ){ |
| 1863 | 1863 | fossil_panic("bad size write, %u out of %u bytes at %p from pid %lu", |
| 1864 | - nRead, nSize, pAddress, processId); | |
| 1864 | + nWrite, nSize, pAddress, processId); | |
| 1865 | 1865 | } |
| 1866 | 1866 | }else{ |
| 1867 | 1867 | CloseHandle(hProcess); |
| 1868 | 1868 | fossil_panic("failed write, %u bytes at %p from pid %lu: %lu", nSize, |
| 1869 | 1869 | pAddress, processId, GetLastError()); |
| @@ -1922,11 +1922,11 @@ | ||
| 1922 | 1922 | if( WriteProcessMemory(hProcess, pAddress, p, nSize, &nWrite) ){ |
| 1923 | 1923 | CloseHandle(hProcess); |
| 1924 | 1924 | fossil_secure_free_page(p, n); |
| 1925 | 1925 | if( nWrite!=nSize ){ |
| 1926 | 1926 | fossil_panic("bad size zero, %u out of %u bytes at %p from pid %lu", |
| 1927 | - nRead, nSize, pAddress, processId); | |
| 1927 | + nWrite, nSize, pAddress, processId); | |
| 1928 | 1928 | } |
| 1929 | 1929 | }else{ |
| 1930 | 1930 | CloseHandle(hProcess); |
| 1931 | 1931 | fossil_secure_free_page(p, n); |
| 1932 | 1932 | fossil_panic("failed zero, %u bytes at %p from pid %lu: %lu", nSize, |
| 1933 | 1933 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1859,11 +1859,11 @@ | |
| 1859 | SIZE_T nWrite = 0; |
| 1860 | if( WriteProcessMemory(hProcess, pAddress, p, nSize, &nWrite) ){ |
| 1861 | CloseHandle(hProcess); |
| 1862 | if( nWrite!=nSize ){ |
| 1863 | fossil_panic("bad size write, %u out of %u bytes at %p from pid %lu", |
| 1864 | nRead, nSize, pAddress, processId); |
| 1865 | } |
| 1866 | }else{ |
| 1867 | CloseHandle(hProcess); |
| 1868 | fossil_panic("failed write, %u bytes at %p from pid %lu: %lu", nSize, |
| 1869 | pAddress, processId, GetLastError()); |
| @@ -1922,11 +1922,11 @@ | |
| 1922 | if( WriteProcessMemory(hProcess, pAddress, p, nSize, &nWrite) ){ |
| 1923 | CloseHandle(hProcess); |
| 1924 | fossil_secure_free_page(p, n); |
| 1925 | if( nWrite!=nSize ){ |
| 1926 | fossil_panic("bad size zero, %u out of %u bytes at %p from pid %lu", |
| 1927 | nRead, nSize, pAddress, processId); |
| 1928 | } |
| 1929 | }else{ |
| 1930 | CloseHandle(hProcess); |
| 1931 | fossil_secure_free_page(p, n); |
| 1932 | fossil_panic("failed zero, %u bytes at %p from pid %lu: %lu", nSize, |
| 1933 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1859,11 +1859,11 @@ | |
| 1859 | SIZE_T nWrite = 0; |
| 1860 | if( WriteProcessMemory(hProcess, pAddress, p, nSize, &nWrite) ){ |
| 1861 | CloseHandle(hProcess); |
| 1862 | if( nWrite!=nSize ){ |
| 1863 | fossil_panic("bad size write, %u out of %u bytes at %p from pid %lu", |
| 1864 | nWrite, nSize, pAddress, processId); |
| 1865 | } |
| 1866 | }else{ |
| 1867 | CloseHandle(hProcess); |
| 1868 | fossil_panic("failed write, %u bytes at %p from pid %lu: %lu", nSize, |
| 1869 | pAddress, processId, GetLastError()); |
| @@ -1922,11 +1922,11 @@ | |
| 1922 | if( WriteProcessMemory(hProcess, pAddress, p, nSize, &nWrite) ){ |
| 1923 | CloseHandle(hProcess); |
| 1924 | fossil_secure_free_page(p, n); |
| 1925 | if( nWrite!=nSize ){ |
| 1926 | fossil_panic("bad size zero, %u out of %u bytes at %p from pid %lu", |
| 1927 | nWrite, nSize, pAddress, processId); |
| 1928 | } |
| 1929 | }else{ |
| 1930 | CloseHandle(hProcess); |
| 1931 | fossil_secure_free_page(p, n); |
| 1932 | fossil_panic("failed zero, %u bytes at %p from pid %lu: %lu", nSize, |
| 1933 |
+14
-7
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1710,10 +1710,11 @@ | ||
| 1710 | 1710 | #endif |
| 1711 | 1711 | /* If the repository has not been opened already, then find the |
| 1712 | 1712 | ** repository based on the first element of PATH_INFO and open it. |
| 1713 | 1713 | */ |
| 1714 | 1714 | if( !g.repositoryOpen ){ |
| 1715 | + char zBuf[24]; | |
| 1715 | 1716 | const char *zRepoExt = ".fossil"; |
| 1716 | 1717 | char *zRepo; /* Candidate repository name */ |
| 1717 | 1718 | char *zToFree = 0; /* Malloced memory that needs to be freed */ |
| 1718 | 1719 | const char *zCleanRepo; /* zRepo with surplus leading "/" removed */ |
| 1719 | 1720 | const char *zOldScript = PD("SCRIPT_NAME", ""); /* Original SCRIPT_NAME */ |
| @@ -1790,11 +1791,10 @@ | ||
| 1790 | 1791 | */ |
| 1791 | 1792 | zCleanRepo = file_cleanup_fullpath(zRepo); |
| 1792 | 1793 | if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){ |
| 1793 | 1794 | szFile = file_size(zCleanRepo, ExtFILE); |
| 1794 | 1795 | if( g.fHttpTrace ){ |
| 1795 | - char zBuf[24]; | |
| 1796 | 1796 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", szFile); |
| 1797 | 1797 | @ <!-- file_size(%h(zCleanRepo)) is %s(zBuf) --> |
| 1798 | 1798 | fprintf(stderr, "# file_size(%s) = %s\n", zCleanRepo, zBuf); |
| 1799 | 1799 | } |
| 1800 | 1800 | } |
| @@ -1896,16 +1896,23 @@ | ||
| 1896 | 1896 | if( g.zBaseURL ) g.zBaseURL = mprintf("%s%.*s", g.zBaseURL, i, zPathInfo); |
| 1897 | 1897 | cgi_replace_parameter("PATH_INFO", &zPathInfo[i+1]); |
| 1898 | 1898 | zPathInfo += i; |
| 1899 | 1899 | cgi_replace_parameter("SCRIPT_NAME", zNewScript); |
| 1900 | 1900 | #if USE_SEE |
| 1901 | - if( strcmp(zPathInfo,"/setseekey")==0 | |
| 1902 | - && strcmp(zRepoExt,".efossil")==0 | |
| 1903 | - && !db_have_saved_encryption_key() ){ | |
| 1904 | - db_set_see_key_page(); | |
| 1905 | - cgi_reply(); | |
| 1906 | - fossil_exit(0); | |
| 1901 | + if( zPathInfo ){ | |
| 1902 | + if( g.fHttpTrace ){ | |
| 1903 | + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", i); | |
| 1904 | + @ <!-- see_path_info(%s(zBuf)) is %h(zPathInfo) --> | |
| 1905 | + fprintf(stderr, "# see_path_info(%d) = %s\n", i, zPathInfo); | |
| 1906 | + } | |
| 1907 | + if( strcmp(zPathInfo,"/setseekey")==0 | |
| 1908 | + && strcmp(zRepoExt,".efossil")==0 | |
| 1909 | + && !db_have_saved_encryption_key() ){ | |
| 1910 | + db_set_see_key_page(); | |
| 1911 | + cgi_reply(); | |
| 1912 | + fossil_exit(0); | |
| 1913 | + } | |
| 1907 | 1914 | } |
| 1908 | 1915 | #endif |
| 1909 | 1916 | db_open_repository(file_cleanup_fullpath(zRepo)); |
| 1910 | 1917 | if( g.fHttpTrace ){ |
| 1911 | 1918 | @ <!-- repository: "%h(zRepo)" --> |
| 1912 | 1919 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1710,10 +1710,11 @@ | |
| 1710 | #endif |
| 1711 | /* If the repository has not been opened already, then find the |
| 1712 | ** repository based on the first element of PATH_INFO and open it. |
| 1713 | */ |
| 1714 | if( !g.repositoryOpen ){ |
| 1715 | const char *zRepoExt = ".fossil"; |
| 1716 | char *zRepo; /* Candidate repository name */ |
| 1717 | char *zToFree = 0; /* Malloced memory that needs to be freed */ |
| 1718 | const char *zCleanRepo; /* zRepo with surplus leading "/" removed */ |
| 1719 | const char *zOldScript = PD("SCRIPT_NAME", ""); /* Original SCRIPT_NAME */ |
| @@ -1790,11 +1791,10 @@ | |
| 1790 | */ |
| 1791 | zCleanRepo = file_cleanup_fullpath(zRepo); |
| 1792 | if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){ |
| 1793 | szFile = file_size(zCleanRepo, ExtFILE); |
| 1794 | if( g.fHttpTrace ){ |
| 1795 | char zBuf[24]; |
| 1796 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", szFile); |
| 1797 | @ <!-- file_size(%h(zCleanRepo)) is %s(zBuf) --> |
| 1798 | fprintf(stderr, "# file_size(%s) = %s\n", zCleanRepo, zBuf); |
| 1799 | } |
| 1800 | } |
| @@ -1896,16 +1896,23 @@ | |
| 1896 | if( g.zBaseURL ) g.zBaseURL = mprintf("%s%.*s", g.zBaseURL, i, zPathInfo); |
| 1897 | cgi_replace_parameter("PATH_INFO", &zPathInfo[i+1]); |
| 1898 | zPathInfo += i; |
| 1899 | cgi_replace_parameter("SCRIPT_NAME", zNewScript); |
| 1900 | #if USE_SEE |
| 1901 | if( strcmp(zPathInfo,"/setseekey")==0 |
| 1902 | && strcmp(zRepoExt,".efossil")==0 |
| 1903 | && !db_have_saved_encryption_key() ){ |
| 1904 | db_set_see_key_page(); |
| 1905 | cgi_reply(); |
| 1906 | fossil_exit(0); |
| 1907 | } |
| 1908 | #endif |
| 1909 | db_open_repository(file_cleanup_fullpath(zRepo)); |
| 1910 | if( g.fHttpTrace ){ |
| 1911 | @ <!-- repository: "%h(zRepo)" --> |
| 1912 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1710,10 +1710,11 @@ | |
| 1710 | #endif |
| 1711 | /* If the repository has not been opened already, then find the |
| 1712 | ** repository based on the first element of PATH_INFO and open it. |
| 1713 | */ |
| 1714 | if( !g.repositoryOpen ){ |
| 1715 | char zBuf[24]; |
| 1716 | const char *zRepoExt = ".fossil"; |
| 1717 | char *zRepo; /* Candidate repository name */ |
| 1718 | char *zToFree = 0; /* Malloced memory that needs to be freed */ |
| 1719 | const char *zCleanRepo; /* zRepo with surplus leading "/" removed */ |
| 1720 | const char *zOldScript = PD("SCRIPT_NAME", ""); /* Original SCRIPT_NAME */ |
| @@ -1790,11 +1791,10 @@ | |
| 1791 | */ |
| 1792 | zCleanRepo = file_cleanup_fullpath(zRepo); |
| 1793 | if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){ |
| 1794 | szFile = file_size(zCleanRepo, ExtFILE); |
| 1795 | if( g.fHttpTrace ){ |
| 1796 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", szFile); |
| 1797 | @ <!-- file_size(%h(zCleanRepo)) is %s(zBuf) --> |
| 1798 | fprintf(stderr, "# file_size(%s) = %s\n", zCleanRepo, zBuf); |
| 1799 | } |
| 1800 | } |
| @@ -1896,16 +1896,23 @@ | |
| 1896 | if( g.zBaseURL ) g.zBaseURL = mprintf("%s%.*s", g.zBaseURL, i, zPathInfo); |
| 1897 | cgi_replace_parameter("PATH_INFO", &zPathInfo[i+1]); |
| 1898 | zPathInfo += i; |
| 1899 | cgi_replace_parameter("SCRIPT_NAME", zNewScript); |
| 1900 | #if USE_SEE |
| 1901 | if( zPathInfo ){ |
| 1902 | if( g.fHttpTrace ){ |
| 1903 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", i); |
| 1904 | @ <!-- see_path_info(%s(zBuf)) is %h(zPathInfo) --> |
| 1905 | fprintf(stderr, "# see_path_info(%d) = %s\n", i, zPathInfo); |
| 1906 | } |
| 1907 | if( strcmp(zPathInfo,"/setseekey")==0 |
| 1908 | && strcmp(zRepoExt,".efossil")==0 |
| 1909 | && !db_have_saved_encryption_key() ){ |
| 1910 | db_set_see_key_page(); |
| 1911 | cgi_reply(); |
| 1912 | fossil_exit(0); |
| 1913 | } |
| 1914 | } |
| 1915 | #endif |
| 1916 | db_open_repository(file_cleanup_fullpath(zRepo)); |
| 1917 | if( g.fHttpTrace ){ |
| 1918 | @ <!-- repository: "%h(zRepo)" --> |
| 1919 |