From owner-svn-src-all@freebsd.org Tue Sep 3 14:07:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39F5BDD099; Tue, 3 Sep 2019 14:06:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7zv2VQGz4PyY; Tue, 3 Sep 2019 14:06:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 36E441AC86; Tue, 3 Sep 2019 14:06:19 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 08AFA1F664; Mon, 15 Apr 2019 02:42:50 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39C108BEB0; Mon, 15 Apr 2019 02:42:49 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0D43B1F5FF; Mon, 15 Apr 2019 02:42:49 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4E3581F5FD for ; Mon, 15 Apr 2019 02:42:46 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B93098BEAC; Mon, 15 Apr 2019 02:42:45 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lj1-x233.google.com with SMTP id y6so14096994ljd.12; Sun, 14 Apr 2019 19:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UVWvKmRzKXRXH/OufVKUKVXxOeIksECyjNAOPFoyRI4=; b=qtig7QK6NAW/5JhZ5YLxfgGgT5XFQ6J9SoOlJ56pgIgCmH5k9d6VwNmnMWTi4s2uf4 t3bq/cXVM0JgzQPscJgwUTHn4iG88YRV4ZF62F1aVW/3DbXa5YycOMleC0MW7CKhIrG4 vTk3SvUDllNEtsGX/utIWJEvOwAG0Smc1QZsJmu2rTApZPoXZAL41B69PMbBE3gBzmOG hYduxLFxtoHLSNYHcnSqdWtMHQdjuYMYLB+qzqr2xD6WMs3qPa5PezZG8Qjc96A4JN1a SDFnCVARZzOOZLJq/VjxCNSRdV/xD7nUzXPtDQERbQJNZdOyCOPkB8L8Sbio8WO5gcbQ ifmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=UVWvKmRzKXRXH/OufVKUKVXxOeIksECyjNAOPFoyRI4=; b=M1aro9vetTMDU3uQfOgxf2+XNqPV1lA9mkHsGL+Vog6mofnFefv0KK4eP+rPLrYXZB bPZS0ertGkbqN5Tvxeq6R0o5SvXB37EltF7JmCDjMuxPvY0bL+Bg+DXVTp8OgT77ED3M m+Nh9wxlsOqc+m3WhWDW5E8sqcKA2nyZiuZY0nm6CriRrqSwQFfsUx4ItP+czuOVO0RG YPoU4yb+fbdZC/o+HvvMZ4uNk26opsdh3xEn/49jzOK2tCPPiiflBohQ379DMPTr6gUz 4Aus5alVhNwqpB8w+K0Yz7YyAL8OisftL01StvTMtbeeYPwdK6gU7WU46yfOCRZspSsU BkJw== X-Gm-Message-State: APjAAAUYFH/4qRXXyfE1QmSMWHkHiRNDoeUnwXz1wWMkxTzQdfwsLpBO okeUXHEROGsTzaZZS15NSNg= X-Google-Smtp-Source: APXvYqwneG5whVsMuwAgfwxq6YvqaIXWuUiKU+Tiv731m8/hncfEUowqyiGU+bRTOlwH7lc7QlgsGA== X-Received: by 2002:a2e:8ece:: with SMTP id e14mr21496948ljl.66.1555296164199; Sun, 14 Apr 2019 19:42:44 -0700 (PDT) Received: from x-wing (87-206-170-77.dynamic.chello.pl. [87.206.170.77]) by smtp.gmail.com with ESMTPSA id q12sm2228019lfa.37.2019.04.14.19.42.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Apr 2019 19:42:42 -0700 (PDT) From: Mariusz Zaborski To: Adrian Chadd Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345875 - in head: contrib/elftoolchain/strings usr.bin/strings Message-ID: <20190415024246.GA36864@x-wing> References: <201904041632.x34GWR4Z006164@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 39C108BEB0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; TAGGED_RCPT(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:07:41 -0000 X-Original-Date: Mon, 15 Apr 2019 04:42:46 +0200 X-List-Received-Date: Tue, 03 Sep 2019 14:07:41 -0000 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 14, 2019 at 08:19:22AM -0700, Adrian Chadd wrote: > This exposed a fun bug - gcc mips 6.4.0 complains about an unused arg (fa) > in fileargs_fopen() in the strings change when you compile without casper > support. I do that on mips. >=20 > I have a local change that converts the #define to an inline function so > the unused arg can be (void)'ed away. Mind if I commit it? Sounds good to me. Although you don't have an issue with others services? --=20 Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD committer | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 >=20 > On Thu, 4 Apr 2019 at 09:32, Mariusz Zaborski wrote: >=20 > > Author: oshogbo > > Date: Thu Apr 4 16:32:27 2019 > > New Revision: 345875 > > URL: https://svnweb.freebsd.org/changeset/base/345875 > > > > Log: > > strings: capsicumize it > > > > Reviewed by: cem > > Discussed with: emaste > > Differential Revision: https://reviews.freebsd.org/D18038 > > > > Modified: > > head/contrib/elftoolchain/strings/strings.c > > head/usr.bin/strings/Makefile > > > > Modified: head/contrib/elftoolchain/strings/strings.c > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/contrib/elftoolchain/strings/strings.c Thu Apr 4 12:02:48 2019 > > (r345874) > > +++ head/contrib/elftoolchain/strings/strings.c Thu Apr 4 16:32:27 2019 > > (r345875) > > @@ -25,8 +25,10 @@ > > */ > > > > #include > > +#include > > #include > > > > +#include > > #include > > #include > > #include > > @@ -44,6 +46,9 @@ > > #include > > #include > > > > +#include > > +#include > > + > > #include "_elftc.h" > > > > ELFTC_VCSID("$Id: strings.c 3648 2018-11-22 23:26:43Z emaste $"); > > @@ -85,7 +90,7 @@ static struct option strings_longopts[] =3D { > > }; > > > > int getcharacter(FILE *, long *); > > -int handle_file(const char *); > > +int handle_file(fileargs_t *fa, const char *); > > int handle_elf(const char *, FILE *); > > int handle_binary(const char *, FILE *, size_t); > > int find_strings(const char *, FILE *, off_t, off_t); > > @@ -99,6 +104,8 @@ void usage(void); > > int > > main(int argc, char **argv) > > { > > + fileargs_t *fa; > > + cap_rights_t rights; > > int ch, rc; > > > > rc =3D 0; > > @@ -187,27 +194,41 @@ main(int argc, char **argv) > > argc -=3D optind; > > argv +=3D optind; > > > > + cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCN= TL); > > + fa =3D fileargs_init(argc, argv, O_RDONLY, 0, &rights); > > + if (fa =3D=3D NULL) > > + err(1, "Unable to initialize casper fileargs"); > > + > > + caph_cache_catpages(); > > + if (caph_limit_stdio() < 0 && caph_enter_casper() < 0) { > > + fileargs_free(fa); > > + err(1, "Unable to enter capability mode"); > > + } > > + > > if (min_len =3D=3D 0) > > min_len =3D 4; > > if (*argv =3D=3D NULL) > > rc =3D find_strings("{standard input}", stdin, 0, 0); > > else while (*argv !=3D NULL) { > > - if (handle_file(*argv) !=3D 0) > > + if (handle_file(fa, *argv) !=3D 0) > > rc =3D 1; > > argv++; > > } > > + > > + fileargs_free(fa); > > + > > return (rc); > > } > > > > int > > -handle_file(const char *name) > > +handle_file(fileargs_t *fa, const char *name) > > { > > FILE *pfile; > > int rt; > > > > if (name =3D=3D NULL) > > return (1); > > - pfile =3D fopen(name, "rb"); > > + pfile =3D fileargs_fopen(fa, name, "rb"); > > if (pfile =3D=3D NULL) { > > warnx("'%s': %s", name, strerror(errno)); > > return (1); > > > > Modified: head/usr.bin/strings/Makefile > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.bin/strings/Makefile Thu Apr 4 12:02:48 2019 > > (r345874) > > +++ head/usr.bin/strings/Makefile Thu Apr 4 16:32:27 2019 > > (r345875) > > @@ -10,6 +10,12 @@ PROG=3D strings > > > > LIBADD=3D elftc elf > > > > +.if ${MK_CASPER} !=3D "no" && !defined(BOOTSTRAPPING) > > +LIBADD+=3D casper > > +LIBADD+=3D cap_fileargs > > +CFLAGS+=3D -DWITH_CASPER > > +.endif > > + > > CFLAGS+=3D-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common > > > > .include > > > > --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkD1x0xkJXVVY1Gwf38KEGuLGxWQFAlyz758ACgkQ38KEGuLG xWR1Qg/8C64XwBxmWoPJOFc+NN4scD6Pczcy8vBknNSuCK2T3++axg8sLJjiIPuP FmTekAnACu1pZe4WdnirO0mXvB/4sSp/uhvPacGXOhCcfsmgSKuKJIfZt4wqKqrU fv108NyKpLaLXrV9c/8N5Fu7p44aduJxpdkzJcSq0cwTNKOxGVsrDYpfC7o4r0e0 bthYQfhyc9JlMwj75mPTh/DQnwwbpZ6dNodigWSsF4ujvCexjj1pcMefo3IMc88P zYD5hJ9JHZKnIwhbMRpuML4MP1+EHyV3uCxQ1aWekDTltkULzJ8KHaguL+1oWUYL CW9SsnPVcpRmGLK/JOrG5SFnCm2OttIZOnhriMS+LRIhXd+f6J6I5VsgITJbnCbu E+Suo514UOxhInuBODJEGfiUYoJmTM2nOPisNsNE3N/x2ToRW+O1gDA02lL9btRC uSKObJ72FL2Lkmru1LsJz/Z9uGN09o6gSJKrI3DB8QJxlBJeJqUxwNFY8XmAJuaE TRChi7OHQGmH6Ira0s+qUnhFW+jM7hRswe8Q9YD16yKLoY25AQAOn+0ez3BBKqJk LwGa5xQR9M9ItUsvJW2HGYKmhSqHIVtvjsrI1sANWYYUIK/WMIo8TN4ISEsNjpLe 4P6r9mCA8U1ZMt9dm8dMoovh3QShkMELrApJfWZCmX6w+z2QdWw= =ClwG -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o--