From nobody Fri Apr 15 19:06:46 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CB0167ED994; Fri, 15 Apr 2022 19:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kg5RB5M7qz4bhT; Fri, 15 Apr 2022 19:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650049606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zs+NWd+uxrB8HawF3ikVj30uTgP0vlXNgy3CwPLnwIo=; b=Z0Q0zIGe/SCY0Erhgl0Jgf1bxR9U0fZQzDkeA9vPOa+diBpENoh57CiocvAUcuBXXH+TbU nU5MsLj/MST5uItCvbBTPQJ7/91owBBDYfKRmkl18GIeZ3f0g4ZWbTDSNsUAvBSsF5o9FX zgpja5rI3bBbeDU+1jfqqBrhr9y1G7EtyV2kLM8+IgbEt3sW49yKc3fkam+yylQLjYShAE U2wxAVQpzzM3sDZgOGpRr3MGCnO+gLWzJ2d3YNMtFpqQfJ+P/AYpmKZxczy1bCtn3J/fgX SdrUuA0lnL4OajsZyCIcdmPcdgGyivi53tVWIM567zYUb12WcM4yTEXgEcytqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97BFC1AB67; Fri, 15 Apr 2022 19:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23FJ6kbN043323; Fri, 15 Apr 2022 19:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23FJ6kgf043322; Fri, 15 Apr 2022 19:06:46 GMT (envelope-from git) Date: Fri, 15 Apr 2022 19:06:46 GMT Message-Id: <202204151906.23FJ6kgf043322@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: a812a5cacbe0 - main - lpr: remove a.out binary detection List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a812a5cacbe06b6ca6917a1e2c023f1e8fe5df2c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650049606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zs+NWd+uxrB8HawF3ikVj30uTgP0vlXNgy3CwPLnwIo=; b=nqNlqwSUkupJy99ryP95vnwsc2rPutDW/f4dHLEJihdwe0uHKnbGiJa2XsTX2/GOzbm+Rj InkZiRNiVU1M6gG1lWZ/sJXfpIjtqX3yjOn739ZFK1Dh2BKu79MGTnyjlgqRIGJ9GFAD62 BQJOgZGJmycxJ7Dn1i2ejyDDsczp+Ls4utbHGGo1pRxKQh5irt1Tcit0A9HlhqsdOX5rT/ py9RornSt5NXtjUWjcrfYdUjAWY0d/Q6wtzLt3Nq5I/REYtSUruZi9o1VTdZSg9Wqr9CH+ BgHjDdug1eQfA7eqFYQGLPnT8gMRYc5KrE7a+ghqVeX74j084TemYu70bX7pxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650049606; a=rsa-sha256; cv=none; b=ACG20VRCtzkBpCrQ9JJpYpmYji+vt6zEC17GubojryomOXSE3aUCa+/KQj43EsX4FVdghn tfx7Jrjqw+Fuq6ytlcyE22RBag1SEIj+DJUTonNDg15Ug76XxYtxzSPjzUgIx0qgKk+G9v HNFyTcXpcSI1Dvr+7W2+tNWgENZSeJmwtyA/iGPwEabwwgYZ2lUcuQgQSZNhGOsJItNZr8 WlQ8cL6oXlYAS7W1U+99U1ll/YjSGsoAdpZxsOjEo78YanAiapz5EwL2hkr9IgWIDeuIjk JzfpNtLAuJJSDcY9WEWQi+IH/WzFP8410N9laUPx/UHGd/qGnY3MY8OJ0GomAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=a812a5cacbe06b6ca6917a1e2c023f1e8fe5df2c commit a812a5cacbe06b6ca6917a1e2c023f1e8fe5df2c Author: Brooks Davis AuthorDate: 2022-04-15 19:04:41 +0000 Commit: Brooks Davis CommitDate: 2022-04-15 19:04:41 +0000 lpr: remove a.out binary detection Since the first unattributed commit in 1981, lpr has attempted to prevent users from printing executables (and in earlier versions archives). Archive detection was lost in 1992 when lpr gained a dependency on a.out.h. No corresponding support was added for ELF files with the full transiation to ELF in 1998, but a.out support has been dragged forward to and contaminated platforms that never supported a.out. While this feature isn't unuseful, preventing the printing of a single file format we stopped producing ~20 years ago isn't worth the costs (however minimal). Reviewed by: gad, imp, emaste Differential Revision: https://reviews.freebsd.org/D34901 --- usr.sbin/lpr/lpr/lpr.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c index 72ba2b3929f1..9845a3774fbe 100644 --- a/usr.sbin/lpr/lpr/lpr.c +++ b/usr.sbin/lpr/lpr/lpr.c @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -703,7 +702,6 @@ cleanup(int signo __unused) static int test(const char *file) { - struct exec execb; size_t dlen; int fd; char *cp, *dirpath; @@ -728,14 +726,6 @@ test(const char *file) printf("%s: cannot open %s\n", progname, file); return(-1); } - /* - * XXX Shall we add a similar test for ELF? - */ - if (read(fd, &execb, sizeof(execb)) == sizeof(execb) && - !N_BADMAG(execb)) { - printf("%s: %s is an executable program", progname, file); - goto error1; - } (void) close(fd); if (rflag) { /* @@ -763,11 +753,6 @@ test(const char *file) printf("%s: %s: is not removable by you\n", progname, file); } return(0); - -error1: - printf(" and is unprintable\n"); - (void) close(fd); - return(-1); } static int