Hex Artifact Content
Not logged in

Artifact 95475202fe161657e4a6e54fd8ded2b422682f02:

File src/shun.c part of check-in [02a584f7f5] - Add the --private option to the "fossil commit" command. This option creates a private branch which is never pushed. by drh on 2009-08-26 18:25:48.

0000: 2f 2a 0a 2a 2a 20 43 6f 70 79 72 69 67 68 74 20  /*.** Copyright 
0010: 28 63 29 20 32 30 30 38 20 44 2e 20 52 69 63 68  (c) 2008 D. Rich
0020: 61 72 64 20 48 69 70 70 0a 2a 2a 0a 2a 2a 20 54  ard Hipp.**.** T
0030: 68 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 66  his program is f
0040: 72 65 65 20 73 6f 66 74 77 61 72 65 3b 20 79 6f  ree software; yo
0050: 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75  u can redistribu
0060: 74 65 20 69 74 20 61 6e 64 2f 6f 72 0a 2a 2a 20  te it and/or.** 
0070: 6d 6f 64 69 66 79 20 69 74 20 75 6e 64 65 72 20  modify it under 
0080: 74 68 65 20 74 65 72 6d 73 20 6f 66 20 74 68 65  the terms of the
0090: 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62   GNU General Pub
00a0: 6c 69 63 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 76  lic.** License v
00b0: 65 72 73 69 6f 6e 20 32 20 61 73 20 70 75 62 6c  ersion 2 as publ
00c0: 69 73 68 65 64 20 62 79 20 74 68 65 20 46 72 65  ished by the Fre
00d0: 65 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64  e Software Found
00e0: 61 74 69 6f 6e 2e 0a 2a 2a 0a 2a 2a 20 54 68 69  ation..**.** Thi
00f0: 73 20 70 72 6f 67 72 61 6d 20 69 73 20 64 69 73  s program is dis
0100: 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65 20  tributed in the 
0110: 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 6c  hope that it wil
0120: 6c 20 62 65 20 75 73 65 66 75 6c 2c 0a 2a 2a 20  l be useful,.** 
0130: 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20  but WITHOUT ANY 
0140: 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75  WARRANTY; withou
0150: 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69  t even the impli
0160: 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0a 2a  ed warranty of.*
0170: 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54  * MERCHANTABILIT
0180: 59 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52  Y or FITNESS FOR
0190: 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55   A PARTICULAR PU
01a0: 52 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 20  RPOSE.  See the 
01b0: 47 4e 55 0a 2a 2a 20 47 65 6e 65 72 61 6c 20 50  GNU.** General P
01c0: 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f  ublic License fo
01d0: 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0a  r more details..
01e0: 2a 2a 20 0a 2a 2a 20 59 6f 75 20 73 68 6f 75 6c  ** .** You shoul
01f0: 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64 20  d have received 
0200: 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 4e  a copy of the GN
0210: 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63  U General Public
0220: 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 61 6c 6f 6e  .** License alon
0230: 67 20 77 69 74 68 20 74 68 69 73 20 6c 69 62 72  g with this libr
0240: 61 72 79 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69  ary; if not, wri
0250: 74 65 20 74 6f 20 74 68 65 0a 2a 2a 20 46 72 65  te to the.** Fre
0260: 65 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64  e Software Found
0270: 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 39 20  ation, Inc., 59 
0280: 54 65 6d 70 6c 65 20 50 6c 61 63 65 20 2d 20 53  Temple Place - S
0290: 75 69 74 65 20 33 33 30 2c 0a 2a 2a 20 42 6f 73  uite 330,.** Bos
02a0: 74 6f 6e 2c 20 4d 41 20 20 30 32 31 31 31 2d 31  ton, MA  02111-1
02b0: 33 30 37 2c 20 55 53 41 2e 0a 2a 2a 0a 2a 2a 20  307, USA..**.** 
02c0: 41 75 74 68 6f 72 20 63 6f 6e 74 61 63 74 20 69  Author contact i
02d0: 6e 66 6f 72 6d 61 74 69 6f 6e 3a 0a 2a 2a 20 20  nformation:.**  
02e0: 20 64 72 68 40 68 77 61 63 69 2e 63 6f 6d 0a 2a   drh@hwaci.com.*
02f0: 2a 20 20 20 68 74 74 70 3a 2f 2f 77 77 77 2e 68  *   http://www.h
0300: 77 61 63 69 2e 63 6f 6d 2f 64 72 68 2f 0a 2a 2a  waci.com/drh/.**
0310: 0a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  .***************
0320: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0330: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0340: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0350: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0360: 0a 2a 2a 0a 2a 2a 20 54 68 69 73 20 66 69 6c 65  .**.** This file
0370: 20 63 6f 6e 74 61 69 6e 73 20 63 6f 64 65 20 75   contains code u
0380: 73 65 64 20 74 6f 20 6d 61 6e 61 67 65 20 53 48  sed to manage SH
0390: 55 4e 20 74 61 62 6c 65 20 6f 66 20 74 68 65 20  UN table of the 
03a0: 72 65 70 6f 73 69 74 6f 72 79 0a 2a 2f 0a 23 69  repository.*/.#i
03b0: 6e 63 6c 75 64 65 20 22 63 6f 6e 66 69 67 2e 68  nclude "config.h
03c0: 22 0a 23 69 6e 63 6c 75 64 65 20 22 73 68 75 6e  ".#include "shun
03d0: 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 3c 61 73  .h".#include <as
03e0: 73 65 72 74 2e 68 3e 0a 0a 2f 2a 0a 2a 2a 20 52  sert.h>../*.** R
03f0: 65 74 75 72 6e 20 74 72 75 65 20 69 66 20 74 68  eturn true if th
0400: 65 20 67 69 76 65 6e 20 61 72 74 69 66 61 63 74  e given artifact
0410: 20 49 44 20 73 68 6f 75 6c 64 20 62 65 20 73 68   ID should be sh
0420: 75 6e 6e 65 64 2e 0a 2a 2f 0a 69 6e 74 20 75 75  unned..*/.int uu
0430: 69 64 5f 69 73 5f 73 68 75 6e 6e 65 64 28 63 6f  id_is_shunned(co
0440: 6e 73 74 20 63 68 61 72 20 2a 7a 55 75 69 64 29  nst char *zUuid)
0450: 7b 0a 20 20 73 74 61 74 69 63 20 53 74 6d 74 20  {.  static Stmt 
0460: 71 3b 0a 20 20 69 6e 74 20 72 63 3b 0a 20 20 69  q;.  int rc;.  i
0470: 66 28 20 7a 55 75 69 64 3d 3d 30 20 7c 7c 20 7a  f( zUuid==0 || z
0480: 55 75 69 64 5b 30 5d 3d 3d 30 20 29 20 72 65 74  Uuid[0]==0 ) ret
0490: 75 72 6e 20 30 3b 0a 20 20 64 62 5f 73 74 61 74  urn 0;.  db_stat
04a0: 69 63 5f 70 72 65 70 61 72 65 28 26 71 2c 20 22  ic_prepare(&q, "
04b0: 53 45 4c 45 43 54 20 31 20 46 52 4f 4d 20 73 68  SELECT 1 FROM sh
04c0: 75 6e 20 57 48 45 52 45 20 75 75 69 64 3d 3a 75  un WHERE uuid=:u
04d0: 75 69 64 22 29 3b 0a 20 20 64 62 5f 62 69 6e 64  uid");.  db_bind
04e0: 5f 74 65 78 74 28 26 71 2c 20 22 3a 75 75 69 64  _text(&q, ":uuid
04f0: 22 2c 20 7a 55 75 69 64 29 3b 0a 20 20 72 63 20  ", zUuid);.  rc 
0500: 3d 20 64 62 5f 73 74 65 70 28 26 71 29 3b 0a 20  = db_step(&q);. 
0510: 20 64 62 5f 72 65 73 65 74 28 26 71 29 3b 0a 20   db_reset(&q);. 
0520: 20 72 65 74 75 72 6e 20 72 63 3d 3d 53 51 4c 49   return rc==SQLI
0530: 54 45 5f 52 4f 57 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a  TE_ROW;.}../*.**
0540: 20 57 45 42 50 41 47 45 3a 20 73 68 75 6e 0a 2a   WEBPAGE: shun.*
0550: 2f 0a 76 6f 69 64 20 73 68 75 6e 5f 70 61 67 65  /.void shun_page
0560: 28 76 6f 69 64 29 7b 0a 20 20 53 74 6d 74 20 71  (void){.  Stmt q
0570: 3b 0a 20 20 69 6e 74 20 63 6e 74 20 3d 20 30 3b  ;.  int cnt = 0;
0580: 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 7a  .  const char *z
0590: 55 75 69 64 20 3d 20 50 28 22 75 75 69 64 22 29  Uuid = P("uuid")
05a0: 3b 0a 20 20 69 6e 74 20 6e 55 75 69 64 3b 0a 20  ;.  int nUuid;. 
05b0: 20 63 68 61 72 20 7a 43 61 6e 6f 6e 69 63 61 6c   char zCanonical
05c0: 5b 55 55 49 44 5f 53 49 5a 45 2b 31 5d 3b 0a 0a  [UUID_SIZE+1];..
05d0: 20 20 6c 6f 67 69 6e 5f 63 68 65 63 6b 5f 63 72    login_check_cr
05e0: 65 64 65 6e 74 69 61 6c 73 28 29 3b 0a 20 20 69  edentials();.  i
05f0: 66 28 20 21 67 2e 6f 6b 41 64 6d 69 6e 20 29 7b  f( !g.okAdmin ){
0600: 0a 20 20 20 20 6c 6f 67 69 6e 5f 6e 65 65 64 65  .    login_neede
0610: 64 28 29 3b 0a 20 20 7d 0a 20 20 69 66 28 20 50  d();.  }.  if( P
0620: 28 22 72 65 62 75 69 6c 64 22 29 20 29 7b 0a 20  ("rebuild") ){. 
0630: 20 20 20 64 62 5f 63 6c 6f 73 65 28 29 3b 0a 20     db_close();. 
0640: 20 20 20 64 62 5f 6f 70 65 6e 5f 72 65 70 6f 73     db_open_repos
0650: 69 74 6f 72 79 28 67 2e 7a 52 65 70 6f 73 69 74  itory(g.zReposit
0660: 6f 72 79 4e 61 6d 65 29 3b 0a 20 20 20 20 64 62  oryName);.    db
0670: 5f 62 65 67 69 6e 5f 74 72 61 6e 73 61 63 74 69  _begin_transacti
0680: 6f 6e 28 29 3b 0a 20 20 20 20 72 65 62 75 69 6c  on();.    rebuil
0690: 64 5f 64 62 28 30 2c 30 29 3b 0a 20 20 20 20 64  d_db(0,0);.    d
06a0: 62 5f 65 6e 64 5f 74 72 61 6e 73 61 63 74 69 6f  b_end_transactio
06b0: 6e 28 30 29 3b 0a 20 20 7d 0a 20 20 69 66 28 20  n(0);.  }.  if( 
06c0: 7a 55 75 69 64 20 29 7b 0a 20 20 20 20 6e 55 75  zUuid ){.    nUu
06d0: 69 64 20 3d 20 73 74 72 6c 65 6e 28 7a 55 75 69  id = strlen(zUui
06e0: 64 29 3b 0a 20 20 20 20 69 66 28 20 6e 55 75 69  d);.    if( nUui
06f0: 64 21 3d 34 30 20 7c 7c 20 21 76 61 6c 69 64 61  d!=40 || !valida
0700: 74 65 31 36 28 7a 55 75 69 64 2c 20 6e 55 75 69  te16(zUuid, nUui
0710: 64 29 20 29 7b 0a 20 20 20 20 20 20 7a 55 75 69  d) ){.      zUui
0720: 64 20 3d 20 30 3b 0a 20 20 20 20 7d 65 6c 73 65  d = 0;.    }else
0730: 7b 0a 20 20 20 20 20 20 6d 65 6d 63 70 79 28 7a  {.      memcpy(z
0740: 43 61 6e 6f 6e 69 63 61 6c 2c 20 7a 55 75 69 64  Canonical, zUuid
0750: 2c 20 55 55 49 44 5f 53 49 5a 45 2b 31 29 3b 0a  , UUID_SIZE+1);.
0760: 20 20 20 20 20 20 63 61 6e 6f 6e 69 63 61 6c 31        canonical1
0770: 36 28 7a 43 61 6e 6f 6e 69 63 61 6c 2c 20 55 55  6(zCanonical, UU
0780: 49 44 5f 53 49 5a 45 29 3b 0a 20 20 20 20 20 20  ID_SIZE);.      
0790: 7a 55 75 69 64 20 3d 20 7a 43 61 6e 6f 6e 69 63  zUuid = zCanonic
07a0: 61 6c 3b 0a 20 20 20 20 7d 0a 20 20 7d 0a 20 20  al;.    }.  }.  
07b0: 73 74 79 6c 65 5f 68 65 61 64 65 72 28 22 53 68  style_header("Sh
07c0: 75 6e 6e 65 64 20 41 72 74 69 66 61 63 74 73 22  unned Artifacts"
07d0: 29 3b 0a 20 20 69 66 28 20 7a 55 75 69 64 20 26  );.  if( zUuid &
07e0: 26 20 50 28 22 73 75 62 22 29 20 29 7b 0a 20 20  & P("sub") ){.  
07f0: 20 20 6c 6f 67 69 6e 5f 76 65 72 69 66 79 5f 63    login_verify_c
0800: 73 72 66 5f 73 65 63 72 65 74 28 29 3b 0a 20 20  srf_secret();.  
0810: 20 20 64 62 5f 6d 75 6c 74 69 5f 65 78 65 63 28    db_multi_exec(
0820: 22 44 45 4c 45 54 45 20 46 52 4f 4d 20 73 68 75  "DELETE FROM shu
0830: 6e 20 57 48 45 52 45 20 75 75 69 64 3d 27 25 73  n WHERE uuid='%s
0840: 27 22 2c 20 7a 55 75 69 64 29 3b 0a 20 20 20 20  '", zUuid);.    
0850: 69 66 28 20 64 62 5f 65 78 69 73 74 73 28 22 53  if( db_exists("S
0860: 45 4c 45 43 54 20 31 20 46 52 4f 4d 20 62 6c 6f  ELECT 1 FROM blo
0870: 62 20 57 48 45 52 45 20 75 75 69 64 3d 27 25 73  b WHERE uuid='%s
0880: 27 22 2c 20 7a 55 75 69 64 29 20 29 7b 0a 20 20  '", zUuid) ){.  
0890: 20 20 20 20 40 20 3c 70 3e 3c 66 6f 6e 74 20 63      @ <p><font c
08a0: 6f 6c 6f 72 3d 22 62 6c 75 65 22 3e 41 72 74 69  olor="blue">Arti
08b0: 66 61 63 74 20 0a 20 20 20 20 20 20 40 20 3c 61  fact .      @ <a
08c0: 20 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73   href="%s(g.zBas
08d0: 65 55 52 4c 29 2f 61 72 74 69 66 61 63 74 2f 25  eURL)/artifact/%
08e0: 73 28 7a 55 75 69 64 29 22 3e 25 73 28 7a 55 75  s(zUuid)">%s(zUu
08f0: 69 64 29 3c 2f 61 3e 20 69 73 20 6e 6f 0a 20 20  id)</a> is no.  
0900: 20 20 20 20 40 20 6c 6f 6e 67 65 72 20 62 65 69      @ longer bei
0910: 6e 67 20 73 68 75 6e 6e 65 64 2e 3c 2f 66 6f 6e  ng shunned.</fon
0920: 74 3e 3c 2f 70 3e 0a 20 20 20 20 7d 65 6c 73 65  t></p>.    }else
0930: 7b 0a 20 20 20 20 20 20 40 20 3c 70 3e 3c 66 6f  {.      @ <p><fo
0940: 6e 74 20 63 6f 6c 6f 72 3d 22 62 6c 75 65 22 3e  nt color="blue">
0950: 41 72 74 69 66 61 63 74 20 25 73 28 7a 55 75 69  Artifact %s(zUui
0960: 64 29 3c 2f 61 3e 20 77 69 6c 6c 20 6e 6f 20 6c  d)</a> will no l
0970: 6f 6e 67 65 72 0a 20 20 20 20 20 20 40 20 62 65  onger.      @ be
0980: 20 73 68 75 6e 6e 65 64 2e 20 20 42 75 74 20 69   shunned.  But i
0990: 74 20 64 6f 65 73 20 6e 6f 74 20 65 78 69 73 74  t does not exist
09a0: 20 69 6e 20 74 68 65 20 72 65 70 6f 73 69 74 6f   in the reposito
09b0: 72 79 2e 20 20 49 74 0a 20 20 20 20 20 20 40 20  ry.  It.      @ 
09c0: 6d 61 79 20 62 65 20 6e 65 63 65 73 73 61 72 79  may be necessary
09d0: 20 74 6f 20 72 65 62 75 69 6c 64 20 74 68 65 20   to rebuild the 
09e0: 72 65 70 6f 73 69 74 6f 72 79 20 75 73 69 6e 67  repository using
09f0: 20 74 68 65 0a 20 20 20 20 20 20 40 20 3c 62 3e   the.      @ <b>
0a00: 66 6f 73 73 69 6c 20 72 65 62 75 69 6c 64 3c 2f  fossil rebuild</
0a10: 62 3e 20 63 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20  b> command-line 
0a20: 62 65 66 6f 72 65 20 74 68 65 20 61 72 74 69 66  before the artif
0a30: 61 63 74 20 63 6f 6e 74 65 6e 74 0a 20 20 20 20  act content.    
0a40: 20 20 40 20 63 61 6e 20 70 75 6c 6c 65 64 20 69    @ can pulled i
0a50: 6e 20 66 72 6f 6d 20 6f 74 68 65 72 20 72 65 73  n from other res
0a60: 70 6f 73 69 74 6f 72 69 65 73 2e 3c 2f 66 6f 6e  positories.</fon
0a70: 74 3e 3c 2f 70 3e 0a 20 20 20 20 7d 0a 20 20 7d  t></p>.    }.  }
0a80: 0a 20 20 69 66 28 20 7a 55 75 69 64 20 26 26 20  .  if( zUuid && 
0a90: 50 28 22 61 64 64 22 29 20 29 7b 0a 20 20 20 20  P("add") ){.    
0aa0: 6c 6f 67 69 6e 5f 76 65 72 69 66 79 5f 63 73 72  login_verify_csr
0ab0: 66 5f 73 65 63 72 65 74 28 29 3b 0a 20 20 20 20  f_secret();.    
0ac0: 64 62 5f 6d 75 6c 74 69 5f 65 78 65 63 28 22 49  db_multi_exec("I
0ad0: 4e 53 45 52 54 20 4f 52 20 49 47 4e 4f 52 45 20  NSERT OR IGNORE 
0ae0: 49 4e 54 4f 20 73 68 75 6e 20 56 41 4c 55 45 53  INTO shun VALUES
0af0: 28 27 25 73 27 29 22 2c 20 7a 55 75 69 64 29 3b  ('%s')", zUuid);
0b00: 0a 20 20 20 20 40 20 3c 70 3e 3c 66 6f 6e 74 20  .    @ <p><font 
0b10: 63 6f 6c 6f 72 3d 22 62 6c 75 65 22 3e 41 72 74  color="blue">Art
0b20: 69 66 61 63 74 0a 20 20 20 20 40 20 3c 61 20 68  ifact.    @ <a h
0b30: 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 55  ref="%s(g.zBaseU
0b40: 52 4c 29 2f 61 72 74 69 66 61 63 74 2f 25 73 28  RL)/artifact/%s(
0b50: 7a 55 75 69 64 29 22 3e 25 73 28 7a 55 75 69 64  zUuid)">%s(zUuid
0b60: 29 3c 2f 61 3e 20 68 61 73 20 62 65 65 6e 0a 20  )</a> has been. 
0b70: 20 20 20 40 20 73 68 75 6e 6e 65 64 2e 20 20 49     @ shunned.  I
0b80: 74 20 77 69 6c 6c 20 6e 6f 20 6c 6f 6e 67 65 72  t will no longer
0b90: 20 62 65 20 70 75 73 68 65 64 2e 0a 20 20 20 20   be pushed..    
0ba0: 40 20 49 74 20 77 69 6c 6c 20 62 65 20 72 65 6d  @ It will be rem
0bb0: 6f 76 65 64 20 66 72 6f 6d 20 74 68 65 20 72 65  oved from the re
0bc0: 70 6f 73 69 74 6f 72 79 20 74 68 65 20 6e 65 78  pository the nex
0bd0: 74 20 74 69 6d 65 20 74 68 65 20 72 65 73 70 6f  t time the respo
0be0: 73 69 74 6f 72 79 0a 20 20 20 20 40 20 69 73 20  sitory.    @ is 
0bf0: 72 65 62 75 69 6c 74 20 75 73 69 6e 67 20 74 68  rebuilt using th
0c00: 65 20 3c 62 3e 66 6f 73 73 69 6c 20 72 65 62 75  e <b>fossil rebu
0c10: 69 6c 64 3c 2f 62 3e 20 63 6f 6d 6d 61 6e 64 2d  ild</b> command-
0c20: 6c 69 6e 65 3c 2f 66 6f 6e 74 3e 3c 2f 70 3e 0a  line</font></p>.
0c30: 20 20 7d 0a 20 20 40 20 3c 70 3e 54 68 65 20 61    }.  @ <p>The a
0c40: 72 74 69 66 61 63 74 73 20 6c 69 73 74 65 64 20  rtifacts listed 
0c50: 62 65 6c 6f 77 20 68 61 76 65 20 62 65 65 6e 20  below have been 
0c60: 73 68 75 6e 6e 65 64 20 62 79 20 74 68 69 73 20  shunned by this 
0c70: 72 65 70 6f 73 69 74 6f 72 79 2e 0a 20 20 40 20  repository..  @ 
0c80: 54 68 69 73 20 6d 65 61 6e 73 20 74 68 61 74 20  This means that 
0c90: 74 68 65 20 61 72 74 69 66 61 63 74 73 20 77 69  the artifacts wi
0ca0: 6c 6c 20 6e 6f 74 20 62 65 20 74 72 61 6e 73 6d  ll not be transm
0cb0: 69 74 74 65 64 20 6f 6e 20 61 20 70 75 73 68 20  itted on a push 
0cc0: 6e 6f 72 0a 20 20 40 20 72 65 63 69 65 76 65 64  nor.  @ recieved
0cd0: 20 6f 6e 20 61 20 70 75 6c 6c 2e 20 20 54 68 65   on a pull.  The
0ce0: 73 65 20 61 72 74 69 66 61 63 74 73 20 61 72 65  se artifacts are
0cf0: 20 62 61 6e 6e 65 64 20 66 72 6f 6d 20 74 68 65   banned from the
0d00: 20 72 65 73 70 6f 73 69 74 6f 72 79 2e 3c 2f 70   respository.</p
0d10: 3e 0a 20 20 40 20 3c 62 6c 6f 63 6b 71 75 6f 74  >.  @ <blockquot
0d20: 65 3e 0a 20 20 64 62 5f 70 72 65 70 61 72 65 28  e>.  db_prepare(
0d30: 26 71 2c 20 0a 20 20 20 20 20 22 53 45 4c 45 43  &q, .     "SELEC
0d40: 54 20 75 75 69 64 2c 20 45 58 49 53 54 53 28 53  T uuid, EXISTS(S
0d50: 45 4c 45 43 54 20 31 20 46 52 4f 4d 20 62 6c 6f  ELECT 1 FROM blo
0d60: 62 20 57 48 45 52 45 20 62 6c 6f 62 2e 75 75 69  b WHERE blob.uui
0d70: 64 3d 73 68 75 6e 2e 75 75 69 64 29 22 0a 20 20  d=shun.uuid)".  
0d80: 20 20 20 22 20 20 46 52 4f 4d 20 73 68 75 6e 20     "  FROM shun 
0d90: 4f 52 44 45 52 20 42 59 20 75 75 69 64 22 29 3b  ORDER BY uuid");
0da0: 0a 20 20 77 68 69 6c 65 28 20 64 62 5f 73 74 65  .  while( db_ste
0db0: 70 28 26 71 29 3d 3d 53 51 4c 49 54 45 5f 52 4f  p(&q)==SQLITE_RO
0dc0: 57 20 29 7b 0a 20 20 20 20 63 6f 6e 73 74 20 63  W ){.    const c
0dd0: 68 61 72 20 2a 7a 55 75 69 64 20 3d 20 64 62 5f  har *zUuid = db_
0de0: 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26 71 2c 20  column_text(&q, 
0df0: 30 29 3b 0a 20 20 20 20 69 6e 74 20 73 74 69 6c  0);.    int stil
0e00: 6c 45 78 69 73 74 73 20 3d 20 64 62 5f 63 6f 6c  lExists = db_col
0e10: 75 6d 6e 5f 69 6e 74 28 26 71 2c 20 31 29 3b 0a  umn_int(&q, 1);.
0e20: 20 20 20 20 63 6e 74 2b 2b 3b 0a 20 20 20 20 69      cnt++;.    i
0e30: 66 28 20 73 74 69 6c 6c 45 78 69 73 74 73 20 29  f( stillExists )
0e40: 7b 0a 20 20 20 20 20 20 40 20 3c 62 3e 3c 61 20  {.      @ <b><a 
0e50: 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65  href="%s(g.zBase
0e60: 55 52 4c 29 2f 61 72 74 69 66 61 63 74 2f 25 73  URL)/artifact/%s
0e70: 28 7a 55 75 69 64 29 22 3e 25 73 28 7a 55 75 69  (zUuid)">%s(zUui
0e80: 64 29 3c 2f 61 3e 3c 2f 62 3e 3c 62 72 3e 0a 20  d)</a></b><br>. 
0e90: 20 20 20 7d 65 6c 73 65 7b 0a 20 20 20 20 20 20     }else{.      
0ea0: 40 20 3c 62 3e 25 73 28 7a 55 75 69 64 29 3c 2f  @ <b>%s(zUuid)</
0eb0: 62 3e 3c 62 72 3e 0a 20 20 20 20 7d 0a 20 20 7d  b><br>.    }.  }
0ec0: 0a 20 20 69 66 28 20 63 6e 74 3d 3d 30 20 29 7b  .  if( cnt==0 ){
0ed0: 0a 20 20 20 20 40 20 3c 69 3e 6e 6f 20 61 72 74  .    @ <i>no art
0ee0: 69 66 61 63 74 73 20 61 72 65 20 73 68 75 6e 6e  ifacts are shunn
0ef0: 65 64 20 6f 6e 20 74 68 69 73 20 73 65 72 76 65  ed on this serve
0f00: 72 3c 2f 69 3e 0a 20 20 7d 0a 20 20 64 62 5f 66  r</i>.  }.  db_f
0f10: 69 6e 61 6c 69 7a 65 28 26 71 29 3b 0a 20 20 40  inalize(&q);.  @
0f20: 20 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20   </blockquote>. 
0f30: 20 40 20 3c 68 72 3e 0a 20 20 40 20 3c 61 20 6e   @ <hr>.  @ <a n
0f40: 61 6d 65 3d 22 61 64 64 73 68 75 6e 22 3e 3c 2f  ame="addshun"></
0f50: 61 3e 0a 20 20 40 20 3c 70 3e 54 6f 20 73 68 75  a>.  @ <p>To shu
0f60: 6e 20 61 6e 20 61 72 74 69 66 61 63 74 2c 20 65  n an artifact, e
0f70: 6e 74 65 72 20 69 74 73 20 61 72 74 69 66 61 63  nter its artifac
0f80: 74 20 49 44 20 28 74 68 65 20 34 30 2d 63 68 61  t ID (the 40-cha
0f90: 72 61 63 74 65 72 20 53 48 41 31 0a 20 20 40 20  racter SHA1.  @ 
0fa0: 68 61 73 68 20 6f 66 20 74 68 65 20 61 72 74 69  hash of the arti
0fb0: 66 61 63 74 29 20 69 6e 20 74 68 65 0a 20 20 40  fact) in the.  @
0fc0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 62 6f 78 20 61   following box a
0fd0: 6e 64 20 70 72 65 73 73 20 74 68 65 20 22 53 68  nd press the "Sh
0fe0: 75 6e 22 20 62 75 74 74 6f 6e 2e 20 20 54 68 69  un" button.  Thi
0ff0: 73 20 77 69 6c 6c 20 63 61 75 73 65 20 74 68 65  s will cause the
1000: 20 61 72 74 69 66 61 63 74 0a 20 20 40 20 74 6f   artifact.  @ to
1010: 20 62 65 20 72 65 6d 6f 76 65 64 20 66 72 6f 6d   be removed from
1020: 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79 20   the repository 
1030: 61 6e 64 20 77 69 6c 6c 20 70 72 65 76 65 6e 74  and will prevent
1040: 20 74 68 65 20 61 72 74 69 66 61 63 74 20 66 72   the artifact fr
1050: 6f 6d 20 62 65 69 6e 67 0a 20 20 40 20 72 65 61  om being.  @ rea
1060: 64 64 65 64 20 74 6f 20 74 68 65 20 72 65 70 6f  dded to the repo
1070: 73 69 74 6f 72 79 20 62 79 20 73 75 62 73 65 71  sitory by subseq
1080: 75 65 6e 74 20 73 79 6e 63 20 6f 70 65 72 61 74  uent sync operat
1090: 69 6f 6e 2e 3c 2f 70 3e 0a 20 20 40 0a 20 20 40  ion.</p>.  @.  @
10a0: 20 3c 70 3e 4e 6f 74 65 20 74 68 61 74 20 79 6f   <p>Note that yo
10b0: 75 20 6d 75 73 74 20 65 6e 74 65 72 20 74 68 65  u must enter the
10c0: 20 66 75 6c 6c 20 34 30 2d 63 68 61 72 61 63 74   full 40-charact
10d0: 65 72 20 61 72 74 69 66 61 63 74 20 49 44 2c 20  er artifact ID, 
10e0: 6e 6f 74 0a 20 20 40 20 61 6e 20 61 62 62 72 65  not.  @ an abbre
10f0: 76 69 61 74 69 6f 6e 20 6f 72 20 61 20 73 79 6d  viation or a sym
1100: 62 6f 6c 69 63 20 74 61 67 2e 3c 2f 70 3e 0a 20  bolic tag.</p>. 
1110: 20 40 0a 20 20 40 20 3c 70 3e 57 61 72 6e 69 6e   @.  @ <p>Warnin
1120: 67 3a 20 20 53 68 75 6e 6e 69 6e 67 20 73 68 6f  g:  Shunning sho
1130: 75 6c 64 20 6f 6e 6c 79 20 62 65 20 75 73 65 64  uld only be used
1140: 20 74 6f 20 72 65 6d 6f 76 65 20 69 6e 61 70 70   to remove inapp
1150: 72 6f 70 72 69 61 74 65 20 63 6f 6e 74 65 6e 74  ropriate content
1160: 0a 20 20 40 20 66 72 6f 6d 20 74 68 65 20 72 65  .  @ from the re
1170: 70 6f 73 69 74 6f 72 79 2e 20 20 49 6e 61 70 70  pository.  Inapp
1180: 72 6f 70 72 69 61 74 65 20 63 6f 6e 74 65 6e 74  ropriate content
1190: 20 69 6e 63 6c 75 64 65 73 20 73 75 63 68 20 74   includes such t
11a0: 68 69 6e 67 73 20 61 73 0a 20 20 40 20 73 70 61  hings as.  @ spa
11b0: 6d 20 61 64 64 65 64 20 74 6f 20 57 69 6b 69 2c  m added to Wiki,
11c0: 20 66 69 6c 65 73 20 74 68 61 74 20 76 69 6f 6c   files that viol
11d0: 61 74 65 20 63 6f 70 79 72 69 67 68 74 20 6f 72  ate copyright or
11e0: 20 70 61 74 65 6e 74 20 61 67 72 65 65 6d 65 6e   patent agreemen
11f0: 74 73 2c 0a 20 20 40 20 6f 72 20 61 72 74 69 66  ts,.  @ or artif
1200: 61 63 74 73 20 74 68 61 74 20 62 79 20 64 65 73  acts that by des
1210: 69 67 6e 20 6f 72 20 61 63 63 69 64 65 6e 74 20  ign or accident 
1220: 69 6e 74 65 72 66 65 72 65 20 77 69 74 68 20 74  interfere with t
1230: 68 65 20 70 72 6f 63 65 73 73 69 6e 67 0a 20 20  he processing.  
1240: 40 20 6f 66 20 74 68 65 20 72 65 70 6f 73 69 74  @ of the reposit
1250: 6f 72 79 2e 20 20 44 6f 20 6e 6f 74 20 73 68 75  ory.  Do not shu
1260: 6e 20 61 72 74 69 66 61 63 74 73 20 6d 65 72 65  n artifacts mere
1270: 6c 79 20 74 6f 20 72 65 6d 6f 76 65 20 74 68 65  ly to remove the
1280: 6d 20 66 72 6f 6d 0a 20 20 40 20 73 69 67 68 74  m from.  @ sight
1290: 20 2d 20 73 65 74 20 74 68 65 20 22 68 69 64 64   - set the "hidd
12a0: 65 6e 22 20 74 61 67 20 6f 6e 20 73 75 63 68 20  en" tag on such 
12b0: 61 72 74 69 66 61 63 74 73 20 69 6e 73 74 65 61  artifacts instea
12c0: 64 2e 3c 2f 70 3e 0a 20 20 40 20 0a 20 20 40 20  d.</p>.  @ .  @ 
12d0: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 40  <blockquote>.  @
12e0: 20 3c 66 6f 72 6d 20 6d 65 74 68 6f 64 3d 22 50   <form method="P
12f0: 4f 53 54 22 20 61 63 74 69 6f 6e 3d 22 25 73 28  OST" action="%s(
1300: 67 2e 7a 42 61 73 65 55 52 4c 29 2f 25 73 28 67  g.zBaseURL)/%s(g
1310: 2e 7a 50 61 74 68 29 22 3e 0a 20 20 6c 6f 67 69  .zPath)">.  logi
1320: 6e 5f 69 6e 73 65 72 74 5f 63 73 72 66 5f 73 65  n_insert_csrf_se
1330: 63 72 65 74 28 29 3b 0a 20 20 40 20 3c 69 6e 70  cret();.  @ <inp
1340: 75 74 20 74 79 70 65 3d 22 74 65 78 74 22 20 6e  ut type="text" n
1350: 61 6d 65 3d 22 75 75 69 64 22 20 76 61 6c 75 65  ame="uuid" value
1360: 3d 22 25 68 28 50 44 28 22 73 68 75 6e 22 2c 22  ="%h(PD("shun","
1370: 22 29 29 22 20 73 69 7a 65 3d 22 35 30 22 3e 0a  "))" size="50">.
1380: 20 20 40 20 3c 69 6e 70 75 74 20 74 79 70 65 3d    @ <input type=
1390: 22 73 75 62 6d 69 74 22 20 6e 61 6d 65 3d 22 61  "submit" name="a
13a0: 64 64 22 20 76 61 6c 75 65 3d 22 53 68 75 6e 22  dd" value="Shun"
13b0: 3e 0a 20 20 40 20 3c 2f 66 6f 72 6d 3e 0a 20 20  >.  @ </form>.  
13c0: 40 20 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a  @ </blockquote>.
13d0: 20 20 40 0a 20 20 40 20 3c 70 3e 45 6e 74 65 72    @.  @ <p>Enter
13e0: 20 74 68 65 20 55 55 49 44 20 6f 66 20 61 20 70   the UUID of a p
13f0: 72 65 76 69 6f 75 73 20 73 68 75 6e 6e 65 64 20  revious shunned 
1400: 61 72 74 69 66 61 63 74 20 74 6f 20 63 61 75 73  artifact to caus
1410: 65 20 69 74 20 74 6f 20 62 65 0a 20 20 40 20 61  e it to be.  @ a
1420: 63 63 65 70 74 65 64 20 61 67 61 69 6e 20 69 6e  ccepted again in
1430: 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79 2e   the repository.
1440: 20 20 54 68 65 20 61 72 74 69 66 61 63 74 20 63    The artifact c
1450: 6f 6e 74 65 6e 74 20 69 73 20 6e 6f 74 0a 20 20  ontent is not.  
1460: 40 20 72 65 73 74 6f 72 65 64 20 62 65 63 61 75  @ restored becau
1470: 73 65 20 74 68 65 20 63 6f 6e 74 65 6e 74 20 69  se the content i
1480: 73 20 75 6e 6b 6e 6f 77 6e 2e 20 20 54 68 65 20  s unknown.  The 
1490: 6f 6e 6c 79 20 63 68 61 6e 67 65 20 69 73 20 74  only change is t
14a0: 68 61 74 0a 20 20 40 20 74 68 65 20 66 6f 72 6d  hat.  @ the form
14b0: 65 72 6c 79 20 73 68 75 6e 6e 65 64 20 61 72 74  erly shunned art
14c0: 69 66 61 63 74 20 77 69 6c 6c 20 62 65 20 61 63  ifact will be ac
14d0: 63 65 70 74 65 64 20 6f 6e 20 73 75 62 73 65 71  cepted on subseq
14e0: 75 65 6e 74 20 73 79 6e 63 0a 20 20 40 20 6f 70  uent sync.  @ op
14f0: 65 72 61 74 69 6f 6e 73 2e 3c 2f 70 3e 0a 20 20  erations.</p>.  
1500: 40 0a 20 20 40 20 3c 62 6c 6f 63 6b 71 75 6f 74  @.  @ <blockquot
1510: 65 3e 0a 20 20 40 20 3c 66 6f 72 6d 20 6d 65 74  e>.  @ <form met
1520: 68 6f 64 3d 22 50 4f 53 54 22 20 61 63 74 69 6f  hod="POST" actio
1530: 6e 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 52 4c  n="%s(g.zBaseURL
1540: 29 2f 25 73 28 67 2e 7a 50 61 74 68 29 22 3e 0a  )/%s(g.zPath)">.
1550: 20 20 6c 6f 67 69 6e 5f 69 6e 73 65 72 74 5f 63    login_insert_c
1560: 73 72 66 5f 73 65 63 72 65 74 28 29 3b 0a 20 20  srf_secret();.  
1570: 40 20 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 74  @ <input type="t
1580: 65 78 74 22 20 6e 61 6d 65 3d 22 75 75 69 64 22  ext" name="uuid"
1590: 20 73 69 7a 65 3d 22 35 30 22 3e 0a 20 20 40 20   size="50">.  @ 
15a0: 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 73 75 62  <input type="sub
15b0: 6d 69 74 22 20 6e 61 6d 65 3d 22 73 75 62 22 20  mit" name="sub" 
15c0: 76 61 6c 75 65 3d 22 41 63 63 65 70 74 22 3e 0a  value="Accept">.
15d0: 20 20 40 20 3c 2f 66 6f 72 6d 3e 0a 20 20 40 20    @ </form>.  @ 
15e0: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20  </blockquote>.  
15f0: 40 0a 20 20 40 20 3c 68 72 3e 0a 20 20 40 20 3c  @.  @ <hr>.  @ <
1600: 70 3e 50 72 65 73 73 20 74 68 65 20 62 75 74 74  p>Press the butt
1610: 6f 6e 20 62 65 6c 6f 77 20 74 6f 20 72 65 62 75  on below to rebu
1620: 69 6c 64 20 74 68 65 20 72 65 73 70 6f 73 69 74  ild the resposit
1630: 6f 72 79 2e 20 20 54 68 65 20 72 65 62 75 69 6c  ory.  The rebuil
1640: 64 0a 20 20 40 20 6d 61 79 20 74 61 6b 65 20 73  d.  @ may take s
1650: 65 76 65 72 61 6c 20 73 65 63 6f 6e 64 73 2c 20  everal seconds, 
1660: 73 6f 20 62 65 20 70 61 74 69 65 6e 74 20 61 66  so be patient af
1670: 74 65 72 20 70 72 65 73 73 69 6e 67 20 74 68 65  ter pressing the
1680: 20 62 75 74 74 6f 6e 2e 3c 2f 70 3e 0a 20 20 40   button.</p>.  @
1690: 0a 20 20 40 20 3c 62 6c 6f 63 6b 71 75 6f 74 65  .  @ <blockquote
16a0: 3e 0a 20 20 40 20 3c 66 6f 72 6d 20 6d 65 74 68  >.  @ <form meth
16b0: 6f 64 3d 22 50 4f 53 54 22 20 61 63 74 69 6f 6e  od="POST" action
16c0: 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 52 4c 29  ="%s(g.zBaseURL)
16d0: 2f 25 73 28 67 2e 7a 50 61 74 68 29 22 3e 0a 20  /%s(g.zPath)">. 
16e0: 20 6c 6f 67 69 6e 5f 69 6e 73 65 72 74 5f 63 73   login_insert_cs
16f0: 72 66 5f 73 65 63 72 65 74 28 29 3b 0a 20 20 40  rf_secret();.  @
1700: 20 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 73 75   <input type="su
1710: 62 6d 69 74 22 20 6e 61 6d 65 3d 22 72 65 62 75  bmit" name="rebu
1720: 69 6c 64 22 20 76 61 6c 75 65 3d 22 52 65 62 75  ild" value="Rebu
1730: 69 6c 64 22 3e 0a 20 20 40 20 3c 2f 66 6f 72 6d  ild">.  @ </form
1740: 3e 0a 20 20 40 20 3c 2f 62 6c 6f 63 6b 71 75 6f  >.  @ </blockquo
1750: 74 65 3e 0a 20 20 40 20 20 0a 20 20 73 74 79 6c  te>.  @  .  styl
1760: 65 5f 66 6f 6f 74 65 72 28 29 3b 0a 7d 0a 0a 2f  e_footer();.}../
1770: 2a 0a 2a 2a 20 52 65 6d 6f 76 65 20 66 72 6f 6d  *.** Remove from
1780: 20 74 68 65 20 42 4c 4f 42 20 74 61 62 6c 65 20   the BLOB table 
1790: 61 6c 6c 20 61 72 74 69 66 61 63 74 73 20 74 68  all artifacts th
17a0: 61 74 20 61 72 65 20 69 6e 20 74 68 65 20 53 48  at are in the SH
17b0: 55 4e 20 74 61 62 6c 65 2e 0a 2a 2f 0a 76 6f 69  UN table..*/.voi
17c0: 64 20 73 68 75 6e 5f 61 72 74 69 66 61 63 74 73  d shun_artifacts
17d0: 28 76 6f 69 64 29 7b 0a 20 20 53 74 6d 74 20 71  (void){.  Stmt q
17e0: 3b 0a 20 20 64 62 5f 6d 75 6c 74 69 5f 65 78 65  ;.  db_multi_exe
17f0: 63 28 0a 20 20 20 20 20 22 43 52 45 41 54 45 20  c(.     "CREATE 
1800: 54 45 4d 50 20 54 41 42 4c 45 20 74 6f 73 68 75  TEMP TABLE toshu
1810: 6e 28 72 69 64 20 49 4e 54 45 47 45 52 20 50 52  n(rid INTEGER PR
1820: 49 4d 41 52 59 20 4b 45 59 29 3b 22 0a 20 20 20  IMARY KEY);".   
1830: 20 20 22 49 4e 53 45 52 54 20 49 4e 54 4f 20 74    "INSERT INTO t
1840: 6f 73 68 75 6e 20 53 45 4c 45 43 54 20 72 69 64  oshun SELECT rid
1850: 20 46 52 4f 4d 20 62 6c 6f 62 2c 20 73 68 75 6e   FROM blob, shun
1860: 20 57 48 45 52 45 20 62 6c 6f 62 2e 75 75 69 64   WHERE blob.uuid
1870: 3d 73 68 75 6e 2e 75 75 69 64 3b 22 0a 20 20 29  =shun.uuid;".  )
1880: 3b 0a 20 20 64 62 5f 70 72 65 70 61 72 65 28 26  ;.  db_prepare(&
1890: 71 2c 0a 20 20 20 20 20 22 53 45 4c 45 43 54 20  q,.     "SELECT 
18a0: 72 69 64 20 46 52 4f 4d 20 64 65 6c 74 61 20 57  rid FROM delta W
18b0: 48 45 52 45 20 73 72 63 69 64 20 49 4e 20 74 6f  HERE srcid IN to
18c0: 73 68 75 6e 22 0a 20 20 29 3b 0a 20 20 77 68 69  shun".  );.  whi
18d0: 6c 65 28 20 64 62 5f 73 74 65 70 28 26 71 29 3d  le( db_step(&q)=
18e0: 3d 53 51 4c 49 54 45 5f 52 4f 57 20 29 7b 0a 20  =SQLITE_ROW ){. 
18f0: 20 20 20 69 6e 74 20 73 72 63 69 64 20 3d 20 64     int srcid = d
1900: 62 5f 63 6f 6c 75 6d 6e 5f 69 6e 74 28 26 71 2c  b_column_int(&q,
1910: 20 30 29 3b 0a 20 20 20 20 63 6f 6e 74 65 6e 74   0);.    content
1920: 5f 75 6e 64 65 6c 74 61 28 73 72 63 69 64 29 3b  _undelta(srcid);
1930: 0a 20 20 7d 0a 20 20 64 62 5f 66 69 6e 61 6c 69  .  }.  db_finali
1940: 7a 65 28 26 71 29 3b 0a 20 20 64 62 5f 6d 75 6c  ze(&q);.  db_mul
1950: 74 69 5f 65 78 65 63 28 0a 20 20 20 20 20 22 44  ti_exec(.     "D
1960: 45 4c 45 54 45 20 46 52 4f 4d 20 64 65 6c 74 61  ELETE FROM delta
1970: 20 57 48 45 52 45 20 72 69 64 20 49 4e 20 74 6f   WHERE rid IN to
1980: 73 68 75 6e 3b 22 0a 20 20 20 20 20 22 44 45 4c  shun;".     "DEL
1990: 45 54 45 20 46 52 4f 4d 20 62 6c 6f 62 20 57 48  ETE FROM blob WH
19a0: 45 52 45 20 72 69 64 20 49 4e 20 74 6f 73 68 75  ERE rid IN toshu
19b0: 6e 3b 22 0a 20 20 20 20 20 22 44 52 4f 50 20 54  n;".     "DROP T
19c0: 41 42 4c 45 20 74 6f 73 68 75 6e 3b 22 0a 20 20  ABLE toshun;".  
19d0: 20 20 20 22 44 45 4c 45 54 45 20 46 52 4f 4d 20     "DELETE FROM 
19e0: 70 72 69 76 61 74 65 20 22 0a 20 20 20 20 20 22  private ".     "
19f0: 20 57 48 45 52 45 20 4e 4f 54 20 45 58 49 53 54   WHERE NOT EXIST
1a00: 53 20 28 53 45 4c 45 43 54 20 31 20 46 52 4f 4d  S (SELECT 1 FROM
1a10: 20 62 6c 6f 62 20 57 48 45 52 45 20 72 69 64 3d   blob WHERE rid=
1a20: 70 72 69 76 61 74 65 2e 72 69 64 29 3b 22 0a 20  private.rid);". 
1a30: 20 29 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 57 45 42   );.}../*.** WEB
1a40: 50 41 47 45 3a 20 72 63 76 66 72 6f 6d 6c 69 73  PAGE: rcvfromlis
1a50: 74 0a 2a 2a 0a 2a 2a 20 53 68 6f 77 20 61 20 6c  t.**.** Show a l
1a60: 69 73 74 69 6e 67 20 6f 66 20 52 43 56 46 52 4f  isting of RCVFRO
1a70: 4d 20 74 61 62 6c 65 20 65 6e 74 72 69 65 73 2e  M table entries.
1a80: 0a 2a 2f 0a 76 6f 69 64 20 72 63 76 66 72 6f 6d  .*/.void rcvfrom
1a90: 6c 69 73 74 5f 70 61 67 65 28 76 6f 69 64 29 7b  list_page(void){
1aa0: 0a 20 20 69 6e 74 20 6f 66 73 74 20 3d 20 61 74  .  int ofst = at
1ab0: 6f 69 28 50 44 28 22 6f 66 73 74 22 2c 22 30 22  oi(PD("ofst","0"
1ac0: 29 29 3b 0a 20 20 69 6e 74 20 63 6e 74 3b 0a 20  ));.  int cnt;. 
1ad0: 20 53 74 6d 74 20 71 3b 0a 0a 20 20 6c 6f 67 69   Stmt q;..  logi
1ae0: 6e 5f 63 68 65 63 6b 5f 63 72 65 64 65 6e 74 69  n_check_credenti
1af0: 61 6c 73 28 29 3b 0a 20 20 69 66 28 20 21 67 2e  als();.  if( !g.
1b00: 6f 6b 41 64 6d 69 6e 20 29 7b 0a 20 20 20 20 6c  okAdmin ){.    l
1b10: 6f 67 69 6e 5f 6e 65 65 64 65 64 28 29 3b 0a 20  ogin_needed();. 
1b20: 20 7d 0a 20 20 73 74 79 6c 65 5f 68 65 61 64 65   }.  style_heade
1b30: 72 28 22 43 6f 6e 74 65 6e 74 20 53 6f 75 72 63  r("Content Sourc
1b40: 65 73 22 29 3b 0a 20 20 69 66 28 20 6f 66 73 74  es");.  if( ofst
1b50: 3e 30 20 29 7b 0a 20 20 20 20 73 74 79 6c 65 5f  >0 ){.    style_
1b60: 73 75 62 6d 65 6e 75 5f 65 6c 65 6d 65 6e 74 28  submenu_element(
1b70: 22 4c 61 74 65 72 22 2c 20 22 4c 61 74 65 72 22  "Later", "Later"
1b80: 2c 20 22 72 63 76 66 72 6f 6d 6c 69 73 74 3f 6f  , "rcvfromlist?o
1b90: 66 73 74 3d 25 64 22 2c 0a 20 20 20 20 20 20 20  fst=%d",.       
1ba0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1bb0: 20 20 20 20 6f 66 73 74 3e 33 30 20 3f 20 6f 66      ofst>30 ? of
1bc0: 73 74 2d 33 30 20 3a 20 30 29 3b 0a 20 20 7d 0a  st-30 : 0);.  }.
1bd0: 20 20 64 62 5f 70 72 65 70 61 72 65 28 26 71 2c    db_prepare(&q,
1be0: 20 0a 20 20 20 20 22 53 45 4c 45 43 54 20 72 63   .    "SELECT rc
1bf0: 76 69 64 2c 20 6c 6f 67 69 6e 2c 20 64 61 74 65  vid, login, date
1c00: 74 69 6d 65 28 72 63 76 66 72 6f 6d 2e 6d 74 69  time(rcvfrom.mti
1c10: 6d 65 29 2c 20 72 63 76 66 72 6f 6d 2e 69 70 61  me), rcvfrom.ipa
1c20: 64 64 72 22 0a 20 20 20 20 22 20 20 46 52 4f 4d  ddr".    "  FROM
1c30: 20 72 63 76 66 72 6f 6d 20 4c 45 46 54 20 4a 4f   rcvfrom LEFT JO
1c40: 49 4e 20 75 73 65 72 20 55 53 49 4e 47 28 75 69  IN user USING(ui
1c50: 64 29 22 0a 20 20 20 20 22 20 4f 52 44 45 52 20  d)".    " ORDER 
1c60: 42 59 20 72 63 76 69 64 20 44 45 53 43 20 4c 49  BY rcvid DESC LI
1c70: 4d 49 54 20 33 31 20 4f 46 46 53 45 54 20 25 64  MIT 31 OFFSET %d
1c80: 22 2c 0a 20 20 20 20 6f 66 73 74 0a 20 20 29 3b  ",.    ofst.  );
1c90: 0a 20 20 40 20 3c 70 3e 57 68 65 6e 65 76 65 72  .  @ <p>Whenever
1ca0: 20 6e 65 77 20 61 72 74 69 66 61 63 74 73 20 61   new artifacts a
1cb0: 72 65 20 61 64 64 65 64 20 74 6f 20 74 68 65 20  re added to the 
1cc0: 72 65 70 6f 73 69 74 6f 72 79 2c 20 65 69 74 68  repository, eith
1cd0: 65 72 20 62 79 0a 20 20 40 20 70 75 73 68 20 6f  er by.  @ push o
1ce0: 72 20 75 73 69 6e 67 20 74 68 65 20 77 65 62 20  r using the web 
1cf0: 69 6e 74 65 72 66 61 63 65 2c 20 61 6e 20 65 6e  interface, an en
1d00: 74 72 79 20 69 73 20 6d 61 64 65 20 69 6e 20 74  try is made in t
1d10: 68 65 20 52 43 56 46 52 4f 4d 20 74 61 62 6c 65  he RCVFROM table
1d20: 0a 20 20 40 20 74 6f 20 72 65 63 6f 72 64 20 74  .  @ to record t
1d30: 68 65 20 73 6f 75 72 63 65 20 6f 66 20 74 68 61  he source of tha
1d40: 74 20 61 72 74 69 66 61 63 74 2e 20 20 54 68 69  t artifact.  Thi
1d50: 73 20 6c 6f 67 20 66 61 63 69 6c 69 74 61 74 65  s log facilitate
1d60: 73 0a 20 20 40 20 66 69 6e 64 69 6e 67 20 61 6e  s.  @ finding an
1d70: 64 20 66 69 78 69 6e 67 20 61 74 74 65 6d 70 74  d fixing attempt
1d80: 73 20 74 6f 20 69 6e 6a 65 63 74 20 69 6c 6c 69  s to inject illi
1d90: 63 69 74 20 63 6f 6e 74 65 6e 74 20 69 6e 74 6f  cit content into
1da0: 20 74 68 65 0a 20 20 40 20 72 65 70 6f 73 69 74   the.  @ reposit
1db0: 6f 72 79 2e 3c 2f 70 3e 0a 20 20 40 0a 20 20 40  ory.</p>.  @.  @
1dc0: 20 3c 70 3e 43 6c 69 63 6b 20 6f 6e 20 74 68 65   <p>Click on the
1dd0: 20 22 72 63 76 69 64 22 20 74 6f 20 73 68 6f 77   "rcvid" to show
1de0: 20 61 20 6c 69 73 74 20 6f 66 20 73 70 65 63 69   a list of speci
1df0: 66 69 63 20 61 72 74 69 66 61 63 74 73 20 72 65  fic artifacts re
1e00: 63 65 69 76 65 64 0a 20 20 40 20 62 79 20 61 20  ceived.  @ by a 
1e10: 74 72 61 6e 73 61 63 74 69 6f 6e 2e 20 20 41 66  transaction.  Af
1e20: 74 65 72 20 69 64 65 6e 74 69 66 79 69 6e 67 20  ter identifying 
1e30: 69 6c 6c 69 63 69 74 20 61 72 74 69 66 61 63 74  illicit artifact
1e40: 73 2c 20 72 65 6d 6f 76 65 20 74 68 65 6d 0a 20  s, remove them. 
1e50: 20 40 20 75 73 69 6e 67 20 74 68 65 20 22 53 68   @ using the "Sh
1e60: 75 6e 22 20 66 65 61 74 75 72 65 2e 3c 2f 70 3e  un" feature.</p>
1e70: 0a 20 20 40 0a 20 20 40 20 3c 74 61 62 6c 65 20  .  @.  @ <table 
1e80: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 30 20 63 65  cellpadding=0 ce
1e90: 6c 6c 73 70 61 63 69 6e 67 3d 30 20 62 6f 72 64  llspacing=0 bord
1ea0: 65 72 3d 30 3e 0a 20 20 40 20 3c 74 72 3e 3c 74  er=0>.  @ <tr><t
1eb0: 68 3e 72 63 76 69 64 3c 2f 74 68 3e 3c 74 68 20  h>rcvid</th><th 
1ec0: 77 69 64 74 68 3d 31 35 3e 0a 20 20 40 20 20 20  width=15>.  @   
1ed0: 20 20 3c 74 68 3e 44 61 74 65 3c 2f 74 68 3e 3c    <th>Date</th><
1ee0: 74 68 20 77 69 64 74 68 3d 31 35 3e 3c 74 68 3e  th width=15><th>
1ef0: 55 73 65 72 3c 2f 74 68 3e 0a 20 20 40 20 20 20  User</th>.  @   
1f00: 20 20 3c 74 68 20 77 69 64 74 68 3d 31 35 3e 3c    <th width=15><
1f10: 74 68 3e 49 50 26 6e 62 73 70 3b 41 64 64 72 65  th>IP&nbsp;Addre
1f20: 73 73 3c 2f 74 68 3e 3c 2f 74 72 3e 0a 20 20 63  ss</th></tr>.  c
1f30: 6e 74 20 3d 20 30 3b 0a 20 20 77 68 69 6c 65 28  nt = 0;.  while(
1f40: 20 64 62 5f 73 74 65 70 28 26 71 29 3d 3d 53 51   db_step(&q)==SQ
1f50: 4c 49 54 45 5f 52 4f 57 20 29 7b 0a 20 20 20 20  LITE_ROW ){.    
1f60: 69 6e 74 20 72 63 76 69 64 20 3d 20 64 62 5f 63  int rcvid = db_c
1f70: 6f 6c 75 6d 6e 5f 69 6e 74 28 26 71 2c 20 30 29  olumn_int(&q, 0)
1f80: 3b 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72  ;.    const char
1f90: 20 2a 7a 55 73 65 72 20 3d 20 64 62 5f 63 6f 6c   *zUser = db_col
1fa0: 75 6d 6e 5f 74 65 78 74 28 26 71 2c 20 31 29 3b  umn_text(&q, 1);
1fb0: 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20  .    const char 
1fc0: 2a 7a 44 61 74 65 20 3d 20 64 62 5f 63 6f 6c 75  *zDate = db_colu
1fd0: 6d 6e 5f 74 65 78 74 28 26 71 2c 20 32 29 3b 0a  mn_text(&q, 2);.
1fe0: 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a      const char *
1ff0: 7a 49 70 41 64 64 72 20 3d 20 64 62 5f 63 6f 6c  zIpAddr = db_col
2000: 75 6d 6e 5f 74 65 78 74 28 26 71 2c 20 33 29 3b  umn_text(&q, 3);
2010: 0a 20 20 20 20 69 66 28 20 63 6e 74 3d 3d 33 30  .    if( cnt==30
2020: 20 29 7b 0a 20 20 20 20 20 20 73 74 79 6c 65 5f   ){.      style_
2030: 73 75 62 6d 65 6e 75 5f 65 6c 65 6d 65 6e 74 28  submenu_element(
2040: 22 45 61 72 6c 69 65 72 22 2c 20 22 45 61 72 6c  "Earlier", "Earl
2050: 69 65 72 22 2c 0a 20 20 20 20 20 20 20 20 20 22  ier",.         "
2060: 72 63 76 66 72 6f 6d 6c 69 73 74 3f 6f 66 73 74  rcvfromlist?ofst
2070: 3d 25 64 22 2c 20 6f 66 73 74 2b 33 30 29 3b 0a  =%d", ofst+30);.
2080: 20 20 20 20 7d 65 6c 73 65 7b 0a 20 20 20 20 20      }else{.     
2090: 20 63 6e 74 2b 2b 3b 0a 20 20 20 20 20 20 40 20   cnt++;.      @ 
20a0: 3c 74 72 3e 0a 20 20 20 20 20 20 40 20 3c 74 64  <tr>.      @ <td
20b0: 3e 3c 61 20 68 72 65 66 3d 22 72 63 76 66 72 6f  ><a href="rcvfro
20c0: 6d 3f 72 63 76 69 64 3d 25 64 28 72 63 76 69 64  m?rcvid=%d(rcvid
20d0: 29 22 3e 25 64 28 72 63 76 69 64 29 3c 2f 61 3e  )">%d(rcvid)</a>
20e0: 3c 2f 74 64 3e 3c 74 64 3e 0a 20 20 20 20 20 20  </td><td>.      
20f0: 40 20 3c 74 64 3e 25 73 28 7a 44 61 74 65 29 3c  @ <td>%s(zDate)<
2100: 2f 74 64 3e 3c 74 64 3e 0a 20 20 20 20 20 20 40  /td><td>.      @
2110: 20 3c 74 64 3e 25 68 28 7a 55 73 65 72 29 3c 2f   <td>%h(zUser)</
2120: 74 64 3e 3c 74 64 3e 0a 20 20 20 20 20 20 40 20  td><td>.      @ 
2130: 3c 74 64 3e 26 6e 62 73 70 3b 25 73 28 7a 49 70  <td>&nbsp;%s(zIp
2140: 41 64 64 72 29 26 6e 62 73 70 3c 2f 74 64 3e 0a  Addr)&nbsp</td>.
2150: 20 20 20 20 20 20 40 20 3c 2f 74 72 3e 0a 20 20        @ </tr>.  
2160: 20 20 7d 0a 20 20 7d 0a 20 20 64 62 5f 66 69 6e    }.  }.  db_fin
2170: 61 6c 69 7a 65 28 26 71 29 3b 0a 20 20 40 20 3c  alize(&q);.  @ <
2180: 2f 74 61 62 6c 65 3e 0a 20 20 73 74 79 6c 65 5f  /table>.  style_
2190: 66 6f 6f 74 65 72 28 29 3b 0a 7d 0a 0a 2f 2a 0a  footer();.}../*.
21a0: 2a 2a 20 57 45 42 50 41 47 45 3a 20 72 63 76 66  ** WEBPAGE: rcvf
21b0: 72 6f 6d 0a 2a 2a 0a 2a 2a 20 53 68 6f 77 20 61  rom.**.** Show a
21c0: 20 73 69 6e 67 6c 65 20 52 43 56 46 52 4f 4d 20   single RCVFROM 
21d0: 74 61 62 6c 65 20 65 6e 74 72 79 2e 0a 2a 2f 0a  table entry..*/.
21e0: 76 6f 69 64 20 72 63 76 66 72 6f 6d 5f 70 61 67  void rcvfrom_pag
21f0: 65 28 76 6f 69 64 29 7b 0a 20 20 69 6e 74 20 72  e(void){.  int r
2200: 63 76 69 64 20 3d 20 61 74 6f 69 28 50 44 28 22  cvid = atoi(PD("
2210: 72 63 76 69 64 22 2c 22 30 22 29 29 3b 0a 20 20  rcvid","0"));.  
2220: 53 74 6d 74 20 71 3b 0a 0a 20 20 6c 6f 67 69 6e  Stmt q;..  login
2230: 5f 63 68 65 63 6b 5f 63 72 65 64 65 6e 74 69 61  _check_credentia
2240: 6c 73 28 29 3b 0a 20 20 69 66 28 20 21 67 2e 6f  ls();.  if( !g.o
2250: 6b 41 64 6d 69 6e 20 29 7b 0a 20 20 20 20 6c 6f  kAdmin ){.    lo
2260: 67 69 6e 5f 6e 65 65 64 65 64 28 29 3b 0a 20 20  gin_needed();.  
2270: 7d 0a 20 20 73 74 79 6c 65 5f 68 65 61 64 65 72  }.  style_header
2280: 28 22 43 6f 6e 74 65 6e 74 20 53 6f 75 72 63 65  ("Content Source
2290: 20 25 64 22 2c 20 72 63 76 69 64 29 3b 0a 20 20   %d", rcvid);.  
22a0: 64 62 5f 70 72 65 70 61 72 65 28 26 71 2c 20 0a  db_prepare(&q, .
22b0: 20 20 20 20 22 53 45 4c 45 43 54 20 6c 6f 67 69      "SELECT logi
22c0: 6e 2c 20 64 61 74 65 74 69 6d 65 28 72 63 76 66  n, datetime(rcvf
22d0: 72 6f 6d 2e 6d 74 69 6d 65 29 2c 20 72 63 76 66  rom.mtime), rcvf
22e0: 72 6f 6d 2e 69 70 61 64 64 72 22 0a 20 20 20 20  rom.ipaddr".    
22f0: 22 20 20 46 52 4f 4d 20 72 63 76 66 72 6f 6d 20  "  FROM rcvfrom 
2300: 4c 45 46 54 20 4a 4f 49 4e 20 75 73 65 72 20 55  LEFT JOIN user U
2310: 53 49 4e 47 28 75 69 64 29 22 0a 20 20 20 20 22  SING(uid)".    "
2320: 20 57 48 45 52 45 20 72 63 76 69 64 3d 25 64 22   WHERE rcvid=%d"
2330: 2c 0a 20 20 20 20 72 63 76 69 64 0a 20 20 29 3b  ,.    rcvid.  );
2340: 0a 20 20 40 20 3c 74 61 62 6c 65 20 63 65 6c 6c  .  @ <table cell
2350: 73 70 61 63 69 6e 67 3d 31 35 20 63 65 6c 6c 70  spacing=15 cellp
2360: 61 64 64 69 6e 67 3d 30 20 62 6f 72 64 65 72 3d  adding=0 border=
2370: 30 3e 0a 20 20 40 20 3c 74 72 3e 3c 74 64 20 76  0>.  @ <tr><td v
2380: 61 6c 69 67 6e 3d 22 74 6f 70 22 20 61 6c 69 67  align="top" alig
2390: 6e 3d 22 72 69 67 68 74 22 3e 3c 62 3e 72 63 76  n="right"><b>rcv
23a0: 69 64 3a 3c 2f 62 3e 3c 2f 74 64 3e 0a 20 20 40  id:</b></td>.  @
23b0: 20 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70   <td valign="top
23c0: 22 3e 25 64 28 72 63 76 69 64 29 3c 2f 74 64 3e  ">%d(rcvid)</td>
23d0: 3c 2f 74 72 3e 0a 20 20 69 66 28 20 64 62 5f 73  </tr>.  if( db_s
23e0: 74 65 70 28 26 71 29 3d 3d 53 51 4c 49 54 45 5f  tep(&q)==SQLITE_
23f0: 52 4f 57 20 29 7b 0a 20 20 20 20 63 6f 6e 73 74  ROW ){.    const
2400: 20 63 68 61 72 20 2a 7a 55 73 65 72 20 3d 20 64   char *zUser = d
2410: 62 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26 71  b_column_text(&q
2420: 2c 20 30 29 3b 0a 20 20 20 20 63 6f 6e 73 74 20  , 0);.    const 
2430: 63 68 61 72 20 2a 7a 44 61 74 65 20 3d 20 64 62  char *zDate = db
2440: 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26 71 2c  _column_text(&q,
2450: 20 31 29 3b 0a 20 20 20 20 63 6f 6e 73 74 20 63   1);.    const c
2460: 68 61 72 20 2a 7a 49 70 41 64 64 72 20 3d 20 64  har *zIpAddr = d
2470: 62 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26 71  b_column_text(&q
2480: 2c 20 32 29 3b 0a 20 20 20 20 40 20 3c 74 72 3e  , 2);.    @ <tr>
2490: 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70 22  <td valign="top"
24a0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 3c   align="right"><
24b0: 62 3e 55 73 65 72 3a 3c 2f 62 3e 3c 2f 74 64 3e  b>User:</b></td>
24c0: 0a 20 20 20 20 40 20 3c 74 64 20 76 61 6c 69 67  .    @ <td valig
24d0: 6e 3d 22 74 6f 70 22 3e 25 73 28 7a 55 73 65 72  n="top">%s(zUser
24e0: 29 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 20 20 20 20  )</td></tr>.    
24f0: 40 20 3c 74 72 3e 3c 74 64 20 76 61 6c 69 67 6e  @ <tr><td valign
2500: 3d 22 74 6f 70 22 20 61 6c 69 67 6e 3d 22 72 69  ="top" align="ri
2510: 67 68 74 22 3e 3c 62 3e 44 61 74 65 3a 3c 2f 62  ght"><b>Date:</b
2520: 3e 3c 2f 74 64 3e 0a 20 20 20 20 40 20 3c 74 64  ></td>.    @ <td
2530: 20 76 61 6c 69 67 6e 3d 22 74 6f 70 22 3e 25 73   valign="top">%s
2540: 28 7a 44 61 74 65 29 3c 2f 74 64 3e 3c 2f 74 72  (zDate)</td></tr
2550: 3e 0a 20 20 20 20 40 20 3c 74 72 3e 3c 74 64 20  >.    @ <tr><td 
2560: 76 61 6c 69 67 6e 3d 22 74 6f 70 22 20 61 6c 69  valign="top" ali
2570: 67 6e 3d 22 72 69 67 68 74 22 3e 3c 62 3e 49 50  gn="right"><b>IP
2580: 26 6e 62 73 70 3b 41 64 64 72 65 73 73 3a 3c 2f  &nbsp;Address:</
2590: 62 3e 3c 2f 74 64 3e 0a 20 20 20 20 40 20 3c 74  b></td>.    @ <t
25a0: 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70 22 3e 25  d valign="top">%
25b0: 73 28 7a 49 70 41 64 64 72 29 3c 2f 74 64 3e 3c  s(zIpAddr)</td><
25c0: 2f 74 72 3e 0a 20 20 7d 0a 20 20 64 62 5f 66 69  /tr>.  }.  db_fi
25d0: 6e 61 6c 69 7a 65 28 26 71 29 3b 0a 20 20 64 62  nalize(&q);.  db
25e0: 5f 70 72 65 70 61 72 65 28 26 71 2c 0a 20 20 20  _prepare(&q,.   
25f0: 20 22 53 45 4c 45 43 54 20 72 69 64 2c 20 75 75   "SELECT rid, uu
2600: 69 64 2c 20 73 69 7a 65 20 46 52 4f 4d 20 62 6c  id, size FROM bl
2610: 6f 62 20 57 48 45 52 45 20 72 63 76 69 64 3d 25  ob WHERE rcvid=%
2620: 64 22 2c 20 72 63 76 69 64 0a 20 20 29 3b 0a 20  d", rcvid.  );. 
2630: 20 40 20 3c 74 72 3e 3c 74 64 20 76 61 6c 69 67   @ <tr><td valig
2640: 6e 3d 22 74 6f 70 22 20 61 6c 69 67 6e 3d 22 72  n="top" align="r
2650: 69 67 68 74 22 3e 3c 62 3e 41 72 74 69 66 61 63  ight"><b>Artifac
2660: 74 73 3a 3c 2f 62 3e 3c 2f 74 64 3e 0a 20 20 40  ts:</b></td>.  @
2670: 20 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70   <td valign="top
2680: 22 3e 0a 20 20 77 68 69 6c 65 28 20 64 62 5f 73  ">.  while( db_s
2690: 74 65 70 28 26 71 29 3d 3d 53 51 4c 49 54 45 5f  tep(&q)==SQLITE_
26a0: 52 4f 57 20 29 7b 0a 20 20 20 20 69 6e 74 20 72  ROW ){.    int r
26b0: 69 64 20 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f 69  id = db_column_i
26c0: 6e 74 28 26 71 2c 20 30 29 3b 0a 20 20 20 20 63  nt(&q, 0);.    c
26d0: 6f 6e 73 74 20 63 68 61 72 20 2a 7a 55 75 69 64  onst char *zUuid
26e0: 20 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f 74 65 78   = db_column_tex
26f0: 74 28 26 71 2c 20 31 29 3b 0a 20 20 20 20 69 6e  t(&q, 1);.    in
2700: 74 20 73 69 7a 65 20 3d 20 64 62 5f 63 6f 6c 75  t size = db_colu
2710: 6d 6e 5f 69 6e 74 28 26 71 2c 20 32 29 3b 0a 20  mn_int(&q, 2);. 
2720: 20 20 20 40 20 3c 61 20 68 72 65 66 3d 22 25 73     @ <a href="%s
2730: 28 67 2e 7a 42 61 73 65 55 52 4c 29 2f 69 6e 66  (g.zBaseURL)/inf
2740: 6f 2f 25 73 28 7a 55 75 69 64 29 22 3e 25 73 28  o/%s(zUuid)">%s(
2750: 7a 55 75 69 64 29 3c 2f 61 3e 0a 20 20 20 20 40  zUuid)</a>.    @
2760: 20 28 72 69 64 3a 20 25 64 28 72 69 64 29 2c 20   (rid: %d(rid), 
2770: 73 69 7a 65 3a 20 25 64 28 73 69 7a 65 29 29 3c  size: %d(size))<
2780: 62 72 3e 0a 20 20 7d 0a 20 20 40 20 3c 2f 74 64  br>.  }.  @ </td
2790: 3e 3c 2f 74 72 3e 0a 20 20 40 20 3c 2f 74 61 62  ></tr>.  @ </tab
27a0: 6c 65 3e 0a 7d 0a                                le>.}.