- # ownership is right.
- # already exists. links all get 777 perms, so
- # we dun have to mess with that.
- if [[ $(stat -L -c%a "$dest_dir") == 2* ]]; then
- grp=$(stat -L -c%g "$dest_dir")
+ # owner & group is as if we created it.
+ # links all get 777 perms, so
+ # we already know that is right.
+
+ # test for setgid.
+ if [[ $(stat -L -c%a "$dest_dir") == 2??? ]]; then
+ grp=$(stat -L -c%g "$dest_dir") || return $?