aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/id
Commit message (Collapse)AuthorAgeFilesLines
* id: Fix WITHOUT_AUDIT buildDag-Erling Smørgrav2025-11-021-8/+2
| | | | | | | | Rather than add more ifdefs, trust the compiler to optimize Aflag away. Fixes: 70b72ede982f ("id: Clean up") PR: 290740 MFC after: 3 days
* id: Add -d and -s optionsDag-Erling Smørgrav2025-10-282-6/+70
| | | | | | | | These options may not be combined with any other options and print the current or specified user's home directory and shell respectively. Reviewed by: imp, bcr Differential Revision: https://reviews.freebsd.org/D53301
* id: Clean upDag-Erling Smørgrav2025-10-281-59/+55
| | | | | | | No functional change intended. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53300
* id: revert to historical and documented behavior for `id`Kyle Evans2025-08-041-16/+17
| | | | | | | | | | | | | | | | | | | | | The manpage claims that we display the credentials for the calling process if no user/flags are specified, but this has not been true since r145628 / 68b9b81e792a9108d. Currently, we display: - uid from the calling process - gid from /etc/passwd - egid from the calling process, if different from that gid - supplementary groups from the calling process This doesn't really match the description in the manpage, and it doesn't match other implementations. Fix it to use the current process credentials for the gid as well. Drop the extra arguments to id_print(), since these facts can be derived from whether we're displaying live data (`pw == NULL`) or not. Reviewed by: olce Differential Revision: https://reviews.freebsd.org/D51689
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-9/+0
| | | | | | | | | | | 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
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-275-10/+0
| | | | | | | | 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
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-163-3/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* pkgbase: Put more binaries/lib in runtimeEmmanuel Vadot2021-12-211-0/+2
| | | | | | | | | 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
* id: sanitize arguments betterAlan Somers2021-06-151-0/+2
| | | | | | | | | | | 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
* id(1): Add EXAMPLES sectionFernando Apesteguía2020-12-101-0/+36
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=368520
* groups(1): Add EXAMPLEFernando Apesteguía2020-12-101-0/+6
| | | | | | | | | | Add a super simple example Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D27538 Notes: svn path=/head/; revision=368518
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Renumber copyright clause 4Warner Losh2017-02-284-4/+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 Notes: svn path=/head/; revision=314436
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-4/+5
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated/new dependenciesSimon J. Gerraty2014-11-191-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=274694
| * Merge from head@274682Simon J. Gerraty2014-11-191-2/+0
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Merge from headSimon J. Gerraty2014-05-081-1/+1
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Adjust printf format specifiers for dev_t and ino_t in user space.Gleb Kurtsou2014-12-171-4/+5
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | ino_t and dev_t are about to become uint64_t. Reviewed by: kib, mckusick Notes: svn path=/head/; revision=275855
* | | id(1) only uses getaudit(2) from the BSM which is part of the libcBaptiste Daroussin2014-11-051-2/+0
| |/ |/| | | | | Notes: svn path=/head/; revision=274136
* | Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
|/ | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* Correct the change made in r227166.Ed Schouten2011-11-061-0/+2
| | | | | | | This function is only compiled in when building WITH_AUDIT. Notes: svn path=/head/; revision=227203
* Add missing static keywords to id(1)Ed Schouten2011-11-061-17/+17
| | | | Notes: svn path=/head/; revision=227166
* Add two new system calls, setloginclass(2) and getloginclass(2). This makesEdward Tomasz Napierala2011-03-052-5/+23
| | | | | | | | | | | | 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) Notes: svn path=/head/; revision=219304
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-114-16/+0
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=216370
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-1/+0
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* In preparation for raising NGROUPS and NGROUPS_MAX, change baseBrooks Davis2009-06-191-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=194494
* Fix id -A when the subject has an extended subject token associated withChristian S.J. Peron2007-10-141-6/+38
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=172621
* Fix SUSv3 compliance: Use a single comma instead of comma and space to separateStefan Farfeleder2006-12-291-1/+1
| | | | | | | | | | additional group entries. PR: 107298 Submitted by: Joost Bekkers Notes: svn path=/head/; revision=165626
* Improve markup.Ruslan Ermilov2006-12-231-1/+2
| | | | Notes: svn path=/head/; revision=165496
* Do not exit without printing the id information if the uid of theMike Pritchard2006-12-091-6/+15
| | | | | | | user executing the command cannot be looked up in the password file. Notes: svn path=/head/; revision=165028
* Add a -a option as a no-op for Solaris compatibility, as brieflyCeri Davies2006-09-262-2/+8
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=162672
* Fix both arguments to err().Ruslan Ermilov2006-09-261-1/+1
| | | | Notes: svn path=/head/; revision=162656
* Rename "-a" flag to "-A" in order to avoid conflicting with the "-a" flagRobert Watson2006-09-232-21/+20
| | | | | | | | | | as found on Solaris. Requested by: ceri MFC after: 3 days Notes: svn path=/head/; revision=162578
* Add a -a argument to id(1), which causes id(1) to print out processRobert Watson2006-09-233-3/+57
| | | | | | | | | | | audit properties, including the audit user id. This can be quite helpful in debugging audit problems. Obtained from: TrustedBSD Project MFC after: 3 days Notes: svn path=/head/; revision=162571
* Print the euid after the gid as demanded by POSIX.Stefan Farfeleder2006-05-281-3/+3
| | | | | | | | | Submitted by: Martin Nagy <nagy.martin@gmail.com> PR: 96239 MFC after: 2 weeks Notes: svn path=/head/; revision=159008
* Add flag to choose whether to use getgrouplist(3) or getgroups(2)Robert Drehmel2005-04-291-6/+11
| | | | | | | | | | | | 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). Notes: svn path=/head/; revision=145672
* Fix spelling error.Robert Drehmel2005-04-291-1/+1
| | | | Notes: svn path=/head/; revision=145671
* We need to pass NGROUPS + 1 to getgrouplist(3) to displayRobert Drehmel2005-04-281-1/+1
| | | | | | | | | 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. Notes: svn path=/head/; revision=145629