Skip to contentSkip to conversation

toolchain-shar-template.sh: Do not offer sudo as an option

PATCH New Mark Hatle 1 participant 1 message Nov 14, 2014

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 toolchain-shar-template.sh: Do not offer sudo as an option

From: Jeffrey C Honig <[email protected]>

NOTE: This is being set to the list for Yocto Project compliance, we don't expect this patch to be merged!

We do not want to offer our users the ability to automatically run sudo.

Using sudo from within a script can be considered a potential security issue by some customers.

This also ensures that the person doing the installation understands the ramifications of where they are installing the code.

WR SDK extensions may not work properly if owned by root as well.

---
 meta/files/toolchain-shar-template.sh | 1 +
 1 file changed, 1 insertion(+)
meta/files/toolchain-shar-template.sh +1 -0
index d79797d..6334e14 100644
@@ -99,6 +99,7 @@ mkdir -p $target_sdk_dir >/dev/null 2>&1
 
 # if don't have the right to access dir, gain by sudo 
 if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; then 
+	echo "Sorry, you do not have permission to install the SDK to \"$target_sdk_dir\"." && exit 1
 	SUDO_EXEC=$(which "sudo")
 	if [ -z $SUDO_EXEC ]; then
 		echo "No command 'sudo' found, please install sudo first. Abort!"
Signature · 1 line
1.9.3