+REGARDING OPENSSL AND XXHASH
+
+In addition, as a special exception, the copyright holders give
+permission to dynamically link rsync with the OpenSSL and xxhash
+libraries when those libraries are being distributed in compliance
+with their license terms, and to distribute a dynamically linked
+combination of rsync and these libraries. This is also considered
+to be covered under the GPL's System Libraries exception.
+
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
+<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-
-REGARDING OPENSSL AND XXHASH
-
-In addition, as a special exception, the copyright holders give
-permission to dynamically link rsync with the OpenSSL and xxhash
-libraries when those libraries are being distributed in compliance
-with their license terms, and to distribute a dynamically linked
-combination of rsync and these libraries. This is also considered
-to be covered under the GPL's System Libraries exception.
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
== ((unsigned)(b2) & (unsigned)(mask)))
/* Update this if you make incompatible changes and ALSO update the
- * SUBPROTOCOL_VERSION if it is not a final (offical) release. */
+ * SUBPROTOCOL_VERSION if it is not a final (official) release. */
#define PROTOCOL_VERSION 31
/* This is used when working on a new protocol version or for any unofficial
#RSYNC="valgrind $rsync_bin $*"
TLS_ARGS=''
-if egrep '^#define HAVE_LUTIMES 1' config.h >/dev/null; then
+if grep -E '^#define HAVE_LUTIMES 1' config.h >/dev/null; then
TLS_ARGS="$TLS_ARGS -l"
fi
-if egrep '#undef CHOWN_MODIFIES_SYMLINK' config.h >/dev/null; then
+if grep -E '#undef CHOWN_MODIFIES_SYMLINK' config.h >/dev/null; then
TLS_ARGS="$TLS_ARGS -L"
fi
set -o pipefail
-rsync "${@}" 2>&1 | (egrep -v "$IGNOREOUT" || true)
+rsync "${@}" 2>&1 | (grep -E -v "$IGNOREOUT" || true)
ret=$?
if [[ $ret == $IGNOREEXIT ]]; then
-#! /bin/sh
+#!/bin/sh
test_fail() {
echo "$@" >&2
These tests also run automatically on the build farm, and you can see
the results on http://build.samba.org/.
-
-
-#! /bin/sh
+#!/bin/sh
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
case "$setfacl_nodef" in
true)
- if ! chmod --help 2>&1 | fgrep +a >/dev/null; then
- test_skipped "I don't know how to use setfacl or chmod for ACLs"
+ if ! chmod --help 2>&1 | grep -F +a >/dev/null; then
+ test_skipped "I don't know how to use setfacl or chmod for ACLs"
fi
chmod +a "root allow read,write,execute" "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled"
chmod +a "root allow read,execute" "$fromdir/file1"
chmod +a "root allow read,execute" "$fromdir/file2"
see_acls() {
- ls -le "${@}"
+ ls -le "${@}"
}
;;
*)
setfacl -m u:0:5 "$fromdir/file2"
see_acls() {
- getfacl "${@}"
+ getfacl "${@}"
}
;;
esac
-#! /bin/sh
+#!/bin/sh
# Test rsync copying atimes
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2004-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2004 by Chris Shoemaker <c.shoemaker@cox.net>
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
mygrps="`rsync_getgroups`" || test_fail "Can't get groups"
mkdir "$fromdir"
-for g in $mygrps
-do
+for g in $mygrps; do
name="$fromdir/foo-$g"
date > "$name"
chgrp "$g" "$name" || test_fail "Can't chgrp"
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
# Copy the files we've created over to another directory
checkit "$RSYNC -avv '$fromdir/' '$checkdir/'" "$fromdir" "$checkdir"
-# And then manually make the changes which should occur
+# And then manually make the changes which should occur
umask 002
chmod ug-s,a+rX "$checkdir"/*
chmod +w "$checkdir" "$checkdir"/dir*
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2004-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2004-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2004-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# Test rsync copying create times
-#! /bin/sh
+#!/bin/sh
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
todir="$scratchdir/$1"
mkdir "$todir"
$setfacl_nodef "$todir"
- if [ "$2" ]; then
+ if [ -n "$2" ]; then
case "$setfacl_nodef" in
*-k*) opts="-dm $2" ;;
*) opts="-m `echo $2 | sed 's/\([ugom]:\)/d:\1/g'`"
-#! /bin/sh
+#!/bin/sh
# Test rsync --delay-updates
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2005-2020 Wayne Davison
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
-# Test rsync handling of various delete directives.
+# Test rsync handling of various delete directives.
. "$suitedir/rsync.fns"
# Also, make sure that --dry-run --del doesn't output anything extraneous.
$RSYNC -av "$fromdir/" "$chkdir/copy/" >"$tmpdir/copy.out" 2>&1
cat "$tmpdir/copy.out"
-egrep -v '^(created directory|sent|total size) ' "$tmpdir/copy.out" >"$tmpdir/copy.new"
+grep -E -v '^(created directory|sent|total size) ' "$tmpdir/copy.out" >"$tmpdir/copy.new"
mv "$tmpdir/copy.new" "$tmpdir/copy.out"
$RSYNC -avn --del "$fromdir/" "$chkdir/copy2/" >"$tmpdir/copy2.out" 2>&1 || true
cat "$tmpdir/copy2.out"
-egrep -v '^(created directory|sent|total size) ' "$tmpdir/copy2.out" >"$tmpdir/copy2.new"
+grep -E -v '^(created directory|sent|total size) ' "$tmpdir/copy2.out" >"$tmpdir/copy2.new"
mv "$tmpdir/copy2.new" "$tmpdir/copy2.out"
diff $diffopt "$tmpdir/copy.out" "$tmpdir/copy2.out"
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
-#! /bin/sh
+#!/bin/sh
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
-# Test rsync handling of duplicate filenames.
+# Test rsync handling of duplicate filenames.
# It's quite possible that the user might specify the same source file
# more than once on the command line, perhaps through shell variables
| tee "$outfile"
# Make sure each file was only copied once...
-if [ `grep -c '^name1$' "$outfile"` != 1 ]
-then
+if [ `grep -c '^name1$' "$outfile"` != 1 ]; then
test_fail "name1 was not copied exactly once"
fi
-if [ `grep -c '^name2 -> ' "$outfile"` != 1 ]
-then
+if [ `grep -c '^name2 -> ' "$outfile"` != 1 ]; then
test_fail "name2 was not copied exactly once"
fi
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2003-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2005-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2005-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2004-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
runtest() {
echo $ECHO_N "Test $1: $ECHO_C"
- if eval "$2"
- then
- echo "$ECHO_T done."
- return 0
+ if eval "$2"; then
+ echo "$ECHO_T done."
+ return 0
else
- echo "$ECHO_T failed!"
- return 1
+ echo "$ECHO_T failed!"
+ return 1
fi
}
(echo " makepath $p"
# Absolute Unix path.
- if echo $p | grep '^/' >/dev/null
- then
+ if echo $p | grep '^/' >/dev/null; then
cd /
fi
# This will break if $p contains a space.
- for c in `echo $p | tr '/' ' '`
- do
- if [ -d "$c" ] || mkdir "$c"
- then
+ for c in `echo $p | tr '/' ' '`; do
+ if [ -d "$c" ] || mkdir "$c"; then
cd "$c" || return $?
else
echo "failed to create $c" >&2; return $?
fi
echo "-------------"
- if [ -z "$failed" ] ; then
+ if [ -z "$failed" ]; then
return 0
fi
failed="$failed status=$status"
fi
- if [ "$2" ]; then
+ if [ -n "$2" ]; then
eval "cat '$outfile' | $2 >'$outfile.new'"
mv "$outfile.new" "$outfile"
fi
diff $diffopt "$chkfile" "$outfile" || failed="$failed output differs"
- if [ "$failed" ] ; then
+ if [ -n "$failed" ]; then
echo "Failed:$failed"
return 1
fi
# Determine what shell command will appropriately test for links.
ln -s foo "$scratchdir/testlink"
-for cmd in test /bin/test /usr/bin/test /usr/ucb/bin/test /usr/ucb/test
-do
- for switch in -h -L
- do
- if $cmd $switch "$scratchdir/testlink" 2>/dev/null
- then
- # how nice
- TEST_SYMLINK_CMD="$cmd $switch"
- # i wonder if break 2 is portable?
- break 2
- fi
- done
+for cmd in test /bin/test /usr/bin/test /usr/ucb/bin/test /usr/ucb/test; do
+ for switch in -h -L; do
+ if $cmd $switch "$scratchdir/testlink" 2>/dev/null; then
+ # how nice
+ TEST_SYMLINK_CMD="$cmd $switch"
+ # i wonder if break 2 is portable?
+ break 2
+ fi
+ done
done
# ok, now get rid of it
rm "$scratchdir/testlink"
-if [ "x$TEST_SYMLINK_CMD" = 'x' ]
-then
+if [ "x$TEST_SYMLINK_CMD" = 'x' ]; then
test_fail "Couldn't determine how to test for symlinks"
else
echo "Testing for symlinks using '$TEST_SYMLINK_CMD'"
SSH="$scratchdir/src/support/lsh.sh"
if test x"$rsync_enable_ssh_tests" = xyes; then
- if type ssh >/dev/null ; then
+ if type ssh >/dev/null; then
SSH=ssh
fi
fi
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2001 by Martin Pool <mbp@samba.org>
[ -f "$todir/referent" ] || test_fail "referent was not copied"
[ -d "$todir/from" ] && test_fail "extra level of directories"
-if is_a_link "$todir/dangling"
-then
+if is_a_link "$todir/dangling"; then
test_fail "dangling symlink was copied"
fi
-if is_a_link "$todir/relative"
-then
- test_fail "relative symlink was copied"
+if is_a_link "$todir/relative"; then
+ test_fail "relative symlink was copied"
fi
-if is_a_link "$todir/absolute"
-then
+if is_a_link "$todir/absolute"; then
test_fail "absolute symlink was copied"
fi
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2002 by Martin Pool
# or "unsafe" otherwise
result=`"$TOOLDIR/t_unsafe" "$1" "$2"` || test_fail "Failed to check $1 $2"
- if [ "$result" != "$3" ]
- then
- test_fail "t_unsafe $1 $2 returned \"$result\", expected \"$3\""
+ if [ "$result" != "$3" ]; then
+ test_fail "t_unsafe $1 $2 returned \"$result\", expected \"$3\""
fi
}
-#! /bin/sh
+#!/bin/sh
# Originally by VladimĂr Michl <Vladimir.Michl@hlubocky.del.cz>
test_symlink() {
is_a_link "$1" || test_fail "File $1 is not a symlink"
-};
+}
test_regular() {
if [ ! -f "$1" ]; then
- test_fail "File $1 is not regular file or not exists";
- fi;
-};
+ test_fail "File $1 is not regular file or not exists"
+ fi
+}
cd "$tmpdir"
ln -s ../files/file2 "from/safe/links/"
ln -s ../../unsafe/unsafefile "from/safe/links/"
-echo "rsync with relative path and just -a";
+echo "rsync with relative path and just -a"
$RSYNC -avv from/safe/ to
test_symlink to/links/file1
test_symlink to/links/file2
test_regular to/links/file2
test_regular to/links/unsafefile
-echo "rsync with relative path and --copy-unsafe-links";
+echo "rsync with relative path and --copy-unsafe-links"
$RSYNC -avv --copy-unsafe-links from/safe/ to
test_symlink to/links/file1
test_symlink to/links/file2
test_regular to/links/unsafefile
rm -rf to
-echo "rsync with relative2 path";
+echo "rsync with relative2 path"
(cd from; $RSYNC -avv --copy-unsafe-links safe/ ../to)
test_symlink to/links/file1
test_symlink to/links/file2
test_regular to/links/unsafefile
rm -rf to
-echo "rsync with absolute path";
+echo "rsync with absolute path"
$RSYNC -avv --copy-unsafe-links `pwd`/from/safe/ to
test_symlink to/links/file1
test_symlink to/links/file2
test_regular to/links/unsafefile
-
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2003-2020 Wayne Davison
-#! /bin/sh
+#!/bin/sh
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
cd "$fromdir"
-if [ "$dashH" ]; then
+if [ -n "$dashH" ]; then
for fn in $files; do
name=`basename $fn`
ln $fn ../lnk/$name
cd "$todir"
xls $dirs $files | diff $diffopt "$scratchdir/xattrs.txt" -
-[ "$dashH" ] && rm -rf "$lnkdir"
+[ -n "$dashH" ] && rm -rf "$lnkdir"
cd "$fromdir"
rm -rf "$todir"
xls $dirs $files | diff $diffopt "$scratchdir/xattrs.txt" -
sed -n -e '/^[^d ][^ ]* *[^ ][^ ]* *[^ ][^ ]* *1 /p' "$scratchdir/ls-to" >"$scratchdir/ls-diff-all"
-fgrep -v './file1' "$scratchdir/ls-diff-all" >"$scratchdir/ls-diff" || :
+grep -F -v './file1' "$scratchdir/ls-diff-all" >"$scratchdir/ls-diff" || :
if [ -s "$scratchdir/ls-diff" ]; then
echo "Missing hard links on:"
cat "$scratchdir/ls-diff"
$RSYNC -aX file1 file2 ../chk/
$RSYNC -aX --del ../chk/ .
$RSYNC -aX file1 ../lnk/
-[ "$dashH" ] && ln "$chkdir/file1" ../lnk/extra-link
+[ -n "$dashH" ] && ln "$chkdir/file1" ../lnk/extra-link
xls file1 file2 >"$scratchdir/xattrs.txt"
checkit "$RSYNC -aiiX $XFILT $dashH $altDest=../lnk . ../to" "$chkdir" "$todir"
-[ "$dashH" ] && rm ../lnk/extra-link
+[ -n "$dashH" ] && rm ../lnk/extra-link
cd "$todir"
xls file1 file2 | diff $diffopt "$scratchdir/xattrs.txt" -