POV-Ray : Newsgroups : povray.unix : file init error Server Time
28 Jul 2024 18:11:42 EDT (-0400)
  file init error (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: Peter J  Holzer
Subject: Error messages - a patch and a security warning (was: file init error)
Date: 4 Dec 2000 16:01:59
Message: <slrn92nr77.ffe.hjp-usenet@teal.h.hjp.at>
On Sun, 03 Dec 2000 21:06:16 -0600, David F wrote:
>When i try to render a file in my home directory, using MegaPOV 0.5a, I
>get the following output:
>
>Persistence of Vision(tm) Ray Tracer Version 3.1g.ump.0.5a (UniMegaPov
>0.5a).u
><snip>
>Creating vista buffer.
>Creating light buffers...
>File init error.
>Error opening output file.
>$
>
>However, when I run it su, it renders.  Got any suggestions?
>

Try the following patch to get a meaningful error message.

BTW, for those who run public render farms: I just noticed that the
Error function uses sprintf on a fixed size buffer. It may be possible
to overflow this buffer and run arbitrary programs. Make sure the user
running povray doesn't have more than the rights he absolutely needs!

	hp


--- povray.c.orig	Thu Jun  1 14:43:52 2000
+++ povray.c	Mon Dec  4 20:03:46 2000
@@ -32,6 +32,7 @@
 *****************************************************************************/
 
 #include <ctype.h>
+#include <errno.h>
 #include <time.h>     /* BP */
 #include "frame.h"    /* common to ALL modules in this program */
 #include "povproto.h"
@@ -1445,7 +1446,8 @@
               &Frame.Screen_Width, &Frame.Screen_Height, Buffer_Size,
               WRITE_MODE) != 1)
         {
-          Error ("Error opening output file.");
+          Error ("Error opening output file `%s': %s\n",
+		 Actual_Output_Name, strerror(errno));
         }
         CHANGEFILETYPE
       }
@@ -1456,7 +1458,8 @@
             &Frame.Screen_Width, &Frame.Screen_Height, Buffer_Size,
             WRITE_MODE) != 1)
       {
-        Error ("Error opening output file.");
+        Error ("Error opening output file `%s': %s\n",
+	       Actual_Output_Name, strerror(errno));
       }
     	 CHANGEFILETYPE
         
--- render.c.orig	Fri Sep  8 22:18:40 2000
+++ render.c	Mon Dec  4 20:00:51 2000
@@ -31,6 +31,7 @@
 *
 ******************************************************************************/
 
+#include <errno.h>
 #include <time.h>
 #include "frame.h"
 #include "vector.h"
@@ -857,7 +858,8 @@
         &Frame.Screen_Width, &Frame.Screen_Height, opts.File_Buffer_Size,
         APPEND_MODE) != 1)
     {
-      Error("Error opening output file.\n");
+      Error("Error opening output file `%s': %s.\n",
+            New_Fname, strerror(errno));
     }
 
     return;




-- 
   _  | Peter J. Holzer    | Es war nicht Gegenstand der Abstimmung zu

| |   | hjp### [at] wsracat      | Zahlen neu festzulegen.
__/   | http://www.hjp.at/ |	-- Johannes Schwenke <jby### [at] ginkode>


Post a reply to this message

From: David F
Subject: Re: Error messages - a patch and a security warning (was: file init error)
Date: 4 Dec 2000 23:49:12
Message: <3A2C73E6.65CAD6A5@ednet.rvc.cc.il.us>
I'm really showing my newbie status, but what am I supposed to do with this?

"Peter J. Holzer" wrote:

