Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCHv4] Fix recursive mode -st on BUILDDIR setup
@ 2015-09-03 21:56 Alex Franco
  2015-09-04  7:17 ` Patrick Ohly
  2015-09-23 16:13 ` [PATCH] sanity.bbclass: show warning when chmod fails Martin Jansa
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Franco @ 2015-09-03 21:56 UTC (permalink / raw)
  To: openembedded-core; +Cc: clarson

Removing recursive option from chmod -st on BUILDDIR as it would
take very long on existing build directories

[YOCTO #7669]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
---
 meta/classes/sanity.bbclass | 9 ++++++---
 scripts/oe-setup-builddir   | 5 ++++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 2864318..29bb619 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -841,9 +841,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)
 
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index f5b7e4e..91bd86b 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -24,7 +24,10 @@ if [ -z "$BUILDDIR" ]; then
 fi
 
 mkdir -p "$BUILDDIR/conf"
-chmod -R -st "$BUILDDIR" 
+
+# Attempting removal of sticky,setuid bits from BUILDDIR, BUILDDIR/conf
+chmod -st "$BUILDDIR" 2>/dev/null || echo "WARNING: unable to chmod $BUILDDIR"
+chmod -st "$BUILDDIR/conf" 2>/dev/null || echo "WARNING: unable to chmod $BUILDDIR/conf"
 
 if [ ! -d "$BUILDDIR" ]; then
     echo >&2 "Error: The builddir ($BUILDDIR) does not exist!"
-- 
2.5.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-24 13:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-03 21:56 [PATCHv4] Fix recursive mode -st on BUILDDIR setup Alex Franco
2015-09-04  7:17 ` Patrick Ohly
2015-09-04  7:23   ` Patrick Ohly
2015-09-04 20:20   ` Alex Franco
2015-09-23 16:13 ` [PATCH] sanity.bbclass: show warning when chmod fails Martin Jansa
2015-09-23 20:25   ` Christopher Larson
2015-09-24 13:46   ` Martin Jansa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox