[prev in list] [next in list] [prev in thread] [next in thread] 

List:       olpc-devel
Subject:    [PATCH 1/2] custom_scripts: check that scripts are executable early on
From:       martin.langhoff () gmail ! com
Date:       2011-02-22 22:26:17
Message-ID: 1298413578-15748-2-git-send-email-martin.langhoff () gmail ! com
[Download RAW message or body]

From: Martin Langhoff <martin@laptop.org>

---
 .../custom_scripts/prepare.20.custom_scripts.sh    |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 modules/custom_scripts/prepare.20.custom_scripts.sh

diff --git a/modules/custom_scripts/prepare.20.custom_scripts.sh \
b/modules/custom_scripts/prepare.20.custom_scripts.sh new file mode 100644
index 0000000..6bd35da
--- /dev/null
+++ b/modules/custom_scripts/prepare.20.custom_scripts.sh
@@ -0,0 +1,20 @@
+# Copyright (C) 2009 One Laptop Per Child
+# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
+
+. $OOB__shlib
+
+oIFS=$IFS
+IFS=$'\n'
+BADSCRIPT='false'
+for line in $(env); do
+	[[ "${line:0:34}" == "CFG_custom_scripts__custom_script_" ]] || continue
+	script=${line#*=}
+	if [ ! -x $script ]; then
+	    BADSCRIPT='yes'
+	    echo "$script is not executable" 
+	fi
+done
+if [ "$BADSCRIPT" = 'yes' ];then
+    exit 1
+fi
+IFS=$oIFS
-- 
1.6.2.5

_______________________________________________
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic