Skip to contentSkip to conversation

tools: hv: change permissions of NetworkManager configuration file

PATCH Applied Olaf Hering 3 participants 3 messages Oct 16, 2024 – Dec 7, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: hv: change permissions of NetworkManager configuration file

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 42999c90 ("Support for keyfile based connection profile")
---
 tools/hv/hv_set_ifconfig.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/hv/hv_set_ifconfig.sh +1 -1
index 440a91b35823..2f8baed2b8f7 100755
@@ -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##*/}"
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Olaf Hering

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 42999c90 ("Support for keyfile based connection profile")
---
 tools/hv/hv_set_ifconfig.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/hv/hv_set_ifconfig.sh +0 -0
index 440a91b35823..2f8baed2b8f7 100755

tools/hv/hv_set_ifconfig.sh echo "ONBOOT=yes" >> $1 · line 87

Quoted 8 lines
tools/hv/hv_set_ifconfig.sh +1 -1
@@ -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##*/}"
 

Thanks Olaf, the changes look good to me.

maintainer Applied
#2 lore raw
In reply to Olaf Hering
Quoted 7 lines · Olaf Hering

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 42999c90 ("Support for keyfile based connection profile")

Applied to hyperv-fixes. Thanks.

Quoted 18 lines
---
 tools/hv/hv_set_ifconfig.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/hv/hv_set_ifconfig.sh +1 -1
index 440a91b35823..2f8baed2b8f7 100755
@@ -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##*/}"