[Midnightbsd-cvs] src [10714] tag
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jun 9 17:32:00 EDT 2018
Revision: 10714
http://svnweb.midnightbsd.org/src/?rev=10714
Author: laffer1
Date: 2018-06-09 17:32:00 -0400 (Sat, 09 Jun 2018)
Log Message:
-----------
tag
Modified Paths:
--------------
trunk/usr.sbin/lpr/lpr/Makefile
trunk/usr.sbin/lpr/lpr/lpr.1
trunk/usr.sbin/lpr/lpr/lpr.c
trunk/usr.sbin/lpr/lpr/printcap.5
Property Changed:
----------------
trunk/usr.sbin/lpr/lpr/lpr.1
trunk/usr.sbin/lpr/lpr/printcap.5
Modified: trunk/usr.sbin/lpr/lpr/Makefile
===================================================================
--- trunk/usr.sbin/lpr/lpr/Makefile 2018-06-09 21:31:28 UTC (rev 10713)
+++ trunk/usr.sbin/lpr/lpr/Makefile 2018-06-09 21:32:00 UTC (rev 10714)
@@ -1,7 +1,8 @@
+# $MidnightBSD$
# From: @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/lpr/lpr/Makefile 321275 2017-07-20 01:07:02Z ngie $
-.PATH: ${.CURDIR}/../common_source
+.PATH: ${.CURDIR:H}/common_source
BINDIR= /usr/bin
@@ -11,7 +12,7 @@
BINGRP= daemon
BINMODE= 6555
-CFLAGS+= -I${.CURDIR}/../common_source
+CFLAGS+= -I${.CURDIR:H}/common_source
WARNS?= 2
Modified: trunk/usr.sbin/lpr/lpr/lpr.1
===================================================================
--- trunk/usr.sbin/lpr/lpr/lpr.1 2018-06-09 21:31:28 UTC (rev 10713)
+++ trunk/usr.sbin/lpr/lpr/lpr.1 2018-06-09 21:32:00 UTC (rev 10714)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -26,7 +27,7 @@
.\" SUCH DAMAGE.
.\"
.\" From @(#)lpr.1 8.1 (Berkeley) 6/6/93
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.sbin/lpr/lpr/lpr.1 216372 2010-12-11 09:38:12Z joel $
.\" "
.Dd June 6, 1993
.Dt LPR 1
Property changes on: trunk/usr.sbin/lpr/lpr/lpr.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/lpr/lpr/lpr.c
===================================================================
--- trunk/usr.sbin/lpr/lpr/lpr.c 2018-06-09 21:31:28 UTC (rev 10713)
+++ trunk/usr.sbin/lpr/lpr/lpr.c 2018-06-09 21:32:00 UTC (rev 10714)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -50,7 +51,7 @@
#endif
#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.sbin/lpr/lpr/lpr.c 241852 2012-10-22 03:31:22Z eadler $");
/*
* lpr -- off line print
@@ -75,6 +76,7 @@
#include <grp.h>
#include <unistd.h>
#include <stdlib.h>
+#include <stdint.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
@@ -144,7 +146,7 @@
printer = NULL;
euid = geteuid();
uid = getuid();
- seteuid(uid);
+ PRIV_END
if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
signal(SIGHUP, cleanup);
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
@@ -325,10 +327,10 @@
*/
mktemps(pp);
tfd = nfile(tfname);
- seteuid(euid);
+ PRIV_START
(void) fchown(tfd, pp->daemon_user, -1);
/* owned by daemon for protection */
- seteuid(uid);
+ PRIV_END
card('H', local_host);
card('P', lpr_username);
card('C', class);
@@ -386,8 +388,8 @@
continue; /* file unreasonable */
if (sflag && (cp = linked(arg)) != NULL) {
- (void) snprintf(buf, sizeof(buf), "%u %u", statb.st_dev,
- statb.st_ino);
+ (void)snprintf(buf, sizeof(buf), "%u %ju",
+ statb.st_dev, (uintmax_t)statb.st_ino);
card('S', buf);
if (format == 'p')
card('T', title ? title : arg);
@@ -414,7 +416,7 @@
* can be very significant when running services like
* samba, pcnfs, CAP, et al.
*/
- seteuid(euid);
+ PRIV_START
didlink = 0;
/*
* There are several things to check to avoid any
@@ -452,11 +454,11 @@
* safe. Otherwise, abandon the move and fall back
* to the (usual) copy method.
*/
- seteuid(uid);
+ PRIV_END
ret = access(dfname, R_OK);
if (ret == 0)
ret = unlink(arg);
- seteuid(euid);
+ PRIV_START
if (ret != 0)
goto nohardlink;
/*
@@ -466,7 +468,7 @@
*/
chown(dfname, pp->daemon_user, getegid());
chmod(dfname, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
- seteuid(uid);
+ PRIV_END
if (format == 'p')
card('T', title ? title : arg);
for (i = 0; i < ncopies; i++)
@@ -478,7 +480,7 @@
nohardlink:
if (didlink)
unlink(dfname);
- seteuid(uid); /* restore old uid */
+ PRIV_END /* restore old uid */
} /* end: if (f) */
if ((i = open(arg, O_RDONLY)) < 0) {
@@ -497,7 +499,7 @@
/*
* Touch the control file to fix position in the queue.
*/
- seteuid(euid);
+ PRIV_START
if ((tfd = open(tfname, O_RDWR)) >= 0) {
char touch_c;
@@ -517,7 +519,7 @@
cleanup(0);
}
unlink(tfname);
- seteuid(uid);
+ PRIV_END
if (qflag) /* just q things up */
exit(0);
if (!startdaemon(pp))
@@ -603,9 +605,9 @@
strncat(buf, file, sizeof(buf) - strlen(buf) - 1);
file = buf;
}
- seteuid(euid);
+ PRIV_START
ret = symlink(file, dfname);
- seteuid(uid);
+ PRIV_END
return(ret ? NULL : file);
}
@@ -637,7 +639,7 @@
register int f;
int oldumask = umask(0); /* should block signals */
- seteuid(euid);
+ PRIV_START
f = open(n, O_WRONLY | O_EXCL | O_CREAT, FILMOD);
(void) umask(oldumask);
if (f < 0) {
@@ -648,7 +650,7 @@
printf("%s: cannot chown %s\n", progname, n);
cleanup(0); /* cleanup does exit */
}
- seteuid(uid);
+ PRIV_END
if (++n[inchar] > 'z') {
if (++n[inchar-2] == 't') {
printf("too many files - break up the job\n");
@@ -673,7 +675,7 @@
signal(SIGQUIT, SIG_IGN);
signal(SIGTERM, SIG_IGN);
i = inchar;
- seteuid(euid);
+ PRIV_START
if (tfname)
do
unlink(tfname);
@@ -845,7 +847,7 @@
char buf[BUFSIZ];
(void) snprintf(buf, sizeof(buf), "%s/.seq", pp->spool_dir);
- seteuid(euid);
+ PRIV_START
if ((fd = open(buf, O_RDWR|O_CREAT, 0664)) < 0) {
printf("%s: cannot create %s\n", progname, buf);
exit(1);
@@ -854,7 +856,7 @@
printf("%s: cannot lock %s\n", progname, buf);
exit(1);
}
- seteuid(uid);
+ PRIV_END
n = 0;
if ((len = read(fd, buf, sizeof(buf))) > 0) {
for (cp = buf; len--; ) {
Modified: trunk/usr.sbin/lpr/lpr/printcap.5
===================================================================
--- trunk/usr.sbin/lpr/lpr/printcap.5 2018-06-09 21:31:28 UTC (rev 10713)
+++ trunk/usr.sbin/lpr/lpr/printcap.5 2018-06-09 21:32:00 UTC (rev 10714)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -26,7 +27,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)printcap.5 8.2 (Berkeley) 12/11/93
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.sbin/lpr/lpr/printcap.5 233510 2012-03-26 15:18:14Z joel $
.\"
.Dd October 11, 2000
.Dt PRINTCAP 5
@@ -72,7 +73,7 @@
.Xr termcap 5
for a description of the file layout.
.Bl -column Namexxx Typexx "/var/spool/lpdxxxxx"
-.Sy "Name Type Default Description
+.Sy "Name Type Default Description"
.It "af str" Ta Dv NULL Ta No "name of accounting file"
.It "br num none if lp is a tty, set the baud rate"
.Xr ( ioctl 2
Property changes on: trunk/usr.sbin/lpr/lpr/printcap.5
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list