Commit graph

191 commits

Author SHA1 Message Date
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Warner Losh 43b96a4eb5 Revert prior commit to restore the files mangled by my "fixing" merge
conflicts for a git rebase I tried to do.
2017-03-01 02:10:40 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
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
2017-02-28 23:42:47 +00:00
Bryan Drewery 490a8aa9a1 DIRDEPS_BUILD: Update dependencies.
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2016-11-13 00:11:30 +00:00
Conrad Meyer cd1693d3f9 Capsicumize some trivial stdio programs
Trivially capsicumize some simple programs that just interact with
stdio.  This list of programs uses 'pledge("stdio")' in OpenBSD.

No objection from:	allanjude, emaste, oshogbo
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8307
2016-11-08 05:31:01 +00:00
Ed Maste 4a1cdaba5f locate: ANSIfy 2016-10-06 13:37:46 +00:00
Ulrich Spörlein c9e1c304c1 Fix type mismatches for malloc(3) and Co.
This is rather pedantic, as for most architectures it holds that
sizeof(type *) == sizeof(type **)

Found by:	clang static analyzer
Reviewed by:	ed
Differential Revision: https://reviews.freebsd.org/D4722
2015-12-29 11:24:41 +00:00
Dag-Erling Smørgrav af1aec74f5 There is no more point in indexing /var/db/freebsd-update than there is in
indexing /var/db/portsnap, which was already in PRUNEPATHS.

MFC after:	1 week
2015-11-13 06:16:12 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
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
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Dimitry Andric 0c4bf57982 Fix the following -Werror warnings from clang 3.5.0, while building
usr.bin/locate:

usr.bin/locate/locate/util.c:249:29: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^
usr.bin/locate/locate/util.c:249:29: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^~~
usr.bin/locate/locate/util.c:274:32: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^
usr.bin/locate/locate/util.c:274:32: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^~~

The problem is that ntohl() always returns an unsigned quantity.  In
this case, it's expected to be cast back to a signed integer, but to
stop complaints about abs() we just store it into an integer, and don't
call ntohl() again.

Reviewed by:	ngie
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D1196
2014-11-22 12:13:05 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Warner Losh 3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
Eitan Adler dda5b39711 multiple: Remove 3rd clause from BSD license where approved by the
regents and renumber.

This patch skips files in contrib/ and crypto/

Acked by:	imp
Discussed with:	emaste
2014-03-14 03:07:51 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Eitan Adler 93d24a8730 Give users a hint when their locate database is too small.
Reviewed by:	wblock, gcooper
Reviewed by:	"Lowell Gilbert" <lgfbsd@be-well.ilk.org>
Approved by:	cperciva (implicit)
MFC after:	3 weeks
2012-12-10 02:26:01 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Ulrich Spörlein 389ae6c65d Touch up some more small typos missed in the previous round.
Reported by:	Ben Kaduk <minimarmot@gmail.com> et al.
2012-01-05 21:36:45 +00:00
Ed Schouten b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Ulrich Spörlein 487ac9ac21 Spelling fixes for usr.bin/ 2011-12-30 11:02:40 +00:00
Nathan Whitehorn b396ac3d0f Properly use SCHAR_MAX instead of CHAR_MAX for 0x7f. This fixes operation
of locate(1) on systems on which char is unsigned by default (ARM and
PowerPC).

Reported by:	Paul Mather
MFC after:	4 days
2010-11-23 15:08:56 +00:00
Garrett Wollman ab10162f86 Style cleanup: make this look more like a 21st-century shell script
and not something out of the early 1980s.  Make sure all error
messages go to stderr, not stdout.  Since there's error-handling code
to handle empty SEARCHPATHS and FILESYSTEMS, use the initialization
form that allows this error to be diagnosed.  (hat tip: jilles@)
2010-11-01 02:20:18 +00:00
Garrett Wollman bf59c7bab7 jilles@ pointed out that using ${PRUNEDIRS:=".zfs"} in updatedb.sh
made it impossible to override PRUNEDIRS to make it empty.  Use the
non-colon form to only set PRUNEDIRS if it is completely unset.  (For
parallelism, the other configuration defaults here could be done the
same way, but that could be more obviously accomplished by disabling
updatedb in periodic.conf, so leave them alone for now.)
2010-11-01 01:51:47 +00:00
Garrett Wollman 6f8b6f9469 Make it possible to exclude directories by name no matter where they
are in the filesystem from the locate database.  By default, exclude
".zfs" directories, as users who who have set snapdir=visible and are
taking frequent snapshots most likely do not want the snapshots
included in the locate database.
2010-10-31 02:36:05 +00:00
Gavin Atkinson 31fa41024e Various changes to make locate compilable with WARNS=6. Note that there
is still one issue on FreeBSD/arm (signed vs unsigned char) which prevents
actually bumping this to WARNS=6 - I'm still considering the correct
solution to this issue.

