svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc
Cy Schubert
Cy.Schubert at cschubert.com
Tue Sep 3 14:07:55 UTC 2019
In message <20190417195145.6824c0f9 at thor.intern.walstatt.dynvpn.de>,
"O. Hartma
nn" writes:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Am Wed, 17 Apr 2019 16:18:14 +0000 (UTC)
> Ed Maste <emaste at FreeBSD.org> schrieb:
>
> > Author: emaste
> > Date: Wed Apr 17 16:18:14 2019
> > New Revision: 346316
> > URL: https://svnweb.freebsd.org/changeset/base/346316
> >
> > Log:
> > cap_fileargs: chase r346315, update fileargs_init in consumers
> >
> > Reported by: ci.freebsd.org (8 times so far)
> > MFC after: 3 weeks
> > MFC with: r346315
> > Sponsored by: The FreeBSD Foundation
> >
> > Modified:
> > head/contrib/elftoolchain/strings/strings.c
> > head/sbin/savecore/savecore.c
> > head/usr.bin/brandelf/brandelf.c
> > head/usr.bin/head/head.c
> > head/usr.bin/wc/wc.c
> >
> > Modified: head/contrib/elftoolchain/strings/strings.c
> > ===========================================================================
> ===
> > --- head/contrib/elftoolchain/strings/strings.c Wed Apr 17 16:02:57 201
> 9
> > (r346315) +++ head/contrib/elftoolchain/strings/strings.c Wed Apr 17 16:1
> 8:14
> > 2019 (r346316) @@ -195,7 +195,7 @@ main(int argc, char **argv)
> > argv += optind;
> >
> > cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCNTL);
> > - fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights);
> > + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
> > if (fa == NULL)
> > err(1, "Unable to initialize casper fileargs");
> >
> >
> > Modified: head/sbin/savecore/savecore.c
> > ===========================================================================
> ===
> > --- head/sbin/savecore/savecore.c Wed Apr 17 16:02:57 2019 (r34631
> 5)
> > +++ head/sbin/savecore/savecore.c Wed Apr 17 16:18:14 2019 (r34631
> 6)
> > @@ -1030,7 +1030,7 @@ init_caps(int argc, char **argv)
> > */
> > (void)cap_rights_init(&rights, CAP_PREAD, CAP_WRITE, CAP_IOCTL);
> > capfa = fileargs_init(argc, argv, checkfor || keep ? O_RDONLY : O_RDWR,
> > - 0, &rights);
> > + 0, &rights, FA_OPEN);
> > if (capfa == NULL) {
> > logmsg(LOG_ERR, "fileargs_init(): %m");
> > exit(1);
> >
> > Modified: head/usr.bin/brandelf/brandelf.c
> > ===========================================================================
> ===
> > --- head/usr.bin/brandelf/brandelf.c Wed Apr 17 16:02:57 2019
> (r346315)
> > +++ head/usr.bin/brandelf/brandelf.c Wed Apr 17 16:18:14 2019
> (r346316)
> > @@ -133,7 +133,7 @@ main(int argc, char **argv)
> > if (flags == O_RDWR)
> > cap_rights_set(&rights, CAP_WRITE);
> >
> > - fa = fileargs_init(argc, argv, flags, 0, &rights);
> > + fa = fileargs_init(argc, argv, flags, 0, &rights, FA_OPEN);
> > if (fa == NULL)
> > errx(1, "unable to init casper");
> >
> >
> > Modified: head/usr.bin/head/head.c
> > ===========================================================================
> ===
> > --- head/usr.bin/head/head.c Wed Apr 17 16:02:57 2019 (r34631
> 5)
> > +++ head/usr.bin/head/head.c Wed Apr 17 16:18:14 2019 (r34631
> 6)
> > @@ -115,7 +115,7 @@ main(int argc, char *argv[])
> > argv += optind;
> >
> > fa = fileargs_init(argc, argv, O_RDONLY, 0,
> > - cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL));
> > + cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL), FA_OPEN);
> > if (fa == NULL)
> > errx(1, "unable to init casper");
> >
> >
> > Modified: head/usr.bin/wc/wc.c
> > ===========================================================================
> ===
> > --- head/usr.bin/wc/wc.c Wed Apr 17 16:02:57 2019 (r346315)
> > +++ head/usr.bin/wc/wc.c Wed Apr 17 16:18:14 2019 (r346316)
> > @@ -133,7 +133,7 @@ main(int argc, char *argv[])
> > (void)signal(SIGINFO, siginfo_handler);
> >
> > fa = fileargs_init(argc, argv, O_RDONLY, 0,
> > - cap_rights_init(&rights, CAP_READ, CAP_FSTAT));
> > + cap_rights_init(&rights, CAP_READ, CAP_FSTAT), FA_OPEN);
> > if (fa == NULL) {
> > xo_warn("Unable to init casper");
> > exit(1);
> > _______________________________________________
> > svn-src-head at freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-head
> > To unsubscribe, send any mail to "svn-src-head-unsubscribe at freebsd.org"
>
> This commit seems to break buildworld on my installations:
>
> [...]
> Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.bin/strings/strings.o
> - --- strings.o ---
> /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of undecla
> red identifier
> 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
> ^
> 1 error generated.
> *** [strings.o] Error code 1
Try this. We shouldn't use headers in /usr/include, only the ones in
src/.
Index: tools/build/Makefile
===================================================================
--- tools/build/Makefile (revision 346330)
+++ tools/build/Makefile (working copy)
@@ -59,9 +59,7 @@
INCS+= libcasper.h
.endif
-.if !exists(/usr/include/casper/cap_fileargs.h)
CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs.
h
-.endif
.if empty(SRCS)
SRCS= dummy.c
I found a number of bugs like this one in heimdal in base and in ntp
previously.
--
Cheers,
Cy Schubert <Cy.Schubert at cschubert.com>
FreeBSD UNIX: <cy at FreeBSD.org> Web: http://www.FreeBSD.org
The need of the many outweighs the greed of the few.
More information about the svn-src-all
mailing list