mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
67 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53feb25dd7 | ||
|
|
9726d96742 | ||
|
|
3283bb8b93 | ||
|
|
2b9d8efc91 | ||
|
|
c3da9e25ed | ||
|
|
ab367e6b13 | ||
|
|
8d0687974f | ||
|
|
230bf31c87 | ||
|
|
5f7aed5f78 | ||
|
|
65b0c96d46 | ||
|
|
cb05584160 | ||
|
|
79043436ce | ||
|
|
3584f04f59 | ||
|
|
1f5e4907c2 | ||
|
|
a04e5b9dbc | ||
|
|
ce8d840e83 | ||
|
|
39da0cbc3b | ||
|
|
dffa52e11a | ||
|
|
60c672e7ec | ||
|
|
ace3c90796 | ||
|
|
c2c680ad95 | ||
|
|
e34407ac09 | ||
|
|
bca49a8c12 | ||
|
|
483f907eb8 | ||
|
|
f680954f1f | ||
|
|
e7a17082b4 | ||
|
|
33675b72ce | ||
|
|
7708d86636 | ||
|
|
ff8d7f3d98 | ||
|
|
39e3db9605 | ||
|
|
8619939503 | ||
|
|
aba49610d9 | ||
|
|
4b5edfea53 | ||
|
|
98daab19b9 | ||
|
|
6924fde974 | ||
|
|
cf19019bf9 | ||
|
|
eccfa6b591 | ||
|
|
1778e41773 | ||
|
|
2d3aded1bb | ||
|
|
9d524deb2b | ||
|
|
12079963ab | ||
|
|
30ee9b3006 | ||
|
|
e87dcda480 | ||
|
|
3d929fbda2 | ||
|
|
c0e5ce613e | ||
|
|
59a8abac57 | ||
|
|
89aa821b03 | ||
|
|
eaa53735c2 | ||
|
|
2dfa2338b8 | ||
|
|
a7f53c72b3 | ||
|
|
f6234990b2 | ||
|
|
9eb2ccc113 | ||
|
|
92ae1c7d2a | ||
|
|
31d9a98e82 | ||
|
|
4df3e0f3b9 | ||
|
|
834c4dbfe1 | ||
|
|
3d7a795592 | ||
|
|
1352d5e6ce | ||
|
|
327b8f63c0 | ||
|
|
af49390ea7 | ||
|
|
ac42c1a725 | ||
|
|
5f9e998bca | ||
|
|
16bcaae35b | ||
|
|
315d948fe2 | ||
|
|
3016c52459 | ||
|
|
a6e3bc0ace | ||
|
|
940dc652a5 |
@@ -77,14 +77,14 @@ PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
|
||||
v = Version
|
||||
|
||||
a_host = alpha.gnu.org
|
||||
b_host = tug.org
|
||||
b_host = freefriends.org
|
||||
|
||||
alpha_subdir = gnu/fetish
|
||||
a_url_dir = $(alpha_subdir)
|
||||
b_url_dir = $(alpha_subdir)
|
||||
|
||||
a_real_dir = /fs/share/ftp/$(alpha_subdir)
|
||||
b_real_dir = /home/ftp/pub/$(alpha_subdir)
|
||||
b_real_dir = /home/ftp/$(alpha_subdir)
|
||||
|
||||
url_dir_list = $(foreach x,a b,ftp://$($(x)_host)/$($(x)_url_dir))
|
||||
|
||||
@@ -122,7 +122,7 @@ announcement: NEWS ChangeLog $(distdir).tar.gz
|
||||
echo "$(md5) $(distdir).tar.gz"; \
|
||||
echo; \
|
||||
echo NEWS:; \
|
||||
sed -n "/$(THIS_VERSION_REGEXP)/,/$(PREV_VERSION_REGEXP)/p" NEWS \
|
||||
sed -n "/$(THIS_VERSION_REGEXP)/,/^\[$(PREV_VERSION_REGEXP)/p" NEWS \
|
||||
| grep -v '^\['; \
|
||||
echo; \
|
||||
echo ChangeLog entries:; \
|
||||
|
||||
2
THANKS
2
THANKS
@@ -59,6 +59,7 @@ Clark Morgan cmorgan@aracnet.com
|
||||
Colin Plumb colin@nyx.net
|
||||
Collin Rogowski collin@rogowski.de
|
||||
Dan Hagerty hag@gnu.ai.it.edu
|
||||
Dan Pascu dan@services.iiruc.ro
|
||||
Daniel Bergstrom noa@melody.se
|
||||
David Dyck dcd@tc.fluke.COM
|
||||
David Godfrey dave@delta.demon.co.uk
|
||||
@@ -149,6 +150,7 @@ J
|
||||
Kai-Uwe Rommel rommel@informatik.tu-muenchen.de
|
||||
Kalle Olavi Niemitalo tosi@stekt.oulu.fi
|
||||
Kamal Paul Nigam Kamal_Paul_Nigam@gs35.sp.cs.cmu.edu
|
||||
Karl Eichwalder keichwa@gmx.net
|
||||
Karl Heuer kwzh@gnu.org
|
||||
Karsten Thygesen karthy@kom.auc.dk
|
||||
Kaveh R. Ghazi ghazi@caip.rutgers.edu
|
||||
|
||||
@@ -276,18 +276,8 @@ o+t
|
||||
|
||||
Remember that the special permissions only affect files that are
|
||||
executable, plus, on some systems, directories (on which they have
|
||||
different meanings; @pxref{Mode Structure}). Using @samp{a}
|
||||
in the @var{users} part of a symbolic mode does not cause the special
|
||||
permissions to be affected; thus,
|
||||
|
||||
@example
|
||||
a+s
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
has @emph{no effect}. You must use @samp{u}, @samp{g}, and @samp{o}
|
||||
explicitly to affect the special permissions. Also, the
|
||||
combinations @samp{u+t}, @samp{g+t}, and @samp{o+s} have no effect.
|
||||
different meanings; @pxref{Mode Structure}).
|
||||
Also, the combinations @samp{u+t}, @samp{g+t}, and @samp{o+s} have no effect.
|
||||
|
||||
The @samp{=} operator is not very useful with special permissions; for
|
||||
example, the mode:
|
||||
|
||||
@@ -2202,7 +2202,7 @@ format of the @samp{%c} directive (described below). Synopses:
|
||||
@example
|
||||
date [@var{option}]@dots{} [+@var{format}]
|
||||
date [-u|--utc|--universal] @c this avoids a newline in the output
|
||||
[ @var{MMDDhhmm}[[@var{CC}]@var{YY}][.@var{ss}] ]
|
||||
[ MMDDhhmm[[CC]YY][.ss] ]
|
||||
@end example
|
||||
|
||||
@findex strftime @r{and @code{date}}
|
||||
@@ -2400,7 +2400,7 @@ zone.
|
||||
The argument must consist entirely of digits, which have the following
|
||||
meaning:
|
||||
|
||||
@table @var
|
||||
@table @samp
|
||||
@item MM
|
||||
month
|
||||
@item DD
|
||||
|
||||
@@ -1,5 +1,38 @@
|
||||
2000-09-25 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* md5.h (rol): Define (from GnuPG).
|
||||
|
||||
* sha.c: Give credit (GnuPG) where due.
|
||||
(M): Use rol rather than open-coding it.
|
||||
Add a FIXME comment.
|
||||
|
||||
2000-09-21 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* userspec.c (parse_user_spec): Remove debugging printf I'd added.
|
||||
Reported by Michael Stone.
|
||||
|
||||
2000-09-20 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (libfetish_a_SOURCES): Add sha.c.
|
||||
(noinst_HEADERS): Add sha.h.
|
||||
Based on code from Scott G. Miller and from GnuPG.
|
||||
|
||||
2000-09-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* regex.c: Update from libc.
|
||||
|
||||
2000-09-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getopt.c (_getopt_internal): Update from glibc.
|
||||
|
||||
2000-09-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
|
||||
think it should be used as a general replacement for isascii.
|
||||
* fnmatch.c: Likewise.
|
||||
* mbswidth.c: Likewise
|
||||
* regex.c: Likewise.
|
||||
|
||||
Don't use atoi.
|
||||
* userspec.c: Include sys/param.h and limits.h.
|
||||
Include xstrtol.h.
|
||||
|
||||
@@ -15,7 +15,7 @@ libfetish_a_SOURCES = \
|
||||
makepath.c mbswidth.c md5.c memcasecmp.c memcoll.c modechange.c \
|
||||
path-concat.c \
|
||||
quote.c quotearg.c readtokens.c safe-read.c same.c save-cwd.c \
|
||||
savedir.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
savedir.c sha.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
|
||||
xstrtoumax.c yesno.c
|
||||
|
||||
@@ -30,7 +30,7 @@ noinst_HEADERS = \
|
||||
linebuffer.h long-options.h mbswidth.h md5.h memcasecmp.h memcoll.h \
|
||||
makepath.h mbswidth.h modechange.h mountlist.h nanosleep.h obstack.h \
|
||||
path-concat.h pathmax.h posixtm.h quote.h quotearg.h readtokens.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h sha.h \
|
||||
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
|
||||
|
||||
BUILT_SOURCES = getdate.c lstat.c stat.c
|
||||
|
||||
@@ -130,7 +130,7 @@ libfetish_a_SOURCES = \
|
||||
makepath.c mbswidth.c md5.c memcasecmp.c memcoll.c modechange.c \
|
||||
path-concat.c \
|
||||
quote.c quotearg.c readtokens.c safe-read.c same.c save-cwd.c \
|
||||
savedir.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
savedir.c sha.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
|
||||
xstrtoumax.c yesno.c
|
||||
|
||||
@@ -146,7 +146,7 @@ noinst_HEADERS = \
|
||||
linebuffer.h long-options.h mbswidth.h md5.h memcasecmp.h memcoll.h \
|
||||
makepath.h mbswidth.h modechange.h mountlist.h nanosleep.h obstack.h \
|
||||
path-concat.h pathmax.h posixtm.h quote.h quotearg.h readtokens.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h sha.h \
|
||||
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
|
||||
|
||||
|
||||
@@ -181,9 +181,9 @@ hash$U.o human$U.o idcache$U.o isdir$U.o linebuffer$U.o \
|
||||
localcharset$U.o long-options$U.o makepath$U.o mbswidth$U.o md5$U.o \
|
||||
memcasecmp$U.o memcoll$U.o modechange$U.o path-concat$U.o quote$U.o \
|
||||
quotearg$U.o readtokens$U.o safe-read$U.o same$U.o save-cwd$U.o \
|
||||
savedir$U.o stripslash$U.o unicodeio$U.o userspec$U.o version-etc$U.o \
|
||||
xgetcwd$U.o xgethostname$U.o xmalloc$U.o xstrdup$U.o xstrtod$U.o \
|
||||
xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o yesno$U.o
|
||||
savedir$U.o sha$U.o stripslash$U.o unicodeio$U.o userspec$U.o \
|
||||
version-etc$U.o xgetcwd$U.o xgethostname$U.o xmalloc$U.o xstrdup$U.o \
|
||||
xstrtod$U.o xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o yesno$U.o
|
||||
libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS)
|
||||
AR = ar
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
@@ -220,18 +220,19 @@ $(DEPDIR)/posixtm$U.Po $(DEPDIR)/putenv.Po $(DEPDIR)/quote$U.Po \
|
||||
$(DEPDIR)/quotearg$U.Po $(DEPDIR)/readtokens$U.Po $(DEPDIR)/readutmp.Po \
|
||||
$(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po $(DEPDIR)/rmdir.Po \
|
||||
$(DEPDIR)/rpmatch.Po $(DEPDIR)/safe-read$U.Po $(DEPDIR)/same$U.Po \
|
||||
$(DEPDIR)/save-cwd$U.Po $(DEPDIR)/savedir$U.Po $(DEPDIR)/stat.Po \
|
||||
$(DEPDIR)/stime.Po $(DEPDIR)/stpcpy.Po $(DEPDIR)/strcasecmp.Po \
|
||||
$(DEPDIR)/strcspn.Po $(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po \
|
||||
$(DEPDIR)/stripslash$U.Po $(DEPDIR)/strncasecmp.Po $(DEPDIR)/strndup.Po \
|
||||
$(DEPDIR)/strnlen.Po $(DEPDIR)/strpbrk.Po $(DEPDIR)/strstr.Po \
|
||||
$(DEPDIR)/strtod.Po $(DEPDIR)/strtol.Po $(DEPDIR)/strtoul.Po \
|
||||
$(DEPDIR)/strtoull.Po $(DEPDIR)/strtoumax.Po $(DEPDIR)/strverscmp.Po \
|
||||
$(DEPDIR)/unicodeio$U.Po $(DEPDIR)/userspec$U.Po $(DEPDIR)/utime.Po \
|
||||
$(DEPDIR)/version-etc$U.Po $(DEPDIR)/xgetcwd$U.Po \
|
||||
$(DEPDIR)/xgethostname$U.Po $(DEPDIR)/xmalloc$U.Po \
|
||||
$(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtod$U.Po $(DEPDIR)/xstrtol$U.Po \
|
||||
$(DEPDIR)/xstrtoul$U.Po $(DEPDIR)/xstrtoumax$U.Po $(DEPDIR)/yesno$U.Po
|
||||
$(DEPDIR)/save-cwd$U.Po $(DEPDIR)/savedir$U.Po $(DEPDIR)/sha$U.Po \
|
||||
$(DEPDIR)/stat.Po $(DEPDIR)/stime.Po $(DEPDIR)/stpcpy.Po \
|
||||
$(DEPDIR)/strcasecmp.Po $(DEPDIR)/strcspn.Po $(DEPDIR)/strdup.Po \
|
||||
$(DEPDIR)/strftime.Po $(DEPDIR)/stripslash$U.Po \
|
||||
$(DEPDIR)/strncasecmp.Po $(DEPDIR)/strndup.Po $(DEPDIR)/strnlen.Po \
|
||||
$(DEPDIR)/strpbrk.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtod.Po \
|
||||
$(DEPDIR)/strtol.Po $(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po \
|
||||
$(DEPDIR)/strtoumax.Po $(DEPDIR)/strverscmp.Po $(DEPDIR)/unicodeio$U.Po \
|
||||
$(DEPDIR)/userspec$U.Po $(DEPDIR)/utime.Po $(DEPDIR)/version-etc$U.Po \
|
||||
$(DEPDIR)/xgetcwd$U.Po $(DEPDIR)/xgethostname$U.Po \
|
||||
$(DEPDIR)/xmalloc$U.Po $(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtod$U.Po \
|
||||
$(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po \
|
||||
$(DEPDIR)/xstrtoumax$U.Po $(DEPDIR)/yesno$U.Po
|
||||
DIST_COMMON = README $(noinst_HEADERS) ChangeLog Makefile.am \
|
||||
Makefile.in TODO __fpending.c alloca.c atexit.c chown.c dup2.c error.c \
|
||||
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
|
||||
@@ -449,6 +450,8 @@ save-cwd_.c: save-cwd.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > save-cwd_.c
|
||||
savedir_.c: savedir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > savedir_.c
|
||||
sha_.c: sha.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/sha.c; then echo $(srcdir)/sha.c; else echo sha.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > sha_.c
|
||||
stat_.c: stat.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
|
||||
stime_.c: stime.c $(ANSI2KNR)
|
||||
@@ -526,7 +529,7 @@ memcmp_.o memcoll_.o memcpy_.o memmove_.o memset_.o mktime_.o \
|
||||
modechange_.o mountlist_.o nanosleep_.o obstack_.o path-concat_.o \
|
||||
posixtm_.o putenv_.o quote_.o quotearg_.o readtokens_.o readutmp_.o \
|
||||
realloc_.o regex_.o rmdir_.o rpmatch_.o safe-read_.o same_.o \
|
||||
save-cwd_.o savedir_.o stat_.o stime_.o stpcpy_.o strcasecmp_.o \
|
||||
save-cwd_.o savedir_.o sha_.o stat_.o stime_.o stpcpy_.o strcasecmp_.o \
|
||||
strcspn_.o strdup_.o strftime_.o stripslash_.o strncasecmp_.o \
|
||||
strndup_.o strnlen_.o strpbrk_.o strstr_.o strtod_.o strtol_.o \
|
||||
strtoul_.o strtoull_.o strtoumax_.o strverscmp_.o unicodeio_.o \
|
||||
@@ -648,6 +651,7 @@ maintainer-clean-tags:
|
||||
@AMDEP@include $(DEPDIR)/same$U.Po
|
||||
@AMDEP@include $(DEPDIR)/save-cwd$U.Po
|
||||
@AMDEP@include $(DEPDIR)/savedir$U.Po
|
||||
@AMDEP@include $(DEPDIR)/sha$U.Po
|
||||
@AMDEP@include $(DEPDIR)/stat.Po
|
||||
@AMDEP@include $(DEPDIR)/stime.Po
|
||||
@AMDEP@include $(DEPDIR)/stpcpy.Po
|
||||
|
||||
@@ -40,12 +40,12 @@
|
||||
|
||||
|
||||
# if defined STDC_HEADERS || !defined isascii
|
||||
# define ISASCII(c) 1
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
# else
|
||||
# define ISASCII(c) isascii(c)
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
# endif
|
||||
|
||||
# define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
# define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
|
||||
|
||||
|
||||
# ifndef errno
|
||||
|
||||
@@ -671,7 +671,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
pfound = p;
|
||||
indfound = option_index;
|
||||
}
|
||||
else if (pfound->has_arg != p->has_arg
|
||||
else if (long_only
|
||||
|| pfound->has_arg != p->has_arg
|
||||
|| pfound->flag != p->flag
|
||||
|| pfound->val != p->val)
|
||||
/* Second or later nonexact match found. */
|
||||
|
||||
@@ -74,15 +74,13 @@ int wcwidth ();
|
||||
|
||||
/* Get ISPRINT. */
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
# undef ISASCII
|
||||
# define ISASCII(c) 1
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii (c)
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
#undef ISPRINT
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
|
||||
|
||||
#include "mbswidth.h"
|
||||
|
||||
|
||||
15
lib/md5.h
15
lib/md5.h
@@ -143,4 +143,19 @@ extern int md5_stream __P ((FILE *stream, void *resblock));
|
||||
digest. */
|
||||
extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
|
||||
|
||||
/* The following is from gnupg-1.0.2's cipher/bithelp.h. */
|
||||
/* Rotate a 32 bit integer by n bytes */
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
static inline md5_uint32
|
||||
rol(md5_uint32 x, int n)
|
||||
{
|
||||
__asm__("roll %%cl,%0"
|
||||
:"=r" (x)
|
||||
:"0" (x),"c" (n));
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
# define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) )
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -92,15 +92,14 @@ size_t mbrtowc ();
|
||||
#define INT_BITS (sizeof (int) * CHAR_BIT)
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
# undef ISASCII
|
||||
# define ISASCII(c) 1
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii (c)
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
#undef ISPRINT
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
|
||||
|
||||
struct quoting_options
|
||||
{
|
||||
|
||||
80
lib/regex.c
80
lib/regex.c
@@ -197,35 +197,34 @@ char *realloc ();
|
||||
eliminate the && through constant folding."
|
||||
Solaris defines some of these symbols so we must undefine them first. */
|
||||
|
||||
#undef ISASCII
|
||||
#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
|
||||
# define ISASCII(c) 1
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii(c)
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#ifdef isblank
|
||||
# define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||
# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c))
|
||||
#else
|
||||
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
#endif
|
||||
#ifdef isgraph
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (c))
|
||||
#else
|
||||
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (c) && !isspace (c))
|
||||
#endif
|
||||
|
||||
#undef ISPRINT
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||
#define ISALNUM(c) (ISASCII (c) && isalnum (c))
|
||||
#define ISALPHA(c) (ISASCII (c) && isalpha (c))
|
||||
#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
|
||||
#define ISLOWER(c) (ISASCII (c) && islower (c))
|
||||
#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
|
||||
#define ISSPACE(c) (ISASCII (c) && isspace (c))
|
||||
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
|
||||
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
|
||||
#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
|
||||
#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
|
||||
#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
|
||||
#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
|
||||
#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
|
||||
#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c))
|
||||
#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
|
||||
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
|
||||
#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
|
||||
|
||||
#ifdef _tolower
|
||||
# define TOLOWER(c) _tolower(c)
|
||||
@@ -1234,7 +1233,7 @@ typedef struct
|
||||
# if defined MATCH_MAY_ALLOCATE
|
||||
/* 4400 was enough to cause a crash on Alpha OSF/1,
|
||||
whose default stack limit is 2mb. */
|
||||
int re_max_failures = 20000;
|
||||
int re_max_failures = 4000;
|
||||
# else
|
||||
int re_max_failures = 2000;
|
||||
# endif
|
||||
@@ -2712,7 +2711,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
PATFETCH (c);
|
||||
|
||||
/* Now add the multibyte character(s) we found
|
||||
to the acceptabed list.
|
||||
to the accept list.
|
||||
|
||||
XXX Note that this is not entirely correct.
|
||||
we would have to match multibyte sequences
|
||||
@@ -3507,23 +3506,19 @@ compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
|
||||
unsigned char *b;
|
||||
{
|
||||
unsigned this_char;
|
||||
|
||||
const char *p = *p_ptr;
|
||||
reg_errcode_t ret;
|
||||
char range_start[2];
|
||||
char range_end[2];
|
||||
char ch[2];
|
||||
#if _LIBC
|
||||
const unsigned char *collseq;
|
||||
unsigned int start_colseq;
|
||||
unsigned int end_colseq;
|
||||
#else
|
||||
unsigned end_char;
|
||||
#endif
|
||||
|
||||
if (p == pend)
|
||||
return REG_ERANGE;
|
||||
|
||||
/* Fetch the endpoints without translating them; the
|
||||
appropriate translation is done in the bit-setting loop below. */
|
||||
range_start[0] = range_start_char;
|
||||
range_start[1] = '\0';
|
||||
range_end[0] = p[0];
|
||||
range_end[1] = '\0';
|
||||
|
||||
/* Have to increment the pointer into the pattern string, so the
|
||||
caller isn't still at the ending character. */
|
||||
(*p_ptr)++;
|
||||
@@ -3531,19 +3526,34 @@ compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
|
||||
/* Report an error if the range is empty and the syntax prohibits this. */
|
||||
ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
|
||||
|
||||
/* Here we see why `this_char' has to be larger than an `unsigned
|
||||
char' -- we would otherwise go into an infinite loop, since all
|
||||
characters <= 0xff. */
|
||||
ch[1] = '\0';
|
||||
#if _LIBC
|
||||
collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
|
||||
_NL_COLLATE_COLLSEQMB);
|
||||
|
||||
start_colseq = collseq[(unsigned char) TRANSLATE (range_start_char)];
|
||||
end_colseq = collseq[(unsigned char) TRANSLATE (p[0])];
|
||||
for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
|
||||
{
|
||||
ch[0] = this_char;
|
||||
if (strcoll (range_start, ch) <= 0 && strcoll (ch, range_end) <= 0)
|
||||
unsigned int this_colseq = collseq[(unsigned char) TRANSLATE (this_char)];
|
||||
|
||||
if (start_colseq <= this_colseq && this_colseq <= end_colseq)
|
||||
{
|
||||
SET_LIST_BIT (TRANSLATE (this_char));
|
||||
ret = REG_NOERROR;
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Here we see why `this_char' has to be larger than an `unsigned
|
||||
char' -- we would otherwise go into an infinite loop, since all
|
||||
characters <= 0xff. */
|
||||
range_start_char = TRANSLATE (range_start_char);
|
||||
end_char = TRANSLATE (p[0]);
|
||||
for (this_char = range_start_char; this_char <= end_char; ++this_char)
|
||||
{
|
||||
SET_LIST_BIT (TRANSLATE (this_char));
|
||||
ret = REG_NOERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
376
lib/sha.c
Normal file
376
lib/sha.c
Normal file
@@ -0,0 +1,376 @@
|
||||
/* sha.c - Functions to compute the SHA1 hash (message-digest) of files
|
||||
or blocks of memory. Complies to the NIST specification FIPS-180-1.
|
||||
|
||||
Copyright (C) 2000 Scott G. Miller
|
||||
|
||||
Credits:
|
||||
Robert Klep <robert@ilse.nl> -- Expansion function fix
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
# ifndef HAVE_MEMCPY
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
#include "sha.h"
|
||||
|
||||
/*
|
||||
Not-swap is a macro that does an endian swap on architectures that are
|
||||
big-endian, as SHA needs some data in a little-endian format
|
||||
*/
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# define NOTSWAP(n) (n)
|
||||
# define SWAP(n) \
|
||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||
#else
|
||||
# define NOTSWAP(n) \
|
||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||
# define SWAP(n) (n)
|
||||
#endif
|
||||
|
||||
/* This array contains the bytes used to pad the buffer to the next
|
||||
64-byte boundary. (RFC 1321, 3.1: Step 1) */
|
||||
static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
|
||||
|
||||
|
||||
/*
|
||||
Takes a pointer to a 160 bit block of data (five 32 bit ints) and
|
||||
intializes it to the start constants of the SHA1 algorithm. This
|
||||
must be called before using hash in the call to sha_hash
|
||||
*/
|
||||
void
|
||||
sha_init_ctx (struct sha_ctx *ctx)
|
||||
{
|
||||
ctx->A = 0x67452301;
|
||||
ctx->B = 0xefcdab89;
|
||||
ctx->C = 0x98badcfe;
|
||||
ctx->D = 0x10325476;
|
||||
ctx->E = 0xc3d2e1f0;
|
||||
|
||||
ctx->total[0] = ctx->total[1] = 0;
|
||||
ctx->buflen = 0;
|
||||
}
|
||||
|
||||
/* Put result from CTX in first 20 bytes following RESBUF. The result
|
||||
must be in little endian byte order.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
void *
|
||||
sha_read_ctx (const struct sha_ctx *ctx, void *resbuf)
|
||||
{
|
||||
((md5_uint32 *) resbuf)[0] = NOTSWAP (ctx->A);
|
||||
((md5_uint32 *) resbuf)[1] = NOTSWAP (ctx->B);
|
||||
((md5_uint32 *) resbuf)[2] = NOTSWAP (ctx->C);
|
||||
((md5_uint32 *) resbuf)[3] = NOTSWAP (ctx->D);
|
||||
((md5_uint32 *) resbuf)[4] = NOTSWAP (ctx->E);
|
||||
|
||||
return resbuf;
|
||||
}
|
||||
|
||||
/* Process the remaining bytes in the internal buffer and the usual
|
||||
prolog according to the standard and write the result to RESBUF.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
void *
|
||||
sha_finish_ctx (struct sha_ctx *ctx, void *resbuf)
|
||||
{
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
md5_uint32 bytes = ctx->buflen;
|
||||
size_t pad;
|
||||
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] += bytes;
|
||||
if (ctx->total[0] < bytes)
|
||||
++ctx->total[1];
|
||||
|
||||
pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
|
||||
memcpy (&ctx->buffer[bytes], fillbuf, pad);
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
*(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = NOTSWAP (ctx->total[0] << 3);
|
||||
*(md5_uint32 *) &ctx->buffer[bytes + pad] = NOTSWAP ((ctx->total[1] << 3) |
|
||||
(ctx->total[0] >> 29));
|
||||
|
||||
/* Process last bytes. */
|
||||
sha_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
||||
|
||||
return sha_read_ctx (ctx, resbuf);
|
||||
}
|
||||
|
||||
/* Compute SHA1 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
int
|
||||
sha_stream (FILE *stream, void *resblock)
|
||||
{
|
||||
/* Important: BLOCKSIZE must be a multiple of 64. */
|
||||
#define BLOCKSIZE 4096
|
||||
struct sha_ctx ctx;
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t sum;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha_init_ctx (&ctx);
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
size_t n;
|
||||
sum = 0;
|
||||
|
||||
/* Read block. Take care for partial reads. */
|
||||
do
|
||||
{
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
|
||||
sum += n;
|
||||
}
|
||||
while (sum < BLOCKSIZE && n != 0);
|
||||
if (n == 0 && ferror (stream))
|
||||
return 1;
|
||||
|
||||
/* If end of file is reached, end the loop. */
|
||||
if (n == 0)
|
||||
break;
|
||||
|
||||
/* Process buffer with BLOCKSIZE bytes. Note that
|
||||
BLOCKSIZE % 64 == 0
|
||||
*/
|
||||
sha_process_block (buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
|
||||
/* Add the last bytes if necessary. */
|
||||
if (sum > 0)
|
||||
sha_process_bytes (buffer, sum, &ctx);
|
||||
|
||||
/* Construct result in desired memory. */
|
||||
sha_finish_ctx (&ctx, resblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
void *
|
||||
sha_buffer (const char *buffer, size_t len, void *resblock)
|
||||
{
|
||||
struct sha_ctx ctx;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha_init_ctx (&ctx);
|
||||
|
||||
/* Process whole buffer but last len % 64 bytes. */
|
||||
sha_process_bytes (buffer, len, &ctx);
|
||||
|
||||
/* Put result in desired memory area. */
|
||||
return sha_finish_ctx (&ctx, resblock);
|
||||
}
|
||||
|
||||
void
|
||||
sha_process_bytes (const void *buffer, size_t len, struct sha_ctx *ctx)
|
||||
{
|
||||
/* When we already have some bits in our internal buffer concatenate
|
||||
both inputs first. */
|
||||
if (ctx->buflen != 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
size_t add = 128 - left_over > len ? len : 128 - left_over;
|
||||
|
||||
memcpy (&ctx->buffer[left_over], buffer, add);
|
||||
ctx->buflen += add;
|
||||
|
||||
if (left_over + add > 64)
|
||||
{
|
||||
sha_process_block (ctx->buffer, (left_over + add) & ~63, ctx);
|
||||
/* The regions in the following copy operation cannot overlap. */
|
||||
memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
|
||||
(left_over + add) & 63);
|
||||
ctx->buflen = (left_over + add) & 63;
|
||||
}
|
||||
|
||||
buffer = (const char *) buffer + add;
|
||||
len -= add;
|
||||
}
|
||||
|
||||
/* Process available complete blocks. */
|
||||
if (len > 64)
|
||||
{
|
||||
sha_process_block (buffer, len & ~63, ctx);
|
||||
buffer = (const char *) buffer + (len & ~63);
|
||||
len &= 63;
|
||||
}
|
||||
|
||||
/* Move remaining bytes in internal buffer. */
|
||||
if (len > 0)
|
||||
{
|
||||
memcpy (ctx->buffer, buffer, len);
|
||||
ctx->buflen = len;
|
||||
}
|
||||
}
|
||||
|
||||
/* --- Code below is the primary difference between md5.c and sha.c --- */
|
||||
|
||||
/* SHA1 round constants */
|
||||
#define K1 0x5a827999L
|
||||
#define K2 0x6ed9eba1L
|
||||
#define K3 0x8f1bbcdcL
|
||||
#define K4 0xca62c1d6L
|
||||
|
||||
/* Round functions. Note that F2 is the same as F4. */
|
||||
#define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) )
|
||||
#define F2(B,C,D) (B ^ C ^ D)
|
||||
#define F3(B,C,D) ( ( B & C ) | ( D & ( B | C ) ) )
|
||||
#define F4(B,C,D) (B ^ C ^ D)
|
||||
|
||||
/* Process LEN bytes of BUFFER, accumulating context into CTX.
|
||||
It is assumed that LEN % 64 == 0.
|
||||
Most of this code comes from GnuPG's cipher/sha1.c. */
|
||||
|
||||
void
|
||||
sha_process_block (const void *buffer, size_t len, struct sha_ctx *ctx)
|
||||
{
|
||||
const md5_uint32 *words = buffer;
|
||||
size_t nwords = len / sizeof (md5_uint32);
|
||||
const md5_uint32 *endp = words + nwords;
|
||||
md5_uint32 x[16];
|
||||
md5_uint32 a = ctx->A;
|
||||
md5_uint32 b = ctx->B;
|
||||
md5_uint32 c = ctx->C;
|
||||
md5_uint32 d = ctx->D;
|
||||
md5_uint32 e = ctx->E;
|
||||
|
||||
/* First increment the byte count. RFC 1321 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] += len;
|
||||
if (ctx->total[0] < len)
|
||||
++ctx->total[1];
|
||||
|
||||
#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \
|
||||
^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \
|
||||
, (x[I&0x0f] = rol(tm, 1)) )
|
||||
|
||||
#define R(A,B,C,D,E,F,K,M) do { E += rol( A, 5 ) \
|
||||
+ F( B, C, D ) \
|
||||
+ K \
|
||||
+ M; \
|
||||
B = rol( B, 30 ); \
|
||||
} while(0)
|
||||
|
||||
while (words < endp)
|
||||
{
|
||||
md5_uint32 tm;
|
||||
int t;
|
||||
/* FIXME: see sha1.c for a better implementation. */
|
||||
for (t = 0; t < 16; t++)
|
||||
{
|
||||
x[t] = NOTSWAP (*words);
|
||||
words++;
|
||||
}
|
||||
|
||||
R( a, b, c, d, e, F1, K1, x[ 0] );
|
||||
R( e, a, b, c, d, F1, K1, x[ 1] );
|
||||
R( d, e, a, b, c, F1, K1, x[ 2] );
|
||||
R( c, d, e, a, b, F1, K1, x[ 3] );
|
||||
R( b, c, d, e, a, F1, K1, x[ 4] );
|
||||
R( a, b, c, d, e, F1, K1, x[ 5] );
|
||||
R( e, a, b, c, d, F1, K1, x[ 6] );
|
||||
R( d, e, a, b, c, F1, K1, x[ 7] );
|
||||
R( c, d, e, a, b, F1, K1, x[ 8] );
|
||||
R( b, c, d, e, a, F1, K1, x[ 9] );
|
||||
R( a, b, c, d, e, F1, K1, x[10] );
|
||||
R( e, a, b, c, d, F1, K1, x[11] );
|
||||
R( d, e, a, b, c, F1, K1, x[12] );
|
||||
R( c, d, e, a, b, F1, K1, x[13] );
|
||||
R( b, c, d, e, a, F1, K1, x[14] );
|
||||
R( a, b, c, d, e, F1, K1, x[15] );
|
||||
R( e, a, b, c, d, F1, K1, M(16) );
|
||||
R( d, e, a, b, c, F1, K1, M(17) );
|
||||
R( c, d, e, a, b, F1, K1, M(18) );
|
||||
R( b, c, d, e, a, F1, K1, M(19) );
|
||||
R( a, b, c, d, e, F2, K2, M(20) );
|
||||
R( e, a, b, c, d, F2, K2, M(21) );
|
||||
R( d, e, a, b, c, F2, K2, M(22) );
|
||||
R( c, d, e, a, b, F2, K2, M(23) );
|
||||
R( b, c, d, e, a, F2, K2, M(24) );
|
||||
R( a, b, c, d, e, F2, K2, M(25) );
|
||||
R( e, a, b, c, d, F2, K2, M(26) );
|
||||
R( d, e, a, b, c, F2, K2, M(27) );
|
||||
R( c, d, e, a, b, F2, K2, M(28) );
|
||||
R( b, c, d, e, a, F2, K2, M(29) );
|
||||
R( a, b, c, d, e, F2, K2, M(30) );
|
||||
R( e, a, b, c, d, F2, K2, M(31) );
|
||||
R( d, e, a, b, c, F2, K2, M(32) );
|
||||
R( c, d, e, a, b, F2, K2, M(33) );
|
||||
R( b, c, d, e, a, F2, K2, M(34) );
|
||||
R( a, b, c, d, e, F2, K2, M(35) );
|
||||
R( e, a, b, c, d, F2, K2, M(36) );
|
||||
R( d, e, a, b, c, F2, K2, M(37) );
|
||||
R( c, d, e, a, b, F2, K2, M(38) );
|
||||
R( b, c, d, e, a, F2, K2, M(39) );
|
||||
R( a, b, c, d, e, F3, K3, M(40) );
|
||||
R( e, a, b, c, d, F3, K3, M(41) );
|
||||
R( d, e, a, b, c, F3, K3, M(42) );
|
||||
R( c, d, e, a, b, F3, K3, M(43) );
|
||||
R( b, c, d, e, a, F3, K3, M(44) );
|
||||
R( a, b, c, d, e, F3, K3, M(45) );
|
||||
R( e, a, b, c, d, F3, K3, M(46) );
|
||||
R( d, e, a, b, c, F3, K3, M(47) );
|
||||
R( c, d, e, a, b, F3, K3, M(48) );
|
||||
R( b, c, d, e, a, F3, K3, M(49) );
|
||||
R( a, b, c, d, e, F3, K3, M(50) );
|
||||
R( e, a, b, c, d, F3, K3, M(51) );
|
||||
R( d, e, a, b, c, F3, K3, M(52) );
|
||||
R( c, d, e, a, b, F3, K3, M(53) );
|
||||
R( b, c, d, e, a, F3, K3, M(54) );
|
||||
R( a, b, c, d, e, F3, K3, M(55) );
|
||||
R( e, a, b, c, d, F3, K3, M(56) );
|
||||
R( d, e, a, b, c, F3, K3, M(57) );
|
||||
R( c, d, e, a, b, F3, K3, M(58) );
|
||||
R( b, c, d, e, a, F3, K3, M(59) );
|
||||
R( a, b, c, d, e, F4, K4, M(60) );
|
||||
R( e, a, b, c, d, F4, K4, M(61) );
|
||||
R( d, e, a, b, c, F4, K4, M(62) );
|
||||
R( c, d, e, a, b, F4, K4, M(63) );
|
||||
R( b, c, d, e, a, F4, K4, M(64) );
|
||||
R( a, b, c, d, e, F4, K4, M(65) );
|
||||
R( e, a, b, c, d, F4, K4, M(66) );
|
||||
R( d, e, a, b, c, F4, K4, M(67) );
|
||||
R( c, d, e, a, b, F4, K4, M(68) );
|
||||
R( b, c, d, e, a, F4, K4, M(69) );
|
||||
R( a, b, c, d, e, F4, K4, M(70) );
|
||||
R( e, a, b, c, d, F4, K4, M(71) );
|
||||
R( d, e, a, b, c, F4, K4, M(72) );
|
||||
R( c, d, e, a, b, F4, K4, M(73) );
|
||||
R( b, c, d, e, a, F4, K4, M(74) );
|
||||
R( a, b, c, d, e, F4, K4, M(75) );
|
||||
R( e, a, b, c, d, F4, K4, M(76) );
|
||||
R( d, e, a, b, c, F4, K4, M(77) );
|
||||
R( c, d, e, a, b, F4, K4, M(78) );
|
||||
R( b, c, d, e, a, F4, K4, M(79) );
|
||||
|
||||
a = ctx->A += a;
|
||||
b = ctx->B += b;
|
||||
c = ctx->C += c;
|
||||
d = ctx->D += d;
|
||||
e = ctx->E += e;
|
||||
}
|
||||
}
|
||||
75
lib/sha.h
Normal file
75
lib/sha.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* sha.h - Declaration of functions and datatypes for SHA1 sum computing
|
||||
library functions.
|
||||
|
||||
Copyright (C) 1999, Scott G. Miller
|
||||
*/
|
||||
|
||||
#ifndef _SHA_H
|
||||
# define _SHA_H 1
|
||||
|
||||
# include <stdio.h>
|
||||
# include "md5.h"
|
||||
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct sha_ctx
|
||||
{
|
||||
md5_uint32 A;
|
||||
md5_uint32 B;
|
||||
md5_uint32 C;
|
||||
md5_uint32 D;
|
||||
md5_uint32 E;
|
||||
|
||||
md5_uint32 total[2];
|
||||
md5_uint32 buflen;
|
||||
char buffer[128];
|
||||
};
|
||||
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is necessary that LEN is a multiple of 64!!! */
|
||||
extern void sha_process_block __P ((const void *buffer, size_t len,
|
||||
struct sha_ctx *ctx));
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is NOT required that LEN is a multiple of 64. */
|
||||
extern void sha_process_bytes __P((const void *buffer, size_t len,
|
||||
struct sha_ctx *ctx));
|
||||
|
||||
/* Initialize structure containing state of computation. */
|
||||
extern void sha_init_ctx __P ((struct sha_ctx *ctx));
|
||||
|
||||
/* Process the remaining bytes in the buffer and put result from CTX
|
||||
in first 16 bytes following RESBUF. The result is always in little
|
||||
endian byte order, so that a byte-wise output yields to the wanted
|
||||
ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *sha_finish_ctx __P ((struct sha_ctx *ctx, void *resbuf));
|
||||
|
||||
|
||||
/* Put result from CTX in first 16 bytes following RESBUF. The result is
|
||||
always in little endian byte order, so that a byte-wise output yields
|
||||
to the wanted ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *sha_read_ctx __P ((const struct sha_ctx *ctx, void *resbuf));
|
||||
|
||||
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha_stream __P ((FILE *stream, void *resblock));
|
||||
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
extern void *sha_buffer __P ((const char *buffer, size_t len, void *resblock));
|
||||
|
||||
#endif
|
||||
@@ -261,7 +261,6 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
if (xstrtoul (u, NULL, 0, &tmp_long, NULL) != LONGINT_OK
|
||||
|| tmp_long > MAXUID)
|
||||
return _(E_invalid_user);
|
||||
printf ("MAXUID: %u\n", (uid_t) MAXUID);
|
||||
*uid = tmp_long;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2000-09-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getloadavg.m4 (AC_FUNC_GETLOADAVG): Restore the initial value of LIBS.
|
||||
Otherwise, everyone ends up linking with -lelf for some configurations.
|
||||
Reported by Mike Stone.
|
||||
|
||||
2000-08-26 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4: Use jm_FUNC_FPENDING.
|
||||
|
||||
@@ -99,5 +99,7 @@ if test "x$ac_save_LIBS" = x; then
|
||||
else
|
||||
GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$ac_save_LIBS!!"`
|
||||
fi
|
||||
LIBS=$ac_save_LIBS
|
||||
|
||||
AC_SUBST(GETLOADAVG_LIBS)dnl
|
||||
])# AC_FUNC_GETLOADAVG
|
||||
|
||||
@@ -1,5 +1,84 @@
|
||||
2000-09-25 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 4.0.27.
|
||||
|
||||
2000-09-24 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* doc/fileutils.texi: Update to more closely match changes in 4.0z.
|
||||
* src/cp.c (usage): Match revised documentation better.
|
||||
|
||||
2000-09-24 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/cp.c (main): Tweak a relatively new diagnostic.
|
||||
|
||||
2000-09-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/ls/time-1: Output more information when a test fails.
|
||||
|
||||
2000-09-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/install.c (cp_option_init): Once again make it so install always
|
||||
unlinks an existing destination before trying to open it for writing.
|
||||
Otherwise, installing onto a running shared library would make the
|
||||
running program malfunction.
|
||||
Reported by Dan Pascu via Michael Stone.
|
||||
|
||||
* src/mv.c (do_move): Moving a directory specified with a trailing
|
||||
slash from one partition to another, and giving it a different
|
||||
name at the destination would cause mv to get a failed assertion.
|
||||
Reported by Michael Stone.
|
||||
(strip_trailing_slashes_2): Move function definition to precede
|
||||
new first use.
|
||||
* tests/mv/part-rename: New test for the above fix.
|
||||
* tests/mv/Makefile.am (TESTS): Add part-rename.
|
||||
|
||||
* src/copy.c (copy_internal): Don't try to unlink directories when
|
||||
using --remove-dest with -R.
|
||||
* tests/cp/dir-rm-dest: New test for the above fix.
|
||||
* tests/cp/Makefile.am (TESTS): Add dir-rm-dest.
|
||||
|
||||
2000-09-19 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/fileutils.texi (cp invocation): Describe how --force works.
|
||||
Update description of -P (soon to change meaning to conform w/POSIX).
|
||||
Describe --remove-destination.
|
||||
|
||||
* src/cp.c (main): When used with --force, each of the --link and
|
||||
--symbolic-link options now implies --remove-destination.
|
||||
Reported by Miles Bader via Mike Stone.
|
||||
* tests/cp/link: New file. Test for the above fix.
|
||||
* tests/cp/same-file: Adjust for this change in behavior.
|
||||
|
||||
2000-09-15 Volker Borchert <bt@teknon.de>
|
||||
|
||||
* tests/Makefile.am (check-root, root-hint): New targets.
|
||||
(check-recursive): Depend on root-hint.
|
||||
* Makefile.am (check-root): New target.
|
||||
|
||||
2000-09-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/perm.texi (Changing Special Permissions): Remove this statement:
|
||||
``a' in the USERS part of a symbolic mode does not cause the special
|
||||
permissions to be affected'... It doesn't reflect what the code does
|
||||
and isn't required by POSIX. Reported by aldomel@ix.netcom.com via
|
||||
Mike Stone.
|
||||
|
||||
2000-09-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* config.sub: Update from master repository.
|
||||
|
||||
2000-09-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/cp/cp-mv-backup (LC_ALL): Set to `C' and export to ensure
|
||||
that `ls' sorts the same way for everyone. Reported by Vin Shelton.
|
||||
|
||||
* Makefile.maint (b_host): Use freefriends.org, not tug.org.
|
||||
|
||||
2000-09-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.maint (announcement): Use a stricter regexp for the
|
||||
previous version.
|
||||
|
||||
* Version 4.0z.
|
||||
|
||||
* tests/cp/special-bits: New file.
|
||||
@@ -83,6 +162,8 @@
|
||||
do this. Now, you must use `cp --remove-destination' to get this
|
||||
behavior. Now, `cp -f' and `mv -f' work as required by POSIX.
|
||||
[unlink_dest_after_failed_open]: Add member.
|
||||
Paul Eggert reported that `cp -f' removes an existing destination
|
||||
file unconditionally, and that is contrary to POSIX.
|
||||
|
||||
* src/copy.c (same_file_ok): New function, extracted from copy_internal,
|
||||
and rewritten.
|
||||
@@ -979,7 +1060,7 @@
|
||||
2000-02-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/touch/Makefile.am (TESTS): Add fifo.
|
||||
* tests/touch/fifo (fail): New file.
|
||||
* tests/touch/fifo: New file.
|
||||
|
||||
2000-02-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
Changes in release 4.01:
|
||||
[4.0.27]
|
||||
* install once again unlinks an existing destination before trying to open it
|
||||
* mv no longer gets a failed assertion when moving a directory (specified with
|
||||
a trailing slash) from one partition to another, and giving it a different
|
||||
name at the destination.
|
||||
* `cp --link -f src existing-dest' no longer fails (bug introduced in 4.0z)
|
||||
* cp's new --remove-destination option now works with -R
|
||||
[4.0z]
|
||||
* `cp -p' once again preserves `special' permission bits (this bug was
|
||||
introduced in 4.0y)
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2000-09-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/date.c (usage): Make the second `Usage' line more precise
|
||||
(also making it match the texinfo documentation).
|
||||
From Karl Eichwalder.
|
||||
|
||||
* doc/sh-utils.texi (Setting the time): Correct the capitalization of
|
||||
`HHMM' in the info-rendering of the texinfo documentation.
|
||||
Reported by Karl Eichwalder.
|
||||
|
||||
2000-08-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/tee.c (main): Remove incorrect `FIXME' comment.
|
||||
|
||||
@@ -723,10 +723,10 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
}
|
||||
new_dst = 1;
|
||||
}
|
||||
else if (x->unlink_dest_before_opening
|
||||
|| (x->xstat == lstat
|
||||
&& ! S_ISREG (src_sb.st_mode)
|
||||
&& ! S_ISDIR (src_sb.st_mode)))
|
||||
else if (! S_ISDIR (dst_sb.st_mode)
|
||||
&& (x->unlink_dest_before_opening
|
||||
|| (x->xstat == lstat
|
||||
&& ! S_ISREG (src_sb.st_mode))))
|
||||
{
|
||||
if (unlink (dst_path) && errno != ENOENT)
|
||||
{
|
||||
|
||||
20
src/cp.c
20
src/cp.c
@@ -156,14 +156,11 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
|
||||
-a, --archive same as -dpR\n\
|
||||
--backup[=CONTROL] make a backup of each existing destination file\n\
|
||||
-b like --backup but does not accept an argument\n\
|
||||
-d, --no-dereference preserve links\n\
|
||||
-f, --force if a preexisting destination file cannot be\n\
|
||||
opened, then unlink it and try again\n\
|
||||
-d, --no-dereference never follow symbolic links\n\
|
||||
-f, --force if an existing destination file cannot be\n\
|
||||
opened, remove it and try again\n\
|
||||
-i, --interactive prompt before overwrite\n\
|
||||
-H follow symbolic links that are explicitly\n\
|
||||
specified in the command line, but do not\n\
|
||||
follow symlinks that are found via recursive\n\
|
||||
traversal\n\
|
||||
-H follow command-line symbolic links\n\
|
||||
-l, --link link files instead of copying\n\
|
||||
-L, --dereference always follow symbolic links\n\
|
||||
-p, --preserve preserve file attributes if possible\n\
|
||||
@@ -173,7 +170,7 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
|
||||
-r copy recursively, non-directories as files\n\
|
||||
WARNING: use -R instead when you might copy\n\
|
||||
special files like FIFOs or /dev/zero\n\
|
||||
--remove-destination unlink each preexisting destination file before\n\
|
||||
--remove-destination remove each existing destination file before\n\
|
||||
attempting to open it (contrast with --force)\n\
|
||||
--sparse=WHEN control creation of sparse files\n\
|
||||
-R, --recursive copy directories recursively\n\
|
||||
@@ -846,7 +843,7 @@ main (int argc, char **argv)
|
||||
error (0, 0,
|
||||
_("\
|
||||
Warning: the meaning of `-P' will change in the future to conform to POSIX.\n\
|
||||
Use `--parents' for the old meaning, and `--no-dereference' for the new."));
|
||||
Use `--parents' for the old meaning, and `--no-dereference' for the new one."));
|
||||
}
|
||||
|
||||
if (backup_suffix_string)
|
||||
@@ -882,6 +879,11 @@ Use `--parents' for the old meaning, and `--no-dereference' for the new."));
|
||||
x.xstat = stat;
|
||||
}
|
||||
|
||||
/* If --force (-f) was specified and we're in link-creation mode,
|
||||
first remove any existing destination file. */
|
||||
if (x.unlink_dest_after_failed_open && (x.hard_link || x.symbolic_link))
|
||||
x.unlink_dest_before_opening = 1;
|
||||
|
||||
/* Allocate space for remembering copied and created files. */
|
||||
|
||||
hash_init (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE);
|
||||
|
||||
@@ -125,7 +125,7 @@ usage (int status)
|
||||
{
|
||||
printf (_("\
|
||||
Usage: %s [OPTION]... [+FORMAT]\n\
|
||||
or: %s [OPTION] [MMDDhhmm[[CC]YY][.ss]]\n\
|
||||
or: %s [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]\n\
|
||||
"),
|
||||
program_name, program_name);
|
||||
printf (_("\
|
||||
|
||||
@@ -189,8 +189,8 @@ cp_option_init (struct cp_options *x)
|
||||
{
|
||||
x->copy_as_regular = 1;
|
||||
x->dereference = DEREF_ALWAYS;
|
||||
x->unlink_dest_before_opening = 0;
|
||||
x->unlink_dest_after_failed_open = 1;
|
||||
x->unlink_dest_before_opening = 1;
|
||||
x->unlink_dest_after_failed_open = 0;
|
||||
|
||||
/* If unlink fails, try to proceed anyway. */
|
||||
x->failed_unlink_is_fatal = 0;
|
||||
|
||||
29
src/mv.c
29
src/mv.c
@@ -145,6 +145,18 @@ is_real_dir (const char *path)
|
||||
return lstat (path, &stats) == 0 && S_ISDIR (stats.st_mode);
|
||||
}
|
||||
|
||||
static int
|
||||
strip_trailing_slashes_2 (char *path)
|
||||
{
|
||||
char *end_p = path + strlen (path) - 1;
|
||||
char *slash = end_p;
|
||||
|
||||
while (slash > path && *slash == '/')
|
||||
*slash-- = '\0';
|
||||
|
||||
return slash < end_p;
|
||||
}
|
||||
|
||||
/* Move SOURCE onto DEST. Handles cross-filesystem moves.
|
||||
If SOURCE is a directory, DEST must not exist.
|
||||
Return 0 if successful, non-zero if an error occurred. */
|
||||
@@ -233,6 +245,11 @@ do_move (const char *source, const char *dest, const struct cp_options *x)
|
||||
remove_init ();
|
||||
|
||||
fspec_init_file (&fs, dir_to_remove);
|
||||
|
||||
/* Remove any trailing slashes. This is necessary if we
|
||||
took the else branch of movefile. */
|
||||
strip_trailing_slashes_2 (fs.filename);
|
||||
|
||||
status = rm (&fs, 1, &rm_options);
|
||||
assert (VALID_STATUS (status));
|
||||
if (status == RM_ERROR)
|
||||
@@ -251,18 +268,6 @@ do_move (const char *source, const char *dest, const struct cp_options *x)
|
||||
return fail;
|
||||
}
|
||||
|
||||
static int
|
||||
strip_trailing_slashes_2 (char *path)
|
||||
{
|
||||
char *end_p = path + strlen (path) - 1;
|
||||
char *slash = end_p;
|
||||
|
||||
while (slash > path && *slash == '/')
|
||||
*slash-- = '\0';
|
||||
|
||||
return slash < end_p;
|
||||
}
|
||||
|
||||
/* Move file SOURCE onto DEST. Handles the case when DEST is a directory.
|
||||
DEST_IS_DIR must be nonzero when DEST is a directory or a symlink to a
|
||||
directory and zero otherwise.
|
||||
|
||||
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = 1.1 gnits
|
||||
TESTS = \
|
||||
backup-1 no-deref-link1 no-deref-link2 no-deref-link3 backup-is-src \
|
||||
same-file cp-mv-backup symlink-slash slink-2-slink fail-perm dir-slash \
|
||||
perm cp-HL special-bits
|
||||
perm cp-HL special-bits link dir-rm-dest
|
||||
EXTRA_DIST = $(TESTS)
|
||||
TESTS_ENVIRONMENT = \
|
||||
MAKE=$(MAKE) \
|
||||
|
||||
@@ -120,7 +120,7 @@ AUTOMAKE_OPTIONS = 1.1 gnits
|
||||
TESTS = \
|
||||
backup-1 no-deref-link1 no-deref-link2 no-deref-link3 backup-is-src \
|
||||
same-file cp-mv-backup symlink-slash slink-2-slink fail-perm dir-slash \
|
||||
perm cp-HL special-bits
|
||||
perm cp-HL special-bits link dir-rm-dest
|
||||
|
||||
EXTRA_DIST = $(TESTS)
|
||||
TESTS_ENVIRONMENT = \
|
||||
|
||||
@@ -9,6 +9,9 @@ fi
|
||||
LANGUAGE=C; export LANGUAGE
|
||||
LANG=C; export LANG
|
||||
|
||||
# Ensure that ls sorts the same way for everyone.
|
||||
LC_ALL=C; export LC_ALL
|
||||
|
||||
. $srcdir/../envvar-check
|
||||
|
||||
umask 022
|
||||
|
||||
32
tests/cp/dir-rm-dest
Executable file
32
tests/cp/dir-rm-dest
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
# verify that cp's --remove-destination option works with -R
|
||||
|
||||
if test "$VERBOSE" = yes; then
|
||||
set -x
|
||||
cp --version
|
||||
fi
|
||||
|
||||
pwd=`pwd`
|
||||
tmp=cprmdest.$$
|
||||
trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
framework_failure=0
|
||||
mkdir $tmp || framework_failure=1
|
||||
cd $tmp || framework_failure=1
|
||||
mkdir d e || framework_failure=1
|
||||
|
||||
if test $framework_failure = 1; then
|
||||
echo 'failure in testing framework'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fail=0
|
||||
|
||||
# Do it once with no destination...
|
||||
cp -R --remove-destination d e || fail=1
|
||||
|
||||
# ...and again, with an existing destination.
|
||||
cp -R --remove-destination d e || fail=1
|
||||
|
||||
(exit $fail); exit
|
||||
33
tests/cp/link
Executable file
33
tests/cp/link
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# Make sure cp --link -f works when the target exists.
|
||||
# This failed for 4.0z (due to a bug introduced in that test release).
|
||||
|
||||
if test "$VERBOSE" = yes; then
|
||||
set -x
|
||||
cp --version
|
||||
fi
|
||||
|
||||
pwd=`pwd`
|
||||
tmp=cp-link.$$
|
||||
trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
framework_failure=0
|
||||
mkdir $tmp || framework_failure=1
|
||||
cd $tmp || framework_failure=1
|
||||
|
||||
touch src || framework_failure=1
|
||||
touch dest || framework_failure=1
|
||||
touch dest2 || framework_failure=1
|
||||
|
||||
if test $framework_failure = 1; then
|
||||
echo 'failure in testing framework'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fail=0
|
||||
|
||||
cp -f --link src dest || fail=1
|
||||
cp -f --symbolic-link src dest2 || fail=1
|
||||
|
||||
(exit $fail); exit
|
||||
@@ -109,7 +109,7 @@ cat <<\EOF > $expected
|
||||
0 -l (foo symlink -> foo)
|
||||
0 -dl (foo symlink -> foo)
|
||||
0 -fl (foo symlink -> foo)
|
||||
0 -dfl (foo symlink -> foo)
|
||||
0 -dfl (foo symlink)
|
||||
0 -bl (foo symlink -> foo)
|
||||
0 -bdl (foo symlink symlink.~1~ -> foo)
|
||||
0 -bfl (foo symlink -> foo)
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
# make sure `cp -p' preserves special bits
|
||||
# This works only when run as root.
|
||||
|
||||
# This test would fail due to a bug introduced in 4.0y.
|
||||
# The bug was fixed in 4.0z.
|
||||
|
||||
if test "$VERBOSE" = yes; then
|
||||
set -x
|
||||
cp --version
|
||||
|
||||
@@ -58,7 +58,12 @@ case "$*" in
|
||||
cat >&2 << \EOF
|
||||
A basic test of touch -a has just failed, so the subsequent
|
||||
tests in this file will not be run.
|
||||
|
||||
In the output below, the date of last modification for `a' should
|
||||
have been Jan 15 23:00:00 1998.
|
||||
EOF
|
||||
#`
|
||||
ls --full -l a
|
||||
framework_failure=1
|
||||
;;
|
||||
esac
|
||||
@@ -72,7 +77,11 @@ case "$*" in
|
||||
cat >&2 << \EOF
|
||||
A basic test of touch -m has just failed, so the subsequent
|
||||
tests in this file will not be run.
|
||||
|
||||
In the output below, the date of last access for `a' should
|
||||
have been Jan 14 11:00:00 1998.
|
||||
EOF
|
||||
ls --full -lu a
|
||||
framework_failure=1
|
||||
;;
|
||||
esac
|
||||
@@ -98,9 +107,14 @@ else
|
||||
# In spite of documentation, (e.g., stat(2)), neither link nor chmod
|
||||
# update a file's st_ctime on SunOS4.1.4.
|
||||
cat >&2 << \EOF
|
||||
failed ls ctime test -- this is expected at least for SunOS4.1.4
|
||||
failed ls ctime test -- this failure is expected at least for SunOS4.1.4
|
||||
and for tmpfs file systems on Solaris 5.5.1.
|
||||
|
||||
In the output below, `c' should have had a ctime more recent than
|
||||
that of `a', but does not.
|
||||
EOF
|
||||
#'
|
||||
ls -ctl --full-time a c
|
||||
fail=1
|
||||
fi
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = 1.3 gnits
|
||||
|
||||
TESTS = i-2 mv-special-1 into-self into-self-2 into-self-3 backup-is-src \
|
||||
i-1 hard-link-1 force partition-perm to-symlink dir-file diag \
|
||||
part-symlink
|
||||
part-symlink part-rename
|
||||
|
||||
EXTRA_DIST = $(TESTS) setup
|
||||
TESTS_ENVIRONMENT = \
|
||||
|
||||
@@ -119,7 +119,7 @@ AUTOMAKE_OPTIONS = 1.3 gnits
|
||||
|
||||
TESTS = i-2 mv-special-1 into-self into-self-2 into-self-3 backup-is-src \
|
||||
i-1 hard-link-1 force partition-perm to-symlink dir-file diag \
|
||||
part-symlink
|
||||
part-symlink part-rename
|
||||
|
||||
|
||||
EXTRA_DIST = $(TESTS) setup
|
||||
|
||||
37
tests/mv/part-rename
Executable file
37
tests/mv/part-rename
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
# Moving a directory specified with a trailing slash from one partition to
|
||||
# another, and giving it a different name at the destination would cause mv
|
||||
# to get a failed assertion.
|
||||
|
||||
if test "$VERBOSE" = yes; then
|
||||
set -x
|
||||
mv --version
|
||||
fi
|
||||
|
||||
pwd=`pwd`
|
||||
tmp=part-ren.$$
|
||||
trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $tmp $other_partition_tmpdir && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
. $srcdir/setup
|
||||
. $srcdir/../envvar-check
|
||||
|
||||
if test -z "$other_partition_tmpdir"; then
|
||||
(exit 77); exit
|
||||
fi
|
||||
|
||||
framework_failure=0
|
||||
mkdir $tmp || framework_failure=1
|
||||
cd $tmp || framework_failure=1
|
||||
mkdir foo || framework_failure=1
|
||||
|
||||
if test $framework_failure = 1; then
|
||||
echo 'failure in testing framework'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fail=0
|
||||
|
||||
mv foo/ $other_partition_tmpdir/bar || fail=1
|
||||
|
||||
(exit $fail); exit
|
||||
Reference in New Issue
Block a user