Fossil

Check-in [141c3179]
Login

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

Overview
Comment:Do not allow the current repository to be added to the set of files for a repository. Ticket [8e9136e8].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 141c31792b66447284b5cc668844fa8b1c85ee4a
User & Date: drh 2008-07-23 17:36:39
References
2008-07-23
17:39 Fixed ticket [8e9136e8]: Fossil allow to add own repository to itself (similar to bug c7b35be88) plus 4 other changes artifact: c76ef5c9 user: drh
Context
2008-07-23
20:57
Make sure new artifacts are entered into the unclustered table. Ticket [4b72e10dca]. check-in: 1f8d2501 user: drh tags: trunk
17:36
Do not allow the current repository to be added to the set of files for a repository. Ticket [8e9136e8]. check-in: 141c3179 user: drh tags: trunk
13:01
The "extra" and "clean" commands ignore the repository file if the repository happens to be within the check-out. Ticket [c7b35be88]. check-in: 2ecc407d user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/add.c.

36
37
38
39
40
41
42

43
44
45
46
47
48
49



50
51
52
53
54
55
56
..
63
64
65
66
67
68
69

70
71
72
73
74
75
76
**
** Make arrangements to add one or more files to the current checkout 
** at the next commit.
*/
void add_cmd(void){
  int i;
  int vid;


  db_must_be_within_tree();
  vid = db_lget_int("checkout",0);
  if( vid==0 ){
    fossil_panic("no checkout to add to");
  }
  db_begin_transaction();



  for(i=2; i<g.argc; i++){
    char *zName;
    char *zPath;
    Blob pathname;
    int isDir;

    zName = mprintf("%/", g.argv[i]);
................................................................................
      fossil_fatal("cannot open %s", zName);
    }
    file_tree_name(zName, &pathname, 1);
    zPath = blob_str(&pathname);
    if( strcmp(zPath, "manifest")==0
     || strcmp(zPath, "_FOSSIL_")==0
     || strcmp(zPath, "manifest.uuid")==0

    ){
      fossil_warning("cannot add %s", zPath);
    }else{
      if( !file_is_simple_pathname(zPath) ){
        fossil_fatal("filename contains illegal characters: %s", zPath);
      }
      if( db_exists("SELECT 1 FROM vfile WHERE pathname=%Q", zPath) ){







>







>
>
>







 







>







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
..
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
**
** Make arrangements to add one or more files to the current checkout 
** at the next commit.
*/
void add_cmd(void){
  int i;
  int vid;
  Blob repo;

  db_must_be_within_tree();
  vid = db_lget_int("checkout",0);
  if( vid==0 ){
    fossil_panic("no checkout to add to");
  }
  db_begin_transaction();
  if( !file_tree_name(g.zRepositoryName, &repo, 0) ){
    blob_zero(&repo);
  }
  for(i=2; i<g.argc; i++){
    char *zName;
    char *zPath;
    Blob pathname;
    int isDir;

    zName = mprintf("%/", g.argv[i]);
................................................................................
      fossil_fatal("cannot open %s", zName);
    }
    file_tree_name(zName, &pathname, 1);
    zPath = blob_str(&pathname);
    if( strcmp(zPath, "manifest")==0
     || strcmp(zPath, "_FOSSIL_")==0
     || strcmp(zPath, "manifest.uuid")==0
     || blob_compare(&pathname, &repo)==0
    ){
      fossil_warning("cannot add %s", zPath);
    }else{
      if( !file_is_simple_pathname(zPath) ){
        fossil_fatal("filename contains illegal characters: %s", zPath);
      }
      if( db_exists("SELECT 1 FROM vfile WHERE pathname=%Q", zPath) ){