summaryrefslogtreecommitdiffstats
path: root/usr.bin/id/id.c
Commit message (Collapse)AuthorAgeFilesLines
* Add two new system calls, setloginclass(2) and getloginclass(2). This makestrasz2011-03-051-4/+18
| | | | | | | | | 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)
* Remove the advertising clause from UCB copyrighted files in usr.bin. Thisjoel2010-12-111-4/+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
* In preparation for raising NGROUPS and NGROUPS_MAX, change basebrooks2009-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
* Fix id -A when the subject has an extended subject token associated withcsjp2007-10-141-7/+39
| | | | | | | | | | | | | 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
* Fix SUSv3 compliance: Use a single comma instead of comma and space to separatestefanf2006-12-291-1/+1
| | | | | | | additional group entries. PR: 107298 Submitted by: Joost Bekkers
* Do not exit without printing the id information if the uid of thempp2006-12-091-6/+15
| | | | user executing the command cannot be looked up in the password file.
* Add a -a option as a no-op for Solaris compatibility, as brieflyceri2006-09-261-1/+3
| | | | | | | | 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
* Fix both arguments to err().ru2006-09-261-1/+1
|
* Rename "-a" flag to "-A" in order to avoid conflicting with the "-a" flagrwatson2006-09-231-16/+15
| | | | | | | as found on Solaris. Requested by: ceri MFC after: 3 days
* Add a -a argument to id(1), which causes id(1) to print out processrwatson2006-09-231-3/+44
| | | | | | | | audit properties, including the audit user id. This can be quite helpful in debugging audit problems. Obtained from: TrustedBSD Project MFC after: 3 days
* Print the euid after the gid as demanded by POSIX.stefanf2006-05-281-3/+3
| | | | | | Submitted by: Martin Nagy <nagy.martin@gmail.com> PR: 96239 MFC after: 2 weeks
* Add flag to choose whether to use getgrouplist(3) or getgroups(2)robert2005-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).
* We need to pass NGROUPS + 1 to getgrouplist(3) to displayrobert2005-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.
* - Merge two functions for printing `id' output.robert2005-04-281-57/+33
| | | | | | | | | | | | 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
* Remove unused variables.stefanf2005-04-091-2/+1
|
* Pass an array of gid_t rather than an array of int to getgroups().stefanf2004-10-021-1/+2
| | | | PR: 56646
* Add missing %s so that all of the usage message gets printed.dwmalone2004-05-191-1/+1
| | | | Bump WARNS to 6 while I'm here.
* Add "-M" argument to id(1), which permits the id command to be usedrwatson2004-05-031-3/+42
| | | | | | | | to print the MAC label of the current process. "-M" selected as that's what is used in Trusted IRIX. Obtained from: TrustedBSD Project Sponsored by: DARPA, McAfee Research
* ANSIify function definitions.dwmalone2002-09-041-16/+8
| | | | | | | | | Add some constness to avoid some warnings. Remove use register keyword. Deal with missing/unneeded extern/prototypes. Some minor type changes/casts to avoid warnings. Reviewed by: md5
* Remove local prototypes for main().jmallett2002-08-191-1/+0
|
* Consistently use FBSDIDobrien2002-06-301-2/+2
|
* remove __Pimp2002-03-221-8/+8
|
* Fold groups(1) and whoami(1) into id(1).ru2001-09-141-8/+33
|
* Silence warnings (most about constness) and clamp down with WARNS=2.dd2001-05-281-5/+6
| | | | Tested on i386 and alpha.
* Print commas in the group list in user(). current() already did this.dd2001-05-201-1/+1
| | | | | Reviewed by: ru, sheldonh Inspired by: OpenBSD, NetBSD
* Cast pw_change and pw_expire to long and fix the format specifier accordingly.billf1999-09-061-2/+2
|
* Remove unused variables.chris1999-09-051-3/+1
|
* Properly document -P and -p flags.chris1999-09-011-1/+3
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Clean up some ambiguous nested if/elses.billf1999-07-041-3/+5
|
* Add "-P" display the id as a password file entry.obrien1998-08-211-5/+34
| | | | Submitted by: terry
* Missing newline when euid != ruid.steve1998-02-181-3/+3
| | | | | PR: 5778 Submitted by: Martin Kammerhofer <dada@sbox.tu-graz.ac.at>
* Use err(3) instead of local redefinition. Silent -Wall.charnier1997-07-151-51/+26
|
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-291-1/+1
| | | | posix standard on the topic.
* Fixed bug where 'id <user>' output the wrong group name (the user namedg1995-08-281-11/+11
| | | | was output instead). Pointed out by Chael Hall <nowhere@chaos.taylored.com>.
* Remove trailing whitespace.rgrimes1995-05-301-1/+1
|
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+351
OpenPOWER on IntegriCloud