summaryrefslogtreecommitdiff
path: root/usr.bin/rwho
Commit message (Collapse)AuthorAgeFilesLines
* capsicum: use a new capsicum helpers in toolsMariusz Zaborski2018-11-041-2/+2
| | | | | | | Use caph_{rights,ioctls,fcntls}_limit to simplify the code. Notes: svn path=/head/; revision=340138
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-1/+2
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* 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
* Update manpage date to when the deprecation notice was removed.Jeremie Le Hen2017-10-271-1/+1
| | | | | | | Reported by: bcr Notes: svn path=/head/; revision=325049
* rwho/ruptime/rwhod shouldn't be gated by RCMDS.Jeremie Le Hen2017-08-081-9/+0
| | | | | | | | | | | | | | | | | | | | | | As peter@ points out in pr/220953: "rwho, rwhod and ruptime are not part of the remote login suite (rsh, rlogin etc). They should *not* be in the rcmds package which is disabled by default. We rely on rwho/rwhod/ruptime in the freebsd.org cluster." This commit is a re-commit of r322029 and r322031 with a better commit log, as pointed out by ngie@. This also includes the necesary changes to OptionalObsoleteFiles.inc, as requested by jhb@. PR: 220953 Reported by: peter@, jhb@ Differential Revision: https://reviews.freebsd.org/D11743 Notes: svn path=/head/; revision=322277
* Revert r322029 and r322031 so as to recommit them with a better commit log.Jeremie Le Hen2017-08-081-0/+9
| | | | | | | | PR: 220953 Reported by: ngie@ Notes: svn path=/head/; revision=322276
* Remove deprecation notice for ruptime/rwho/rwhod.Jeremie Le Hen2017-08-031-9/+0
| | | | | | | | PR: 220953 Reported by: peter Notes: svn path=/head/; revision=322031
* Add deprecation notices for all rcmd toolsAllan Jude2017-07-041-1/+10
| | | | | | | | | | | Submitted by: bcr Reviewed by: emaste, bapt, jhl MFC after: immediate Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11471 Notes: svn path=/head/; revision=320644
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | 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
* Create a rcmds package.Glen Barber2016-01-211-0/+2
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=294517
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * 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 headSimon J. Gerraty2014-04-281-1/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=265044
| * Merge from headSimon J. Gerraty2013-09-051-53/+81
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | 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
* | | Update most userspace consumers of capability.h to use capsicum.h instead.Robert Watson2014-03-161-1/+1
| |/ |/| | | | | | | | | | | | | | | | | auditdistd is not updated as I will make the change upstream and then do a vendor import sometime in the next week or two. MFC after: 3 weeks Notes: svn path=/head/; revision=263234
* | Change the cap_rights_t type from uint64_t to a structure that we can extendPawel Jakub Dawidek2013-09-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the future in a backward compatible (API and ABI) way. The cap_rights_t represents capability rights. We used to use one bit to represent one right, but we are running out of spare bits. Currently the new structure provides place for 114 rights (so 50 more than the previous cap_rights_t), but it is possible to grow the structure to hold at least 285 rights, although we can make it even larger if 285 rights won't be enough. The structure definition looks like this: struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; }; The initial CAP_RIGHTS_VERSION is 0. The top two bits in the first element of the cr_rights[] array contain total number of elements in the array - 2. This means if those two bits are equal to 0, we have 2 array elements. The top two bits in all remaining array elements should be 0. The next five bits in all array elements contain array index. Only one bit is used and bit position in this five-bits range defines array index. This means there can be at most five array elements in the future. To define new right the CAPRIGHT() macro must be used. The macro takes two arguments - an array index and a bit to set, eg. #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) We still support aliases that combine few rights, but the rights have to belong to the same array element, eg: #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP) There is new API to manage the new cap_rights_t structure: cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); Capability rights to the cap_rights_init(), cap_rights_set(), cap_rights_clear() and cap_rights_is_set() functions are provided by separating them with commas, eg: cap_rights_t rights; cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT); There is no need to terminate the list of rights, as those functions are actually macros that take care of the termination, eg: #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...); Thanks to using one bit as an array index we can assert in those functions that there are no two rights belonging to different array elements provided together. For example this is illegal and will be detected, because CAP_LOOKUP belongs to element 0 and CAP_PDKILL to element 1: cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL); Providing several rights that belongs to the same array's element this way is correct, but is not advised. It should only be used for aliases definition. This commit also breaks compatibility with some existing Capsicum system calls, but I see no other way to do that. This should be fine as Capsicum is still experimental and this change is not going to 9.x. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=255219
* | Few more style nits.Pawel Jakub Dawidek2013-07-031-13/+10
| | | | | | | | | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=252599
* | Sandbox rwho(1) using capability mode and Capsicum capabilities.Pawel Jakub Dawidek2013-07-031-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | rwho(1) gets only read-only access to /var/rwho/ directory. Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Sponsored by: Google Summer of Code 2013 Reviewed by: pjd MFC after: 1 month Notes: svn path=/head/; revision=252598
* | Style cleanups.Pawel Jakub Dawidek2013-07-031-45/+53
|/ | | | | | | | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Sponsored by: Google Summer of Code 2013 Reviewed by: pjd MFC after: 1 month Notes: svn path=/head/; revision=252596
* Add missing static keywords to rwho(1)Ed Schouten2011-11-061-8/+8
| | | | Notes: svn path=/head/; revision=227181
* Build rwho(1) with WARNS=6.Ed Schouten2011-10-162-4/+3
| | | | | | | | | | The only reason why it didn't build with WARNS=6, is because of some simple to fix string formatting bugs. MFC after: 3 months Notes: svn path=/head/; revision=226427
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-112-8/+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-0/+3
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* Let the width of the username column depend on the rwho file format.Ed Schouten2009-12-251-2/+1
| | | | | | | | Right now the code uses UT_NAMESIZE, but this makes little sense, because rwho(1) parses files generated by rwhod(8). Not utmp(5) files. Notes: svn path=/head/; revision=200997
* It's actually 11 minutes when the machine is assumed to be down and removedSuleiman Souhlal2005-08-071-1/+1
| | | | | | | | | from the output. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=148822
* Expand *n't contractions.Ruslan Ermilov2005-02-131-1/+1
| | | | Notes: svn path=/head/; revision=141846
* Modernise; ISOify, use __FBSDID(), use headers instead of hand-declaring.Mark Murray2002-07-011-12/+13
| | | | | | | Fix easy warnings. Notes: svn path=/head/; revision=99218
* remove __PWarner Losh2002-03-221-2/+2
| | | | Notes: svn path=/head/; revision=92921
* I've been meaning to do this for a while. Add an underscore to theMatthew Dillon2002-01-191-1/+1
| | | | | | | | | | | time_to_xxx() and xxx_to_time() functions. e.g. _time_to_xxx() instead of time_to_xxx(), to make it more obvious that these are stopgap functions & placemarkers and not meant to create a defacto standard. They will eventually be replaced when a real standard comes out of committee. Notes: svn path=/head/; revision=89572
* Fix time_t == int assumption, convert protocol int to time_t.Matthew Dillon2001-10-281-1/+2
| | | | Notes: svn path=/head/; revision=85639
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79535
* Don't attempt to parse %cAndrey A. Chernov2001-03-211-3/+9
| | | | Notes: svn path=/head/; revision=74593
* Get rid of hard sentence breakPhilippe Charnier2000-03-271-2/+3
| | | | | | | Asked by: Sheldon Notes: svn path=/head/; revision=58704
* Add section number to .Xr references. Enumerate flags the standard way.Philippe Charnier2000-03-261-8/+9
| | | | Notes: svn path=/head/; revision=58623
* $Id$ -> $FreeBSD$Peter Wemm1999-08-282-2/+2
| | | | Notes: svn path=/head/; revision=50477
* Add $Id$, to make it simpler for members of the translation teams toNik Clayton1999-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | track. The $Id$ line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so; .\" $Id$ .\" If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted. Approved by: bde Notes: svn path=/head/; revision=48792
* Fixed typo.Foxfair Hu1998-12-201-1/+1
| | | | Notes: svn path=/head/; revision=41949
* Be picky about the format of the commandline and cleanupSteve Price1998-05-031-6/+16
| | | | | | | | | | a warning related to qsort. PR: 6420 Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua> Notes: svn path=/head/; revision=35659
* Use err(3). Add usage() and prototypes. Add Xr to who(1).Philippe Charnier1997-08-082-20/+34
| | | | Notes: svn path=/head/; revision=27978
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-291-1/+1
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24360
* Fix my error from previous commit with mixing rwhod protocolAndrey A. Chernov1996-12-051-7/+8
| | | | | | | | and utmp sizes. Replace hardcoded constants by sizeofs or symbolic constants Notes: svn path=/head/; revision=20165
* Use UT_* contstants when possible instead of harcoded 8Andrey A. Chernov1996-12-051-8/+9
| | | | | | | 2.2 candidate Notes: svn path=/head/; revision=20156
* Eliminated includes of the "temporary" backwards compatibility headerBruce Evans1996-09-241-2/+2
| | | | | | | | | <sys/dir.h> in applications. Maintained existing (inadequate) ifdefs for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any new ones. Notes: svn path=/head/; revision=18485
* Fix some incorrect locations in the FILES sections of some man pages.Mike Pritchard1996-02-021-1/+1
| | | | Notes: svn path=/head/; revision=13851