> On Sun, 03 Dec 2000 21:06:16 -0600, David F wrote:
> >When i try to render a file in my home directory, using MegaPOV 0.5a, I
> >get the following output:
> >
> >Persistence of Vision(tm) Ray Tracer Version 3.1g.ump.0.5a (UniMegaPov
> >0.5a).u
> ><snip>
> >Creating vista buffer.
> >Creating light buffers...
> >File init error.
> >Error opening output file.
> >$
> >
> >However, when I run it su, it renders.  Got any suggestions?
> >
>
> Try the following patch to get a meaningful error message.
>
> BTW, for those who run public render farms: I just noticed that the
> Error function uses sprintf on a fixed size buffer. It may be possible
> to overflow this buffer and run arbitrary programs. Make sure the user
> running povray doesn't have more than the rights he absolutely needs!
>
>         hp
>
> --- povray.c.orig       Thu Jun  1 14:43:52 2000
> +++ povray.c    Mon Dec  4 20:03:46 2000
> @@ -32,6 +32,7 @@
>  <snip>


Post a reply to this message

From: Warp
Subject: Re: file init error
Date: 5 Dec 2000 06:09:54
Message: <3a2ccd02@news.povray.org>
Nicolas Calimet <pov### [at] freefr> wrote:
: 	Precisely because you can't assume what anyone has in his own
: ini files (either *.ini or $HOME/.povrayrc).

  Yes, of course, but if you give them only the huge command line, they may
learn a bad habit that will only make their life harder (ie they will always
write the huge command line... then they will make an alias... then they
will make several aliases for different renderings...).

  IMO, the best way is to teach the shortest command line needed for rendering
and that all the default settings should be put in $HOME/.povrayrc.
  For example, when I make quick test renders, I just type:

xmegapov -i test +sp8

  I have a default image size of 320x240, which is a good compromise between
image size and rendering speed.
  If I'm making a final image, I write something like:

xmegapov -i test -w800 -h600 +a0.1


  Tip:
  There's an easy way of creating a full ini file with all possible setting
in an easy-to-read form:

povray +GIyour.ini

  Then you can edit 'your.ini' and put your preferred default values (and then
perhaps copy it to $HOME/.povrayrc).

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Peter J  Holzer
Subject: Re: Error messages - a patch and a security warning (was: file init error)
Date: 5 Dec 2000 16:02:42
Message: <slrn92qfdn.n8s.hjp-usenet@teal.h.hjp.at>
On Mon, 04 Dec 2000 22:49:42 -0600, David F wrote:
>I'm really showing my newbie status, but what am I supposed to do with this?

Save the message with the patch to a file (e.g., "/tmp/errmsg.patch")

Get the povray sources, if you don't have them already, and unpack them.

Go to the source directory (cd povray31/source)

Invoke the patch command:

    patch < /tmp/errmsg.patch

It should mumble a bit about successfully applying some hunks, and if
you look into povray.c and render.c afterwards, you should see the new
error messages there.

Recompile povray as explained in the file CMPL_Unix.doc.

	hp


-- 
   _  | Peter J. Holzer    | Es war nicht Gegenstand der Abstimmung zu

| |   | hjp### [at] wsracat      | Zahlen neu festzulegen.
__/   | http://www.hjp.at/ |	-- Johannes Schwenke <jby### [at] ginkode>


Post a reply to this message

From: David F
Subject: Re: Error messages - a patch and a security warning (was: file init error)
Date: 5 Dec 2000 18:26:37
Message: <3A2D79CE.F71129FB@ednet.rvc.cc.il.us>
Thank you very much

"Peter J. Holzer" wrote:

> On Mon, 04 Dec 2000 22:49:42 -0600, David F wrote:
> >I'm really showing my newbie status, but what am I supposed to do with this?
>
> Save the message with the patch to a file (e.g., "/tmp/errmsg.patch")
>
> Get the povray sources, if you don't have them already, and unpack them.
>
> Go to the source directory (cd povray31/source)
>
> Invoke the patch command:
>
>     patch < /tmp/errmsg.patch
>
> It should mumble a bit about successfully applying some hunks, and if
> you look into povray.c and render.c afterwards, you should see the new
> error messages there.
>
> Recompile povray as explained in the file CMPL_Unix.doc.
>
>         hp
>
> --
>    _  | Peter J. Holzer    | Es war nicht Gegenstand der Abstimmung zu

> | |   | hjp### [at] wsracat      | Zahlen neu festzulegen.
> __/   | http://www.hjp.at/ |    -- Johannes Schwenke <jby### [at] ginkode>


