Mark variables static where possible and place the uid/euid variables in
lp.h, so that we can compile-time enforce that these variables have the
same type.
current version of FreeBSD, this isn't guarenteed by the API. Custom
security modules, or future implementations of the setuid and setgid
may fail.
PR: bin/172289
PR: bin/172290
PR: bin/172291
Submittud by: Erik Cederstrand <erik@cederstrand.dk>
Discussed by: freebsd-security
Approved by: cperciva
MFC after: 1 week
source to use __FBSDID() for setting rcsids. Also fix the format
of 'sccsid' lines to consistently match style(9) guidelines.
Reviewed by: discussed with bde and obrien
MFC after: 15 days
more sensible/understandable. 'from'->'from_host' 'host'->'local_host'
'fromb'->'frombuf' 'fromhost'->'origin_host' and a local-variable
named 'host'->'hostbuf'. This fixes some compile-time warnings about
local variables shadowing global variables.
Other than renaming variables, the only actual code changes are to call
strlcpy() instead of strncpy() when setting those (renamed) variables,
and that 'from_ip' is now a strdup()-created buffer instead of being a
static buffer compiled in as 1025 bytes.
Reviewed by: freebsd-print@bostonradio.org (an earlier version)
MFC after: 1 week
with BDECFLAGS on, mainly by adding 'const' to parameters in a number
of routine declarations. While I'm at it, ANSI-fy all of the routine
declarations. The resulting object code is exactly the same after
this update as before it, with the exception of one unavoidable
change to lpd.o on freebsd/alpha.
Also added $FreeBSD$ line to lpc/extern.h lpc/lpc.h lptest/lptest.c
Reviewed by: /sbin/md5, and no feedback from freebsd-audit
in lpd. Stat.recv is useful on a printserver, as something of a network
performance-monitoring tool. Stat.send is a minimal accounting record of
sorts for jobs going to tcp/ip based printers.
Reviewed by: freebsd-print@bostonradio.org
However, it doesn't check if the remote printer name it
is sending it to is the same as the local printer name,
and so chokes 'cos "laser" is not a real printer.
PR: 7081
Submitted by: David Malone <dwmalone@maths.tcd.ie>
- Get rid of a lot of the static variables which were shared by
many routines and programs in the suite.
- Create an abstract interface to the printcap database, so that
other retrieval and iteration mechanisms could be developed
(e.g., YP, Hesiod, or automatic retrieval from a trusted server).
- Give each capability a human-readable name in addition to the historic
two-character one.
- Otherwise generally clean up a lot of dark corners. Many still remain.
- When submitting jobs, use the official login name record (from getlogin())
if there is one, rather than reverse-mapping the uid.
More to come...