aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/whereis
Commit message (Collapse)AuthorAgeFilesLines
* whereis: fix fetching of user.cs_path sysctl variableStefan Eßer2022-02-041-5/+5
| | | | | | | | | | | | | | | The current implementation of sysctlbyname() does not support the user sub-tree. This function exits with a return value of 0, but sets the passed string buffer to an empty string. As a result, the whereis program did not use the value of the sysctl variable "user.cs_path", but only the value of the environment variable "PATH". This update makes whereis use the sysctl function with a fixed OID, which already supports the user sub-tree. MFC after: 3 days
* whereis: remove gnu/libexec from source search pathsEd Maste2020-02-191-1/+1
| | | | | | | The last subdirectory of gnu/libexec was removed in r85742. Notes: svn path=/head/; revision=358111
* Silence Clang Scan warnings regarding the use of strcp().Stefan Eßer2019-01-241-9/+7
| | | | | | | | | | | | | | | | | | | | While these warnings are false positives, the use of strdup() instead of malloc() and strcpy() simplifies and clarifies the code. While checking the remaining uses of strcpy and strcat I noticed an assignment of a strlen() to a variable "s", whose value needs to be preserved for use in later output routines (where it is used to allocate a buffer). I do not think that the value of "s" will come out lower than its correct value and thus there is no risk of a buffer overflow, in the general case, but a specially crafter argument might lead to an overflow. The bogus assignment to "s" is removed since this value was only used a single time in the following malloc() call, which has been removed. MFC after: 2 weeks Notes: svn path=/head/; revision=343408
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-2/+6
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. 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. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* usr.bin: minor spelling fixes on comments.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298879
* Fix bad checking of the return of realloc(3)Baptiste Daroussin2016-04-201-1/+1
| | | | | | | | | Reported by: Coverity CID: 1007335 MFC after: 3 days Notes: svn path=/head/; revision=298371
* Use NULL instead of 0 for pointers.Marcelo Araujo2016-04-181-4/+4
| | | | | | | | | realloc will return NULL if it cannot allocate memory. MFC after: 2 weeks. Notes: svn path=/head/; revision=298184
* 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-273-7/+4
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * 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-5/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * | 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/+19
| | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;Colin Percival2015-02-123-7/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | update paths; and include everything in the "base" distribution. The "games" distribution being optional made sense when there were more games and we had small disks; but the "games-like" games were moved into the ports tree a dozen years ago and the remaining "utility-like" games occupy less than 0.001% of my laptop's small hard drive. Meanwhile every new user is confronted by the question "do you want games installed" when they they try to install FreeBSD. The next steps will be: 2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor, morse, number, primes, and random, since there is evidence that those are still being used. 3. Merging src/games into src/usr.bin. This change will not be MFCed. Reviewed by: jmg Discussed at: EuroBSDCon Approved by: gjb (release-affecting changes) Notes: svn path=/head/; revision=278616
* | multiple: Remove 3rd clause from BSD license where approved by theEitan Adler2014-03-141-5/+1
|/ | | | | | | | | | | | regents and renumber. This patch skips files in contrib/ and crypto/ Acked by: imp Discussed with: emaste Notes: svn path=/head/; revision=263142
* Reencode files from latin1 to UTF-8.Ulrich Spörlein2011-12-302-2/+2
| | | | | | | | | | This makes a tiny percentage of entries in calendars ugly for latin1 users, but fixes them for UTF-8 users. This badly needs a solution involving locale-dependent re-encoding. Notes: svn path=/head/; revision=228991
* Mark global functions and/or variables in whereis(1) static where possible.Ed Schouten2011-11-061-16/+16
| | | | | | | This allows compilers and static analyzers to more thorough analysis. Notes: svn path=/head/; revision=227244
* 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
* Make the search for sources in PATH_PORTS more accurate. I onlyJoerg Wunsch2008-06-201-2/+21
| | | | | | | | | | | | | noticed that a "whereis -qs qemu" matched the distfiles subdir of qemu rather than /usr/ports/emulators/qemu. It now ignores all dot entries in /usr/ports, plus all entries starting with a capital letter (maintenance stuff like Templates, but also includes subdir CVS), plus /usr/ports/distfiles which is simply a magic name in that respect. Notes: svn path=/head/; revision=179888
* Remove unused variables.Stefan Farfeleder2005-04-091-2/+1
| | | | Notes: svn path=/head/; revision=144840
* Fixed usage().Ruslan Ermilov2005-02-101-2/+3
| | | | Notes: svn path=/head/; revision=141657
* Let bsd.prog.mk set SRCS and MAN to their default values.Ruslan Ermilov2005-01-281-1/+0
| | | | Notes: svn path=/head/; revision=140941
* Respect locale settings from the environment.Tim J. Robbins2004-07-151-0/+3
| | | | Notes: svn path=/head/; revision=132198
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-6/+12
| | | | Notes: svn path=/head/; revision=131491
* Adjust max WARNs for sparc64.David E. O'Brien2002-12-301-2/+1
| | | | Notes: svn path=/head/; revision=108436
* mdoc(7) police: markup polishing.Ruslan Ermilov2002-11-261-3/+3
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107276
* Use correct document date for the -a option.Johan Karlsson2002-08-221-1/+1
| | | | Notes: svn path=/head/; revision=102247
* Add the -a option to report all matches instead of only theJohan Karlsson2002-08-223-57/+145
| | | | | | | | | first of each requested type. Approved by: joerg, sheldonh (mentor) Notes: svn path=/head/; revision=102246
* Correctly handle empty path arguments, e.g., whereis -S -f biff.Johan Karlsson2002-08-181-7/+3
| | | | | | | Approved by: joerg, sheldonh (mentor) Notes: svn path=/head/; revision=102072
* Define all paths in pathnames.hJohan Karlsson2002-07-252-2/+6
| | | | | | | Approved by: joerg, sheldonh (mentor) Notes: svn path=/head/; revision=100691
* Teach whereis(1) about games.Johan Karlsson2002-07-243-5/+9
| | | | | | | Approved by: joerg, sheldonh (mentor) Notes: svn path=/head/; revision=100608
* The .Nm utilityPhilippe Charnier2002-07-141-1/+1
| | | | Notes: svn path=/head/; revision=99970
* Complete rewrite, once again.Joerg Wunsch2002-07-115-339/+720
| | | | | | | | | | | | | | | | | | | | | | | | | | This is basically a ``C compilation'' of the former whereis.pl file, employing the same algorithms, and aiming at being mostly UI-compatible to the old (legally tainted) 4.3BSD whereis(1). In comparision, the 4.4BSD-Lite version is just another variant of which(1) only, where in particular the option to search for source directories is sorely missing. While i was at it, i added two more options which i contemplated doing long since. -x will suppress the run of locate(1) to find sources that could not be found otherwise, potentially saving a lot of time (but obviously, risking to not find some sources that are well hidden in the tree). -q will omit the leading name of the query, so in particular, you can now do something like: cd `whereis -qs ls` I'd explicitly like to thank johan for his review which was quite a bit more than an average review, including sending me a lot of diffs. Reviewed by: johan Notes: svn path=/head/; revision=99821
* Restore copyright and RCSID.Johan Karlsson2002-07-041-6/+11
| | | | | | | | | | Remove duplicate $FreeBSD$, $NetBSD$. Submitted by: mike Approved by: sheldonh (mentor) Notes: svn path=/head/; revision=99406
* Switch to c versionJohan Karlsson2002-07-031-1/+1
| | | | | | | Approved by: sheldonh (mentor) Notes: svn path=/head/; revision=99378
* compact synopsisJohan Karlsson2002-07-032-3/+2
| | | | | | | | | | s/program [program ...]/program .../ s/program [...]/program .../ Approved by: sheldonh (mentor) Notes: svn path=/head/; revision=99377
* Remove -p flag.Johan Karlsson2002-07-032-33/+16
| | | | | | | | | | | | OpenBSD's implementation lacks -p, and we don't want to support the option now, only to lose it if/when we later switch to OpenBSD's implementation. This functionality is provided by which(1). Approved by: sheldonh (mentor) Notes: svn path=/head/; revision=99376
* Add __FBSDID.Johan Karlsson2002-07-031-7/+2
| | | | | | | | | Remove __COPYRIGHT, __RCSID which caused an assembler warning. Approved by: sheldonh (mentor) Notes: svn path=/head/; revision=99375
* Change to NetBSDs version of whereis.Johan Karlsson2002-07-032-86/+160
| | | | | | | | Approved by: sheldonh (mentor) Obtained from: NetBSD Notes: svn path=/head/; revision=99373
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79535
* beforeinstall -> SCRIPTS.Ruslan Ermilov2001-04-071-4/+1
| | | | Notes: svn path=/head/; revision=75286
* MAN[1-9] -> MAN.Ruslan Ermilov2001-03-271-1/+3
| | | | Notes: svn path=/head/; revision=74848
* Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-191-1/+1
| | | | Notes: svn path=/head/; revision=70197
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-3/+3
| | | | Notes: svn path=/head/; revision=68963
* mdoc(7) police: use certified section headers wherever possible.Ruslan Ermilov2000-11-171-1/+1
| | | | Notes: svn path=/head/; revision=68854
* $Id$ -> $FreeBSD$Peter Wemm1999-08-282-2/+2
| | | | Notes: svn path=/head/; revision=50477