From: Alex Franco Date: Wed, 23 Sep 2015 16:13:56 +0000 (+0200) Subject: sanity.bbclass: show warning when chmod fails X-Git-Tag: yocto-4.0~24323 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95daa7c26d119ae11f1835ce0e895bbd4a3e9605;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git sanity.bbclass: show warning when chmod fails * for some reason this part of: http://patchwork.openembedded.org/patch/102561/ wasn't ever merged. [YOCTO #7669] Signed-off-by: Alex Franco Signed-off-by: Martin Jansa Signed-off-by: Ross Burton --- diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 2eb744fb7d1..34f86180df7 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass @@ -839,9 +839,12 @@ def check_sanity_everybuild(status, d): else: bb.utils.mkdirhier(tmpdir) # Remove setuid, setgid and sticky bits from TMPDIR - os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISUID) - os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISGID) - os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISVTX) + try: + os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISUID) + os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISGID) + os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISVTX) + except OSError: + bb.warn("Unable to chmod TMPDIR: %s" % tmpdir) with open(checkfile, "w") as f: f.write(tmpdir)