Tested by:		make universe
2010-06-28 12:04:55 +00:00
Ed Schouten b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
John Baldwin 29985e350d Move the check to ensure the locate database has the minimum required size
when using mmap() before invoking mmap().  This avoids a confusing error
message when locate is invoked against a zero-size database after the
recent change to make mmap() fail requests to map 0 bytes.

Submitted by:	Jaakko Heinonen  jh of saunalahti dot fi
Approved by:	re (kensmith)
MFC after:	1 week
2009-07-24 13:40:25 +00:00
Xin LI 534ad498af Signed/unsigned fixes, should be WARNS=2 clean now. 2009-04-02 21:44:55 +00:00
Xin LI ab85842c90 Don't crash when we have an invalid count number.
PR:		bin/32686
Submitted by:	Jaakko Heinonen <jh saunalahti.fi>
MFC after:	1 week
2009-04-02 21:23:04 +00:00
Kevin Lo 4c6ea66f44 Use RUSAGE_SELF for the current process instead of hardcoded value 2008-09-02 02:59:38 +00:00
Stefan Eßer afb6c26e9e The previous version included too many file system types in the scan,
since "local" includes also synthetic file systems (e.g. /dev, /proc)
and loopback mounts.

This version uses lsvfs to identify file system types that are local
and additionally not synthetik, loopback mounts, or read-only. This
has been suggested by Craig Rodrigues half a year ago. The patch that
has been committed is based on his suggestion, but slightly modified.

The comments in locate.rc have been updated to reflect the change and
o include zfs and xfs in the example file system parameter that can
be used to override the default outlined above.

PR:		114101
Submitted by:	rodrigc at crodrigues dot org (Craig Rodrigues)
MFC:		2 weeks
2007-10-17 07:27:51 +00:00
Stefan Eßer 8862db8d54 Make the updatedb script installed as /usr/libexec/locate.updatedb
inspect all local file systems, not only ufs and ext2fs. A number
of local file systems has been added over time, and at least zfs
has the potential to become a popular choice. Without this change
a ZFS root file system causes the script to ignore all file-systems
and leads to an empty locate db. (An alternative is to add all the
relevant file systems individually, which means that at least zfs,
xfs, ntfs, ntfs-3g, msdosfs should be added, probably more).
2007-10-15 22:09:19 +00:00
John Baldwin 87bebf24f7 Update the default FILESYSTEMS value in a comment to note that ext2fs is
included in the default list in the locate.updatedb script.

Approved by:	re (bmah)
Inspired by:	mwlucas
2007-07-19 21:00:08 +00:00
Ruslan Ermilov cb29445a92 Markup fixes. 2006-09-29 15:20:48 +00:00
Ceri Davies 15af4b716b Further nitpicking. 2006-08-17 16:29:27 +00:00
Ceri Davies 4b3d1ae7a4 Fix a grammatical error.
Funny how one character can completely distort the perception of a sentence :)
2006-08-17 16:20:42 +00:00
Maxim Konovalov 6d3d5db831 o Sync usage() with reality. 2006-06-11 17:40:25 +00:00
Dag-Erling Smørgrav 1c6859f833 Add a -0 option for interoperability with xargs -0.
PR:		bin/56558
Submitted by:	Eugene Grosbein <eugen@grosbein.pp.ru>
MFC after:	2 weeks
2005-12-07 12:22:46 +00:00
Greg Lehey b2f9e51241 Look through ext2fs file systems as well as ufs.
This should almost certainly be extended to other local file systems
as well (ntfs springs to mind), but I don't have the ability to test
it.
2005-11-12 12:45:08 +00:00
Colin Percival f46417c577 Most users probably aren't interested in locating 13000+ files named
[0-9a-f]{64}, so exclude portsnap's compressed snapshots from locate's
indexing.

