From e693830a9bb540aa192ea13bbc50d3d798ae46d3 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Mon, 12 Apr 2021 08:26:00 +0200 Subject: [PATCH] Copy files to TFTP server with default permissions Previously, we used rsync's --perm option to mirror source permissions at target. This could have caused the files to be inaccessible by the TFTP server, because source permissions were to tight. To overcome this problem, we now always set the target permissions to the default value by using --chmod. From rsync manual: To give new files the destination-default permissions (while leaving existing files unchanged), make sure that the --perms option is off and use --chmod=ugo=rwX. Note that this change does not require changes on the server side (novaboot-shell). --- novaboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/novaboot b/novaboot index 15eddaa..c17b5c1 100755 --- a/novaboot +++ b/novaboot @@ -1002,7 +1002,7 @@ foreach my $script (@scripts) { my $istty = -t STDOUT && ($ENV{'TERM'} || 'dumb') ne 'dumb'; my $progress = $istty ? "--progress" : ""; if ($files) { - system_verbose("rsync $progress -RLp $rsync_flags $files $real_server"); + system_verbose("rsync $progress -RL --chmod=ugo=rwX $rsync_flags $files $real_server"); if ($server =~ m|/\$NAME$| && $concat) { my $cmd = join("; ", map { "( cd $path/.. && cat */$_ > $_ )" } @bootloader_configs); system_verbose($hostname ? "ssh $hostname '$cmd'" : $cmd); -- 2.39.2