Commit Graph

32 Commits

Author SHA1 Message Date
Mark Johnston
7ef518c05a fileargs_init() sets errno on failure.
Sponsored by:	The FreeBSD Foundation
2019-11-06 01:42:30 +00:00
Ed Maste
d76eef3430 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
2019-04-17 16:18:14 +00:00
Mariusz Zaborski
ce57fd97fe brandelf: capsicumize it 2018-11-18 12:23:03 +00:00
Mariusz Zaborski
d72ba183ff brandelf: fix style nits
No functional change intended.

Reviewed by:	emaste, markj
Differential Revision:	https://reviews.freebsd.org/D17966
2018-11-18 12:03:12 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Eitan Adler
fdba8122d6 Fix warning when compiling with gcc46:
error: variable 'verbose' set but not use

Approved by:	dim
MFC after:      3 days
2012-01-10 02:58:29 +00:00
Ulrich Spörlein
fb2ad9d3a4 Reencode files from latin1 to UTF-8.
This makes a tiny percentage of entries in calendars ugly for latin1
users, but fixes them for UTF-8 users.

This badly needs a solution involving locale-dependent re-encoding.
2011-12-30 10:59:15 +00:00
Ruslan Ermilov
f682f10c76 Sync program's usage() with manpage's SYNOPSIS. 2005-05-21 09:55:10 +00:00
Brian Feldman
816e8c037d Make brandelf(1)'s -t "ABI format" case insensitive, as the ABI value
given is looked up in a table and no longer stored literally in the
header.

Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz
PR: 80499
MFC After: 1 month
2005-05-02 17:19:33 +00:00
Jens Schweikhardt
21dc7d4f57 Fix typo in the BSD copyright: s/withough/without/
Spotted and suggested by:	des
MFC after:	3 weeks
2002-06-02 20:05:59 +00:00
David Malone
9f5b04e925 Style improvements recommended by Bruce as a follow up to some
of the recent WARNS commits. The idea is:

1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.
2001-12-10 21:13:08 +00:00
Mark Murray
7f1afe0e0e Style fixes.
Use __FBSDID().
Be consistent WRT ANSI use.

OK'ed by:	obrien
2001-12-03 00:00:22 +00:00
David E. O'Brien
b0b7095861 Quiet compiler warnings by making `WARNS 2' clean.
Submitted by:	Mike Barcroft <mike@q9media.com>

Set maintainer to myself.  This needs to stay in sync with what Buntils
does, and it would be best to pass functionality changes thru me to make
sure future plans are taken into account.
2001-06-22 21:43:51 +00:00
David E. O'Brien
31255c78c7 Fix $FreeBSD$ style. 2001-05-02 23:57:49 +00:00
David E. O'Brien
5e6220d9d0 * include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.
2001-05-02 23:56:21 +00:00
Jeroen Ruigrok van der Werven
2fa72ea7d4 Fix typo: compatability -> compatibility.
Compatability is not an existing english word.
2001-02-06 12:05:58 +00:00
Warner Losh
9fb5801442 fix fd leak by close(fd) at end of loop. 2000-07-02 03:34:08 +00:00
Brian Feldman
b4739f39af The SVR4 module calls itself ELFOSABI_SOLARIS, and who am I to disagree
if it runs my Solaris binaries?  Add the missing "Solaris" type here
so that binaries may be branded with it rather than the seemingly-
defunct ELFOSABI_SVR4.
2000-07-01 05:48:33 +00:00
David E. O'Brien
c815a20cb2 Change our ELF binary branding to something more acceptable to the Binutils
maintainers.

After we established our branding method of writing upto 8 characters of
the OS name into the ELF header in the padding; the Binutils maintainers
and/or SCO (as USL) decided that instead the ELF header should grow two new
fields -- EI_OSABI and EI_ABIVERSION.  Each of these are an 8-bit unsigned
integer.  SCO has assigned official values for the EI_OSABI field.  In
addition to this, the Binutils maintainers and NetBSD decided that a better
ELF branding method was to include ABI information in a ".note" ELF
section.

With this set of changes, we will now create ELF binaries branded using
both "official" methods.  Due to the complexity of adding a section to a
binary, binaries branded with ``brandelf'' will only brand using the
EI_OSABI method.  Also due to the complexity of pulling a section out of an
ELF file vs. poking around in the ELF header, our image activator only
looks at the EI_OSABI header field.

Note that a new kernel can still properly load old binaries except for
Linux static binaries branded in our old method.

  *
  * For a short period of time, ``ld'' will also brand ELF binaries
  * using our old method.  This is so people can still use kernel.old
  * with a new world.  This support will be removed before 5.0-RELEASE,
  * and may not last anywhere upto the actual release.  My expiration
  * time for this is about 6mo.
  *
2000-04-18 02:39:26 +00:00
Wes Peters
b5ce857bec Make brandelf explain itself a little better on error.
Also, at Boris' suggestion, add -l option to list known
ELF types.

PR:		bin/15285
Reviewed by:	bp
2000-01-04 02:33:54 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Mark Newton
d81380b49d Added "SVR4" as an acceptable brand 1999-01-30 06:16:48 +00:00
Eivind Eklund
7b206e114e Add a forgotten 'static'. 1998-04-21 02:44:12 +00:00
Eivind Eklund
e3e9c8eed9 Make brandelf test for known brands, and introduce a '-f' option to
bypass the testing.

Partially submitted by:  Brian Feldman <green@feldman.dyn.ml.org>
1998-04-21 02:31:09 +00:00
Joerg Wunsch
6fe3822809 Open the file r/o if looking only. Make the error message more useful.
PR:		bin/3283
Submitted by:	Martin Kammerhofer <dada@freepass.tu-graz.ac.at>
1997-08-23 15:51:14 +00:00
Philippe Charnier
4f971ac410 Use err(3). Typo fix in usage string. 1997-06-23 06:47:12 +00:00
John Polstra
5851a3655a Fill out the ELF header files to make them more or less complete.
Fix a macro name that was misspelled both in brandelf.c and
imgact_elf.h.
1997-05-21 23:07:31 +00:00
Warner Losh
1c8af87873 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
Peter Wemm
c115df18cd Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
Joerg Wunsch
b5b54135f4 Add a manpage for brandelf(1). Minor stylistic fixes, and a buffer
overrun fix, too.

Submitted by:	John-Mark Gurney <jmg@nike.efn.org>
1997-02-09 20:35:54 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Søren Schmidt
fcfc24ca7d Utility to "brand" ELF binaries.
Man page to come...
For now use: <brandelf -t Linux linuxbin> to brand, and just
<brandelf> to verify branding on a ELF file. FreeBSD native is
set with <brandelf -t FreeBSD freebsdbin>.
1996-10-16 18:16:22 +00:00