John Fabiani on Tue, 5 Mar 2002 20:01:43 +0100 (CET)(envelope-from owner-apsfilter-help@apsfilter.org)


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

Re: pass through printing


Telnet will be switched to ssh soon.  The problem is that our terminal 
software does not support it.  
Remember, what I'm attempting to do is pass-through printing.  This means 
that I'm attempting to print on the users printer not the Unix server 
printer.  The only connection I have to the user's printer is the telnet 
connection.  The next problem is I don't know in advance what the tty of user 
is going to be.  So this information rules out setting up the printcap file 
in advance.  Normally, I could just place "/dev/tty??" into the printcap 
":lp" section and all would work.  Since I can't use a fixed tty in the ":lp" 
field I have replaced it with "/dev/null".  Anything the lpd daemon prints 
just go out into the bit bucket.  The problem is that when I ask the lpd 
daemon to send data to the tty that the user is logged into it errors out 
with permission denied.  A friend has suggested editing the printcap file 
each time a remote user logs into the system.  But this sounds like plenty 
could go wrong - like what happens when the user looses connection and does 
not log off.  Since everyone is using a telnet session locally too - how will 
I be sure it is a remote user that I'm setting up.  Anyway I think you 
understand the problem.  
I even attempted to use Samba (using smbclient) to print.  
This works but - some of the users have AOL as an ISP and AOL does not allow 
port 139 to open.  This can't be new (although it's new to me).  What are 
others doing????????   BTW I have discovered the SCO does not have this 
problem of writing to any port from the LPD daemon.
TIA
John
On Tuesday 05 March 2002 12:39 am, you wrote:
> On 05-Mar-02 John Fabiani wrote:
> > Hi,
> > Does apsfilter support pass-through printing?  What I am attempting to
> > do is the following:
> >
> > Allow a user to login via telnet.  The IP address is NOT static.
>
> You definitely don't want to use telnet. Get ssh instead.
>
> >  Therefore I can not use standard remote print setup in the printcap. I
> > then want to run a script (aspfilter) that redirects the print job not
> > to a printer but to the user's terminal.  The simple script would go
> > something like this:
> >
> > printf "\033[5i" && cat && printf "\033[4i"
>
> Sounds kinda weird. Maybe you'd also want to have a look at
> the RAW_PROLOGUE and RAW_EPILOGUE variables which seem to
> work the way you expect (the printf stuff).
>
> > The problem is that I can't figure out how to get the print job back to
> > the terminal. No matter what I do I get a permissions error when I
> > attempt to write to the terminal.  The reason of course is that the user
> > owns the tty - crw------- username tty 7,2 etc.....
>
> I still don't know why you actually want to do that, but
> "aps2file" is your salvation. Try "man aps2file" and see
> if you can handle it.
>
> > If I change it as root (chmod 777 tty) of course the filter will then
> > print to the tty.  However, when the user logs out and logins again the
> > permissions return to the normal crw-------.
>
> Which is perfectly normal, since your tty is not to be used
> by everyone -- they could easily spy on you otherwise.
>
>
> HTH
> Michael