Skip site navigation (1)Skip section navigation (2)

CVS log for src/usr.sbin/lpr/lpc/lpc.c

[BACK] Up to [FreeBSD] / src / usr.sbin / lpr / lpc

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.34: download - view: text, markup, annotated - select for diffs
Fri Jan 13 06:51:15 2012 UTC (3 weeks, 6 days ago) by kevlo
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +1 -1 lines
SVN rev 230044 on 2012-01-13 06:51:15Z by kevlo

fgets(3) returns a pointer, so compare against NULL, not integer 0.

Revision 1.33.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.33.2.1: preferred, colored; next MAIN 1.34: preferred, colored
Changes since revision 1.33.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.33.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.33: preferred, colored; next MAIN 1.34: preferred, colored
Changes since revision 1.33: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.31.2.1.4.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.31.2.1: preferred, colored; next MAIN 1.31.6.1: preferred, colored
Changes since revision 1.31.2.1: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.32.2.1.6.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.32.2.1: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32.2.1: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat Dec 11 09:38:12 2010 UTC (13 months, 4 weeks ago) by joel
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +0 -4 lines
SVN rev 216372 on 2010-12-11 09:38:12Z by joel

Remove the advertising clause from UCB copyrighted files in usr.sbin.  This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Revision 1.32.2.1.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.32.2.1: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32.2.1: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.31.2.1.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.31.2.1: preferred, colored; next MAIN 1.31.6.1: preferred, colored
Changes since revision 1.31.2.1: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.32.2.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.32.2.1: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32.2.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.32.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_2_BP, RELENG_8_1_BP, RELENG_8_0_BP
Branch point for: RELENG_8_2, RELENG_8_1, RELENG_8_0
Diff to: previous 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.31.2.1: download - view: text, markup, annotated - select for diffs
Fri Jul 24 21:42:10 2009 UTC (2 years, 6 months ago) by brooks
Branches: RELENG_7
CVS tags: RELENG_7_4_BP, RELENG_7_3_BP
Branch point for: RELENG_7_4, RELENG_7_3
Diff to: previous 1.31: preferred, colored; next MAIN 1.32: preferred, colored
Changes since revision 1.31: +6 -2 lines
SVN rev 195859 on 2009-07-24 21:42:10Z by brooks

MFC r194494 to improve support for 7.x worlds on >=8.0 kernels:

In preparation for raising NGROUPS and NGROUPS_MAX, change base
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.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Fri Jun 19 15:58:24 2009 UTC (2 years, 7 months ago) by brooks
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +6 -2 lines
SVN rev 194494 on 2009-06-19 15:58:24Z by brooks

In preparation for raising NGROUPS and NGROUPS_MAX, change base
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

Revision 1.31.8.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.31: preferred, colored; next MAIN 1.32: preferred, colored
Changes since revision 1.31: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.31.6.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.31: preferred, colored; next MAIN 1.32: preferred, colored
Changes since revision 1.31: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.30.12.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.30: preferred, colored; next MAIN 1.31: preferred, colored
Changes since revision 1.30: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed Oct 19 16:37:52 2005 UTC (6 years, 3 months ago) by stefanf
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_2_BP, RELENG_7_1_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7_2, RELENG_7_1, RELENG_7
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +1 -1 lines
Use the new name H_SETSIZE instead of the old H_EVENT to set the history
size.

PR:		86355
Approved by:	gad

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Feb 22 02:56:42 2005 UTC (6 years, 11 months ago) by delphij
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2, RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0, RELENG_6
Branch point for: RELENG_6_4
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +1 -1 lines
MFS5: Minor style(9) tweak.

Revision 1.28.4.1: download - view: text, markup, annotated - select for diffs
Tue Feb 22 02:54:36 2005 UTC (6 years, 11 months ago) by delphij
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.28: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28: +1 -1 lines
MFC revision 1.29
date: 2005/02/15 10:23:01;  author: delphij;  state: Exp;  lines: +1 -1
Be more careful when doing el_parse() - only do it when el is
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