Suggested by:	silby
MFC after:	3 days
2005-08-22 08:22:48 +00:00
Wolfram Schneider f7070a400c remove myself as maintainer 2005-07-17 21:19:28 +00:00
Ruslan Ermilov 0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Stefan Farfeleder a3eb24c68b Include missing headers. 2005-02-09 09:13:36 +00:00
Ruslan Ermilov 6c7216df78 Sort sections. 2005-01-18 13:43:56 +00:00
Ruslan Ermilov 6a5796e734 Eliminate macro calls inside literal displays. 2005-01-15 12:28:01 +00:00
Ruslan Ermilov e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Ruslan Ermilov a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
Colin Percival ad4876008f Merge the "multibyte not supported" BUG into the pre-existing BUGS
section.

Move the HISTORY section to place it before BUGS rather than after BUGS,
in order to minimize the chance of this error being reproduced in the
future.  (Both mdoc(7) and 63% of manual pages have these sections listed
in this order.)
2004-07-27 21:13:04 +00:00
Tim J. Robbins e9b497dbf6 Document incorrect handling of multibyte characters. 2004-07-23 06:56:38 +00:00
Ruslan Ermilov 557b7fa148 Deal with double whitespace. 2004-07-03 00:24:45 +00:00
Ruslan Ermilov 6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
Philippe Charnier 33f9fef537 The .Xr utility 2003-06-08 13:45:37 +00:00
Ruslan Ermilov d2893b161b Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by:	bde
2002-07-29 09:40:17 +00:00
Tim J. Robbins c4232ceae7 Correct syntax error, remove the unescaped newline between "||" and the
command it is intended to test. pdksh and bash caught this syntax error,
sh(1) did not behave as intended.

PR:		40386
2002-07-22 05:35:59 +00:00
Ruslan Ermilov 0b87f79976 s/${INSTALL} -c/${INSTALL} ${COPY}/ 2002-07-18 12:07:49 +00:00
Philippe Charnier 084e19802d The .Nm utility 2002-07-14 15:12:00 +00:00
Tom Rhodes 126aa65832 Fix grammar in 1 sentence
Reword 'Usually faster in most cases' to 'and is faster in most cases'

PR:	40024 (partly)
2002-07-02 21:13:15 +00:00
Christian Weisgerber 401717b20d Fix unaligned access error.
Reviewed by:	ticso
2002-06-24 12:40:11 +00:00
David E. O'Brien 5386688cf3 Only got one of the Perl usages. 2002-06-23 00:57:17 +00:00
David E. O'Brien 2c4d8a870f Replace a perl usage with an AWK one.
Submitted by:	Bob Willcox <bob@immure.com>
2002-06-23 00:55:03 +00:00
Eivind Eklund 0f798c48ed Make locate.updatedb tell about the security risk when it is run as root. 2002-06-19 19:22:18 +00:00
Warner Losh f1bb2cd2aa remove __P 2002-03-22 01:22:50 +00:00
Mike Barcroft fd8e4ebc8c o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
  source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
  Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
  POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
  and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
  complexities associated with having MD (asm and inline) versions, and
  having to prevent exposure of these functions in other headers that
  happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
  third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on:	alpha, i386
Reviewed by:	bde, jake, tmm
2002-02-18 20:35:27 +00:00
Wolfram Schneider 2f367644e0 A global is used even though the value is
passed through the function call.

Submitted by: "Crist J . Clark" <cjc@freebsd.org>
2002-01-01 21:16:10 +00:00
Mike Heffner 8080703a26 Print the path with the shortest absolute length, rather than
arbitrarily selecting one.

