From e22bcf54d4828de862d9ce5570a579e49b6967c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Sat, 8 Aug 2026 20:47:05 -0300 Subject: [PATCH] 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> --- xCAT-server/lib/xcat/plugins/syncfiles.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/syncfiles.pm b/xCAT-server/lib/xcat/plugins/syncfiles.pm index ff31ca2c5..66a7e0b4c 100644 --- a/xCAT-server/lib/xcat/plugins/syncfiles.pm +++ b/xCAT-server/lib/xcat/plugins/syncfiles.pm @@ -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; }