aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-11-17 12:25:55 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2016-12-08 14:12:56 +0100
commit76d34f41347e782411f737b03acb7046b535bf7c (patch)
tree0e6997a025c8ce77331bb40c0ee192eac4a6a4f3
parent7a8ba7a37777d3ce0dd2325c205927a0d4f5ee86 (diff)
downloadmeta-swupd-76d34f41347e782411f737b03acb7046b535bf7c.tar.gz
meta-swupd-76d34f41347e782411f737b03acb7046b535bf7c.tar.bz2
meta-swupd-76d34f41347e782411f737b03acb7046b535bf7c.zip
swupd-image.bbclass: enhance OS_VERSION sanity check
Besides being an integer, it also must be in the signed int32 range supported by swupd. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--classes/swupd-image.bbclass4
1 files changed, 3 insertions, 1 deletions
diff --git a/classes/swupd-image.bbclass b/classes/swupd-image.bbclass
index ba6b98e..0cac12d 100644
--- a/classes/swupd-image.bbclass
+++ b/classes/swupd-image.bbclass
@@ -84,9 +84,11 @@ REQUIRED_DISTRO_FEATURES = "systemd"
python () {
ver = d.getVar('OS_VERSION', True) or 'invalid'
try:
- int(ver)
+ ver = int(ver)
except ValueError:
bb.fatal("Invalid value for OS_VERSION (%s), must be a non-negative integer value." % ver)
+ if ver <= 0 or ver > 2147483647:
+ bb.fatal('OS_VERSION outside of valid range (> 0, <= 2147483647): %d' % ver)
havebundles = (d.getVar('SWUPD_BUNDLES', True) or '') != ''
deploy_dir = d.getVar('DEPLOY_DIR_SWUPD', True)