]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity.bbclass: show warning when chmod fails
authorAlex Franco <alejandro.franco@linux.intel.com>
Wed, 23 Sep 2015 16:13:56 +0000 (18:13 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 28 Sep 2015 10:58:21 +0000 (11:58 +0100)
* for some reason this part of:
  http://patchwork.openembedded.org/patch/102561/
  wasn't ever merged.

[YOCTO #7669]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/sanity.bbclass

index 2eb744fb7d171be53cd095fd55bcc9da5e0c9fd0..34f86180df707816d8db91afc2e6d18a79e41853 100644 (file)
@@ -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)