[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: logos left in /tmp



Chris Travers wrote:
On Fri, Apr 24, 2009 at 1:17 AM, Maanus Kask <..hidden..> wrote:
Hi,

How can I prevent ledgersmb lefting logo.* files in /tmp/ after
printing invoices?

There is problem as soon as at least one company does not have a logo,
then he gets someone else's logo in his invoice instead.
You could add an unlink call to LedgerSMB Form.pm (approx line 1013),
right after:

if ( $self->{format} =~ /(postscript|pdf)/ || $self->{media} eq 'email' ) {

and before:

if ( $self->{media} eq 'email' ) {

We may want to add this to fixes for 1.2.19.

Chris,

To me that sounds like a slightly bigger problem, if the app is using the /tmp/ dir for all users, there is a risk that simultaneous calls could end up with incorrect data. e.g. someone from company a and company b prints an invoice at the same time, then the former could end up with the latter's files. It would make sense to have unique filenames or separate tmp dirs for each company or user.

John