Fossil

Check-in [a48936e834]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changes to the way new repositories are created. Also make the CGI output blob available to all modules through a function call.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a48936e834b6d383037b19d1f79f12067b09135a
User & Date: drh 2007-08-03 23:04:05.000
Context
2007-08-04
00:08
Merge in and correct the changes to the new repository initialization. Also fix other misc bugs seen while testing. check-in: f5e8b1d736 user: drh tags: trunk
2007-08-03
23:04
Changes to the way new repositories are created. Also make the CGI output blob available to all modules through a function call. check-in: a48936e834 user: drh tags: trunk
2007-08-01
21:59
Add the ability to sign manifests using GPG during a check-in. Due to a bug in the manifest parser, older versions will not be able to check-out signed manifests. check-in: e37451d9c2 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/cgi.c.
75
76
77
78
79
80
81







82
83
84
85
86
87
88

/*
** Reset the HTTP reply text to be an empty string.
*/
void cgi_reset_content(void){
  blob_reset(&cgiContent);
}








/*
** Return a pointer to the HTTP reply text.
*/
char *cgi_extract_content(int *pnAmt){
  return blob_buffer(&cgiContent);
}







>
>
>
>
>
>
>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

/*
** Reset the HTTP reply text to be an empty string.
*/
void cgi_reset_content(void){
  blob_reset(&cgiContent);
}

/*
** Return a pointer to the CGI output blob.
*/
Blob *cgi_output_blob(void){
  return &cgiContent;
}

/*
** Return a pointer to the HTTP reply text.
*/
char *cgi_extract_content(int *pnAmt){
  return blob_buffer(&cgiContent);
}
Changes to src/db.c.
662
663
664
665
666
667
668

669
670
671
672
673
674
675
676
677
678
679
680
681
682
683






684
685
686
687
688
689
690
  }
  db_create_repository(g.argv[2]);
  db_open_repository(g.argv[2]);
  db_open_config();
  db_begin_transaction();
  db_set("content-schema", CONTENT_SCHEMA);
  db_set("aux-schema", AUX_SCHEMA);

  db_multi_exec(
    "INSERT INTO config(name,value) VALUES('server-code', hex(randomblob(20)));"
    "INSERT INTO config(name,value) VALUES('project-code',hex(randomblob(20)));"
  );
  zUser = db_global_get("default-user", 0);
  if( zUser==0 ){
    zUser = getenv("USER");
  }
  if( zUser==0 ){
    zUser = "anonymous";
  }
  db_multi_exec(
     "INSERT INTO user(login, pw, cap, info)"
     "VALUES(%Q,'','s','')", zUser
  );






  user_select();
  blob_zero(&manifest);
  blob_appendf(&manifest, "C initial\\sempty\\sbaseline\n");
  zDate = db_text(0, "SELECT datetime('now')");
  zDate[10]='T';
  blob_appendf(&manifest, "D %s\n", zDate);
  blob_appendf(&manifest, "P\n");







>









|





>
>
>
>
>
>







662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
  }
  db_create_repository(g.argv[2]);
  db_open_repository(g.argv[2]);
  db_open_config();
  db_begin_transaction();
  db_set("content-schema", CONTENT_SCHEMA);
  db_set("aux-schema", AUX_SCHEMA);
  db_set_int("localauth", 1);
  db_multi_exec(
    "INSERT INTO config(name,value) VALUES('server-code', hex(randomblob(20)));"
    "INSERT INTO config(name,value) VALUES('project-code',hex(randomblob(20)));"
  );
  zUser = db_global_get("default-user", 0);
  if( zUser==0 ){
    zUser = getenv("USER");
  }
  if( zUser==0 ){
    zUser = "root";
  }
  db_multi_exec(
     "INSERT INTO user(login, pw, cap, info)"
     "VALUES(%Q,'','s','')", zUser
  );
  db_multi_exec(
     "INSERT INTO user(login,pw,cap,info)"
     "   VALUES('anonymous','anonymous','hjkorw','Anon');"
     "INSERT INTO user(login,pw,cap,info)"
     "   VALUES('nobody','','jor','Nobody');"
  );
  user_select();
  blob_zero(&manifest);
  blob_appendf(&manifest, "C initial\\sempty\\sbaseline\n");
  zDate = db_text(0, "SELECT datetime('now')");
  zDate[10]='T';
  blob_appendf(&manifest, "D %s\n", zDate);
  blob_appendf(&manifest, "P\n");