Commit Graph

186 Commits

Author SHA1 Message Date
sbruno
538d90d30d revert sign changes to buffers used in invocation of digest_update()
Instead, change arguments of internal function digest_update() to accept
signed char arguments.

Remove MAP_FAILED fallback definition and casts of MAP_FAILED.

Thanks to bde@ for looking over this and doing the code analysis.
2013-10-30 18:40:55 +00:00
sbruno
cdcf32ccc2 Queisce sign errors by using unsigned char * and casting MAP_FAILED as unsigned
char *

Reviewed by:	brooks@
2013-10-29 20:38:00 +00:00
sjg
62bb106222 Merge from head 2013-09-05 20:18:59 +00:00
brooks
4b6fd300cc New install flags were merged to 9-STABLE and will appear in FreeBSD-9.2.
Sponsored by:	DARPA, AFRL
Submitted by:	ru
MFC after:	3 days
2013-06-05 17:02:21 +00:00
sjg
97d8b94956 sync from head 2013-04-12 20:48:55 +00:00
sjg
6d37b86f2b Updated dependencies 2013-03-11 17:21:52 +00:00
sjg
0ee5295509 Updated dependencies 2013-02-16 01:23:54 +00:00
hrs
af9a6b5901 - Fix libmd dependency. It is needed in the bootstrap library list because
usr.bin/xinstall depends on it.
- Remove libutil from usr.bin/xinstall/Makefile.  No symbol was actually used.

Reviewed by:	brooks
2013-02-14 08:32:07 +00:00
obrien
3028e3f8ab Sync with HEAD. 2013-02-08 16:10:16 +00:00
brooks
96dbcebea0 When in -U mode do avoid setting SUID bits, but do not modify the mode
variable so the intended mode can be logged correctly if -M is specified.

