History log of /freebsd-9.3-release/usr.bin/newgrp/newgrp.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 253205 11-Jul-2013 des

MFH (r246553): document and explain need for setuid bit.

PR: docs/167741


# 231164 07-Feb-2012 delphij

MFC r226274,r226416:

Fix the error message when setgid() failed.

PR: bin/161509
Submitted by: Jeremy Huddleston <jeremyhu apple com>


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 200462 13-Dec-2009 delphij

Revert most part of 200420 as requested, as more review and polish is
needed.


# 200420 11-Dec-2009 delphij

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# 194494 19-Jun-2009 brooks

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


# 121741 30-Oct-2003 harti

Use (char *)NULL to terminated to argument list for execl().
Without this cast the compiler cannot know that it has to convert
the null pointer constant NULL to a null pointer.


# 97364 28-May-2002 tjr

Add the newgrp(1) utility, which changes groups. This is required by
the POSIX.2 UPE.

PR: 36190
Reviewed by: -standards, silence on -audit