[Bf-committers] Security Fix

Ton Roosendaal ton at blender.org
Mon Sep 27 13:04:39 CEST 2004


Hi,

Although it's not the most elegant of all solutions, I can imagine this  
solves issues for now. More users have requested commandline access to  
enforce the output file name.

I'd appreciate if you include comments at the global var, where it's  
exported to and/or comes from... we've just got too many globals  
already. :)

The patch also comes in with linebreaks in the mail... dunno if the  
'patch' unix command handles that correct? I'm always very hesitant  
just applying patches to my code.

-Ton-


On 25 Sep 2004, at 21:08, Philipp Gühring wrote:

> Hi,
>
> We are building a renderfarm, and came across a lot of problematic
> picture-filenames:
>
> Under Unix:
> /render/abc
> ( The directory /render does not exist, so the image is lost)
> Unter Windows
> C:\ntldr
> ( this would crash the whole machine)
>
> So we created the following patch for blender, to solve the problem.
> With this patch you can override the output filename like this:
>
> blender -o newfilename -b anim.blender -a
>
> Here is the patch:
>
> Many greetings,
> Philipp Gühring
>
> --- source/creator/creator.c.orig       2004-08-02 00:28:56.000000000  
> +0200
> +++ source/creator/creator.c    2004-09-25 20:53:41.687558760 +0200
> @@ -99,6 +99,9 @@
>  # include <sys/rtprio.h>
>  #endif
>
> +// for overriding the outputfilename for backgroundrendering
> +char *outputfilename=NULL;
> +
>  // from buildinfo.c
>  extern char * build_date;
>  extern char * build_time;
> @@ -166,6 +169,7 @@
>         printf ("    -s <frame>\tSet start to frame <frame> (use with  
> -a)\n");
>         printf ("    -e <frame>\tSet end to frame (use with  
> -a)<frame>\n");
>         printf ("    -a\t\tRender animation\n");
> +       printf ("    -o <filename>\tSet filename for output\n");
>
>         printf ("\nAnimation options:\n");
>         printf ("  -a <file(s)>\tPlayback <file(s)>\n");
> @@ -308,6 +312,10 @@
>                                 G.background = 1;
>                                 a= argc;
>                                 break;
> +                       case 'o':
> +                       case 'O':
> +                               outputfilename=argv[++a];
> +                               break;
>
>           case 'm':
>               /* unified render pipeline */
> --- source/blender/render/intern/source/initrender.c.orig        
> 2004-07-12
> 05:20:30.000000000 +0200
> +++ source/blender/render/intern/source/initrender.c    2004-09-25
> 20:55:07.372532664 +0200
> @@ -118,6 +118,8 @@
>  short allparts[65][4];
>  int qscount;
>
> +extern char *outputfilename;
> +
>  /* ********************* *********************** */
>
>
> @@ -1277,6 +1279,7 @@
>                         } else if ELEM4(R.r.imtype, R_AVIRAW,  
> R_AVIJPEG,
> R_MOVIE, R_AVICODEC) {
>                                 append_avi((G.scene->r.cfra));
>                         } else {
> +                               if(outputfilename!=NULL &&
> strlen(outputfilename)<159) strcpy(G.scene->r.pic,outputfilename);
>                                 makepicstring(name, (G.scene->r.cfra));
>                                 schrijfplaatje(name);
>                                 if(RE_local_test_break()==0)  
> printf("Saved:
> %s", name);
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton at blender.org  
http://www.blender.org



More information about the Bf-committers mailing list