Unique printjob name
Emil Isberg
emil.isberg at mds.mdh.se
Mon Dec 9 16:15:59 GMT 2002
On Mon, 9 Dec 2002 Tobias.Gerndt at EnBW.com wrote:
>Everything we tried with a global pre-/postexec or workaround with print
>command failed ... :-(
How about doing a wrapper shellscript instead?
prompt$ cat /usr/local/bin/sambalpr
#! /bin/bash
MYDIR=/var/spool/samba/printdir$RANDOM
#Preexec
mkdir -p "$MYDIR"
chmod 700 "$MYDIR"
lpr "$@"
#Postexec
rm -rf "$MYDIR"
prompt$
Just make sure that /var/spool/samba is writeable by nobody.
And change the command for printing to be the script instead of lpr
directly.
--
You just know when a relationship is about to end. My girlfriend called me
at work and asked me how you change a lightbulb in the bathroom. "It's very
simple," I said. "You start by filling up the bathtub with water..."
More information about the samba-technical
mailing list