Commit Graph

176 Commits

Author SHA1 Message Date
elad 3044852cc5 The hashing routines (MD5File() and co.) can do dynamic allocation, so
take advantage of that instead of an ugly hard-coded MAXHASHLEN limit
that needs updating.

I think this was suggested by cube@ years ago.
2007-02-04 08:03:18 +00:00
perry 981d0d04cb Fix a typo in a boolean test, which used & instead of &&. 2007-01-20 01:13:13 +00:00
bouyer 3697550e70 Don't depend on lubutil if we're building host tools. Fix tools build on
non-NetBSD hosts.
2006-12-16 12:59:16 +00:00
he f6b748e0c7 Fix mtree to release the returned strings from flags_to_string()
following the move of it from bin/ls to libutil and the change of
it to return malloc()ed memory.
2006-12-14 20:21:47 +00:00
he 0a97c3f688 Complete the move of string_to_flags() and flags_to_string() from the
bin/ls sources to libutil:
 o Bump libutil minor version number
 o Fix uses to include <util.h> to pick up the function definitions
 o Fix most uses of flags_to_string() to release the now-malloc()ed result
2006-12-14 20:09:35 +00:00
he 29ff6ed16a The "#ifdef UNUSED_BLOCK" in stat_flags.c wasn't so unused after
all -- it was used by the mtree source.  So, instead do an "#ifdef
MTREE", and define that one when building mtree.
2006-12-14 17:54:19 +00:00
christos 11c53ad61c kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
2006-10-30 20:22:53 +00:00
christos a3522b311f c99 initializers 2006-10-16 00:11:57 +00:00
christos 4ce31f7c8c PR/34818: rad at twig dot com: Recognize solaris door files. 2006-10-14 21:14:02 +00:00
martin a073765d4a Apply patch from Peter Bex to fix PR bin/31922. 2006-10-08 18:09:47 +00:00
elad d71fc8765e PR/28786: Jukka Salmi: mtree bug (in verify.c)
Apply patch from Peter Bex, thanks!
2006-10-07 15:35:51 +00:00
pavel b1328dedeb describe how to suppress printing of "type" keyword when -k is used.
bump date.
2006-09-12 20:22:49 +00:00
wiz 7e78208091 i.e. without a space. PR 33328 by Igor Sobrado. 2006-04-22 19:35:35 +00:00
dsl c0b0ba1f18 If parameter don't have values, then 'continue' after setting the flag bit.
Fixes coverty CID 776 and removes the need for a 'val = NULL' added to
appease gcc's undefined variable tests.
This parsing code sucks though, it doesn't correctly check for the '='
between a parameter and its value, whitespace can be used instead.
2006-04-12 19:49:59 +00:00
elad 7084f7a24b SHA2 support has been pulled up to NetBSD 3.0, update the history part. 2005-11-10 19:41:59 +00:00
christos c05266af8a fix setmode error handling. 2005-10-01 20:23:54 +00:00
tron fe7c56c577 The list of keywords must be sorted because it is search with bsearch(3).
Correcting this makes mtree(8) work again under Solaris.
2005-09-29 14:29:03 +00:00
elad a375b7cdb7 Use crypto/rmd160.h. 2005-09-24 22:40:32 +00:00
elad d05d5cada8 Use MAXHASHLEN here too. 2005-09-02 17:12:38 +00:00
elad aae00d5a54 Add SHA2 support in mtree. 2005-08-24 20:55:41 +00:00
elad d0b9773c8f Reference cksum(1) only. 2005-08-24 20:49:51 +00:00
lukem c8e07a4ef7 appease gcc -Wuninitialized 2005-06-02 05:58:24 +00:00
dsl 6b5922eb36 WARNS=3 seems to work for me 2005-04-09 13:13:32 +00:00
perry d777c795fa ANSIfy function declaration, remove register declarations, and some
minor KNFing.
2005-02-06 04:52:53 +00:00
lukem 24e1167471 In replacenode(), don't strunvis() a NULL pointer. (Fixes bug in previous.) 2004-12-01 23:27:36 +00:00
lukem 507e9f7256 strsvis(3) encode & decode the "link=" value (symlink target). 2004-12-01 10:07:56 +00:00
lukem 9cc32040b1 Implement -M to "merge" entries, even with different types.
This can be used in /etc/security to allow special.local to override
types of entries in special (e.g, replacing a dir with a link).

Rename Wflag to mtree_Wflag, to be more "external namespace" friendly.
2004-07-22 16:51:45 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
christos 455c8493fb foliage from pack_dev change :-) 2004-05-11 17:11:03 +00:00
ross 4875c0a7d0 Handle new-style error return from mknod/pack_dev.c 2004-01-30 19:09:03 +00:00
dbj 982688a7fd #include <util.h>
this is needed by fparseln on macos/darwin and is harmless on netbsd
2003-11-17 00:02:33 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
dsl d597578896 Include filename in:
'existing entry for `sha1.h', type `file' does not match type `link'
2003-10-10 11:08:54 +00:00
itojun e99b62a1d7 realloc pedant 2003-09-19 06:11:35 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
wiz 085295fd9c Quote some characters. 2003-06-27 23:21:50 +00:00
lukem 826a14607a Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
2003-05-18 07:57:31 +00:00
grant f125cd44b3 grammar tweak. 2003-03-31 08:44:22 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
lukem 9e74ffcba8 Change default permissions of newly created directories from
"0700, modified by umask", to "0777, modified by umask".
This matches the behaviour of mkdir(1) and just about every other command...

This change is useful when running with '-W', where the mode of the
new directory won't be changed to what's specified in the specfile.
(I.e, an UNPRIVED build, with a umask of 022).
2003-01-04 13:10:52 +00:00
grant 653b2f1552 File types belong under 'type', not 'uname'. 2002-12-27 06:31:51 +00:00
lukem 3cbfaf0af4 Add -C, which dumps the specification with the full path name first,
and then all the other fields.  (I.e, like -D except with the name
first instead of last).
Consistenly strsvis(3) encode path names (even for -C and -D).
2002-12-23 04:40:19 +00:00
lukem 92a480785a correct description of -D 2002-12-09 13:42:08 +00:00
lukem d348d3d723 tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
2002-11-30 03:10:53 +00:00
grant 58306652d2 avoid non-constant initializer errors by changing hack to workaround
gcc warning to a slightly different hack.
2002-11-29 02:07:34 +00:00
lukem 6e980262a4 Remove convoluted code to work around missing lch{flags,mod,own}();
instead, rely upon libnbcompat to provide a workaround (which returns
an error if the target is a symlink).
Should fix another MacOS X build issue due to missing lchown(2).
2002-10-08 00:34:08 +00:00
lukem 64beaeafc8 - Check HAVE_LCHFLAGS for lchflags(2) support, rather than assuming
that HAVE_STRUCT_STAT_ST_FLAGS implies this.
- Set HAVE_LCHFLAGS for native builds
- Clean up {CLEAR,SET,CHANGE}FLAGS macros, and only provide if
  HAVE_STRUCT_STAT_ST_FLAGS is set.

(Fixes compilation as a tool on MacOS X, noted by Allen Briggs.)
2002-10-06 01:36:09 +00:00
lukem 17d72c8a6b use NETBSDSRCDIR as appropriate 2002-09-18 03:54:26 +00:00
soren 236006d5dc Remove extraneous \n's in {err,warn}{,x} that used to be printfs. 2002-08-08 13:24:12 +00:00
bjh21 dd9c5ed338 Don't use __RCSID unless it's defined. 2002-04-09 19:17:11 +00:00