summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lpc
Commit message (Collapse)AuthorAgeFilesLines
* The last big commit: let usr.sbin/ use WARNS=6 by default.ed2010-01-021-0/+2
|
* In preparation for raising NGROUPS and NGROUPS_MAX, change basebrooks2009-06-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | system callers of getgroups(), getgrouplist(), and setgroups() to allocate buffers dynamically. Specifically, allocate a buffer of size sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow). This (or similar gymnastics) is required for the code to actually follow the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime and where getgroups may return {NGROUPS_MAX}+1 results on systems like FreeBSD which include the primary group. In id(1), don't pointlessly add the primary group to the list of all groups, it is always the first result from getgroups(). In principle the old code was more portable, but this was only done in one of the two places where getgroups() was called to the overall effect was pointless. Document the actual POSIX requirements in the getgroups(2) and setgroups(2) manpages. We do not yet support a dynamic NGROUPS, but we may in the future. MFC after: 2 weeks
* Use the new name H_SETSIZE instead of the old H_EVENT to set the historystefanf2005-10-191-1/+1
| | | | | | | size. PR: 86355 Approved by: gad
* MFS5: Minor style(9) tweak.delphij2005-02-221-1/+1
|
* Be more careful when doing el_parse() - only do it when el isdelphij2005-02-151-1/+1
| | | | | | | | | | properly initialized, that happens when lpc is called from a tty. Without this change, it's possible to get SIGSEGV simply doing: echo "..:" | lpc Reported by: Wojciech A. Koszek <dunstan at freebsd czest pl> PR: 77462 (patch rewritten by myself) MFC After: 1 week
* Expand *n't contractions.ru2005-02-131-1/+1
|
* Fixed .Xr call.ru2005-01-211-1/+2
|
* Sort sections.ru2005-01-181-7/+7
|
* Fix two buffer overflows caused by off-by-one errors: avoid writing a nulltjr2003-10-131-2/+2
| | | | | | | character 1 byte past the end of cmdline[] when libedit is being used for input, and avoid writing a null pointer 1 element past the end of margv[]. Reviewed by: gad
* More changes to use __FBSDID() for setting rcsids, and fix thegad2003-07-145-18/+17
| | | | | | | | | | format of 'sccsid' lines so they consistently match style(9) guidelines. Note that this means you will have to add '-a' to the 'strings' command when searching for rcs ids, eg: strings -a /usr/sbin/lpc | grep '$FreeBSD' Reviewed by: discussed on cvs-src & with bde and obrien MFC after: 15 days
* mdoc(7) police: markup fixes.ru2002-11-271-13/+16
| | | | Approved by: re
* Changes which rewrite 'lpc topq', and which add 'lpc bottomq'. Thesegad2002-07-176-8/+415
| | | | | | | | | | | | | reflect much valuable feedback from wollman. More details on the new 'lpc topq' are in the log message for revision 1.2 of lpc/movejobs.c. The previous implementation of 'lpc topq' is available as 'lpc xtopq', in case there are any problems noticed in the new implementation. If there are no problems with this version, a later update will remove the 'lpc xtopq' command. Reviewed by: freebsd-print@bostonradio.org MFC after: 6 days
* The .Nm utilitycharnier2002-07-141-3/+4
|
* Call routine to free everything obtained when filling in 'struct printer'.gad2002-07-121-0/+1
| | | | MFC after: 3 days
* Remove the backup-versions ("x*") of various lpc commands that weregad2002-07-023-377/+0
| | | | | | | recently rewritten. No one in -current has reported any problems with the newer versions. MFC after: 3 weeks
* Stop adding ${CWARNFLAGS} to CFLAGS. The standard makefile processing willgad2002-06-231-1/+1
| | | | | | add them automatically, and there is no point in adding them twice. MFC after: 5 days
* Just rename two generic-queue init routines from 'init_*' to '*_gi'gad2002-06-163-7/+7
| | | | | | ("gi" short for 'generic init'...). MFC after: 10 days
* Add a nearly complete rewrite of the lpc command 'down'. The only user-gad2002-06-164-3/+73
| | | | | | | | | | | | | | visible change should be that more than one queue can now be specified, if one uses the '-msg' parameter to separate the list of queues from the status message to set. The previous implementation of 'down' remains available as the command 'xdown', available for instant fallback if there seems to be anything wrong with the new one. If no one reports a problem after a few weeks, then a later update will remove 'xdown'. Reviewed by: freebsd-print@bostonradio.org MFC after: 10 days
* Make the description of the 'down' command a little more readable.gad2002-06-151-2/+4
| | | | MFC after: 10 days
* Reorganize the way that arguments are processed in lpc's generic-queuegad2002-06-151-20/+24
| | | | | | | commands, to make things a little cleaner (mainly for a later update). Reviewed by: freebsd-print@bostonradio.org MFC after: 10 days
* Add a new command to 'lpc' called 'setstatus', which would be used togad2002-06-156-28/+140
| | | | | | | | | change the status message of a print queue. This includes some minor changes to the upstat() routine, so that error messages are not printed while seteuid(priv-user). Reviewed by: freebsd-audit and freebsd-print@bostonradio.org MFC after: 10 days
* Almost complete rewrite of the lpc commands 'abort', 'enable', 'disable',gad2002-06-133-14/+306
| | | | | | | | | | | | | | | | | 'restart', 'start', 'stop' and 'up'. These are commands which mainly just alter the access bits on the lock-file of a queue, and they all now use a central routine to do that. This reduces the amount of code that is run as the priv userid, and eliminates a number of cases where error messages were written while that priv uid was in effect. As far as users are concerned, there should be no noticable difference in the new versions. In case there *is*, the previous implementations are still there as 'xabort', 'xenable', etc, so they are available for instant fallback. If no one reports a problem after a few weeks, then a later update will remove those x-commands. Reviewed by: freebsd-audit and freebsd-print@bostonradio.org MFC after: 10 days
* Add 'const' to some casts to fix two warnings that are printed by thegad2002-04-221-2/+2
| | | | | | new gcc (on sparc64). MFC after: 4 days
* Usage style sweep: spell "usage" with a small 'u'.des2002-04-221-3/+3
| | | | | Also change one case of blatant __progname abuse (several more remain) This commit does not touch anything in src/{contrib,crypto,gnu}/.
* Add description of `mc' (max copies), add short-form to long-form mappinggad2002-04-221-0/+1
| | | | | | | | for `tf' (troff filter), and add a cross-reference to chkprintcap in some lpr-related man pages. Submitted by: dwmalone MFC after: 4 days
* My recent changes to add the ctl_renametf routine assumed that print jobgad2001-11-281-13/+22
| | | | | | | | | | | control-files will always start with 'cfA*'. It turns out that some implementations of lpd (such as solaris) may send a control file which starts with 'cfB*', or really 'cf<anyLetter>*'. Although such filenames are very odd, we did used to accept them. This changes ctl_renametf to work correctly with them, and fixes up 'lpc clean' to match. PR: bin/32183 MFC after: 10 days
* Fix minor compile-time warning that snunk in with changes to sortq() rtn.gad2001-10-091-0/+1
| | | | MFC after: 4 days
* *** empty log message ***obrien2001-10-011-3/+4
|
* Basically rewrite the sortq() routine which is used by 'lpc clean' andgad2001-09-271-20/+126
| | | | | | | | | | 'lpc tclean'. In some obscure cases, the previous version could cause a valid user job to be removed (by 'clean'), due to invalid assumptions in the sort routine. This was a rare problem, unless ctlinfo.c is compiled with 'LEAVE_TMPCF_FILES' turned on (to check what that rtn was doing). Reviewed by: Lack of outcry on -audit and freebsd-print@bostonradio.org MFC after: 10 days
* Fix so that lpc's interactive-mode will not be confused by EditLine processinggad2001-09-171-0/+9
| | | | | | | into thinking that there is a print-queue called 'xterm'... Reviewed by: short discussion on freebsd-stable MFC after: 1 week
* Get rid of a compile-time warning by casting to (size_t).gad2001-07-231-1/+1
| | | | MFC after: 1 week
* Get rid of a compile-time warning by casting to (size_t).gad2001-07-231-1/+1
| | | | MFC after: 1 week
* Perform a major cleanup of the usr.sbin Makefiles.obrien2001-07-201-3/+6
| | | | | These are not perfectly in agreement with each other style-wise, but they are orders of orders of magnitude more consistent style-wise than before.
* Get rid of one compile-time warning by changing an 'int' to a 'size_t'.gad2001-07-151-6/+10
| | | | MFC after: 1 week
* Fix most of the warnings generated by compiling lpr with -Wnon-const-format,gad2001-07-151-5/+5
| | | | | | | | | often by just telling gcc that some internal routine is "__printflike" (work done by Kris Kennaway <kris@FreeBSD.org>). Also fix the new warnings which show up once gcc starts checking the "printf-like parameters" passed to those routines. MFC after: 1 week
* mdoc(7) police: removed hard sentence breaks, use new .Brq macro.ru2001-07-051-54/+27
|
* Make 'lpc clean' somewhat safer. Add an 'lpc tclean' command, which allowsgad2001-06-256-47/+351
| | | | | | | | | | | | | | | | | | | one to see what files would be removed *if* an 'lpc clean' is done. 'tclean' will remove no files, and is therefore not a privileged command. Also, both 'lpc clean' and 'lpc tclean' will now look for 'core' files in spool directories (but not remove them). They also print out an extra line of info when a datafile to be removed is a symlink (from 'lpr -s'), saying what file it is a symlink to. The 'lpc clean' commands also now print out a summary line saying how many queues were checked, how many files were removed (or "would be" removed, for tclean), and how much disk space is involved. For the benefit of those who have many print queues, 'lpc clean all' will only print out the names of print queues where some "interesting" files were found, instead of printing out a header-line for every queue in your printcap file. Reviewed by: freebsd-print@bostonradio.org freebsd-audit@FreeBSD.org MFC after: 2 weeks
* Rename global variable 'name' to 'progname', thus fixing a number ofgad2001-06-151-1/+1
| | | | | | | | warnings which come up for various routines that have a parameter which is also called 'name'. Reviewed by: freebsd-print@bostonradio.org MFC after: 1 week
* Fix about 90-100 warnings one gets when trying to compile lpr&friendsgad2001-06-124-137/+104
| | | | | | | | | | | | 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
* mdoc(7) police: properly use a -diag list in the DIAGNOSTICS section.dd2001-04-131-4/+4
| | | | Reviewed by: ru
* - Backout botched attempt to introduce MANSECT feature.ru2001-03-261-0/+1
| | | | - MAN[1-9] -> MAN.
* Set the default manual section for usr.sbin/ to 8.ru2001-03-201-1/+0
|
* mdoc(7) police: split punctuation characters + misc fixes.ru2001-02-011-23/+54
|
* Prepare for mdoc(7)NG.ru2000-12-271-0/+1
|
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-2/+2
|
* Cosmetic change of a structure name.gad2000-11-061-10/+10
| | | | | | | Turn 'struct queue { q_time, q_name }' (loosely-speaking) into 'struct jobqueue { job_time, job_cfname }' Reviewed by: GAWollman
* Get rid of a minor compile-time warning.gad2000-11-061-2/+2
|
* the code assumes that getgroups() always returns NGROUPS groups, howeveralfred2000-08-231-2/+4
| | | | | | | that is not true. Instead of looping NGROUPS times, get the return value from getgroups() and loop over the return that many times. Noticed by: David A. Holland <dholland@eecs.harvard.edu>
* Quit on EOF from terminal instead of redisplaying the prompt.mph2000-06-301-1/+1
|
* Remove single-space hard sentence breaks. These degrade the qualitysheldonh2000-03-011-2/+4
| | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc.
OpenPOWER on IntegriCloud