xref: /openbsd-src/regress/usr.bin/rsync/test13b_perms.test (revision 932b7127be46854fb6d1ab69a58afbd62992e1ab)
1*932b7127Sbluhm#! /bin/sh
2*932b7127Sbluhm
3*932b7127Sbluhm. ${tstdir-.}/lib.sh
4*932b7127Sbluhm. ${tstdir-.}/conf.sh
5*932b7127Sbluhm
6*932b7127Sbluhmgenerate_tree() {
7*932b7127Sbluhm	mkdirfile "${1}/one.txt"
8*932b7127Sbluhm}
9*932b7127Sbluhm
10*932b7127Sbluhmrm -rf dir1 dir2 dir3
11*932b7127Sbluhm# make the copy-from-here tree
12*932b7127Sbluhmgenerate_tree dir1
13*932b7127Sbluhm# make the tree we want to compare to
14*932b7127Sbluhmgenerate_tree dir2
15*932b7127Sbluhm
16*932b7127Sbluhm# Also make the target tree and mess up some permissions in there.
17*932b7127Sbluhm# We expect rsync to reset this to what dir1 has.
18*932b7127Sbluhmgenerate_tree dir3
19*932b7127Sbluhm# regular user cannot read his own file, rsync must fix permissions first
20*932b7127Sbluhmchmod 070 dir3/one.txt
21*932b7127Sbluhmtouch -m -t 199901020405 dir3/one.txt
22*932b7127Sbluhm
23*932b7127Sbluhm$rsync -a dir1/ dir3
24*932b7127Sbluhmcompare_trees dir2 dir3
25