tools: hv: change permissions of NetworkManager configuration file

[ Upstream commit 91ae69c7ed ]

Align permissions of the resulting .nmconnection file, instead of
the input file from hv_kvp_daemon. To avoid the tiny time frame
where the output file is world-readable, use umask instead of chmod.

Fixes: 42999c9046 ("hv/hv_kvp_daemon:Support for keyfile based connection profile")
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Link: https://lore.kernel.org/r/20241016143521.3735-1-olaf@aepfle.de
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20241016143521.3735-1-olaf@aepfle.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Olaf Hering 2024-10-16 16:35:10 +02:00 committed by Avenger-285714
parent bb5a347b86
commit 196c06864f
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ echo "ONBOOT=yes" >> $1
cp $1 /etc/sysconfig/network-scripts/
chmod 600 $2
umask 0177
interface=$(echo $2 | awk -F - '{ print $2 }')
filename="${2##*/}"