From 701e9e00c001addc65f5aeae59bd75fe14af9eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Mon, 11 May 2026 13:13:05 -0300 Subject: [PATCH] Fix xcatprobe TFTP check failure with restrictive umask The is_tftp_ready() function creates test files that inherit the shell's umask. With umask 027, files get 640 permissions and the TFTP daemon (running as nobody/tftp) cannot read them, causing a false negative even when TFTP service is healthy. Temporarily set umask to 022 during test file creation so files are world-readable (644), then restore the original umask. Fixes: https://github.com/xcat2/xcat-core/issues/7487 --- xCAT-probe/lib/perl/probe_utils.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index d6731c44e..700c1d01f 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -552,12 +552,14 @@ sub is_tftp_ready { $mnip = shift if (($mnip) && ($mnip =~ /probe_utils/)); my $tftpdir = shift; my $test_dir = $tftpdir . "/tftptest/"; + my $old_umask = umask(022); system("mkdir -p $test_dir"); rename("/$test_dir/tftptestt.tmp", "/$test_dir/tftptestt.tmp.old") if (-e "/$test_dir/tftptestt.tmp"); rename("./tftptestt.tmp", "./tftptestt.tmp.old") if (-e "./tftptestt.tmp"); system("date > /$test_dir/tftptestt.tmp"); + umask($old_umask); my $output = `tftp -4 -v $mnip -c get /tftptest/tftptestt.tmp 2>&1`; if ((!$?) && (-s "./tftptestt.tmp")) { unlink("./tftptestt.tmp");