Post a reply to this message

From: David F
Subject: Re: Error messages - a patch and a security warning (was: file init error)
Date: 5 Dec 2000 21:12:03
Message: <3A2DA093.10077B83@ednet.rvc.cc.il.us>
ok, I applied the patch, recompiled, and make sure I was runnign it in the same
directory so that I would have premission to render the file.   I still get the
ubiquitous "file init error" and no further information.  I get this error when I
run x-povray as well, so I know it is not MegaPOV specific.

"Peter J. Holzer" wrote:

> On Mon, 04 Dec 2000 22:49:42 -0600, David F wrote:
> >I'm really showing my newbie status, but what am I supposed to do with this?
>
> Save the message with the patch to a file (e.g., "/tmp/errmsg.patch")
>
> Get the povray sources, if you don't have them already, and unpack them.
>
> Go to the source directory (cd povray31/source)
>
> Invoke the patch command:
>
>     patch < /tmp/errmsg.patch
>
> It should mumble a bit about successfully applying some hunks, and if
> you look into povray.c and render.c afterwards, you should see the new
> error messages there.
>
> Recompile povray as explained in the file CMPL_Unix.doc.
>
>         hp
>
> --
>    _  | Peter J. Holzer    | Es war nicht Gegenstand der Abstimmung zu

> | |   | hjp### [at] wsracat      | Zahlen neu festzulegen.
> __/   | http://www.hjp.at/ |    -- Johannes Schwenke <jby### [at] ginkode>


Post a reply to this message

From: Warp
Subject: Re: Error messages - a patch and a security warning
Date: 6 Dec 2000 05:42:57
Message: <3a2e1830@news.povray.org>
Are you sure you are not running povray like this:

povray myfile.pov

?

(Should be: povray -i myfile.pov)

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Peter J  Holzer
Subject: Re: Error messages - a patch and a security warning (was: file init error)
Date: 6 Dec 2000 14:01:38
Message: <slrn92t22n.ovg.hjp-usenet@teal.h.hjp.at>
On Tue, 05 Dec 2000 20:12:35 -0600, David F wrote:
>ok, I applied the patch, recompiled, and make sure I was runnign it in the same
>directory so that I would have premission to render the file.   I still get the
>ubiquitous "file init error" and no further information. 

There was a bit more information even before. According to your original
post, it said:

| File init error.
| Error opening output file.

Now it should say something like:

| File init error.
| Error opening output file `foo.png': Permission denied.

If you still get the original message, you are probably not running 
the executable. Did you run "make install"? Type 

    ls -l `which megapov` 

to see where your povray binary is located, and whether the modification
date is what you expect (I didn't notice before that you are using
megapov. I wrote the patch for megapov, but my patching instructions
were for regular pov - the only difference is the name of the source
directory, though).

	hp

-- 
   _  | Peter J. Holzer    | Es war nicht Gegenstand der Abstimmung zu

| |   | hjp### [at] wsracat      | Zahlen neu festzulegen.
__/   | http://www.hjp.at/ |	-- Johannes Schwenke <jby### [at] ginkode>


Post a reply to this message

From: David F
Subject: Re: Error messages - a patch and a security warning
Date: 6 Dec 2000 15:34:41
Message: <3A2EA302.391E5769@ednet.rvc.cc.il.us>
Thank you all for your help.  I found the error, and it's one of those where
I will be kicking myself for weks now for not noticing earlier.  It is, as
you said in one of your earlier posts to this thread, Warp, permissions.  I
had initially rendered this file while logged in as su, and I didn't delete
the output file.  Therefore, when I run it logged in under something else, I
couldn't alter the output file.  Thank you again for all your help
everyone!!!


Post a reply to this message

From: Margus Ramst
Subject: Re: Error messages - a patch and a security warning
Date: 6 Dec 2000 19:49:03
Message: <3A2EDEFE.315FF467@peak.edu.ee>
David F wrote:
> 
> had initially rendered this file while logged in as su, and I didn't delete
> the output file.

Never run anything as su unless you really have to.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Home page http://www.hot.ee/margusrt


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.