PR:		bin/14361
Approved by:	wosch
MFC after:	1 week
2001-12-12 20:38:07 +00:00
Ruslan Ermilov c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00
Dima Dorfman f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Ruslan Ermilov 625003720a mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 14:16:33 +00:00
Dima Dorfman a910f192bb Remove duplicate words. 2001-06-24 01:34:38 +00:00
Ruslan Ermilov b9ad8c8635 beforeinstall -> SCRIPTS. 2001-04-07 11:21:35 +00:00
Ruslan Ermilov dc12be5258 MAN[1-9] -> MAN. 2001-03-27 10:52:19 +00:00
Wolfram Schneider 47ecee5e83 Off by one error in reading mmap data.
Submitted by: Martin Kraemer <Martin.Kraemer@Fujitsu-Siemens.com>
2001-01-06 18:17:06 +00:00
Ruslan Ermilov 9b88faecd3 Prepare for mdoc(7)NG. 2000-12-19 16:00:12 +00:00
Ruslan Ermilov b5c508fba3 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
Warner Losh 62f882d620 getopt and friends are declared in <unistd.h>
getopt returns -1 not EOF.
2000-09-04 06:09:54 +00:00
Alexander Langer 98fae40bf0 /etc/weekly --> /etc/periodic/weekly/310.locate
PR:		19268
Submitted by:	Uwe Pierau <uwe.pierau@tu-clausthal.de>
Reviewed by:	asmodai
2000-06-14 17:41:31 +00:00
Sheldon Hearn 2ed2dc52a6 Remove more single-space hard sentence breaks. 2000-03-06 09:45:37 +00:00
Sheldon Hearn 87faa07bec Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 12:20:22 +00:00
Gregory Sutter 9906a8ab7d underline "pattern" in the synopsis.
PR:		17042
Submitted by:	Edwin Groothuis <mavetju@chello.nl>
2000-02-28 21:23:27 +00:00
Jeroen Ruigrok van der Werven a6324d7034 Fix typo's.
PR:		16430
Submitted by:	Adam.Kranzel@teru.dyndns.org (shade@dnai.com)
2000-01-28 20:20:28 +00:00
Kris Kennaway c144d68c9f Use mktemp(1) for tempfiles (concatdb.sh), and increase the number of X's. 2000-01-12 08:01:01 +00:00
Peter Wemm c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Nik Clayton 3be5f1f5ce Add $Id$, to make it simpler for members of the translation teams to
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
1999-07-12 20:24:20 +00:00
Ruslan Ermilov 436d5d04f4 Fix a width. 1999-06-05 15:03:47 +00:00
Wolfram Schneider 4bc71ceab3 Delete debug line.
PR:	bin/9793
Submitted by: Andy Farkas <andyf@speednet.com.au>
1999-05-14 18:45:18 +00:00
Wolfram Schneider 2d3de6c999 Don't overwrite the variable LOCATE_CONFIG
This is useful for people who want index their home directory:

$ env LOCATE_CONFIG=$HOME/.locate.rc /usr/libexec/locate.updatedb

Submitted by: Dmitry Morozovsky <marck@rinet.ru>
1999-05-14 10:18:43 +00:00
Andrey A. Chernov 7c105f542d fix PRUNEPATHS assignment 1999-02-28 20:40:19 +00:00
Wolfram Schneider 1c9a0db841 Added myself as maintainer. 1999-02-09 17:23:03 +00:00
Wolfram Schneider 215a9c2799 Set TMPDIR to /tmp
Use the new find option -s for sorted output.
Remove the temp directory in trap.
1998-11-29 14:46:35 +00:00
Wolfram Schneider fce53ea99b Set TMPDIR to /tmp
Remove the temp directory in trap.
Replace the buggy awk script with a correct perl script.

Don't make a copy of the input data anymore if the input is already
sorted (option -presort). This scheme avoid large temporary files in
/tmp.
1998-11-29 00:59:20 +00:00
Wolfram Schneider 0bf9cc11f0 Recommended TMPDIR is now /tmp (undo rev 1.6) 1998-11-29 00:57:03 +00:00
Wolfram Schneider a2f2188044 Create a save TMPDIR using `mktemp -d'. 1998-06-18 09:26:22 +00:00
Joseph Koshy 41cbb62401 Add cross references for find(1), locate(1), whereis(1) and which(1).
Submitted by: Josh Gillam <josh@quick.net>
PR: docs/6642
1998-05-15 11:22:42 +00:00
Wolfram Schneider 8b91ab6a61 Change default temporary directory (TMPDIR) from /tmp to /var/tmp.
Mosts users seems to have a larger /var/tmp partition
than /tmp - IMHO silly but who cares?
1998-03-08 16:09:31 +00:00
Wolfram Schneider a294b5d81b Improve shell variable substitution. 1998-03-08 15:28:37 +00:00