From: Michal Sojka Date: Mon, 12 Apr 2021 06:26:00 +0000 (+0200) Subject: Copy files to TFTP server with default permissions X-Git-Tag: 20211022~9 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/novaboot.git/commitdiff_plain/e693830a9bb540aa192ea13bbc50d3d798ae46d3 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). --- 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);