Revision 1.29: download - view: text, markup, annotated - select for diffs
Tue Feb 15 10:23:01 2005 UTC (6 years, 11 months ago) by delphij
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +1 -1 lines
Be more careful when doing el_parse() - only do it when el is
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

Revision 1.13.2.12.4.1: download - view: text, markup, annotated - select for diffs
Wed May 12 03:14:00 2004 UTC (7 years, 9 months ago) by tjr
Branches: RELENG_4_10
CVS tags: RELENG_4_10_0_RELEASE
Diff to: previous 1.13.2.12: preferred, colored; next MAIN 1.13.2.13: preferred, colored
Changes since revision 1.13.2.12: +2 -2 lines
MFS rev. 1.13.2.13: Fix two buffer overflows caused by off-by-one errors:
avoid writing a null 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[].

Approved by:	re (kensmith)

Revision 1.13.2.13: download - view: text, markup, annotated - select for diffs
Wed May 12 02:11:33 2004 UTC (7 years, 9 months ago) by tjr
Branches: RELENG_4
CVS tags: RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11
Diff to: previous 1.13.2.12: preferred, colored; branchpoint 1.13: preferred, colored; next MAIN 1.14: preferred, colored
Changes since revision 1.13.2.12: +2 -2 lines
MFC rev. 1.28: Fix two buffer overflows caused by off-by-one errors:
avoid writing a null 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[].

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Oct 13 07:24:22 2003 UTC (8 years, 4 months ago) by tjr
Branches: MAIN
CVS tags: RELENG_5_BP, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3, RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Branch point for: RELENG_5
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +2 -2 lines
Fix two buffer overflows caused by off-by-one errors: avoid writing a null
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

