FW: Comment posted to PDF backend for CUPS

Kurt Pfeifle k1pfeifle at gmx.net
Tue Jan 30 13:30:10 CET 2007


On Tuesday 30 January 2007 08:25, Goffioul Michael wrote:
> > > 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

Yes, but it's possible, f.e. using 

 HOME=$(getent passwd | grep $USER | awk -F: '{print $6}')

> - 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)

...or if $HOME dirs are mounted via Samba, and if users are 
authenticated via Samba/Winbind anyway...

This can be seen in surprisingly many places nowadays.  :-)

But in any case, you are right in this: we can not offer a *generic*
solution which matches any possible use case.

The current (very simple) pdf:// backend offered in the download area
of printing.kde.org can best be used by individual users on their own
workstations -- and can serve as a template or jumping board if some-
one wants to modify it for his own specific needs (like the user wants
commented at http://www.cups.org/links.php?V53#_USER_COMMENT_1623 ).
 
> 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.

Yes, good point.

Also, in case of e-mailing the PDF result back, a lot of networked 
environment allow to query the $USER email addresses via LDAP; alter-
natively, if it is a not-too-large domain/network, the backend could 
read the email from a list (f.e. "/etc/cups/emails.list") which would 
have to be maintained by the admin.

> Michael.

Cheers,
Kurt


More information about the kde-print mailing list