From owner-svn-src-head@freebsd.org Tue Sep 3 14:07:14 2019 Return-Path: Delivered-To: svn-src-head@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 A0106DD2EE; Tue, 3 Sep 2019 14:07:00 +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 46N8033px0z4Q7Y; Tue, 3 Sep 2019 14:06:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id E38CB1AF34; Tue, 3 Sep 2019 14:06:25 +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 3240B13491; Wed, 17 Apr 2019 16:53:31 +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 3EC428842A; Wed, 17 Apr 2019 16:53:30 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1CC351342A; Wed, 17 Apr 2019 16:53:30 +0000 (UTC) Delivered-To: src-committers@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 8377913427; Wed, 17 Apr 2019 16:53:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8550F88425; Wed, 17 Apr 2019 16:53:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm1-x32c.google.com with SMTP id z6so5064948wmi.0; Wed, 17 Apr 2019 09:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4zVKHO9SQEXTLl1Gc+wirfNUm1cXSr2aEZzspW/TLkg=; b=pC3By7K4TeKLHH+gvbYNBdL4Z7iXoY45TU0wR/jbMaSbLBiemIPLUUiQi/S2QFUyhd mLVD8pjneHoPmYlffEDp1cmq2FLEBIS10f4vgvBOXF8TkXAfQeSY+Z1F3BpvVUQToHB5 KcOB1etUfNAsA+cPgASHouFzbNH63a8MgM4Nfj0/QHT8FP1Fx3yx0Q8pzTiQnO0EyNgj 37njgLfKkPvb+pJtqEZOD9eekaQiKP4Z2CCwx7fi/Sz3CLiaoIheVys2/v+hplMYEukP ZOPDLjeWymEnj8I2GRQUXOpkz+IECRxjLidiKDu+46MAIHUjBvWSbBVhxwaOCJ8qogsw +ZCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4zVKHO9SQEXTLl1Gc+wirfNUm1cXSr2aEZzspW/TLkg=; b=k2kxitOP3kmSOGAyXB036zYl5uDcnldLreY0G3McUrbWlxeCth4lO5asSI0esd1c12 1jTust4ObUD7EijU7LnwNETGg9TEiJmVkCWL+D4sYSOgwl49HdPV15OMAvdiVePwlP+2 0uD8HbssKlEaYI3xQUNQJsJ0qlcqykjIXgZN/mYCzN7gOlnkryDx+Q19Ivc7gScABErV jHw5zYxj+8p1R3afvUtLDQTd472gkmaFYhmj3xFWgT1o7+QmDjHQmwzPVk0aAxjjTXLA XJK/65E8W0EtEps+KK9N2ETyH6utEoUvRFzoE95rK3darzZXQQI6EsFQMSOSORdHv8A/ ndgg== X-Gm-Message-State: APjAAAVRqkaDyc0k5wz7alyl/sxeYOVa+UbBhZT8Eb2m9DFXWlbifrLV 2AqmxuM1narBPA/9sEeKwZfphoXgvqxYE9xdEVxOIA== X-Google-Smtp-Source: APXvYqwByrE577Wx9CNgVo8eWzcclfDWRaqxb/l17/8bHW9Y/85LlSUE8URHMrTQyN+vJYH+1Fi9yKuX2anlt8Qw/8s= X-Received: by 2002:a1c:1f08:: with SMTP id f8mr468636wmf.97.1555520003529; Wed, 17 Apr 2019 09:53:23 -0700 (PDT) MIME-Version: 1.0 References: <201904041632.x34GWR4Z006164@repo.freebsd.org> <20190415024246.GA36864@x-wing> In-Reply-To: <20190415024246.GA36864@x-wing> From: Adrian Chadd Message-ID: Subject: Re: svn commit: r345875 - in head: contrib/elftoolchain/strings usr.bin/strings To: Mariusz Zaborski Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3EC428842A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; TAGGED_FROM(0.00)[] Status: O Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:07:14 -0000 X-Original-Date: Wed, 17 Apr 2019 09:53:11 -0700 X-List-Received-Date: Tue, 03 Sep 2019 14:07:14 -0000 not yet? I'm still debugging other issues; this just pissed off gcc. :) -a On Sun, 14 Apr 2019 at 19:42, Mariusz Zaborski wrote: > 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. > > > > 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? > > -- > 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 > > > > > On Thu, 4 Apr 2019 at 09:32, Mariusz Zaborski > wrote: > > > > > 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 > > > > > > > ============================================================================== > > > --- 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[] = { > > > }; > > > > > > 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 = 0; > > > @@ -187,27 +194,41 @@ main(int argc, char **argv) > > > argc -= optind; > > > argv += optind; > > > > > > + cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, > CAP_FCNTL); > > > + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights); > > > + if (fa == 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 == 0) > > > min_len = 4; > > > if (*argv == NULL) > > > rc = find_strings("{standard input}", stdin, 0, 0); > > > else while (*argv != NULL) { > > > - if (handle_file(*argv) != 0) > > > + if (handle_file(fa, *argv) != 0) > > > rc = 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 == NULL) > > > return (1); > > > - pfile = fopen(name, "rb"); > > > + pfile = fileargs_fopen(fa, name, "rb"); > > > if (pfile == NULL) { > > > warnx("'%s': %s", name, strerror(errno)); > > > return (1); > > > > > > Modified: head/usr.bin/strings/Makefile > > > > > > > ============================================================================== > > > --- 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= strings > > > > > > LIBADD= elftc elf > > > > > > +.if ${MK_CASPER} != "no" && !defined(BOOTSTRAPPING) > > > +LIBADD+= casper > > > +LIBADD+= cap_fileargs > > > +CFLAGS+= -DWITH_CASPER > > > +.endif > > > + > > > CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common > > > > > > .include > > > > > > >