The new style is
uid (username)
and was previously causing a warning since the entire string is not
numeric, just the first part. Now explicitly split it apart. (For now, we
ignore the username string, but it could possibly be used in the future.)
my $uid = -1;
my $gid = -1;
- $uid = $info{user} + 0 if defined $info{user};
- $gid = $info{group} + 0 if defined $info{group};
+ if (defined $info{user}) {
+ my @items = split /\s/, $info{user};
+ $uid = $items[0] + 0 if exists $items[0];
+ }
+ if (defined $info{group}) {
+ my @items = split /\s/, $info{group};
+ $gid = $items[0] + 0 if exists $items[0];
+ }
chown $uid, $gid, $dest
or warn "Unable to change ownership for $dest";