Sponsored by:	DARPA, AFRL
2013-01-31 16:04:40 +00:00
brooks
f02eed2e13 Remove documentation of the old -M option.
Sponsored by:	DARPA, AFRL
2013-01-22 18:57:51 +00:00
brooks
27ebf0630a Make "install -l s[ar]" act like "ln -sfh" as intended. This fixes
installation of symbolic links where the target is a link is to an
existing directory.
2013-01-22 16:23:08 +00:00
joel
cfe5f4c14b Remove EOL whitespace. 2013-01-19 07:07:05 +00:00
brooks
3a6566041c Introduce six new options from NetBSD:
* -M <metalog>   Log metadata in mtree format.
 * -D <destdir>   Log paths relative to <destdir>.
 * -h <hash>      Log digest of type <hash>.
 * -T <tags>      Specify which mtree tags to log.
 * -l <linkflag>  Create hard or symbolic links (allows logging).
 * -U             Install without root privileges (owner, group, mode,
                  and flags can be logged via -M

NOTE: In the interest of compatibility with NetBSD and because it is the
obvious letter, the nearly useless -M option (disable mmap) has been
repurposed.

Sponsored by:	DARPA, AFRL
Obtained from:	NetBSD
Reviewed by:	bz
2013-01-18 20:57:50 +00:00
brooks
4bf0acc9bc Implement the -N <dbdir> option which allows an alternate passwd and
group file to be used.  This is useful for installing on systems where
a user or group does not currently exist.

Sponsored by:	DARPA, AFRL
Obtained from:	NetBSD
MFC after:	5 days
2013-01-11 20:53:28 +00:00
sjg
778e93c51a Sync from head 2012-11-04 02:52:03 +00:00
marcel
9dd41e3647 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
kib
9b048bab45 Issue proper diagnostic on the short writes, also consider the
case of write reporting 0 bytes as short write.

Reported and tested by:	adreast
MFC after:   1 week
2012-07-02 09:53:57 +00:00
ed
89e56ab1b3 Add missing static keywords to xinstall(1) 2011-11-06 08:19:07 +00:00
uqs
39bd167d32 Teach tools/install.sh the -d directory mode.
Sync up with flags understood by install(1) [1], and make install(1)'s
usage output not hide the clearly documented -M flag.

PR:		misc/154739 [1]
Submitted by:	arundel
2011-02-22 08:07:17 +00:00
brucec
6d9b42b486 Fix typos - remove duplicate "the".
PR:	bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after: 	3 days
2011-02-21 09:01:34 +00:00
joel
29af67e52c Remove the advertising clause from UCB copyrighted files in usr.bin. This
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
2010-12-11 08:32:16 +00:00
uqs
f41a820b03 Fix common misspelling of hierarchy
Pointed out by:		bf1783 at gmail
Approved by:		np (cxgb), kientzle (tar, etc.), philip (mentor)
2010-02-20 10:19:19 +00:00
ed
9b380e30d4 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
delphij
f86f4aa6c8 Style improvements:
- Sort function prototypes;
 - Apply static on all function bodies.  To quote bde@:

> It is a good obfuscation to declare functions as static only in the
> prototype, so that you can't see the static for the actual function.
> The reverse obfuscation (with static only in the function definition)
> would make more sense, but is a constraint error.

Reviewed by:	bde
2009-12-14 16:54:39 +00:00
delphij
3aca24a984 xinstall.c does not require ctype functions, so ctype.h is not
necessary here.

Note: this would change the md5 checksum due to change caused
by different register layout.
2009-12-13 03:53:15 +00:00
delphij
1fe1a17dd4 Staticify internal functions and make usage() a prototype. 2009-12-13 03:34:19 +00:00
delphij
0842b7d53f Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
delphij
b963db4652 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
edwin
172a6bf061 Give a better description when a install of multiple files fails
because of the absence of a destination directory or if the
"destination directory" is not a directory.

PR:		bin/11826
Submitted by:	Denis Eremenko <moonshade@pnhz.kz>
Approved by:	grog@
X-MFC after:	various freezes
2007-12-14 08:46:57 +00:00
ru
33e34aeeb5 Markup fixes. 2006-09-29 15:20:48 +00:00
obrien
ed90ac4a12 Add an override (DONTSTRIP) so that one can easily install debugable
binaries when one cannot easily edit a package's Makefiles and/or
configure scripts.
2006-03-06 21:52:59 +00:00
keramida
ac7c9f771d Fix all the spelling mistakes I could find in the man pages for words
that have at least 3 characters.

MFC after:	1 week
Thanks to:	Music band ``Chingon''
		for keeping me company while searching for these.
2005-07-31 03:30:48 +00:00
ru
1541af42f1 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
ssouhlal
0b08736243 - Make WARNS?= 6 clean
- Add WARNS?= 6

Approved by:	stefanf, grehan (mentor)
2005-01-25 14:34:57 +00:00
ru
7f3c7f0d46 Sort sections. 2005-01-18 13:43:56 +00:00
ru
6cc4b6c220 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
ru
fb1d8b3724 Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
marcel
d7eddc1b0a Document the STRIPBIN environment variable. This includes adding a
forward reference from where strip(1) is being mention (-s option).

PR: bin/28620
2004-06-11 17:25:37 +00:00
ru
1837ea9bf5 Improved incorrect usage diagnostics. 2004-03-17 11:06:40 +00:00
ru
50bea8bbbe Trust bsd.prog.mk to set SRCS correctly. 2004-03-17 10:52:12 +00:00
ru
89525cfb11 GC unnecessary include file. 2004-03-17 10:51:18 +00:00
ru
94a2ba9ecb - Demangle usage().
- Require the "directory" argument with the -d option.
2004-02-07 07:22:11 +00:00
phk
519d477531 Since (x)install is pretty unhelpfull and just spits out a Usage
for a lot of unrelated error conditions, at least report the line
number where it bailed.

Don't use multiline string literals for Usage, gcc 3.3 doesn't like them.
2003-07-11 20:51:16 +00:00
imp
b0693a4cbc Migrate to a new way of dealing with building from old revisions of
FreeBSD.  This method attempts to centralize all the necessary hacks
or work arounds in one of two places in the tree (src/Makefile.inc1
and src/tools/build).  We build a small compatibility library
(libbuild.a) as well as selectively installing necessary include
files.  We then include this directory when building host binaries.

This removes all the past release compatibilty hacks from various
places in the tree.  We still build on tip of stable and current.  I
will work with those that want to support more, although I anticipate
it will just work.

Many thanks to ru@, obrien@ and jhb@ for providing valuable input at
various stage of implementation, as well as for working together to
positively effect a change for the better.
2003-04-05 20:30:30 +00:00
ru
041d1287e8 Uniformly refer to a file system as "file system".
Approved by:	re
2002-12-12 17:26:04 +00:00
fenner
eb450c7edf If both the unlink and the open fail, return the errno from the
unlink (very likely EPERM), since the errno from the open might
 be a confusing ETXTBSY.

Approved by:	re
MFC After:	1 week
2002-11-30 23:12:59 +00:00
bde
313635e051 #include <sys/time.h> instead of depending on namespace pollution in
<sys/stat.h> for the declaration of struct timeval.

Approved by:	re (rwatson)
2002-11-30 18:59:31 +00:00
peter
5044bd9ace A little bit of anti-foot-shooting. Use utimes(2) rather than
the deprecated utime(3).  utimes(2) uses timeval, but utime(3) uses
time_t's.  If you do bad things (like I did) by mixing up include files
with libc, then install can do strange things if you mismatch the time_t
stuff.  utime() is emulated entirely within libc.

Approved by:  re (jhb)
2002-11-15 22:43:56 +00:00
ru
7920e22cea Take __FreeBSD_version into account when BOOTSTRAPPING. 2002-11-13 13:49:29 +00:00
ru
c592850409 Document the new behavior of -C with respect to inode-change-time.
Document that -p also preserves the access time of the source.
2002-10-31 10:43:32 +00:00
ru
c5d62c42fa Do not change the target file's inode-change-time if -C is
specified, the target file already exists and the files are
the same, and the target's file flags and mode need not to
be changed.
2002-10-31 10:41:51 +00:00
dwmalone
b4339b74ad ANSIify function definitions.
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
2002-09-04 23:29:10 +00:00
ru
2a8927efce Ignore -C, -p, and -S options of install(1) when used with the -d
option.  Warn about COPY being phased out.  Restore the old method
of always comparing before installing: INSTALL="install -C".

Requested by:	bde
2002-07-29 08:51:04 +00:00
ru
e11700e21e Start the (overdue) de-orbit sequence for the -d -C combo,
as was promised in revision 1.43.

MFC after:	1 month
2002-06-05 17:37:48 +00:00
trhodes
fa6c7efe3f More consistancy. file system > filesystem 2002-05-16 02:19:14 +00:00
fanf
3609bfaab7 Report errors properly if wait() fails.
PR:		30543
Approved by:	dwmalone (mentor)
MFC after:	3 weeks
2002-05-15 16:50:09 +00:00
bde
66189f380b Fixed 5 style bugs in VCS ids. 2002-05-12 04:02:57 +00:00
bde
20313e69cb Fixed printing the the strip binary's name in error messages. 2002-05-12 03:47:23 +00:00
marcel
e4f919be68 Add support for stripping non-native object files by using an
environment variable that specifies the name of the strip(1)
program to use. The envvar is "STRIPBIN". The more natural
choice would be "STRIP", but that one is taken already.
2002-05-11 19:15:15 +00:00
charnier
ad8a79e6a5 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
ru
6d38d7dc3c No longer needed to #ifdef __FBSDID, this is now handled by Makefile.inc1. 2002-04-09 11:39:05 +00:00
imp
0b20191705 remove __P 2002-03-22 01:42:45 +00:00
des
aa322cf19a Bump the cutoff mark for comparing files from 8 MB to 16 MB. 2002-03-18 23:26:13 +00:00
markm
31d81e4fbc Remove NO_WERRORs and WARNS=n's. To be revisited after GCC3. 2002-02-08 23:07:37 +00:00
imp
7380723594 xinstall is part of the upgrade path for 4.4-RELEASE as well.
Do the usualy ifdef trick here.

Reported by: dworkin muller <addr-removed> and faried nawaz <fn@hungry.com>
2001-12-19 06:05:42 +00:00
ru
d27bd7160f More "const" poisoning, and only use NO_WERROR if we're bootstrapping. 2001-12-12 08:49:51 +00:00
markm
50e4bbdea1 WARNS=2, use __FBSDID(), set NO_WERROR, as there are "dirty" files used
during the bootstrap phase.
2001-12-11 22:46:42 +00:00
dd
316b09762f This program uses sysexits(3), so it does not exit 1 on failure.
PR:		31415
2001-10-23 00:47:27 +00:00
ru
84ac5b97df When bootstrapping install(1), libc may not have the strtofflags(3) support. 2001-09-17 11:58:14 +00:00
ru
ac9087fba1 Update -v documentation to match reality.
Spotted by:	bde
2001-08-21 15:59:55 +00:00
brian
8636b161b3 Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
ru
0ca37f1781 Note that the default behavior has changed to copy files.
Also, fix markup in the SYNOPSIS.

Submitted by:	dougb
2001-05-30 09:45:47 +00:00
ru
28c43881ca Backout rev. 1.42 (relaxing the check for -d plus other flags).
Instead, issue a warning for now if -d and -C options are used
together.  This will be turned into an error before 4.5-RELEASE.

Reviewed by:	imp
2001-05-30 07:08:49 +00:00
imp
0925b2a595 Use use ${INSTALL} -d in our build process. If INSTALL is set to
"install -C" then things will fail due to new checks.  Relax the
checks so that install -C -d works again.
2001-05-29 18:41:16 +00:00
ru
03c37077e5 Many new features and optimization improvements:
o New flags: -b and -B (backup)
o New flag: -S (safe copy; aka "atomic" install)
o The -c flag is now the default.
o The -D flag was withdrawn.

Reviewed by:	bde (up to some point)
Obtained from:	OpenBSD but heavily modified
MFC after:	1 month
2001-05-28 16:41:53 +00:00
ru
5c4fced5ff Do not override `realinstall' target, use ${PROGNAME}. 2001-04-02 11:54:59 +00:00
ru
17f756a033 Do not override the ``install'' target. 2001-03-27 15:14:49 +00:00
ru
89596e4538 MAN[1-9] -> MAN. 2001-03-27 10:52:19 +00:00
ru
e6cfc0711d Prepare for mdoc(7)NG. 2000-12-19 16:00:12 +00:00
ru
0d1334ca0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
bde
d0ce9bc4dc Use the correct timestamp for the -C -p case when the comparison fails.
A garbage timestamp was used for at least installing /dev/null with -C -p
when the target doesn't already exist.
2000-10-08 09:17:56 +00:00
joe
8de98cc2fa Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
charnier
42d5955dc9 Add DIAGNOSTICS section name 2000-03-26 15:06:46 +00:00
sheldonh
49c4458c80 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
joe
b57f9be4b7 Revert part of the last commit, remove {g|s}etflags from the libc
interface, and statically link them to the programs using them.
These functions, upon reflection and discussion, are too generically
named for a library interface with such specific functionality.
Also the api that they use, whilst ok for private use, isn't good
enough for a libc function.

Additionally there were complications with the build/install-world
process.  It depends heavily upon xinstall, which got broken by
the change in api, and caused bootstrap problems and general mayhem.

There is work in progress to address future problems that may be
caused by changes in install-chain tools, and better names for
{g|s}etflags can be derived when some future program requires them.
For now the code has been left in src/lib/libc/gen (it started off
in src/bin/ls).

It's important to provide library functions for manipulating file
flag strings if we ever want this interface to be adopted outside
of the source tree, but now isn't necessarily the right moment
with 4.0-release just around the corner.

Approved:	jkh
2000-02-05 18:42:36 +00:00
joe
f1a9497df5 Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and
string_to_flags, which co-existed with 'ls'.  As time has progressed
more and more other tools have used these private functions to
manipulate the file flags.

Recently I moved these functions from /usr/src/bin/ls to libutil,
but after some discussion with bde it's been decided that they
really ought to go in libc.

There are two already existing libc functions for manipulating file
modes:  setmode and getmode.  In keeping with these flags_to_string
has been renamed getflags and string_to_flags to setflags.

The manual page could probably be improved upon ;)
2000-01-27 21:17:01 +00:00
bde
90aaf7aa83 Actually remove unrequired SRCS. 2000-01-05 19:22:10 +00:00
joe
9dba5b86f4 Added missing DPADD's. Removed unrequired SRCS's.
Obtained from:	bde
2000-01-01 15:44:11 +00:00
joe
a381d987c4 Moved flags_to_string and string_to_flags into libutil. It's used in
many places nowadays.
1999-12-30 13:15:15 +00:00
obrien
c4d3fc5932 Add "-v" to usage(). 1999-12-06 05:02:32 +00:00
obrien
ef7574daa0 Document the "-v" flag. [It was like that when I got here.. honestly.] 1999-12-06 05:01:14 +00:00
billf
f3e2a0e313 -Wall fixes.
Submitted by:	nrahlstr
1999-09-27 00:36:03 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
imp
3d6d60242a Free memory from setmode.
Obtained from: OpenBSD
1998-12-16 04:51:27 +00:00
des
3ca80efd3a Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork()
instead.

Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.

PR:		Loosely related to bin/8252
Approved by:	jkh and bde
1998-10-13 14:52:33 +00:00
peter
7a359c2e0c fchflags(8) -> fchflags(2)
Submitted by:  Kenneth Merry <ken@plutotech.com>

Also, while here, mention that other FS's don't do flags.
1998-06-10 07:17:59 +00:00
peter
0a878d2304 Treat an EOPNOTSUPP from fchflags() as a non-fatal case. Only warn about
it if flags were explicitly specified on the command line.  Do not warn
if we were merely trying to preserve flags or remove UF_NODUMP.  NFS does
not support flags.

I'm not sure that this is ideal, but it should do for now.  Installing
a plain file onto a NFS server must work, we used to silently ignore the
attempt.  Doing a binary install looses the flags anyway since cpio
doens't preserve them with the cdrom/network images.
XXX make world should not use flags or chown/chgrp in the obj/tmp area.

This is based on a suggestion from Ken Merry <ken@plutotech.com>.
1998-06-02 12:00:08 +00:00
bde
94f39c6b01 Converted to Lite2 mount interface - don't use numeric filesystem
types.  The NetBSD compatibility cruft was more correct for -current
than FreeBSD's own code.  It just used NetBSD #defines instead of
string literals for the filesystem names.  NetBSD's MOUNT_UFS is
"ffs", so using a literal "ufs" gives wrong results, but this is
unimportant, especially for bootstrapping.

Fixed style bugs in trymmap().

Fixed some disordered declarations.
1998-01-20 13:52:32 +00:00
alex
3d7686dc1c Change MAP_FAILED to type void *.
Typo fix.
1998-01-13 02:12:43 +00:00