Revision 1.13.2.12: download - view: text, markup, annotated - select for diffs
Thu Jul 31 00:43:09 2003 UTC (8 years, 6 months ago) by gad
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_10_BP
Branch point for: RELENG_4_10
Diff to: previous 1.13.2.11: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.11: +5 -4 lines
MFC:  all lpr/lpc/* changes to use __FBSDID(), and to fix 'sccsid'
lines to consistently match style(9) guidelines.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Jul 14 22:24:28 2003 UTC (8 years, 6 months ago) by gad
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +5 -4 lines
More changes to use __FBSDID() for setting rcsids, and fix the
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

Revision 1.13.2.11: download - view: text, markup, annotated - select for diffs
Fri Jul 26 03:12:07 2002 UTC (9 years, 6 months ago) by gad
Branches: RELENG_4
CVS tags: RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7
Diff to: previous 1.13.2.10: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.10: +42 -0 lines
MFC *: Changes which rewrite 'lpc topq', and which add 'lpc bottomq'.
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.

[* = 1.10 common_source/Makefile, 1.1->1.2 matchjobs.c, 1.1 matchjobs.h,
 1.12 lpc/Makefile, 1.10 cmdtab.c, 1.11 extern.h, 1.20 lpc.8, 1.26 lpc.c,
 1.1 movejobs.c]

Revision 1.26: download - view: text, markup, annotated - select for diffs
Wed Jul 17 00:51:19 2002 UTC (9 years, 6 months ago) by gad
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1, RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +42 -0 lines
Changes which rewrite 'lpc topq', and which add 'lpc bottomq'.  These
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

Revision 1.13.2.10: download - view: text, markup, annotated - select for diffs
Tue Jun 25 22:55:07 2002 UTC (9 years, 7 months ago) by gad
Branches: RELENG_4
Diff to: previous 1.13.2.9: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.9: +9 -5 lines
MFC *: Add a new command to 'lpc' called 'setstatus', which would be used
to change the status message of a print queue.

[* = 1.26 cmds.c, 1.6 cmdtab.c, 1.7 extern.h, 1.16 lpc.8, 1.25 lpc.c,
 1.5 lpc.h]

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sat Jun 15 22:51:58 2002 UTC (9 years, 7 months ago) by gad
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +9 -5 lines
Add a new command to 'lpc' called 'setstatus', which would be used to
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

Revision 1.24: download - view: text, markup, annotated - select for diffs
Mon Oct 1 08:46:45 2001 UTC (10 years, 4 months ago) by obrien
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +1 -1 lines
Adjust to the libedit enhancements some functions now take more parameters.

Partially submitted by:	kris

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Oct 1 08:43:57 2001 UTC (10 years, 4 months ago) by obrien
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +5 -4 lines
*** empty log message ***

Revision 1.13.2.9: download - view: text, markup, annotated - select for diffs
Thu Sep 27 16:53:40 2001 UTC (10 years, 4 months ago) by gad
Branches: RELENG_4
CVS tags: RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6, RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5
Diff to: previous 1.13.2.8: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.8: +10 -1 lines
MFC 1.22:  Fix so that lpc's interactive-mode will not be confused by EditLine
processing into thinking that there is a print-queue called 'xterm'...

Revision 1.22: download - view: text, markup, annotated - select for diffs
Mon Sep 17 02:35:34 2001 UTC (10 years, 4 months ago) by gad
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +10 -1 lines
Fix so that lpc's interactive-mode will not be confused by EditLine processing
into thinking that there is a print-queue called 'xterm'...

Reviewed by:	short discussion on freebsd-stable
MFC after:	1 week

Revision 1.13.2.8: download - view: text, markup, annotated - select for diffs
Sun Jul 29 23:17:36 2001 UTC (10 years, 6 months ago) by gad
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4
Diff to: previous 1.13.2.7: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.7: +2 -2 lines
MFC 1.21: Get rid of a compile-time warning by casting to (size_t).

Revision 1.21: download - view: text, markup, annotated - select for diffs
Mon Jul 23 01:13:20 2001 UTC (10 years, 6 months ago) by gad
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +2 -2 lines
Get rid of a compile-time warning by casting to (size_t).

MFC after:	1 week

Revision 1.13.2.7: download - view: text, markup, annotated - select for diffs
Sun Jul 22 03:21:52 2001 UTC (10 years, 6 months ago) by gad
Branches: RELENG_4
Diff to: previous 1.13.2.6: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.6: +11 -7 lines
MFC 1.20: Get rid of one compile-time warning (on alpha) by changing
an 'int' to a 'size_t'.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sun Jul 15 03:10:54 2001 UTC (10 years, 6 months ago) by gad
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +11 -7 lines
Get rid of one compile-time warning by changing an 'int' to a 'size_t'.

MFC after:	1 week

Revision 1.13.2.6: download - view: text, markup, annotated - select for diffs
Wed Jul 11 23:44:48 2001 UTC (10 years, 7 months ago) by gad
Branches: RELENG_4
Diff to: previous 1.13.2.5: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.5: +11 -3 lines
...[MFC]  Make 'lpc clean' somewhat safer, and have it look for 'core' files
in spool directories.  Also add the 'lpc tclean' command, which shows what
a 'lpc clean' command would do without removing any files.  Also adds a
summary line to 'lpc clean' and 'lpc tclean'.

[1.17 cmds.c, 1.4 cmdtab.c, 1.5 extern.h, 1.13 lpc.8, 1.19 lpc.c, 1.4 lpc.h]

Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Jun 25 02:05:03 2001 UTC (10 years, 7 months ago) by gad
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +11 -3 lines
Make 'lpc clean' somewhat safer.  Add an 'lpc tclean' command, which allows
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

Revision 1.13.2.5: download - view: text, markup, annotated - select for diffs
Mon Jun 25 00:48:59 2001 UTC (10 years, 7 months ago) by gad
Branches: RELENG_4
Diff to: previous 1.13.2.4: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.4: +2 -2 lines
[MFC from 2001/06/15]
Rename global variable 'name' to 'progname', thus fixing about 10 warnings
which come up for various routines that have a parameter also called 'name'.

Reviewed by:	freebsd-print@bostonradio.org

Revision 1.13.2.4: download - view: text, markup, annotated - select for diffs
Mon Jun 25 00:37:27 2001 UTC (10 years, 7 months ago) by gad
Branches: RELENG_4
Diff to: previous 1.13.2.3: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.3: +17 -23 lines
[MFC from 2001/06/12]
Fix about 85 warnings one gets when trying to compile lpr&friends
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
(object for lptest.c changes due to the $FreeBSD$ line being added)

Reviewed by:	/sbin/md5, and freebsd-audit, freebsd-print

Revision 1.18: download - view: text, markup, annotated - select for diffs
Fri Jun 15 16:28:35 2001 UTC (10 years, 7 months ago) by gad
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -2 lines
Rename global variable 'name' to 'progname', thus fixing a number of
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

Revision 1.17: download - view: text, markup, annotated - select for diffs
Tue Jun 12 16:38:17 2001 UTC (10 years, 8 months ago) by gad
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +17 -23 lines
Fix about 90-100 warnings one gets when trying to compile lpr&friends
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

Revision 1.13.2.3: download - view: text, markup, annotated - select for diffs
Tue Dec 26 22:31:45 2000 UTC (11 years, 1 month ago) by gad
Branches: RELENG_4
CVS tags: RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3
Diff to: previous 1.13.2.2: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.2: +5 -3 lines
(MFC) 'lpc' assumed that getgroups() always returns NGROUPS groups, which
      is not true.  Get the return value from getgroups() and loop that
      many times.         (1.15, from August)

Noticed by: David A. Holland <dholland@eecs.harvard.edu>

Revision 1.13.2.2: download - view: text, markup, annotated - select for diffs
Tue Dec 26 18:42:08 2000 UTC (11 years, 1 month ago) by gad
Branches: RELENG_4
Diff to: previous 1.13.2.1: preferred, colored; branchpoint 1.13: preferred, colored
Changes since revision 1.13.2.1: +3 -3 lines
(MFC) Get rid of a minor compile-time warning.   (1.16)

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Nov 6 19:19:49 2000 UTC (11 years, 3 months ago) by gad
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +3 -3 lines
Get rid of a minor compile-time warning.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Aug 23 23:36:32 2000 UTC (11 years, 5 months ago) by alfred
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +5 -3 lines
the code assumes that getgroups() always returns NGROUPS groups, however
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>

Revision 1.13.2.1: download - view: text, markup, annotated - select for diffs
Mon Jul 3 06:23:49 2000 UTC (11 years, 7 months ago) by ps
Branches: RELENG_4
CVS tags: RELENG_4_2_0_RELEASE, RELENG_4_1_1_RELEASE, RELENG_4_1_0_RELEASE
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +1 -1 lines
MFC: [rev 1.14] Quit on EOF from terminal instead of redisplaying
the prompt.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Fri Jun 30 20:05:21 2000 UTC (11 years, 7 months ago) by mph
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +2 -2 lines
Quit on EOF from terminal instead of redisplaying the prompt.

Revision 1.3.2.3: download - view: text, markup, annotated - select for diffs
Sun Sep 5 11:40:23 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_2
Diff to: previous 1.3.2.2: preferred, colored; branchpoint 1.3: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3.2.2: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.8.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 29 15:43:20 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE, RELENG_3_4_0_RELEASE, RELENG_3_3_0_RELEASE
Diff to: previous 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Aug 28 01:16:51 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.12: download - view: text, markup, annotated - select for diffs
Fri Aug 20 07:14:34 1999 UTC (12 years, 5 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +2 -2 lines
Fix some cut and paste damage.

Noticed by: Norman C. Rice <nrice@emu.sourcee.com>

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri Aug 20 01:24:35 1999 UTC (12 years, 5 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +5 -3 lines
What the heck was I thinking?  Nobody else saw this?  Sheesh.

(num > MAX) ? MAX : num

rather than

(MAX > num) ? MAX : num

Also, make things a little easier to read while I'm here.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Aug 19 04:10:32 1999 UTC (12 years, 5 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -1 lines
Use el_source() so we pick up .editrc

Revision 1.9: download - view: text, markup, annotated - select for diffs
Thu Aug 19 03:29:13 1999 UTC (12 years, 5 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +44 -23 lines
Add support for command line editing and history.

Remove src/contrib/bind/bin/nslookup/commands.c as it is generated by lex
from commands.l.

Submitted by: lpc/cdcontrol patches originally by msmith.
Reviewed by: msmith (in theory)

Revision 1.8: download - view: text, markup, annotated - select for diffs
Fri Sep 11 18:49:31 1998 UTC (13 years, 5 months ago) by wollman
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE, RELENG_3_1_0_RELEASE, RELENG_3_0_0_RELEASE
Branch point for: RELENG_3
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +9 -8 lines
Fix additional warnings.  Remove -Werror, since some people have complained
about it.

PR:		7886
Submitted by:	Stefan Eggers <seggers@semyam.dinoco.de> (partially)

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Mar 22 20:19:27 1998 UTC (13 years, 10 months ago) by jb
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -2 lines
Cast an argument to int for a printf field width the way that gcc
prefers it. This source is compiled with -Werror so the slightest
warning is enough to ruin my day.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Dec 2 20:45:43 1997 UTC (14 years, 2 months ago) by wollman
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +11 -4 lines
Mega lpd/lpd upgrade, part I:

- 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...

Revision 1.3.2.2: download - view: text, markup, annotated - select for diffs
Thu Sep 25 06:32:33 1997 UTC (14 years, 4 months ago) by charnier
Branches: RELENG_2_2
CVS tags: RELENG_2_2_8_RELEASE, RELENG_2_2_7_RELEASE, RELENG_2_2_6_RELEASE, RELENG_2_2_5_RELEASE
Diff to: previous 1.3.2.1: preferred, colored; branchpoint 1.3: preferred, colored
Changes since revision 1.3.2.1: +14 -13 lines
MFC: Use err(3). Add usage(). Various fixes in man pages.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Wed Sep 24 06:47:46 1997 UTC (14 years, 4 months ago) by charnier
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +14 -13 lines
Use err(3). Add usage(). Various fixes in man pages.

Revision 1.3.2.1: download - view: text, markup, annotated - select for diffs
Thu Aug 14 23:10:18 1997 UTC (14 years, 5 months ago) by imp
Branches: RELENG_2_2
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +12 -4 lines
Merge in the OpenBSD security changes from -current.  Any revs by
imp between 7/23 and 8/1 are included in this update.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Wed Jul 23 00:49:24 1997 UTC (14 years, 6 months ago) by imp
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +12 -4 lines
Use setuid/seteuid around dangerous operations.  Also a few buffer
overflow patches that were "near" to where these operations are taking
place.  The buffer overflows are from OpenBSD.  The setuid/seteuid patches
are from NetBSD by way of OpenBSD (they changed them a little), at least from
my read of the tree.

This is the first of a series of OpenBSD lpr/et al merges.  It (and them)
should be merged back into 2.2 and/or 2.1 (if requested) branches when they
have been shaken out in -current.
Obtained from: OpenBSD

Revision 1.1.1.1.6.1: download - view: text, markup, annotated - select for diffs
Fri Nov 1 04:57:02 1996 UTC (15 years, 3 months ago) by imp
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_7_RELEASE, RELENG_2_1_6_RELEASE, RELENG_2_1_6_1_RELEASE
Diff to: previous 1.1.1.1: preferred, colored; next MAIN 1.1.1.2: preferred, colored
Changes since revision 1.1.1.1: +1 -1 lines
Back port OpenBSD of 961025 merge in -current to -stable

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Oct 27 03:06:23 1996 UTC (15 years, 3 months ago) by imp
Branches: MAIN
CVS tags: RELENG_2_2_BP, RELENG_2_2_2_RELEASE, RELENG_2_2_1_RELEASE, RELENG_2_2_0_RELEASE
Branch point for: RELENG_2_2
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -1 lines
lpc/cmds.c:
	From NetBSD via OpenBSD to fix NetBSD PR #506
	More descriptive message for printer status
	(OpenBSD: 1.2)

	Various warnings cleaned up (OpenBSD: 1.4)

lpc/lpc.c:
	Various warnings cleaned up (OpenBSD: 1.3)

lpd/lpd.c:
	Remove trailing blank lines (OpenBSD: 1.2)

	Potential umask problem with creating /dev/printer
	(OpenBSD: 1.4 and 1.5)

	Ftp bounce attack (untested on FreeBSD)
	(OpenBSD: 1.6, 1.8, 1.9)
	Fencepost in strncpy
	(OpenBSD: 1.6)

lpd/printjob.c:
	Fix from freebsd for waiting for an exiting filter, that
	appears not in the FreeBSD CVS tree.
	(OpenBSD: 1.6)

lpd/recvjob.c:
	Buffer overflow protection: use strncpy rather than strcpy.
	(OpenBSD: 1.3)

lpr/lpr.c:
	NetBSD change of return type for main()
	(OpenBSD: 1.2)

	Restrict time running as root
	(OpenBSD: 1.7)

	Use getcwd rather than getwd (from NetBSD)

	Use snprintf rather than sprintf
	(OpenBSD: 1.8)

	Minor tweak to end of loop and buffer overflow sanity.  card()
	overflow already in FreeBSD
	(OpenBSD: 1.9)

lptest/lptest.c:
	void -> int return type of main, from NetBSD via OpenBSD
	(OpenBSD: 1.2)

pac/pac.c:
	void -> int return type of main, from NetBSD via OpenBSD
	(OpenBSD: 1.3)

Obtained from: OpenBSD

Revision 1.2: download - view: text, markup, annotated - select for diffs
Thu May 9 22:44:18 1996 UTC (15 years, 9 months ago) by joerg
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +41 -5 lines
Cleanup.

The removed files are no longer needed, they are actually labelled as
``Use only if you are not 4.4BSD''.  (Yeah, the ol' crufty printcap.c
is really gone!)

Properly declare all external objects in files ending in .h, as
opposed to embed them into files ending in .c.

Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Sun May 5 14:04:14 1996 UTC (15 years, 9 months ago) by joerg
Branches: CSRG
CVS tags: bsd_44_lite_2
Diff to: previous 1.1.1.1: preferred, colored
Changes since revision 1.1.1.1: +41 -4 lines
Vendor-branch import of the 4.4BSD-Lite2 code for lpr.  There are
several bugfixes in it that are worth considering.

Don't be alarmed about the import conflicts...

Obtained from: 4.4BSD-Lite2

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Thu May 26 05:21:55 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: CSRG
CVS tags: bsd_44_lite, RELENG_2_1_5_RELEASE, RELENG_2_1_0_RELEASE, RELENG_2_1_0_BP, RELENG_2_0_5_RELEASE, RELENG_2_0_5_BP, RELENG_2_0_5_ALPHA, RELENG_2_0_5, RELEASE_2_0, BETA_2_0, ALPHA_2_0
Branch point for: RELENG_2_1_0
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
BSD 4.4 Lite usr.sbin Sources

Revision 1.1: download - view: text, markup, annotated - select for diffs
Thu May 26 05:21:54 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options