Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Merge in trunk and local fixes. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | ssl_platform_fixes |
| Files: | files | file ages | folders |
| SHA1: |
3b06c951cf0de259105a495a4d965f6d |
| User & Date: | linuxfood 2010-03-21 22:14:46.000 |
Context
|
2010-03-21
| ||
| 22:38 | Fix case when trying to free a non-malloced pointer. check-in: ee59ca74b8 user: linuxfood tags: ssl_platform_fixes | |
| 22:14 | Merge in trunk and local fixes. check-in: 3b06c951cf user: linuxfood tags: ssl_platform_fixes | |
| 22:10 | Create new branch named "ssl_platform_fixes" check-in: 6a21088a78 user: linuxfood tags: ssl_platform_fixes | |
| 21:51 | Avoid the use of rowids in URLs, since they can change on a rebuild. Use SHA1-derived artifact IDs instead. check-in: a4b10f43e2 user: drh tags: trunk | |
Changes
Changes to src/attach.c.
| ︙ | ︙ | |||
28 29 30 31 32 33 34 | #include <assert.h> /* ** WEBPAGE: attachlist ** ** tkt=TICKETUUID ** page=WIKIPAGE | < > > > > | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
#include <assert.h>
/*
** WEBPAGE: attachlist
**
** tkt=TICKETUUID
** page=WIKIPAGE
**
** List attachments.
** Either one of tkt= or page= are supplied or neither. If neither
** are given, all attachments are listed. If one is given, only
** attachments for the designated ticket or wiki page are shown.
** TICKETUUID must be complete
*/
void attachlist_page(void){
const char *zPage = P("page");
const char *zTkt = P("tkt");
Blob sql;
Stmt q;
|
| ︙ | ︙ |
Changes to src/browse.c.
| ︙ | ︙ | |||
148 149 150 151 152 153 154 |
if( zCI ){
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
char zShort[20];
memcpy(zShort, zUuid, 10);
zShort[10] = 0;
@ <h2>Files of check-in [<a href="vinfo?name=%T(zUuid)">%s(zShort)</a>]
@ %s(blob_str(&dirname))</h2>
| | | | | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
if( zCI ){
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
char zShort[20];
memcpy(zShort, zUuid, 10);
zShort[10] = 0;
@ <h2>Files of check-in [<a href="vinfo?name=%T(zUuid)">%s(zShort)</a>]
@ %s(blob_str(&dirname))</h2>
zSubdirLink = mprintf("%s/dir?ci=%S&name=%T", g.zTop, zUuid, zPrefix);
if( zD ){
style_submenu_element("Top", "Top", "%s/dir?ci=%S", g.zTop, zUuid);
style_submenu_element("All", "All", "%s/dir?name=%t", g.zTop, zD);
}else{
style_submenu_element("All", "All", "%s/dir", g.zBaseURL);
}
}else{
@ <h2>The union of all files from all check-ins
@ %s(blob_str(&dirname))</h2>
zSubdirLink = mprintf("%s/dir?name=%T", g.zBaseURL, zPrefix);
|
| ︙ | ︙ |
Changes to src/db.c.
| ︙ | ︙ | |||
842 843 844 845 846 847 848 849 850 851 852 853 854 855 |
while( pAllStmt ){
db_finalize(pAllStmt);
}
g.repositoryOpen = 0;
g.localOpen = 0;
g.configOpen = 0;
sqlite3_close(g.db);
g.db = 0;
}
/*
** Create a new empty repository database with the given name.
**
| > > > > | 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 |
while( pAllStmt ){
db_finalize(pAllStmt);
}
g.repositoryOpen = 0;
g.localOpen = 0;
g.configOpen = 0;
sqlite3_close(g.db);
if(g.dbConfig) {
sqlite3_close(g.dbConfig);
g.configOpen = 0;
}
g.db = 0;
}
/*
** Create a new empty repository database with the given name.
**
|
| ︙ | ︙ | |||
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 |
** If g.useAttach that means the ~/.fossil database was opened with
** the useAttach flag set to 1. In that case no connection swap is required
** so this routine is a no-op.
*/
void db_swap_connections(void){
if( !g.useAttach ){
sqlite3 *dbTemp = g.db;
g.db = g.dbConfig;
g.dbConfig = dbTemp;
}
}
/*
** Get and set values from the CONFIG, GLOBAL_CONFIG and VVAR table in the
| > | 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 |
** If g.useAttach that means the ~/.fossil database was opened with
** the useAttach flag set to 1. In that case no connection swap is required
** so this routine is a no-op.
*/
void db_swap_connections(void){
if( !g.useAttach ){
sqlite3 *dbTemp = g.db;
assert( g.dbConfig!=0 );
g.db = g.dbConfig;
g.dbConfig = dbTemp;
}
}
/*
** Get and set values from the CONFIG, GLOBAL_CONFIG and VVAR table in the
|
| ︙ | ︙ |
Changes to src/diff.c.
| ︙ | ︙ | |||
727 728 729 730 731 732 733 | } /* ** WEBPAGE: annotate ** ** Query parameters: ** | | | | | > > | 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 |
}
/*
** WEBPAGE: annotate
**
** Query parameters:
**
** checkin=ID The manifest ID at which to start the annotation
** filename=FILENAME The filename.
*/
void annotation_page(void){
int mid;
int fnid;
int i;
Annotator ann;
login_check_credentials();
if( !g.okRead ){ login_needed(); return; }
mid = name_to_rid(PD("checkin","0"));
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", P("filename"));
if( mid==0 || fnid==0 ){ fossil_redirect_home(); }
if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){
fossil_redirect_home();
}
style_header("File Annotation");
annotate_file(&ann, fnid, mid, g.okHistory);
@ <pre>
|
| ︙ | ︙ |
Changes to src/finfo.c.
| ︙ | ︙ | |||
115 116 117 118 119 120 121 |
"SELECT"
" substr(b.uuid,1,10),"
" datetime(event.mtime,'localtime'),"
" coalesce(event.ecomment, event.comment),"
" coalesce(event.euser, event.user),"
" mlink.pid,"
" mlink.fid,"
| | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
"SELECT"
" substr(b.uuid,1,10),"
" datetime(event.mtime,'localtime'),"
" coalesce(event.ecomment, event.comment),"
" coalesce(event.euser, event.user),"
" mlink.pid,"
" mlink.fid,"
" (SELECT substr(uuid,1,10) FROM blob WHERE rid=mlink.pid),"
" (SELECT substr(uuid,1,10) FROM blob WHERE rid=mlink.fid),"
" ci.uuid,"
" event.bgcolor,"
" (SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0"
" AND tagxref.rid=mlink.mid)"
" FROM mlink, blob b, event, blob ci"
" WHERE mlink.fnid=(SELECT fnid FROM filename WHERE name=%Q)"
" AND b.rid=mlink.fid"
|
| ︙ | ︙ | |||
145 146 147 148 149 150 151 |
while( db_step(&q)==SQLITE_ROW ){
const char *zUuid = db_column_text(&q, 0);
const char *zDate = db_column_text(&q, 1);
const char *zCom = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
int fpid = db_column_int(&q, 4);
int frid = db_column_int(&q, 5);
| | | | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
while( db_step(&q)==SQLITE_ROW ){
const char *zUuid = db_column_text(&q, 0);
const char *zDate = db_column_text(&q, 1);
const char *zCom = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
int fpid = db_column_int(&q, 4);
int frid = db_column_int(&q, 5);
const char *zFpuid = db_column_text(&q, 6);
const char *zFuid = db_column_text(&q, 7);
const char *zCkin = db_column_text(&q,8);
const char *zBgClr = db_column_text(&q, 9);
const char *zBr = db_column_text(&q, 10);
int gidx;
char zTime[10];
char zShort[20];
char zShortCkin[20];
|
| ︙ | ︙ | |||
186 187 188 189 190 191 192 |
@ part of check-in
hyperlink_to_uuid(zShortCkin);
@ %h(zCom) (user:
hyperlink_to_user(zUser, zDate, "");
@ branch: %h(zBr))
if( g.okHistory ){
if( fpid ){
| | | | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
@ part of check-in
hyperlink_to_uuid(zShortCkin);
@ %h(zCom) (user:
hyperlink_to_user(zUser, zDate, "");
@ branch: %h(zBr))
if( g.okHistory ){
if( fpid ){
@ <a href="%s(g.zTop)/fdiff?v1=%s(zFpuid)&v2=%s(zFuid)">[diff]</a>
}
@ <a href="%s(g.zTop)/annotate?checkin=%s(zShortCkin)&filename=%h(zFilename)">
@ [annotate]</a>
@ </td>
}
}
db_finalize(&q);
if( pGraph ){
graph_finish(pGraph, 1);
|
| ︙ | ︙ |
Changes to src/http_ssl.c.
| ︙ | ︙ | |||
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
/*
** Call this routine once before any other use of the SSL interface.
** This routine does initial configuration of the SSL module.
*/
void ssl_global_init(void){
if( sslIsInit==0 ){
SSL_library_init();
SSL_load_error_strings();
ERR_load_BIO_strings();
OpenSSL_add_all_algorithms();
sslCtx = SSL_CTX_new(SSLv23_client_method());
sslIsInit = 1;
}
}
/*
** Call this routine to shutdown the SSL module prior to program exit.
*/
| > > > > > > > > > > > > > > > > > > > > > > > > | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
/*
** Call this routine once before any other use of the SSL interface.
** This routine does initial configuration of the SSL module.
*/
void ssl_global_init(void){
if( sslIsInit==0 ){
char *system_store = NULL;
SSL_library_init();
SSL_load_error_strings();
ERR_load_BIO_strings();
OpenSSL_add_all_algorithms();
sslCtx = SSL_CTX_new(SSLv23_client_method());
#if defined(__MINGW32__)
/* TODO Load windows cert store here. */
#elif defined(__linux__)
/* Linux has a few different places to find the root certificate bundle */
if(file_isfile("/etc/pki/tls/cert.pem")) {
/* This is for RedHat derived distros */
system_store = "/etc/pki/tls/cert.pem";
}
else if(file_isfile("/etc/ssl/certs/ca-certificates.crt")) {
/* This is for Debian derived distros, and Arch */
system_store = "/etc/ssl/certs/ca-certificates.crt";
}
#elif defined(__FreeBSD__)
system_store = "/usr/local/share/certs/ca-root-nss.crt";
#elif defined(__APPLE__)
/* No action necessary, OpenSSL on OS X appears
to load the system store automatically */
#endif
system_store = db_get("certificate-bundle", system_store);
if(system_store != NULL) {
SSL_CTX_load_verify_locations(sslCtx, system_store, NULL);
free(system_store);
}
sslIsInit = 1;
}
}
/*
** Call this routine to shutdown the SSL module prior to program exit.
*/
|
| ︙ | ︙ |
Changes to src/info.c.
| ︙ | ︙ | |||
344 345 346 347 348 349 350 |
if( zUser==0 || zUser[0]==0 ) zUser = "unknown";
@ <tr><th>Received From:</th>
@ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
}
db_finalize(&q);
}
if( g.okHistory ){
| < | | | | | | | | < | 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
if( zUser==0 || zUser[0]==0 ) zUser = "unknown";
@ <tr><th>Received From:</th>
@ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
}
db_finalize(&q);
}
if( g.okHistory ){
const char *zProjName = db_get("project-name", "unnamed");
@ <tr><th>Timelines:</th><td>
@ <a href="%s(g.zBaseURL)/timeline?p=%S(zUuid)">ancestors</a>
@ | <a href="%s(g.zBaseURL)/timeline?d=%S(zUuid)">descendants</a>
@ | <a href="%s(g.zBaseURL)/timeline?d=%S(zUuid)&p=%S(zUuid)">both</a>
db_prepare(&q, "SELECT substr(tag.tagname,5) FROM tagxref, tag "
" WHERE rid=%d AND tagtype>0 "
" AND tag.tagid=tagxref.tagid "
" AND +tag.tagname GLOB 'sym-*'", rid);
while( db_step(&q)==SQLITE_ROW ){
const char *zTagName = db_column_text(&q, 0);
@ | <a href="%s(g.zTop)/timeline?t=%T(zTagName)">%h(zTagName)</a>
}
db_finalize(&q);
@ </td></tr>
@ <tr><th>Other Links:</th>
@ <td>
@ <a href="%s(g.zTop)/dir?ci=%S(zUuid)">files</a>
@ | <a href="%s(g.zTop)/zip/%s(zProjName)-%S(zUuid).zip?uuid=%s(zUuid)">
@ ZIP archive</a>
@ | <a href="%s(g.zTop)/artifact/%S(zUuid)">manifest</a>
if( g.okWrite ){
@ | <a href="%s(g.zTop)/ci_edit?r=%S(zUuid)">edit</a>
}
@ </td>
@ </tr>
}
@ </table></p>
}else{
style_header("Check-in Information");
login_anonymous_available();
}
db_finalize(&q);
|
| ︙ | ︙ | |||
496 497 498 499 500 501 502 |
@ <tr><th>Record ID:</th><td>%d(rid)</td></tr>
}
@ <tr><th>Original User:</th><td>
hyperlink_to_user(zUser, zDate, "</td></tr>");
if( g.okHistory ){
@ <tr><th>Commands:</th>
@ <td>
| < | | 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
@ <tr><th>Record ID:</th><td>%d(rid)</td></tr>
}
@ <tr><th>Original User:</th><td>
hyperlink_to_user(zUser, zDate, "</td></tr>");
if( g.okHistory ){
@ <tr><th>Commands:</th>
@ <td>
@ <a href="%s(g.zBaseURL)/whistory?name=%t(zName)">history</a>
@ | <a href="%s(g.zBaseURL)/artifact/%S(zUuid)">raw-text</a>
@ </td>
@ </tr>
}
@ </table></p>
}else{
style_header("Wiki Information");
rid = 0;
|
| ︙ | ︙ | |||
619 620 621 622 623 624 625 626 627 628 629 630 631 632 |
int rid, /* The artifact ID */
int linkToView, /* Add viewer link if true */
Blob *pDownloadName /* Fill with an appropriate download name */
){
Stmt q;
int cnt = 0;
int nWiki = 0;
db_prepare(&q,
"SELECT filename.name, datetime(event.mtime),"
" coalesce(event.ecomment,event.comment),"
" coalesce(event.euser,event.user),"
" b.uuid"
" FROM mlink, filename, event, blob a, blob b"
" WHERE filename.fnid=mlink.fnid"
| > > | 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 |
int rid, /* The artifact ID */
int linkToView, /* Add viewer link if true */
Blob *pDownloadName /* Fill with an appropriate download name */
){
Stmt q;
int cnt = 0;
int nWiki = 0;
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
db_prepare(&q,
"SELECT filename.name, datetime(event.mtime),"
" coalesce(event.ecomment,event.comment),"
" coalesce(event.euser,event.user),"
" b.uuid"
" FROM mlink, filename, event, blob a, blob b"
" WHERE filename.fnid=mlink.fnid"
|
| ︙ | ︙ | |||
689 690 691 692 693 694 695 |
}
@ by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate,".");
nWiki++;
cnt++;
if( pDownloadName && blob_size(pDownloadName)==0 ){
| | | 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 |
}
@ by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate,".");
nWiki++;
cnt++;
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_appendf(pDownloadName, "%s.wiki", zPagename);
}
}
db_finalize(&q);
if( nWiki==0 ){
db_prepare(&q,
"SELECT datetime(mtime), user, comment, type, uuid"
" FROM event, blob"
|
| ︙ | ︙ | |||
724 725 726 727 728 729 730 |
@ Control file referencing
}
hyperlink_to_uuid(zUuid);
@ - %w(zCom) by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate, ".");
if( pDownloadName && blob_size(pDownloadName)==0 ){
| | | | 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
@ Control file referencing
}
hyperlink_to_uuid(zUuid);
@ - %w(zCom) by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate, ".");
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_appendf(pDownloadName, "%.10s.txt", zUuid);
}
cnt++;
}
db_finalize(&q);
}
db_prepare(&q,
"SELECT target, filename, datetime(mtime), user, src"
" FROM attachment"
" WHERE src=(SELECT uuid FROM blob WHERE rid=%d)"
" ORDER BY mtime DESC",
rid
);
while( db_step(&q)==SQLITE_ROW ){
const char *zTarget = db_column_text(&q, 0);
const char *zFilename = db_column_text(&q, 1);
const char *zDate = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
/* const char *zSrc = db_column_text(&q, 4); */
if( cnt>0 ){
@ Also attachment "%h(zFilename)" to
}else{
@ Attachment "%h(zFilename)" to
}
if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
char zShort[20];
|
| ︙ | ︙ | |||
768 769 770 771 772 773 774 |
}
}
@ added by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate,".");
cnt++;
if( pDownloadName && blob_size(pDownloadName)==0 ){
| | < | | | | | 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 |
}
}
@ added by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate,".");
cnt++;
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_append(pDownloadName, zFilename, -1);
}
}
db_finalize(&q);
if( cnt==0 ){
@ Control artifact.
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_appendf(pDownloadName, "%.10s.txt", zUuid);
}
}else if( linkToView && g.okHistory ){
@ <a href="%s(g.zBaseURL)/artifact/%S(zUuid)">[view]</a>
}
}
/*
** WEBPAGE: fdiff
**
** Two arguments, v1 and v2, are integers. Show the difference between
** the two records.
*/
void diff_page(void){
int v1 = name_to_rid(P("v1"));
int v2 = name_to_rid(P("v2"));
Blob c1, c2, diff;
login_check_credentials();
if( !g.okRead ){ login_needed(); return; }
style_header("Diff");
@ <h2>Differences From:</h2>
@ <blockquote>
|
| ︙ | ︙ | |||
927 928 929 930 931 932 933 |
style_header("Hex Artifact Content");
zUuid = db_text("?","SELECT uuid FROM blob WHERE rid=%d", rid);
@ <h2>Artifact %s(zUuid):</h2>
@ <blockquote>
blob_zero(&downloadName);
object_description(rid, 0, &downloadName);
style_submenu_element("Download", "Download",
| | | 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 |
style_header("Hex Artifact Content");
zUuid = db_text("?","SELECT uuid FROM blob WHERE rid=%d", rid);
@ <h2>Artifact %s(zUuid):</h2>
@ <blockquote>
blob_zero(&downloadName);
object_description(rid, 0, &downloadName);
style_submenu_element("Download", "Download",
"%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
@ </blockquote>
@ <hr>
content_get(rid, &content);
@ <blockquote><pre>
hexdump(&content);
@ </pre></blockquote>
style_footer();
|
| ︙ | ︙ | |||
974 975 976 977 978 979 980 |
style_header("Artifact Content");
zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
@ <h2>Artifact %s(zUuid)</h2>
@ <blockquote>
blob_zero(&downloadName);
object_description(rid, 0, &downloadName);
style_submenu_element("Download", "Download",
| | | | | | | | | | 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 |
style_header("Artifact Content");
zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
@ <h2>Artifact %s(zUuid)</h2>
@ <blockquote>
blob_zero(&downloadName);
object_description(rid, 0, &downloadName);
style_submenu_element("Download", "Download",
"%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
zMime = mimetype_from_name(blob_str(&downloadName));
if( zMime ){
if( strcmp(zMime, "text/html")==0 ){
if( P("txt") ){
style_submenu_element("Html", "Html",
"%s/artifact?name=%s", g.zTop, zUuid);
}else{
renderAsHtml = 1;
style_submenu_element("Text", "Text",
"%s/artifact?name=%s&txt=1", g.zTop, zUuid);
}
}else if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
if( P("txt") ){
style_submenu_element("Wiki", "Wiki",
"%s/artifact?name=%s", g.zTop, zUuid);
}else{
renderAsWiki = 1;
style_submenu_element("Text", "Text",
"%s/artifact?name=%s&txt=1", g.zTop, zUuid);
}
}
}
@ </blockquote>
@ <hr>
content_get(rid, &content);
if( renderAsWiki ){
wiki_convert(&content, 0, 0);
}else if( renderAsHtml ){
@ <div>
cgi_append_content(blob_buffer(&content), blob_size(&content));
@ </div>
}else{
zMime = mimetype_from_content(&content);
@ <blockquote>
if( zMime==0 ){
@ <pre>
@ %h(blob_str(&content))
@ </pre>
style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
}else if( strncmp(zMime, "image/", 6)==0 ){
@ <img src="%s(g.zBaseURL)/raw?name=%s(zUuid)&m=%s(zMime)"></img>
style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
}else{
@ <pre>
hexdump(&content);
@ </pre>
}
@ </blockquote>
}
|
| ︙ | ︙ | |||
1194 1195 1196 1197 1198 1199 1200 |
{ "#c0c0c0", "#c0c0c0" },
};
int nColor = sizeof(aColor)/sizeof(aColor[0]);
int i;
login_check_credentials();
if( !g.okWrite ){ login_needed(); return; }
| | | | 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
{ "#c0c0c0", "#c0c0c0" },
};
int nColor = sizeof(aColor)/sizeof(aColor[0]);
int i;
login_check_credentials();
if( !g.okWrite ){ login_needed(); return; }
rid = name_to_rid(P("r"));
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
" FROM event WHERE objid=%d", rid);
if( zComment==0 ) fossil_redirect_home();
if( P("cancel") ){
cgi_redirectf("ci?name=%s", zUuid);
}
zNewComment = PD("c",zComment);
zUser = db_text(0, "SELECT coalesce(euser,user)"
" FROM event WHERE objid=%d", rid);
if( zUser==0 ) fossil_redirect_home();
zNewUser = PD("u",zUser);
zDate = db_text(0, "SELECT datetime(mtime)"
|
| ︙ | ︙ | |||
1313 1314 1315 1316 1317 1318 1319 |
blob_appendf(&ctrl, "Z %b\n", &cksum);
db_begin_transaction();
g.markPrivate = content_is_private(rid);
nrid = content_put(&ctrl, 0, 0);
manifest_crosslink(nrid, &ctrl);
db_end_transaction(0);
}
| | | 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 |
blob_appendf(&ctrl, "Z %b\n", &cksum);
db_begin_transaction();
g.markPrivate = content_is_private(rid);
nrid = content_put(&ctrl, 0, 0);
manifest_crosslink(nrid, &ctrl);
db_end_transaction(0);
}
cgi_redirectf("ci?name=%s", zUuid);
}
blob_zero(&comment);
blob_append(&comment, zNewComment, -1);
zUuid[10] = 0;
style_header("Edit Check-in [%s]", zUuid);
if( P("preview") ){
Blob suffix;
|
| ︙ | ︙ | |||
1355 1356 1357 1358 1359 1360 1361 |
@ %s(blob_str(&suffix))
@ </td></tr></table>
@ </blockquote>
@ <hr>
blob_reset(&suffix);
}
@ <p>Make changes to attributes of check-in
| | | 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 |
@ %s(blob_str(&suffix))
@ </td></tr></table>
@ </blockquote>
@ <hr>
blob_reset(&suffix);
}
@ <p>Make changes to attributes of check-in
@ [<a href="ci?name=%s(zUuid)">%s(zUuid)</a>]:</p>
@ <form action="%s(g.zBaseURL)/ci_edit" method="POST">
login_insert_csrf_secret();
@ <input type="hidden" name="r" value="%d(rid)">
@ <table border="0" cellspacing="10">
@ <tr><td align="right" valign="top"><b>User:</b></td>
@ <td valign="top">
|
| ︙ | ︙ |
Changes to src/name.c.
| ︙ | ︙ | |||
278 279 280 281 282 283 284 |
** This routine is used in test routines to resolve command-line inputs
** into a rid.
*/
int name_to_rid(const char *zName){
int i;
int rid;
Blob name;
| > > > > > | | | | | | | < < | > | | | > | 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
** This routine is used in test routines to resolve command-line inputs
** into a rid.
*/
int name_to_rid(const char *zName){
int i;
int rid;
Blob name;
if( zName==0 || zName[0]==0 ) return 0;
blob_init(&name, zName, -1);
if( name_to_uuid(&name, -1) ){
blob_reset(&name);
for(i=0; zName[i] && isdigit(zName[i]); i++){}
if( zName[i]==0 ){
rid = atoi(zName);
if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){
return rid;
}
}
fossil_error(1, "no such artifact: %s", zName);
return 0;
}else{
rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &name);
blob_reset(&name);
}
return rid;
}
|
Changes to src/printf.c.
| ︙ | ︙ | |||
50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #define etHTMLIZE 16 /* Make text safe for HTML */ #define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */ #define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */ #define etFOSSILIZE 19 /* The fossil header encoding format. */ #define etPATH 20 /* Path type */ #define etWIKISTR 21 /* Wiki text rendered from a char* */ #define etWIKIBLOB 22 /* Wiki text rendered from a Blob* */ /* ** An "etByte" is an 8-bit unsigned value. */ typedef unsigned char etByte; | > | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #define etHTMLIZE 16 /* Make text safe for HTML */ #define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */ #define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */ #define etFOSSILIZE 19 /* The fossil header encoding format. */ #define etPATH 20 /* Path type */ #define etWIKISTR 21 /* Wiki text rendered from a char* */ #define etWIKIBLOB 22 /* Wiki text rendered from a Blob* */ #define etSTRINGID 23 /* String with length limit for a UUID prefix */ /* ** An "etByte" is an 8-bit unsigned value. */ typedef unsigned char etByte; |
| ︙ | ︙ | |||
99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
{ 'B', 0, 2, etBLOBSQL, 0, 0 },
{ 'w', 0, 2, etWIKISTR, 0, 0 },
{ 'W', 0, 2, etWIKIBLOB, 0, 0 },
{ 'h', 0, 4, etHTMLIZE, 0, 0 },
{ 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */
{ 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */
{ 'F', 0, 4, etFOSSILIZE, 0, 0 },
{ 'c', 0, 0, etCHARX, 0, 0 },
{ 'o', 8, 0, etRADIX, 0, 2 },
{ 'u', 10, 0, etRADIX, 0, 0 },
{ 'x', 16, 0, etRADIX, 16, 1 },
{ 'X', 16, 0, etRADIX, 0, 4 },
{ 'f', 0, 1, etFLOAT, 0, 0 },
{ 'e', 0, 1, etEXP, 30, 0 },
| > | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
{ 'B', 0, 2, etBLOBSQL, 0, 0 },
{ 'w', 0, 2, etWIKISTR, 0, 0 },
{ 'W', 0, 2, etWIKIBLOB, 0, 0 },
{ 'h', 0, 4, etHTMLIZE, 0, 0 },
{ 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */
{ 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */
{ 'F', 0, 4, etFOSSILIZE, 0, 0 },
{ 'S', 0, 4, etSTRINGID, 0, 0 },
{ 'c', 0, 0, etCHARX, 0, 0 },
{ 'o', 8, 0, etRADIX, 0, 2 },
{ 'u', 10, 0, etRADIX, 0, 0 },
{ 'x', 16, 0, etRADIX, 16, 1 },
{ 'X', 16, 0, etRADIX, 0, 4 },
{ 'f', 0, 1, etFLOAT, 0, 0 },
{ 'e', 0, 1, etEXP, 30, 0 },
|
| ︙ | ︙ | |||
573 574 575 576 577 578 579 580 581 582 583 584 585 586 |
}else{
bufpt[i]=e[i];
}
}
bufpt[length]='\0';
break;
}
case etSTRING:
case etDYNSTRING: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
bufpt = va_arg(ap,char*);
if( bufpt==0 ){
bufpt = "";
}else if( xtype==etDYNSTRING ){
| > > > > | 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
}else{
bufpt[i]=e[i];
}
}
bufpt[length]='\0';
break;
}
case etSTRINGID: {
precision = 16;
/* Fall through */
}
case etSTRING:
case etDYNSTRING: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
bufpt = va_arg(ap,char*);
if( bufpt==0 ){
bufpt = "";
}else if( xtype==etDYNSTRING ){
|
| ︙ | ︙ |
Changes to src/sync.c.
| ︙ | ︙ | |||
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
void process_sync_args(void){
const char *zUrl = 0;
const char *zPw = 0;
int urlOptional = find_option("autourl",0,0)!=0;
g.dontKeepUrl = find_option("once",0,0)!=0;
url_proxy_options();
db_find_and_open_repository(1);
if( g.argc==2 ){
zUrl = db_get("last-sync-url", 0);
zPw = db_get("last-sync-pw", 0);
}else if( g.argc==3 ){
zUrl = g.argv[2];
}
if( zUrl==0 ){
| > | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
void process_sync_args(void){
const char *zUrl = 0;
const char *zPw = 0;
int urlOptional = find_option("autourl",0,0)!=0;
g.dontKeepUrl = find_option("once",0,0)!=0;
url_proxy_options();
db_find_and_open_repository(1);
db_open_config(0);
if( g.argc==2 ){
zUrl = db_get("last-sync-url", 0);
zPw = db_get("last-sync-pw", 0);
}else if( g.argc==3 ){
zUrl = g.argv[2];
}
if( zUrl==0 ){
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
673 674 675 676 677 678 679 |
** If n= is missing, the default count is 20.
*/
void page_timeline(void){
Stmt q; /* Query used to generate the timeline */
Blob sql; /* text of SQL used to generate timeline */
Blob desc; /* Description of the timeline */
int nEntry = atoi(PD("n","20")); /* Max number of entries on timeline */
| | | | 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 |
** If n= is missing, the default count is 20.
*/
void page_timeline(void){
Stmt q; /* Query used to generate the timeline */
Blob sql; /* text of SQL used to generate timeline */
Blob desc; /* Description of the timeline */
int nEntry = atoi(PD("n","20")); /* Max number of entries on timeline */
int p_rid = name_to_rid(P("p")); /* artifact p and its parents */
int d_rid = name_to_rid(P("d")); /* artifact d and its descendants */
const char *zUser = P("u"); /* All entries by this user if not NULL */
const char *zType = PD("y","all"); /* Type of events. All if NULL */
const char *zAfter = P("a"); /* Events after this time */
const char *zBefore = P("b"); /* Events before this time */
const char *zCirca = P("c"); /* Events near this time */
const char *zTagName = P("t"); /* Show events with this tag */
const char *zSearch = P("s"); /* Search string */
|
| ︙ | ︙ |