Fossil SCM

Bring in latest from trunk.

andybradford 2014-02-01 05:58 UTC http-auth merge
Commit da070fafe2cced5d808499892f5b32c15d55253e
-2
--- src/cgi.c
+++ src/cgi.c
@@ -1340,14 +1340,12 @@
13401340
cgi_setenv("HTTP_HOST", zVal);
13411341
}else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
13421342
cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
13431343
}else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
13441344
cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
1345
-#if 0
13461345
}else if( fossil_strcmp(zFieldName,"referer:")==0 ){
13471346
cgi_setenv("HTTP_REFERER", zVal);
1348
-#endif
13491347
}else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
13501348
cgi_setenv("HTTP_USER_AGENT", zVal);
13511349
}else if( fossil_strcmp(zFieldName,"x-forwarded-for:")==0 ){
13521350
const char *zIpAddr = cgi_accept_forwarded_for(zVal);
13531351
if( zIpAddr!=0 ){
13541352
--- src/cgi.c
+++ src/cgi.c
@@ -1340,14 +1340,12 @@
1340 cgi_setenv("HTTP_HOST", zVal);
1341 }else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
1342 cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
1343 }else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
1344 cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
1345 #if 0
1346 }else if( fossil_strcmp(zFieldName,"referer:")==0 ){
1347 cgi_setenv("HTTP_REFERER", zVal);
1348 #endif
1349 }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
1350 cgi_setenv("HTTP_USER_AGENT", zVal);
1351 }else if( fossil_strcmp(zFieldName,"x-forwarded-for:")==0 ){
1352 const char *zIpAddr = cgi_accept_forwarded_for(zVal);
1353 if( zIpAddr!=0 ){
1354
--- src/cgi.c
+++ src/cgi.c
@@ -1340,14 +1340,12 @@
1340 cgi_setenv("HTTP_HOST", zVal);
1341 }else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
1342 cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
1343 }else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
1344 cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
 
