Fossil SCM

Some changes for Windows.

mistachkin 2023-05-20 00:25 enhSee
Commit 119f97133522f661dcac7d5a846e7bd29b211c56677f032a218ebbcf142db3b1
2 files changed +2 -2 +14 -7
+2 -2
--- src/db.c
+++ src/db.c
@@ -1859,11 +1859,11 @@
18591859
SIZE_T nWrite = 0;
18601860
if( WriteProcessMemory(hProcess, pAddress, p, nSize, &nWrite) ){
18611861
CloseHandle(hProcess);
18621862
if( nWrite!=nSize ){
18631863
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);
18651865
}
18661866
}else{
18671867
CloseHandle(hProcess);
18681868
fossil_panic("failed write, %u bytes at %p from pid %lu: %lu", nSize,
18691869
pAddress, processId, GetLastError());
@@ -1922,11 +1922,11 @@
19221922
if( WriteProcessMemory(hProcess, pAddress, p, nSize, &nWrite) ){
19231923
CloseHandle(hProcess);
19241924
fossil_secure_free_page(p, n);
19251925
if( nWrite!=nSize ){
19261926
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);
19281928
}
19291929
}else{
19301930
CloseHandle(hProcess);
19311931
fossil_secure_free_page(p, n);
19321932
fossil_panic("failed zero, %u bytes at %p from pid %lu: %lu", nSize,
19331933
--- 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 @@
17101710
#endif
17111711
/* If the repository has not been opened already, then find the
17121712
** repository based on the first element of PATH_INFO and open it.
17131713
*/
17141714
if( !g.repositoryOpen ){
1715
+ char zBuf[24];
17151716
const char *zRepoExt = ".fossil";
17161717
char *zRepo; /* Candidate repository name */
17171718
char *zToFree = 0; /* Malloced memory that needs to be freed */
17181719
const char *zCleanRepo; /* zRepo with surplus leading "/" removed */
17191720
const char *zOldScript = PD("SCRIPT_NAME", ""); /* Original SCRIPT_NAME */
@@ -1790,11 +1791,10 @@
17901791
*/
17911792
zCleanRepo = file_cleanup_fullpath(zRepo);
17921793
if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){
17931794
szFile = file_size(zCleanRepo, ExtFILE);
17941795
if( g.fHttpTrace ){
1795
- char zBuf[24];
17961796
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", szFile);
17971797
@ <!-- file_size(%h(zCleanRepo)) is %s(zBuf) -->
17981798
fprintf(stderr, "# file_size(%s) = %s\n", zCleanRepo, zBuf);
17991799
}
18001800
}
@@ -1896,16 +1896,23 @@
18961896
if( g.zBaseURL ) g.zBaseURL = mprintf("%s%.*s", g.zBaseURL, i, zPathInfo);
18971897
cgi_replace_parameter("PATH_INFO", &zPathInfo[i+1]);
18981898
zPathInfo += i;
18991899
cgi_replace_parameter("SCRIPT_NAME", zNewScript);
19001900
#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
+ }
19071914
}
19081915
#endif
19091916
db_open_repository(file_cleanup_fullpath(zRepo));
19101917
if( g.fHttpTrace ){
19111918
@ <!-- repository: "%h(zRepo)" -->
19121919
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button