Insufficiently Random

The lonely musings of a loosely connected software developer.

Sunday, August 28, 2005

Kerberos Printing on MacOS X

The RPI Computer Science department network uses Kerberos to protect its print spoolers. This allows students and faculty to print from any computer on the network and yet the department can verify the individual is allowed to print to that printer - and more importantly - track usage to prevent printer abuse.

MacOS 10.3 and 10.4 uses CUPS - and CUPS doesn't support connecting to a remote LPR daemon that requires Kerberos authentication. MacOS 10.3 and 10.4 both support printing to an SMB print spooler, but for unknown reasons 10.4 can't actually print over SMB.

Due to the architecture of CUPS and MacOS X it is rather difficult for a CUPS backend to gain access to the user's Kerberos tickets. So I developed this solution. :-)

Installation is rather technical - if you aren't comfortable opening a shell and using a command line don't attempt to install this software.

Otherwise, here you go: cups2lprng-relay-1.0.tar.bz2

How it works


At login a Perl script is started and run in the background as a
daemon.

The daemon creates a UNIX domain socket in /tmp which only the
user can access.

The CUPS backend (cups2lprng) is run as root by the CUPS printing
daemon. When the print job is received by the CUPS backend the
backend connects to the UNIX domain socket of the user who CUPS
claims submitted the print job. The print job is then copied over
the domain socket.

When the daemon receives a connection it starts up an LPRng process
to print the incoming print job.

Kerberos Tickets/Mach-O Chains


Other solutions have tried to run LPRng directly from within the
CUPS backend process. This has proved to be impossible with
Keberos tickets as the tickets are held in memory by the kernel
and are unavailable to the CUPS backend.

We get around the problem by running the daemon as the part of the
user login/desktop. The daemon will have access to the user's
tickets.

I have seen a solution from NCSU which has a printer plugin that
copies the user's Kerberos ticket to a temp file, then passes that
temp file to the CUPS backend. This exposes the ticket on disk
for a short period of time - a risk. This solution avoids that
risk.

Wednesday, August 24, 2005

Starting Graduate School!

I'm finally starting graduate school. I left my full time job to focus on a doctorate in computer science at Rensselaer Polytechnic Institute. Hopefully I will be able to finish in 3 years - most take closer to 6.

I'll likely start trying to write here more now that I will have slightly more free time - or slightly less - we'll see how it goes.

The main thing I am looking forward to is being able to start learning new material again... it has been a few years since I last took classes and I haven't really gained very much knowledge since I finished my undergraduate degree. I discovered it is very hard to maintain being on the cutting edge as a computing professional - most businesses won't tolerate employees spending time keeping abreast of their field. *sigh*