initial commit of file from CVS for e-smith-LPRng on Wed 12 Jul 08:48:21 BST 2023
This commit is contained in:
9
root/etc/e-smith/templates/etc/lpd.perms/10printing
Normal file
9
root/etc/e-smith/templates/etc/lpd.perms/10printing
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Printing (ie unspooling) requests
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
# Accept all requests
|
||||
ACCEPT SERVICE=P
|
9
root/etc/e-smith/templates/etc/lpd.perms/20spooling
Normal file
9
root/etc/e-smith/templates/etc/lpd.perms/20spooling
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Spooling (ie lpr) requests
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
# Accept all requests
|
||||
ACCEPT SERVICE=R
|
15
root/etc/e-smith/templates/etc/lpd.perms/30control
Normal file
15
root/etc/e-smith/templates/etc/lpd.perms/30control
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Control (ie lpc) requests
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
# Allow root on the server to control jobs
|
||||
ACCEPT SERVICE=C SERVER REMOTEUSER=root
|
||||
|
||||
# Allow all others access only to server, status and printcap
|
||||
ACCEPT SERVICE=C LPC=lpd,status,printcap
|
||||
|
||||
# Reject all other requests
|
||||
REJECT SERVICE=C
|
15
root/etc/e-smith/templates/etc/lpd.perms/40removal
Normal file
15
root/etc/e-smith/templates/etc/lpd.perms/40removal
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Removal (ie lprm) requests
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
# Allow same user on originating host to remove a job
|
||||
ACCEPT SERVICE=M SAMEHOST SAMEUSER
|
||||
|
||||
# Allow root on the server to remove a job
|
||||
ACCEPT SERVICE=M SERVER REMOTEUSER=root
|
||||
|
||||
# Reject all other requests
|
||||
REJECT SERVICE=M
|
9
root/etc/e-smith/templates/etc/lpd.perms/50information
Normal file
9
root/etc/e-smith/templates/etc/lpd.perms/50information
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Information (ie lpq) requests
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
# Allow all requests
|
||||
ACCEPT SERVICE=Q
|
37
root/etc/e-smith/templates/etc/lpd.perms/60access
Normal file
37
root/etc/e-smith/templates/etc/lpd.perms/60access
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Connection access. This controls access to ALL the request types. If
|
||||
# a host does not match one of these rules it will be denied access,
|
||||
# regardless of ANY of the other rules above.
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
# Allow connections from the localhost
|
||||
ACCEPT SERVICE=X REMOTEIP=127.0.0.1
|
||||
|
||||
# Allow connections from subnets in our control
|
||||
{
|
||||
use esmith::NetworksDB;
|
||||
|
||||
my $ndb = esmith::NetworksDB->open_ro();
|
||||
|
||||
my $prefix = "ACCEPT SERVICE=X REMOTEIP=";
|
||||
|
||||
my ($network, undef) =
|
||||
esmith::util::computeNetworkAndBroadcast($LocalIP, $LocalNetmask);
|
||||
|
||||
my $result = $prefix . "${network}/${LocalNetmask}";
|
||||
|
||||
foreach my $net ($ndb->get_all_by_prop(type=>'network'))
|
||||
{
|
||||
my $key = $net->key;
|
||||
my %properties = $net->props;
|
||||
$result .= "\n" . $prefix . "${key}/$properties{'Mask'}";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
# Reject all other connections
|
||||
REJECT SERVICE=X
|
9
root/etc/e-smith/templates/etc/lpd.perms/70default
Normal file
9
root/etc/e-smith/templates/etc/lpd.perms/70default
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Default action
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
# Reject anything which has not been explicitly allowed
|
||||
DEFAULT=REJECT
|
13
root/etc/e-smith/templates/etc/printcap/00example
Normal file
13
root/etc/e-smith/templates/etc/printcap/00example
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
#--------------------------------------------------
|
||||
# Example printcap entry:
|
||||
#
|
||||
# hplaser|HP Laser 5:\
|
||||
# :server:\
|
||||
# :mx#0:\
|
||||
# :sh:\
|
||||
# :ff_separator=false:\
|
||||
# :sd=/var/spool/lpd/hplaser:\
|
||||
# :lp=/dev/lp0:
|
||||
#--------------------------------------------------
|
||||
|
42
root/etc/e-smith/templates/etc/printcap/05printer
Normal file
42
root/etc/e-smith/templates/etc/printcap/05printer
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
# process all accounts
|
||||
|
||||
use esmith::AccountsDB;
|
||||
my $adb = esmith::AccountsDB->open_ro();
|
||||
|
||||
$OUT = "";
|
||||
|
||||
foreach my $printer ( $adb->printers )
|
||||
{
|
||||
$OUT .= "\n";
|
||||
$OUT .= $printer->key;
|
||||
$OUT .= "|" . $printer->prop('Description') . ":\\\n";
|
||||
$OUT .= "\t:server:\\\n";
|
||||
$OUT .= "\t:mx#0:\\\n";
|
||||
$OUT .= "\t:sh:\\\n";
|
||||
$OUT .= "\t:ff_separator=false:\\\n";
|
||||
$OUT .= "\t:sd=/var/spool/lpd/" . $printer->key . ":\\\n";
|
||||
|
||||
if ($printer->prop('Location') eq 'remote')
|
||||
{
|
||||
$OUT .= "\t:rm=" . $printer->prop('Address') . ":\\\n";
|
||||
|
||||
# no trailing backslash for last entry
|
||||
|
||||
if (defined $printer->prop('RemoteName'))
|
||||
{
|
||||
$OUT .= "\t:rp=" . $printer->prop('RemoteName') . ":\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "\t:rp=raw:\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# no trailing backslash for last entry
|
||||
$OUT .= "\t:lp=/dev/" . $printer->prop('Location') . ":\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
14
root/etc/e-smith/templates/etc/smb.conf/20printing
Normal file
14
root/etc/e-smith/templates/etc/smb.conf/20printing
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
# if you want to automatically load your printer list rather
|
||||
# than setting them up individually then you'll need this
|
||||
# It should not be necessary to spell out the print system type unless
|
||||
# yours is non-standard. Currently supported print systems include:
|
||||
# bsd, sysv, plp, lprng, aix, hpux, qnx
|
||||
|
||||
$OUT .= <<HERE;
|
||||
printcap name = /etc/printcap
|
||||
load printers = yes
|
||||
printing = lprng
|
||||
print command = /usr/bin/lpr -b -h -r -P%p %s
|
||||
HERE
|
||||
}
|
16
root/etc/e-smith/templates/etc/smb.conf/50printers
Normal file
16
root/etc/e-smith/templates/etc/smb.conf/50printers
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
# NOTE: If you have a BSD-style print system there is no need to
|
||||
# specifically define each individual printer
|
||||
# Set public = yes to allow user 'guest account' to print
|
||||
$OUT = <<HERE;
|
||||
[printers]
|
||||
comment = All Printers
|
||||
path = /var/spool/samba
|
||||
browseable = no
|
||||
guest ok = no
|
||||
writable = no
|
||||
printable = yes
|
||||
HERE
|
||||
$OUT .= "use client driver = ";
|
||||
$OUT .= $smb{UseClientDriver} || "yes";
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
# lpd specific service (lpd in init.d)
|
||||
{
|
||||
$status = $lpd{status} || 'disabled';
|
||||
$status = ($status eq "enabled") ? "enable" : "disable";
|
||||
$OUT .= "$status lpd.service\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user