On 30 Jun, Rick Cochran wrote:
Helmut,
Quick and dirty: Write a perl script backend for CUPS which invokes LPRng's "lpr".
I have one if you're interested.
Yes, thanks! Helmut.
This script was designed to do Kerberos (in a sneaky way which may be
broken by future versions of MIT Kerberos (eg. MacOS X.3 Kerberos)). You will
probably want to modify it.
-Rick
-- |Rick Cochran phone: 607-255-7618| |Cornell CIT - Systems & Operations - Net-Print FAX: 607-255-8521| |730 Rhodes Hall, Ithaca, N.Y. 14853 email: [EMAIL PROTECTED]|
#!/usr/bin/perl
use strict;
my $argc = @ARGV;
if ( $argc == 0 ) {
print "network klpd \"Unknown\" \"Kerberized LPD/LPR Host\"\n";
exit(0);
}
elsif ( $argc < 5 or $argc > 6 ) {
print STDERR "Usage: $0 job-id user title copies options [file]\n";
exit(1);
}my $user = $ARGV[1]; my $uid = (getpwnam($user))[2];
# If there is a spool file, open it on STDIN. Otherwise, when we change the # RUID to the user's UID, we won't be able to open it.
if ( $argc == 6 ) {
open(STDIN, $ARGV[5])
or die "Unable to open $ARGV[5] ($!)\n";
}# Set RUID to user's UID $< = $uid;
# Get the queue name
$ENV{DEVICE_URI} =~ m|^klpd://([^/]+)/(.*)$|;
my $lpdhost = $1;
my $lpdqueue = "$2";$ENV{AUTH} = 'kerberos';if ( 0 ) {
foreach ( @ARGV ) {
print STDERR"ARGV->'$_'\n";
}
foreach ( sort keys %ENV ) {
print STDERR"$_->'$ENV{$_}'\n";
}
print STDERR"user = $user\n";
print STDERR"uid = $uid\n";
}# Invoke LPRng kerberized lpr client
system("/usr/local/LPRng/bin/lpr -A [EMAIL PROTECTED] -U
\"$user\"");exit(0);
----------------------------------------------------------------------------- YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRng MAILING LIST The address you post from or your Reply-To address MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests or lprng-digest-requests) with the word 'help' in the body. To subscribe to a list with name LIST, send mail to [EMAIL PROTECTED] with: | example: subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED] unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, call Patrick Powell or one of the friendly staff at Astart Technologies for help. Astart also does support for LPRng. Also, check the Web Page at: http://www.lprng.com for any announcements. Astart Technologies (LPRng - Print Spooler http://www.lprng.com) 6741 Convoy Court San Diego, CA 92111 858-874-6543 FAX 858-751-2435 -----------------------------------------------------------------------------
