2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-08-28 09:36:40 +00:00

fix(syncfiles): name root explicitly on the xdcp subrequest

syncfiles builds an xdcp subrequest with no username. xdcp takes its user from
-l, then from DSH_FROM_USERID, and otherwise leaves it unset, so the sync ends
up running as whatever identity xcatd happens to have rather than one the
request states.

That gap dates from 2c9bdf848, which removed the forceroot flag because any
caller could set it, and replaced it by passing the real username through.
updatenode was updated to do that; syncfiles was not. Its request comes from the
node, so there is no calling user to carry through, and root is what the sync
has to run as.

Name it explicitly, the same way updatenode does. This is a consistency and
hardening change: on a management node running as root the resulting identity is
the same either way, and no behavior difference is observable today.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
This commit is contained in:
Vinícius Ferrão
2026-08-08 20:47:05 -03:00
parent 32ff727e62
commit e22bcf54d4
+1 -1
View File
@@ -129,7 +129,7 @@ sub syncfiles {
push @$args, "$::RCP";
}
my $env = ["DSH_RSYNC_FILE=$synclistfile"];
$subreq->({ command => ['xdcp'], node => [$node], arg => $args, env => $env }, $callback);
$subreq->({ command => ['xdcp'], username => ['root'], node => [$node], arg => $args, env => $env }, $callback);
}
return 1;
}