From owner-svn-src-head@freebsd.org Wed Apr 17 16:53:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA8C31572211; 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 Date: Wed, 17 Apr 2019 09:53:11 -0700 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 X-Rspamd-Queue-Id: 8550F88425 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=pC3By7K4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2a00:1450:4864:20::32c as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-6.60 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.78)[-0.780,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.81)[ip: (-9.36), ipnet: 2a00:1450::/32(-2.38), asn: 15169(-2.22), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[c.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2] 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 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2019 16:53:27 -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 > > > > > > >