From 2a4833986b928f5ed384968764ec95784a563aeb Mon Sep 17 00:00:00 2001 From: Jochen Schmitt Date: Jan 13 2010 19:18:14 +0000 Subject: Add forgotten patch --- diff --git a/blender-2.46rc3-cve-2008-1103-1.patch b/blender-2.46rc3-cve-2008-1103-1.patch deleted file mode 100644 index c45a811..0000000 --- a/blender-2.46rc3-cve-2008-1103-1.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up blender/source/blender/blenkernel/intern/blender.c.cve blender/source/blender/blenkernel/intern/blender.c ---- blender/source/blender/blenkernel/intern/blender.c.cve 2008-05-07 17:37:52.000000000 +0200 -+++ blender/source/blender/blenkernel/intern/blender.c 2008-05-07 17:38:22.000000000 +0200 -@@ -716,7 +716,7 @@ void BKE_undo_save_quit(void) - - BLI_make_file_string("/", str, btempdir, "quit.blend"); - -- file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666); -+ file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC+O_EXCL, 0666); - if(file == -1) { - error("Unable to save %s, check you have permissions", str); - return; diff --git a/blender-2.48a-cve-2008-4863.patch b/blender-2.48a-cve-2008-4863.patch deleted file mode 100644 index 4fa3c6f..0000000 --- a/blender-2.48a-cve-2008-4863.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up blender-2.48a/source/blender/python/BPY_interface.c.cve blender-2.48a/source/blender/python/BPY_interface.c ---- blender-2.48a/source/blender/python/BPY_interface.c.cve 2008-11-03 17:31:19.000000000 +0100 -+++ blender-2.48a/source/blender/python/BPY_interface.c 2008-11-03 17:35:01.000000000 +0100 -@@ -225,6 +225,11 @@ void BPY_start_python( int argc, char ** - Py_Initialize( ); - - PySys_SetArgv( argc_copy, argv_copy ); -+ -+ /* Sanitize sys.path to prevent relative imports loading modules in -+ the current working directory */ -+ PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)"); -+ - /* Initialize thread support (also acquires lock) */ - PyEval_InitThreads(); - diff --git a/blender-2.49b-cve.patch b/blender-2.49b-cve.patch new file mode 100644 index 0000000..5141756 --- /dev/null +++ b/blender-2.49b-cve.patch @@ -0,0 +1,61 @@ +diff -up blender-2.49b/source/blender/blenkernel/intern/blender.c.cve blender-2.49b/source/blender/blenkernel/intern/blender.c +--- blender-2.49b/source/blender/blenkernel/intern/blender.c.cve 2009-09-01 17:21:17.000000000 +0200 ++++ blender-2.49b/source/blender/blenkernel/intern/blender.c 2010-01-13 17:32:11.312632711 +0100 +@@ -41,6 +41,7 @@ + #define write _write + #endif + ++#include + #include + #include + #include +@@ -753,7 +754,7 @@ void BKE_undo_save_quit(void) + { + UndoElem *uel; + MemFileChunk *chunk; +- int file; ++ int file = -1; + char str[FILE_MAXDIR+FILE_MAXFILE]; + + if( (U.uiflag & USER_GLOBALUNDO)==0) return; +@@ -767,12 +768,20 @@ void BKE_undo_save_quit(void) + /* no undo state to save */ + if(undobase.first==undobase.last) return; + +- BLI_make_file_string("/", str, btempdir, "quit.blend"); ++ BLI_make_file_string("/", str, BLI_gethome(), ".blender/quit.blend"); + +- file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666); +- if(file == -1) { +- error("Unable to save %s, check you have permissions", str); +- return; ++ int flags = O_BINARY+O_WRONLY+O_TRUNC+O_EXCL+O_CREAT; ++ ++ while(file == -1) { ++ file = open(str,flags,0666); ++ if(file == -1) { ++ if(errno == EEXIST) { ++ flags ^= O_CREAT; ++ } else { ++ error("Unable to save %s, check you have permissions", str); ++ return; ++ } ++ } + } + + chunk= uel->memfile.chunks.first; +diff -up blender-2.49b/source/blender/python/BPY_interface.c.cve blender-2.49b/source/blender/python/BPY_interface.c +--- blender-2.49b/source/blender/python/BPY_interface.c.cve 2009-09-01 17:21:12.000000000 +0200 ++++ blender-2.49b/source/blender/python/BPY_interface.c 2010-01-13 17:08:19.567752630 +0100 +@@ -236,6 +236,11 @@ void BPY_start_python( int argc, char ** + Py_Initialize( ); + + PySys_SetArgv( argc_copy, argv_copy ); ++ ++ /* Sanitize sys.path to prevent relative imports loading modules in ++ the current working directory */ ++ PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)"); ++ + /* Initialize thread support (also acquires lock) */ + PyEval_InitThreads(); + diff --git a/blender.spec b/blender.spec index b826983..11f9b94 100644 --- a/blender.spec +++ b/blender.spec @@ -5,7 +5,7 @@ Name: blender Version: 2.49b -Release: 4%{?dist} +Release: 5%{?dist} Summary: 3D modeling, animation, rendering and post-production @@ -244,6 +244,9 @@ fi || : %{_bindir}/blenderplayer.bin %changelog +* Wed Jan 13 2010 Jochen Schmitt - 2.49b-5 +- Add forgotten patch + * Wed Jan 13 2010 Jochen Schmitt 2.49b-4 - Fix O_CREAT issue on existing quit.blend file (#553959) - Move quit.blend to ~/.blender