[OE-core] [PATCH][dizzy] toolchain-shar-template.sh: Do not offer sudo as an option

Mark Hatle mark.hatle at windriver.com
Fri Nov 14 23:53:53 UTC 2014


From: Jeffrey C Honig <jeffrey.honig at windriver.com>


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.

Signed-off-by: Jeffrey C Honig <jeffrey.honig at windriver.com>
Signed-off-by: Mark Hatle <mark.hatle at windriver.com>
---
 meta/files/toolchain-shar-template.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/files/toolchain-shar-template.sh b/meta/files/toolchain-shar-template.sh
index d79797d..6334e14 100644
--- a/meta/files/toolchain-shar-template.sh
+++ b/meta/files/toolchain-shar-template.sh
@@ -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!"
-- 
1.9.3




More information about the Openembedded-core mailing list