FW: Comment posted to PDF backend for CUPS

Goffioul Michael goffioul at imec.be
Tue Jan 30 09:25:05 CET 2007


> > I was wondering whether the output directory could be set \"on the 
> > fly\"making it nice with kdialog. The point is to \"satisfy\" the 
> > users in mycompany, that want the result document to be 
> stored with a 
> > name of theirwish. I've been trying to do it myself but 
> apparently the 
> > script doesn't launch any interactive programs; and I had 
> no results 
> > by googling (all thescripts alike form the output the 
> directory in the 
> > same fashion as it isin here). Any clues on how to do
> > it?. Thanks in advance         
> > 
> > View/Reply At: http://www.cups.org/links.php?V53#_USER_COMMENT_1623
> 
> 
> I don't think it is possible to do that *in* *a* *secure* way 
> (the backend needs to run with root privileges to be able to 
> write to a user-owned directory).
> 
> However, what would be easily possible is modifiying the 
> current pdf:// backend to do either of thesse:
>  
>   * depending on the user's home directory $HOME, write the
>     result into a specific sub directory, "$HOME/PDFs/"
> 
>   * depending on a commandline parameter like "-o targetdir=
>     /tmp/my/path/to/pdfs" to write the result accordingly
> 
>   * depending on what a (hidden?) file in the user's $HOME,
>     has as its content, write to that directory (i.e. hidden 
>     file ".mypdfs" has 1 line "outputdir=/home/kurt/pdfs")

I see (at least) 2 potential problems/issues:
- pdf backend is executed with specific privileges, not as a simple
user; hence $HOME doesn't make sense and you must find the actual
$HOME in another way
- in a network environment, placing output pdf's in $HOME is only
meaningful if the printer queue is located in the local CUPS server,
or if the $HOME dirs are common for the whole network (using NFS
for instance)

As an alternative, it might be useful to make the pdf backend mail
the output pdf back to the user. For instance, if all users have an
email address with the same servername '<user>@company.com' (which
is usually the case), you might think of defining the backend URI
as "pdf:mailto:company.com". As the pdf backend knows the login of
the user that sent the print job, it should be able to send a mail
to login at company.com.

Michael.


More information about the kde-print mailing list