Commit graph

92 commits

Author SHA1 Message Date
Warner Losh 0b8224d1cc Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by:		Netflix
2023-11-26 22:23:58 -07:00
Warner Losh bdcbfde31e usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:30 -07:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Emmanuel Vadot 93c4369096 pkgbase: Put more binaries/lib in runtime
Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33435
2021-12-21 10:17:27 +01:00
Alan Somers 4a06e93773 id: sanitize arguments better
The -[AMc] flags ignore the user argument.  Better if id rejects
invocations that include a user argument along with any of those flags.

PR:		256554
MFC after:	2 weeks
Reviewed by:	trasz
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D30734
2021-06-15 06:51:16 -06:00
Fernando Apesteguía 97c8162543 id(1): Add EXAMPLES section
Add some examples covering the flags: G, n, P, p, u

Add reference to groups(1)

Approved by:	manpages (gbe@)
Differential Revision:		https://reviews.freebsd.org/D27539
2020-12-10 18:34:15 +00:00
Fernando Apesteguía fc89b27576 groups(1): Add EXAMPLE
Add a super simple example

Approved by:	manpages (gbe@)
Differential Revision:		https://reviews.freebsd.org/D27538
2020-12-10 17:48:34 +00:00
Pedro F. Giffuni 8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

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.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Gleb Kurtsou 9b33705411 Adjust printf format specifiers for dev_t and ino_t in user space.
ino_t and dev_t are about to become uint64_t.

Reviewed by:	kib, mckusick
2014-12-17 07:10:48 +00:00
Simon J. Gerraty 488c975a1f Updated/new dependencies 2014-11-19 07:10:38 +00:00
Simon J. Gerraty 9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Baptiste Daroussin 1deb311eeb id(1) only uses getaudit(2) from the BSM which is part of the libc 2014-11-05 15:03:58 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Ed Schouten 6291cd02cb Correct the change made in r227166.
This function is only compiled in when building WITH_AUDIT.
2011-11-06 09:09:45 +00:00
Ed Schouten f82c82df6d Add missing static keywords to id(1) 2011-11-06 08:15:30 +00:00
Edward Tomasz Napierala 2bfc50bc4f Add two new system calls, setloginclass(2) and getloginclass(2). This makes
it possible for the kernel to track login class the process is assigned to,
which is required for RCTL.  This change also make setusercontext(3) call
setloginclass(2) and makes it possible to retrieve current login class using
id(1).

Reviewed by:	kib (as part of a larger patch)
2011-03-05 12:40:35 +00:00
Joel Dahl da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Ed Schouten b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Brooks Davis 54404cfb13 In preparation for raising NGROUPS and NGROUPS_MAX, change base
system callers of getgroups(), getgrouplist(), and setgroups() to
allocate buffers dynamically.  Specifically, allocate a buffer of size
sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow).

This (or similar gymnastics) is required for the code to actually follow
the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime
and where getgroups may return {NGROUPS_MAX}+1 results on systems like
FreeBSD which include the primary group.

In id(1), don't pointlessly add the primary group to the list of all
groups, it is always the first result from getgroups().  In principle
the old code was more portable, but this was only done in one of the two
places where getgroups() was called to the overall effect was pointless.

Document the actual POSIX requirements in the getgroups(2) and
setgroups(2) manpages.  We do not yet support a dynamic NGROUPS, but we
may in the future.

MFC after:	2 weeks
2009-06-19 15:58:24 +00:00
Christian S.J. Peron 2e61a3d00a Fix id -A when the subject has an extended subject token associated with
them (for example when they have logged in from an ip6 source).

- Stick with the initial call to getaudit(2), if it returns E2BIG, use
  getaudit_addr(2) instead and set the "extended" flag to indicate that
  we the calling credential has an extended subject state.
- Additionally, add the printing of the machine/at_addr (the ip/ip6
  addresses)

MFC after:	1 week
Obtained from:	TrustedBSD Project
2007-10-14 00:52:30 +00:00
Stefan Farfeleder 703dfcbeb9 Fix SUSv3 compliance: Use a single comma instead of comma and space to separate
additional group entries.

PR:		107298
Submitted by:	Joost Bekkers
2006-12-29 12:28:34 +00:00
Ruslan Ermilov edea595c91 Improve markup. 2006-12-23 17:14:01 +00:00
Mike Pritchard f2588359cb Do not exit without printing the id information if the uid of the
user executing the command cannot be looked up in the password file.
2006-12-09 12:58:14 +00:00
Ceri Davies de5e5e6ead Add a -a option as a no-op for Solaris compatibility, as briefly
discussed on src-committers.  This is intentionally not included in the
usage() function as it would confuse the output too much.

Approved by:	jhb
MFC after:	1 week
2006-09-26 22:28:12 +00:00
Ruslan Ermilov acc17cb5a5 Fix both arguments to err(). 2006-09-26 05:46:55 +00:00
Robert Watson f4882b24fd Rename "-a" flag to "-A" in order to avoid conflicting with the "-a" flag
as found on Solaris.

Requested by:	ceri
MFC after:	3 days
2006-09-23 15:43:29 +00:00
Robert Watson 5bae3124ab Add a -a argument to id(1), which causes id(1) to print out process
audit properties, including the audit user id.  This can be quite
helpful in debugging audit problems.

Obtained from:	TrustedBSD Project
MFC after:	3 days
2006-09-23 12:30:31 +00:00
Stefan Farfeleder 311e80b148 Print the euid after the gid as demanded by POSIX.
Submitted by:	Martin Nagy <nagy.martin@gmail.com>
PR:		96239
MFC after:	2 weeks
2006-05-28 12:32:30 +00:00
Robert Drehmel 7f31354152 Add flag to choose whether to use getgrouplist(3) or getgroups(2)
to the id_print() function.

Use getgrouplist(3) for the case when an user was specified,
and getgroups(2) when no user was given.
That reverts to the expected behaviour and makes it easy to
implement an option later to force using getgrouplist(3).
2005-04-29 10:11:18 +00:00
Robert Drehmel 5b8e7b6b29 Fix spelling error. 2005-04-29 08:37:52 +00:00
Robert Drehmel 58b6761db3 We need to pass NGROUPS + 1 to getgrouplist(3) to display
NGROUPS groups.  getgrouplist(3) may put a duplicate group
id into the passed array (it sets [0] and [1] to the value
of the gid argument), but id_print() sorts them out.
2005-04-28 16:11:37 +00:00
Robert Drehmel 68b9b81e79 - Merge two functions for printing `id' output.
Showing the ids of both an user given by an argument to `id',
   and the current user, is now handled in a single function.
   Displaying the current user's ids was inaccurate because
   getgroups(2) had been used.  getgroups(2) returns the current
   kernel state of a user's groups, which may not always be
   correct if /etc/group was recently changed.
 - Fix a few style bugs.

PR:		bin/78085
2005-04-28 15:55:54 +00:00
Stefan Farfeleder 6c97c3d1d3 Remove unused variables. 2005-04-09 14:31:41 +00:00
Ruslan Ermilov a866e17077 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
Stefan Farfeleder 950cc39559 Pass an array of gid_t rather than an array of int to getgroups().
PR:	56646
2004-10-02 11:40:48 +00:00
David Malone f2ab33b6eb Add missing %s so that all of the usage message gets printed.
Bump WARNS to 6 while I'm here.
2004-05-19 21:06:36 +00:00