summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lpc
Commit message (Collapse)AuthorAgeFilesLines
* In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.bdrewery2014-06-081-0/+2
| | | | | | | | | | | | | | | | This is currently an opt-in build flag. Once ASLR support is ready and stable it should changed to opt-out and be enabled by default along with ASLR. Each application Makefile uses opt-out to ensure that ASLR will be enabled by default in new directories when the system is compiled with PIE/ASLR. [2] Mark known build failures as NO_PIE for now. The only known runtime failure was rtld. [1] http://www.bsdcan.org/2014/schedule/events/452.en.html Submitted by: Shawn Webb <lattera@gmail.com> Discussed between: des@ and Shawn Webb [2]
* Check the return error of set[ug]id. While this can never fail in theeadler2012-10-223-34/+36
| | | | | | | | | | | | | | 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
* Print out a warning message if a `lpc setstatus' is done whengad2012-04-301-0/+18
| | | | | | | | the queue is not 'lpc stop'-ed. In that situation `lpq' will not display the status message to the user, and the operator may think the queue is already stopped when it is not. MFC after: 3 weeks
* Catch the user-error when no queue name was specified on angad2012-04-301-0/+8
| | | | | | | lpc-command which supports '-msg' (e.g.: setstatus). Print out a helpful error message instead hitting a seg-fault. MFC after: 3 weeks
* The scandir(3) function expects fourth parameter, compar, be in type of:delphij2012-04-131-4/+4
| | | | | | | | | | | int (*compar)(const struct dirent **, const struct dirent **) The current code defines sortq() to accept two void *, then cast them to const struct dirent **. Because the code does not really need this cast, we can eliminate the casts by changing the function prototype to match scandir(3) expectation. MFC after: 1 month
* - Remove some unnecessary cast when assigning NULL to a handle.kevlo2012-02-151-3/+3
| | | | - Silent a warning
* fgets(3) returns a pointer, so compare against NULL, not integer 0.kevlo2012-01-131-1/+1
|
* Spelling fixes for usr.sbin/uqs2011-12-301-4/+4
|
* Remove the advertising clause from UCB copyrighted files in usr.sbin. Thisjoel2010-12-116-24/+0
| | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
* 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.
OpenPOWER on IntegriCloud