Ethereal-dev: Re: [Ethereal-dev] BUG: printing in windows needs access-rights to root director

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Ph. Marek" <philipp.marek@xxxxxxxxxx>
Date: Tue, 16 Aug 2005 08:18:08 +0200
Hello Ulf, hello Guy, 
hello everybody else,


On Friday 29 July 2005 10:31, Ph. Marek wrote:
> diff -u print_dlg.c.orig print_dlg.c
> --- print_dlg.c.orig    2005-07-29 10:26:17.363031600 +0200
> +++ print_dlg.c 2005-07-29 10:30:14.314310680 +0200
> @@ -855,7 +855,11 @@
>      win_printer = TRUE;
>      /*XXX should use temp file stuff in util routines */
>      g_free(args->file);
> -    args->file = g_strdup(tmpnam(NULL));
> +    args->file = gstrdup_printf("%s\\ethereal_print_%s.tmp",
> +                          getenv("TMP") ? getenv("TMP") :
> +                          getenv("TEMP") ? getenv("TEMP") :
> +                          "c:\\temp",
> +                          tmpnam(NULL));
>      args->to_file = TRUE;
>  #else
>      g_free(args->cmd);
Oops, sorry. Just found on nearer examination that that won't work - because 
of the \ at the start of tmpnam(). (Unless you create a matching 
directory :-)

Maybe I should have tried a compile - but doing that in windows isn't nice 
(and I'm writing this in kmail ;-).


> > The function tmpnam() is used to get the output path/filename for
> > printing on windows. The function description is a bit hard to
> > understand, but I think it will use %TMP%, so there seems something
> > wrong with your environment.
>
> I don't think so - on both accounts (it doesn't, and there isn't ;-).
How's the current status - is there something being done?

I'd be very glad to have that fixes in the next version!


Regards,

Phil