$NetBSD: patch-aa,v 1.1 2004/10/11 09:44:50 kim Exp $ --- rsnapshot-program.pl.orig 2004-07-05 19:43:18.000000000 -0400 +++ rsnapshot-program.pl 2004-10-11 05:13:15.000000000 -0400 @@ -32,6 +32,7 @@ use File::Path; # mkpath(), rmtree() use File::stat; # stat(), lstat() use POSIX qw(locale_h); # setlocale() +use Lchown qw(lchown LCHOWN_AVAILABLE); ######################################## ### DECLARE GLOBAL VARIABLES ### @@ -2934,7 +2935,11 @@ } } - $result = chown($st->uid, $st->gid, "$dest"); + if (Lchown::LCHOWN_AVAILABLE) { + $result = lchown($st->uid, $st->gid, "$dest"); + } else { + $result = chown($st->uid, $st->gid, "$dest"); + } if (! $result) { print_err("Warning! Could not chown(" . $st->uid . ", " . $st->gid . ", \"$dest\");", 2); return(0); @@ -3284,7 +3289,11 @@ # CHOWN DEST (if root) if (0 == $<) { - $result = chown($st->uid, $st->gid, "$dest"); + if (Lchown::LCHOWN_AVAILABLE) { + $result = lchown($st->uid, $st->gid, "$dest"); + } else { + $result = chown($st->uid, $st->gid, "$dest"); + } if (! $result) { print_err("Warning! Could not chown(" . $st->uid . ", " . $st->gid . ", \"$dest\");", 2); return(0); @@ -3513,7 +3522,11 @@ } } - $result = chown($st->uid, $st->gid, "$dest"); + if (Lchown::LCHOWN_AVAILABLE) { + $result = lchown($st->uid, $st->gid, "$dest"); + } else { + $result = chown($st->uid, $st->gid, "$dest"); + } if (! $result) { print_err("Warning! Could not chown(" . $st->uid . ", " . $st->gid . ", \"$dest\")", 2);