Fossil SCM

Allow remote commands of the form "*/fossil.exe" on the "ssh:" protocol.

drh 2019-09-25 13:28 trunk
Commit 8f70ccaac82d0e30e00158841d1715f14d279687892ba5202cf9f876394a85b8
1 file changed +1 -1
--- src/http_transport.c
+++ src/http_transport.c
@@ -80,11 +80,11 @@
8080
** Check zFossil to see if it is a reasonable "fossil" command to
8181
** run on the server. Do not allow an attacker to substitute something
8282
** like "/bin/rm".
8383
*/
8484
static int is_safe_fossil_command(const char *zFossil){
85
- static const char *const azSafe[] = { "*/fossil", "*/echo" };
85
+ static const char *const azSafe[] = { "*/fossil", "*/fossil.exe", "*/echo" };
8686
int i;
8787
for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){
8888
if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1;
8989
if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1;
9090
}
9191
--- src/http_transport.c
+++ src/http_transport.c
@@ -80,11 +80,11 @@
80 ** Check zFossil to see if it is a reasonable "fossil" command to
81 ** run on the server. Do not allow an attacker to substitute something
82 ** like "/bin/rm".
83 */
84 static int is_safe_fossil_command(const char *zFossil){
85 static const char *const azSafe[] = { "*/fossil", "*/echo" };
86 int i;
87 for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){
88 if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1;
89 if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1;
90 }
91
--- src/http_transport.c
+++ src/http_transport.c
@@ -80,11 +80,11 @@
80 ** Check zFossil to see if it is a reasonable "fossil" command to
81 ** run on the server. Do not allow an attacker to substitute something
82 ** like "/bin/rm".
83 */
84 static int is_safe_fossil_command(const char *zFossil){
85 static const char *const azSafe[] = { "*/fossil", "*/fossil.exe", "*/echo" };
86 int i;
87 for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){
88 if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1;
89 if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1;
90 }
91

Keyboard Shortcuts

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