xref: /openbsd-src/regress/usr.bin/rsync/test6b_perms.test (revision dd2586252dd259bf50dc37241e2ccb18ad90b7fb)
13a0ab0b7Sclaudio#! /bin/sh
23a0ab0b7Sclaudio
33a0ab0b7Sclaudio# Testing that rsync -a without -p indeed leaves permissions alone.
43a0ab0b7Sclaudio# Make the target tree and mess up some permissions in there.
53a0ab0b7Sclaudio# We expect rsync to NOT reset this to what dir1 has since we don't
63a0ab0b7Sclaudio# use -a.
73a0ab0b7Sclaudio
83a0ab0b7Sclaudio. ${tstdir-.}/lib.sh
93a0ab0b7Sclaudio. ${tstdir-.}/conf.sh
103a0ab0b7Sclaudio
113a0ab0b7Sclaudiorm -rf dir1 dir2 dir3
123a0ab0b7Sclaudio# make the copy-from-here tree
133a0ab0b7Sclaudiomkdir dir1
143a0ab0b7Sclaudiocd dir1
153a0ab0b7Sclaudiogenerate_tree_1
163a0ab0b7Sclaudio# make the tree we want to compare to
173a0ab0b7Sclaudiomkdir ../dir2
183a0ab0b7Sclaudiocd ../dir2
193a0ab0b7Sclaudiogenerate_tree_1
203a0ab0b7Sclaudiochmod 600 foo/bar/baz/one.txt
21*dd258625Santontouch -m -t 199901020405 foo/bar/baz/one.txt
223a0ab0b7Sclaudiochmod 777 foo/bar/baz/one2.txt
23*dd258625Santontouch -m -t 199901020405 foo/bar/baz/one2.txt
243a0ab0b7Sclaudio
253a0ab0b7Sclaudiomkdir ../dir3
263a0ab0b7Sclaudiocd ../dir3
273a0ab0b7Sclaudiogenerate_tree_1
283a0ab0b7Sclaudiochmod 600 foo/bar/baz/one.txt
29*dd258625Santontouch -m -t 199901020405 foo/bar/baz/one.txt
303a0ab0b7Sclaudiochmod 777 foo/bar/baz/one2.txt
31*dd258625Santontouch -m -t 199901020405 foo/bar/baz/one2.txt
323a0ab0b7Sclaudio
333a0ab0b7Sclaudiocd ..
343a0ab0b7Sclaudio# call -a without -p.
353a0ab0b7Sclaudio$rsync -Dglort dir1/ dir3
363a0ab0b7Sclaudiocompare_trees dir2 dir3
37