CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 08/01/05 00:08:47
Modified files: . : ChangeLog server : URLAccessManager.cpp Log message: * server/URLAccessManager.cpp (local_check): don't use base url (-U) to tell apart local movies from remote ones, as base url is web-author-forgeable ('base' attribute). Use non web-author-forgeable virtual url of starting movie instead (-u). Skip the "forbid load of local resources by network movie" check if no starting movie exists yet (to allow loading a local file pretending it was a remote one). Should fix bug #21930 and allow more flexibility. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5297&r2=1.5298 http://cvs.savannah.gnu.org/viewcvs/gnash/server/URLAccessManager.cpp?cvsroot=gnash&r1=1.21&r2=1.22 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5297 retrieving revision 1.5298 diff -u -b -r1.5297 -r1.5298 --- ChangeLog 4 Jan 2008 23:57:10 -0000 1.5297 +++ ChangeLog 5 Jan 2008 00:08:46 -0000 1.5298 @@ -1,5 +1,14 @@ 2008-01-04 Sandro Santilli <[EMAIL PROTECTED]> + * server/URLAccessManager.cpp (local_check): don't use base url + (-U) to tell apart local movies from remote ones, as base url + is web-author-forgeable ('base' attribute). + Use non web-author-forgeable virtual url of starting movie + instead (-u). + Skip the "forbid load of local resources by network movie" + check if no starting movie exists yet (to allow loading a local + file pretending it was a remote one). + Should fix bug #21930 and allow more flexibility. * Makefile.am: install plugins under /tmp/ during 'distcheck'. (we can do something a bit smarter, but it's a start). * doc/C/usermanual/installation/custompath_configuration.xml: Index: server/URLAccessManager.cpp =================================================================== RCS file: /sources/gnash/gnash/server/URLAccessManager.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -b -r1.21 -r1.22 --- server/URLAccessManager.cpp 23 Oct 2007 10:21:07 -0000 1.21 +++ server/URLAccessManager.cpp 5 Jan 2008 00:08:47 -0000 1.22 @@ -23,7 +23,8 @@ #include "URL.h" #include "log.h" #include "StringPredicates.h" // for case-insensitive host match -#include "gnash.h" // for get_base_url +//#include "gnash.h" // for get_base_url +#include "VM.h" // for getRoot().getRootMovie() #include "rc.h" // for rcfile #include <cerrno> // for errno :) @@ -220,15 +221,20 @@ assert( ! path.empty() ); - // Don't allow local access if base url is a network resource - // TODO: let user override this behaviour using the .gnashrc file - const URL& baseUrl = get_base_url(); + // Don't allow local access if starting movie is a network resource. + if ( VM::isInitialized() ) + { + sprite_instance* startingMovie = VM::get().getRoot().getRootMovie(); + assert(startingMovie); // or VM would not be initialized (currently) + const URL& baseUrl = startingMovie->get_movie_definition()->get_url(); // get_base_url(); if ( baseUrl.protocol() != "file" ) { - log_security("Load of file %s forbidden (base url %s is not a local resource).", + log_security("Load of file %s forbidden" + " (starting url %s is not a local resource).", path.c_str(), baseUrl.str().c_str()); return false; } + } // else we didn't start yet, so path *is* the starting movie RcInitFile& rcfile = RcInitFile::getDefaultInstance(); _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit