Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2013-01-12 15:59:22 +0400
committerTon Roosendaal <ton@blender.org>2013-01-12 15:59:22 +0400
commit129fb516f43126497bbc7cc96a032b51196b5b2d (patch)
tree10571ed72fbb662148d9d01d0a19cacc5fc57ebb /source/blender/blenkernel/intern/packedFile.c
parent7db00f082603ea93384a627399e9d99ad02f8063 (diff)
Security fix:
"Pack Blender Libraries" now first does a check if the .blend files are all used with relative paths. This to prevent bad things happen on unpacking.
Diffstat (limited to 'source/blender/blenkernel/intern/packedFile.c')
-rw-r--r--source/blender/blenkernel/intern/packedFile.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index 9f77094994d..9fab052f80c 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -553,7 +553,7 @@ int unpackLibraries(Main *bmain, ReportList *reports)
if (newname != NULL) {
ret_value = RET_OK;
- printf("Saved .blend library: %s\n", newname);
+ printf("Unpacked .blend library: %s\n", newname);
freePackedFile(lib->packedfile);
lib->packedfile = NULL;
@@ -570,6 +570,16 @@ void packLibraries(Main *bmain, ReportList *reports)
{
Library *lib;
+ /* test for relativenss */
+ for (lib = bmain->library.first; lib; lib = lib->id.next)
+ if (0 == BLI_path_is_rel(lib->name))
+ break;
+
+ if (lib) {
+ BKE_reportf(reports, RPT_ERROR, "Cannot pack absolute file: '%s'", lib->name);
+ return;
+ }
+
for (lib = bmain->library.first; lib; lib = lib->id.next)
if (lib->packedfile == NULL)
lib->packedfile = newPackedFile(reports, lib->name, bmain->name);