From 4b1709e59d81a198736ea6c23a969a8c3c4308e0 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 13 Apr 2018 16:58:42 +0800 Subject: [PATCH] When xdcp files to CN and CN is controlled by a SN, xcat will push (#5102) files to SN first (site.SNsyncfiledir). This should be run as admin for normal user as they cannot touch that directory. --- xCAT-server/lib/xcat/plugins/xdsh.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/xdsh.pm b/xCAT-server/lib/xcat/plugins/xdsh.pm index 3378e512a..50ae19bb3 100644 --- a/xCAT-server/lib/xcat/plugins/xdsh.pm +++ b/xCAT-server/lib/xcat/plugins/xdsh.pm @@ -645,6 +645,12 @@ sub process_servicenodes_xdcp if (grep(/^--nodestatus$/, @$args)) { push(@{ $addreq->{arg} }, "--nodestatus"); # return nodestatus } + + if (defined($req->{username}) && ($req->{username}->[0] ne "root")) { + # Using `root` when sync temporary files to `site.SNsyncfiledir` (default: /var/xcat/syncfiles) + push(@{ $addreq->{arg} }, "-l"); + push(@{ $addreq->{arg} }, "root"); + } push(@{ $addreq->{arg} }, "-v"); push(@{ $addreq->{arg} }, "-s"); push(@{ $addreq->{arg} }, "-F");