X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=restore.pl;fp=restore.pl;h=be94078f7fe869cc5080160e9549eab53c29c901;hb=25dc252eb3c3db9fe48ffb074cd66aa37a216fbc;hp=e7bb5ff6c617ba41580f95a9f651675dfead7d11;hpb=ee97c61a57ac71f06748e614fc56889df3813194;p=cumulus.git diff --git a/restore.pl b/restore.pl index e7bb5ff..be94078 100755 --- a/restore.pl +++ b/restore.pl @@ -266,13 +266,14 @@ sub process_file { # Restore mode, ownership, and any other metadata for the file. This is # split out from the code above since the code is the same regardless of # file type. - my $atime = $info{atime} || time(); my $mtime = $info{mtime} || time(); - utime $atime, $mtime, $dest - or warn "Unable to update atime/mtime for $dest"; + utime time(), $mtime, $dest + or warn "Unable to update mtime for $dest"; - my $uid = $info{user} || -1; - my $gid = $info{group} || -1; + my $uid = -1; + my $gid = -1; + $uid = $info{user} + 0 if defined $info{user}; + $gid = $info{group} + 0 if defined $info{group}; chown $uid, $gid, $dest or warn "Unable to change ownership for $dest"; @@ -371,8 +372,8 @@ print "Source directory: $OBJECT_DIR\n" if $VERBOSE; open DESCRIPTOR, "<", $descriptor or die "Cannot open backup descriptor file $descriptor: $!"; my $line = ; -if ($line !~ m/^root: (\S+)$/) { - die "Expected 'root:' specification in backup descriptor file"; +if ($line !~ m/^Root: (\S+)$/) { + die "Expected 'Root:' specification in backup descriptor file"; } my $root = $1; close DESCRIPTOR;