Check-in [da9d38e2c3]
Not logged in
Overview

SHA1 Hash:da9d38e2c38f5271e1abbdee4a771a09be3a1812
Date: 2007-10-15 20:45:11
User: drh
Comment:Fix the "add" command is that it does not allow users to accidently add files that contain shell wildcard characters.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/add.c from [7e200015f8] to [ce8cf09189].

@@ -63,10 +63,13 @@
     }
     file_tree_name(zName, &pathname);
     zPath = blob_str(&pathname);
     if( strcmp(zPath, "manifest")==0 || strcmp(zPath, "_FOSSIL_")==0 ){
       fossil_fatal("cannot add %s", zPath);
+    }
+    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) ){
       db_multi_exec("UPDATE vfile SET deleted=0 WHERE pathname=%Q", zPath);
     }else{
       db_multi_exec(