1345 }else if( fossil_strcmp(zFieldName,"referer:")==0 ){
1346 cgi_setenv("HTTP_REFERER", zVal);
 
1347 }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
1348 cgi_setenv("HTTP_USER_AGENT", zVal);
1349 }else if( fossil_strcmp(zFieldName,"x-forwarded-for:")==0 ){
1350 const char *zIpAddr = cgi_accept_forwarded_for(zVal);
1351 if( zIpAddr!=0 ){
1352
+3 -3
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -176,14 +176,14 @@
176176
}
177177
}
178178
179179
/*
180180
** Open an SSL connection. The identify of the server is determined
181
-** by global variables that are set using url_parse():
181
+** by variables that are set using url_parse():
182182
**
183
-** g.urlName Name of the server. Ex: www.fossil-scm.org
184
-** g.urlPort TCP/IP port to use. Ex: 80
183
+** pUrlData->name Name of the server. Ex: www.fossil-scm.org
184
+** pUrlData->port TCP/IP port to use. Ex: 80
185185
**
186186
** Return the number of errors.
187187
*/
188188
int ssl_open(UrlData *pUrlData){
189189
X509 *cert;
190190
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -176,14 +176,14 @@
176 }
177 }
178
179 /*
180 ** Open an SSL connection. The identify of the server is determined
181 ** by global variables that are set using url_parse():
182 **
183 ** g.urlName Name of the server. Ex: www.fossil-scm.org
184 ** g.urlPort TCP/IP port to use. Ex: 80
185 **
186 ** Return the number of errors.
187 */
188 int ssl_open(UrlData *pUrlData){
189 X509 *cert;
190
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -176,14 +176,14 @@
176 }
177 }
178
179 /*
180 ** Open an SSL connection. The identify of the server is determined
181 ** by variables that are set using url_parse():
182 **
183 ** pUrlData->name Name of the server. Ex: www.fossil-scm.org
184 ** pUrlData->port TCP/IP port to use. Ex: 80
185 **
186 ** Return the number of errors.
187 */
188 int ssl_open(UrlData *pUrlData){
189 X509 *cert;
190
+16
--- src/info.c
+++ src/info.c
@@ -108,10 +108,26 @@
108108
);
109109
fossil_print("%-13s %s %s\n", zType, zUuid, zDate);
110110
free(zDate);
111111
}
112112
db_finalize(&q);
113
+ }
114
+ if( zUuid ){
115
+ fossil_print("%-13s ", "leaf:");
116
+ if(is_a_leaf(rid)){
117
+ if(db_int(0, "SELECT 1 FROM tagxref AS tx"
118
+ " WHERE tx.rid=%d"
119
+ " AND tx.tagid=%d"
120
+ " AND tx.tagtype>0",
121
+ rid, TAG_CLOSED)){
122
+ fossil_print("%s\n", "closed");
123
+ }else{
124
+ fossil_print("%s\n", "open");
125
+ }
126
+ }else{
127
+ fossil_print("no\n");
128
+ }
113129
}
114130
zTags = info_tags_of_checkin(rid, 0);
115131
if( zTags && zTags[0] ){
116132
fossil_print("tags: %s\n", zTags);
117133
}
118134
--- src/info.c
+++ src/info.c
@@ -108,10 +108,26 @@
108 );
109 fossil_print("%-13s %s %s\n", zType, zUuid, zDate);
110 free(zDate);
111 }
112 db_finalize(&q);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113 }
114 zTags = info_tags_of_checkin(rid, 0);
115 if( zTags && zTags[0] ){
116 fossil_print("tags: %s\n", zTags);
117 }
118
--- src/info.c
+++ src/info.c
@@ -108,10 +108,26 @@
108 );
109 fossil_print("%-13s %s %s\n", zType, zUuid, zDate);
110 free(zDate);
111 }
112 db_finalize(&q);
113 }
114 if( zUuid ){
115 fossil_print("%-13s ", "leaf:");
116 if(is_a_leaf(rid)){
117 if(db_int(0, "SELECT 1 FROM tagxref AS tx"
118 " WHERE tx.rid=%d"
119 " AND tx.tagid=%d"
120 " AND tx.tagtype>0",
121 rid, TAG_CLOSED)){
122 fossil_print("%s\n", "closed");
123 }else{
124 fossil_print("%s\n", "open");
125 }
126 }else{
127 fossil_print("no\n");
128 }
129 }
130 zTags = info_tags_of_checkin(rid, 0);
131 if( zTags && zTags[0] ){
132 fossil_print("tags: %s\n", zTags);
133 }
134
--- src/login.c
+++ src/login.c
@@ -472,10 +472,11 @@
472472
int anonFlag;
473473
char *zErrMsg = "";
474474
int uid; /* User id logged in user */
475475
char *zSha1Pw;
476476
const char *zIpAddr; /* IP address of requestor */
477
+ const char *zReferer;
477478
478479
login_check_credentials();
479480
sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
480481
constant_time_cmp_function, 0, 0);
481482
zUsername = P("u");
@@ -532,10 +533,11 @@
532533
return;
533534
}
534535
}
535536
}
536537
zIpAddr = PD("REMOTE_ADDR","nil"); /* Complete IP address for logging */
538
+ zReferer = P("HTTP_REFERER");
537539
uid = login_is_valid_anonymous(zUsername, zPasswd, P("cs"));
538540
if( uid>0 ){
539541
login_set_anon_cookie(zIpAddr, NULL);
540542
record_login_attempt("anonymous", zIpAddr, 1);
541543
redirect_to_g();
@@ -570,10 +572,12 @@
570572
@ <p>A login is required for <a href="%h(zGoto)">%h(zGoto)</a>.</p>
571573
}
572574
form_begin(0, "%R/login");
573575
if( zGoto ){
574576
@ <input type="hidden" name="g" value="%h(zGoto)" />
577
+ }else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){
578
+ @ <input type="hidden" name="g" value="%h(zReferer)" />
575579
}
576580
@ <table class="login_out">
577581
@ <tr>
578582
@ <td class="login_out_label">User ID:</td>
579583
if( anonFlag ){
580584
--- src/login.c
+++ src/login.c
@@ -472,10 +472,11 @@
472 int anonFlag;
473 char *zErrMsg = "";
474 int uid; /* User id logged in user */
475 char *zSha1Pw;
476 const char *zIpAddr; /* IP address of requestor */
 
477
478 login_check_credentials();
479 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
480 constant_time_cmp_function, 0, 0);
481 zUsername = P("u");
@@ -532,10 +533,11 @@
532 return;
533 }
534 }
535 }
536 zIpAddr = PD("REMOTE_ADDR","nil"); /* Complete IP address for logging */
 
