Bug 6519

Summary: RootFS polluted by inherited setgid bit
Product: [Build System, Metadata & Runtime] BitBake Reporter: seth bollinger <sethb>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: VERIFIED FIXED QA Contact: Andra Necula <andrax.g.necula>
Severity: normal    
Priority: Medium+ CC: alexandru.c.georgescu, andrax.g.necula, poky.bs.watcher, poky.watcher, ross.burton
Version: 2.0   
Target Milestone: 1.7 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description seth bollinger 2014-07-09 16:53:35 UTC
I recently ran into a problem where I had trouble determining why the setgid bit was set in my rootfs.  It turns out that debian has this bit set on /usr/local (where I was building from), and thus inherited this bit from that directory tree.
Comment 2 Andra Necula 2014-10-02 11:21:18 UTC
Verified on master commit: 8ac8eca2e3bd8c78e2b31ea974930ed0243258a3
Host : Debian 3.14.13-2, x86_64
Comment 3 Andra Necula 2014-11-17 15:28:20 UTC
Verified on master commit: 8ac8eca2e3bd8c78e2b31ea974930ed0243258a3
Host : Debian 3.14.13-2, x86_64

Reproducing steps (method 1):
1. in poky folder : source oe-init-build-env newbuild
2. ls -ld .
3. chmode g+s .
4. ls -ls ( now now you can see the sticky note (s): drwxr -sr -x ....)
5. bitbake core-image-minimal

You will get an error message: "TMPDIR is setgid, please don't build in a setgid directory"


(method 2)
1. cd  /usr/local
2. sudo mkdir test
3. sudo chown user test
1. in poky folder : source oe-init-build-env /usr/local/test
2. ls -ld .
3. chmode g+s .
4. ls -ls ( now now you can see the sticky note (s): drwxr -sr -x ....)
5. bitbake core-image-minimal

You will get an error message: "TMPDIR is setgid, please don't build in a setgid directory"