aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/finger/util.c
Commit message (Collapse)AuthorAgeFilesLines
* usr.bin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-4/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-271-3/+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 .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | 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
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | 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
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-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 Notes: svn path=/head/; revision=216370
* Migrate finger(1) towards utmpx.Ed Schouten2010-01-131-6/+5
| | | | | | | | | It was already ported to use libulog, which makes it simpler now. Be sure to catch the error returned by setutxdb(). Otherwise it may perform a lookup on the utx.active database. Notes: svn path=/head/; revision=202191
* Migrate finger(1) away from <utmp.h>.Ed Schouten2009-12-281-40/+21
| | | | | | | | | | Unfortunately it also uses lastlog, which means we must resort to local extensions of the utmpx-interface. Because the user name and TTY name are now nul-terminated, there is no need to copy around strings as often. Notes: svn path=/head/; revision=201140
* Revert most part of 200420 as requested, as more review and polish isXin LI2009-12-131-1/+1
| | | | | | | needed. Notes: svn path=/head/; revision=200462
* Remove unneeded header includes from usr.bin/ except contributed code.Xin LI2009-12-111-1/+1
| | | | | | | Tested with: make universe Notes: svn path=/head/; revision=200420
* Setting .nofinger will not hide you from root.Diomidis Spinellis2005-09-191-1/+2
| | | | Notes: svn path=/head/; revision=150316
* If stat() on the terminal specified in utmp fails due to ENOENT, don'tRobert Watson2003-04-021-1/+14
| | | | | | | | | | | | print a warning, and set the idletime variable for the entry to -1; then pick up the -1 later in sprint() and lprint() and ignore those idle times by printing just whitespace. When third party applications, such as kdm, insert utmp entries, they sometimes use strings like ":0", which can't be stat()'d and currently result in warnings that are not helpful to the user. Notes: svn path=/head/; revision=112987
* ANSIify function definitions.David Malone2002-09-041-25/+12
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=102944
* Clean up malloc(3)'s argument. Remove casts which do nothing when we'reJuli Mallett2002-05-171-2/+2
| | | | | | | | | | using sizeof() anyway. Use slightly more consistent (per-file) error reporting for malloc(3) returning NULL. If "malloc failed" was being printed, don't use err(3). If a NULL format is being used, use err(3). In one case errx(3) was being used with strerror(3), so just use err(3). Notes: svn path=/head/; revision=96785
* remove __PWarner Losh2002-03-221-3/+3
| | | | Notes: svn path=/head/; revision=92920
* Style improvements recommended by Bruce as a follow up to someDavid Malone2001-12-101-5/+6
| | | | | | | | | | | of the recent WARNS commits. The idea is: 1) FreeBSD id tags should follow vendor tags. 2) Vendor tags should not be compiled (though copyrights probably should). 3) There should be no blank line between including cdefs and __FBSDIF. Notes: svn path=/head/; revision=87628
* WARNS=2 fix, remove 'register' and use __FBSDID().Mark Murray2001-12-021-18/+18
| | | | Notes: svn path=/head/; revision=87229
* Replace the condemned access(2) by stat(2),Yaroslav Tykhiy2001-08-081-1/+2
| | | | | | | as per the discussion in -audit. Notes: svn path=/head/; revision=81309
* Don't use ".nofinger" as a string constant from within the codeYaroslav Tykhiy2001-07-301-1/+2
| | | | | | | since there is the ``pathnames.h'' file; use _PATH_NOFINGER instead. Notes: svn path=/head/; revision=80649
* MAXPATHLEN is enough.Warner Losh2001-03-011-2/+1
| | | | | | | | Also, snprinf is guaranteed by the new ansi standard to NUL terminate the string, so we don't need to do that ourselves. Notes: svn path=/head/; revision=73260
* SpellingPhilippe Charnier2001-02-061-10/+8
| | | | | | | Remove unused #includes Notes: svn path=/head/; revision=72109
* Check strdup() return valuesChris D. Faulhaber2001-01-201-4/+8
| | | | | | | Reviewed by: kris Notes: svn path=/head/; revision=71273
* If the utmp login time is greater than the tty atime, use it to calculateBrian Somers2000-12-211-1/+7
| | | | | | | | | | | | the idle time instead of the atime. This makes entries for people that have logged in but done nothing else show up correctly. Reviewed by: markk@knigma.org Notes: svn path=/head/; revision=70242
* Don't call warn() with no format string.Kris Kennaway2000-07-101-1/+1
| | | | Notes: svn path=/head/; revision=62891
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Use the final version of the patch for the overflow, not the next toWarner Losh1999-08-221-7/+9
| | | | | | | | | final. Noticed by: eivind Notes: svn path=/head/; revision=50167
* Fix possible buffer overflow with finger and fingerd.Warner Losh1999-08-211-16/+27
| | | | | | | | | | Submitted by: Lukasz Luzar <lluzar@noname.kki.krakow.pl> and Eivind Eklund <eivind@yes.no> This patch is actually a combination of those two patches. Notes: svn path=/head/; revision=50127
* Add rcsid, usage(). Silent -Wall. Use warn(3).Philippe Charnier1997-07-021-4/+7
| | | | Notes: svn path=/head/; revision=27169
* Merge from Lite2Peter Wemm1997-03-111-44/+20
| | | | Notes: svn path=/head/; revision=23693
* Add Sean Eric Fagan's support for a ~/.nofinger file for user who preferJordan K. Hubbard1995-01-041-0/+28
| | | | | | | | their privacy. Submitted by: sef Notes: svn path=/head/; revision=5369
* Install Luke's enhancements for finger.Paul Traina1994-09-071-2/+19
| | | | | | | | | | | | | By default, behave like the old ugly 4.4bsd finger and print office information instead of remote login information. It's an easy one line fix to make it behave like most other vendor's fingers if we decide to change the default. Reviewed by: pst Notes: svn path=/head/; revision=2537
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+381
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590