Fossil

Check-in [417dd898]
Login

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

Overview
Comment:Allow an alternative URL syntax for downloading artifacts via the /zip page. The original way is:
  http://localhost:8080/zip/fa6e9930177e84ce089b30ad768c454a012364f7.zip
which will store the artifact in the file a6e9930177e84ce089b30ad768c454a012364f7.zip. Alternatively it is now possible to download the artifact in e.g. the file fossil.zip via the URL:
  http://localhost:8080/zip/fossil.zip?rid=fa6e9930177e84ce089b30ad768c454a012364f7
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:417dd898ab0640f2472ebd248ac80e80f0ec6972
User & Date: hintze 2008-08-13 11:57:17
Context
2008-08-13
19:22
Use new alternative /zip URL syntax for the Zip archive link at the /vinfo page. Where the old filename of the ZIP archive was
  417dd898ab0640f2472ebd248ac80e80f0ec6972.zip
the new name would be:
  fossil-417dd898ab.zip
The archive's content is placed into a directory named after the Zip archive file's basename.
check-in: 3c9e5699 user: cle tags: trunk
11:57
Allow an alternative URL syntax for downloading artifacts via the /zip page. The original way is:
  http://localhost:8080/zip/fa6e9930177e84ce089b30ad768c454a012364f7.zip
which will store the artifact in the file a6e9930177e84ce089b30ad768c454a012364f7.zip. Alternatively it is now possible to download the artifact in e.g. the file fossil.zip via the URL:
  http://localhost:8080/zip/fossil.zip?rid=fa6e9930177e84ce089b30ad768c454a012364f7
check-in: 417dd898 user: hintze tags: trunk
2008-08-12
03:27
New Zip permission. This permission allow someone to download a zipped artifact via the wiki's /zip URL. It can given the user nobody to allow automatic package builder to download the sources they know from fossil-scm.org or other servers without any intervening login necessary.

As the /zip page do not expose anything, a spider should have a hard time to crawl thru the project using this URL. So IMO it does not open a break-in hole for spiders. check-in: fa6e9930 user: cle tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/zip.c.

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
** URL: /zip/RID.zip
**
** Generate a ZIP archive for the baseline.
** Return that ZIP archive as the HTTP reply content.
*/
void baseline_zip_page(void){
  int rid;
  char *zName;
  int nName;
  Blob zip;

  login_check_credentials();
  if( !g.okZip && (!g.okRead || !g.okHistory) ){ login_needed(); return; }
  zName = mprintf("%s", PD("name",""));
  nName = strlen(zName);


  for(nName=strlen(zName)-1; nName>5; nName--){
    if( zName[nName]=='.' ){
      zName[nName] = 0;
      break;
    }
  }
  rid = name_to_rid(zName);
  if( rid==0 ){
    @ Not found
    return;
  }
  if( nName>10 ) zName[10] = 0;
  zip_of_baseline(rid, &zip, zName);
  free( zName );

  cgi_set_content(&zip);
  cgi_set_content_type("application/zip");
  cgi_reply();
}







|
|






>
>






|




|


>




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
384
** URL: /zip/RID.zip
**
** Generate a ZIP archive for the baseline.
** Return that ZIP archive as the HTTP reply content.
*/
void baseline_zip_page(void){
  int rid;
  char *zName, *zRid;
  int nName, nRid;
  Blob zip;

  login_check_credentials();
  if( !g.okZip && (!g.okRead || !g.okHistory) ){ login_needed(); return; }
  zName = mprintf("%s", PD("name",""));
  nName = strlen(zName);
  zRid = mprintf("%s", PD("rid",""));
  nRid = strlen(zRid);
  for(nName=strlen(zName)-1; nName>5; nName--){
    if( zName[nName]=='.' ){
      zName[nName] = 0;
      break;
    }
  }
  rid = name_to_rid(nRid?zRid:zName);
  if( rid==0 ){
    @ Not found
    return;
  }
  if( nRid==0 && nName>10 ) zName[10] = 0;
  zip_of_baseline(rid, &zip, zName);
  free( zName );
  free( zRid );
  cgi_set_content(&zip);
  cgi_set_content_type("application/zip");
  cgi_reply();
}