537 uid = login_is_valid_anonymous(zUsername, zPasswd, P("cs"));
538 if( uid>0 ){
539 login_set_anon_cookie(zIpAddr, NULL);
540 record_login_attempt("anonymous", zIpAddr, 1);
541 redirect_to_g();
@@ -570,10 +572,12 @@
570 @ <p>A login is required for <a href="%h(zGoto)">%h(zGoto)</a>.</p>
571 }
572 form_begin(0, "%R/login");
573 if( zGoto ){
574 @ <input type="hidden" name="g" value="%h(zGoto)" />
 
 
575 }
576 @ <table class="login_out">
577 @ <tr>
578 @ <td class="login_out_label">User ID:</td>
579 if( anonFlag ){
580
--- src/login.c
+++ src/login.c
@@ -472,10 +472,11 @@
472 int anonFlag;
473 char *zErrMsg = "";
474 int uid; /* User id logged in user */
475 char *zSha1Pw;
476 const char *zIpAddr; /* IP address of requestor */
477 const char *zReferer;
478
479 login_check_credentials();
480 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
481 constant_time_cmp_function, 0, 0);
482 zUsername = P("u");
@@ -532,10 +533,11 @@
533 return;
534 }
535 }
536 }
537 zIpAddr = PD("REMOTE_ADDR","nil"); /* Complete IP address for logging */
538 zReferer = P("HTTP_REFERER");
539 uid = login_is_valid_anonymous(zUsername, zPasswd, P("cs"));
540 if( uid>0 ){
541 login_set_anon_cookie(zIpAddr, NULL);
542 record_login_attempt("anonymous", zIpAddr, 1);
543 redirect_to_g();
@@ -570,10 +572,12 @@
572 @ <p>A login is required for <a href="%h(zGoto)">%h(zGoto)</a>.</p>
573 }
574 form_begin(0, "%R/login");
575 if( zGoto ){
576 @ <input type="hidden" name="g" value="%h(zGoto)" />
577 }else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){
578 @ <input type="hidden" name="g" value="%h(zReferer)" />
579 }
580 @ <table class="login_out">
581 @ <tr>
582 @ <td class="login_out_label">User ID:</td>
583 if( anonFlag ){
584
--- www/changes.wiki
+++ www/changes.wiki
@@ -2,10 +2,14 @@
22
33
<h2>Changes For Version 1.29 (as yet unreleased)</h2>
44
* Add the ability to display content and diffs for UTF16 text files
55
in the web interface.
66
* Honor timezones in imports from git.
7
+ * The [/reports] page now requires Read ("o") permissions. The "byweek"
8
+ report now properly propagates the selected year through the event type
9
+ filter links.
10
+ * The [/help/info | info command] now shows leaf status of the checkout.
711
812
<h2>Changes For Version 1.28 (2014-01-27)</h2>
913
* Enhance [/help?cmd=/reports | /reports] to support event type filtering.
1014
* When cloning a repository, the user name passed via the URL (if any)
1115
is now used as the default local admin user's name.
1216
--- www/changes.wiki
+++ www/changes.wiki
@@ -2,10 +2,14 @@
2
3 <h2>Changes For Version 1.29 (as yet unreleased)</h2>
4 * Add the ability to display content and diffs for UTF16 text files
5 in the web interface.
6 * Honor timezones in imports from git.
 
 
 
 
7
8 <h2>Changes For Version 1.28 (2014-01-27)</h2>
9 * Enhance [/help?cmd=/reports | /reports] to support event type filtering.
10 * When cloning a repository, the user name passed via the URL (if any)
11 is now used as the default local admin user's name.
12
--- www/changes.wiki
+++ www/changes.wiki
@@ -2,10 +2,14 @@
2
3 <h2>Changes For Version 1.29 (as yet unreleased)</h2>
4 * Add the ability to display content and diffs for UTF16 text files
5 in the web interface.
6 * Honor timezones in imports from git.
7 * The [/reports] page now requires Read ("o") permissions. The "byweek"
8 report now properly propagates the selected year through the event type
9 filter links.
10 * The [/help/info | info command] now shows leaf status of the checkout.
11
12 <h2>Changes For Version 1.28 (2014-01-27)</h2>
13 * Enhance [/help?cmd=/reports | /reports] to support event type filtering.
14 * When cloning a repository, the user name passed via the URL (if any)
15 is now used as the default local admin user's name.
16

Keyboard Shortcuts

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