summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-07-26 14:28:33 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-27 15:45:48 +0100
commit30ddd02277d4513e2649ed168a513205e244bcb1 (patch)
tree5758f035b94ab5ad86af5c157b1dd86d6b82df27
parent19715dafa51a94d7a4bde1c72bc3d07699aa2315 (diff)
downloadast2050-yocto-poky-30ddd02277d4513e2649ed168a513205e244bcb1.zip
ast2050-yocto-poky-30ddd02277d4513e2649ed168a513205e244bcb1.tar.gz
package.bbclass: fixup_perms - change symlink processing
We switch to using os.lchown in order to avoid following a symlink. We also now check if an item is a symlink, if so we avoid the os.chmod as a symlink inherits the mode of it's target. (From OE-Core rev: c64d075b3d367e6c76aafa17782585d026b1f31e) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package.bbclass10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index f2950e2..076a532 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -472,7 +472,7 @@ python fixup_perms () {
else:
return int(mode,8)
- # Note uid/gid -1 has special significance in os.chown
+ # Note uid/gid -1 has special significance in os.lchown
def _procuid(self, uid):
if uid is None or uid == "-":
return -1
@@ -514,14 +514,14 @@ python fixup_perms () {
# Fix the permission, owner and group of path
def fix_perms(path, mode, uid, gid, dir):
- if mode:
+ if mode and not os.path.islink(path):
#bb.note("Fixup Perms: chmod 0%o %s" % (mode, dir))
os.chmod(path, mode)
# -1 is a special value that means don't change the uid/gid
- # if they are BOTH -1, don't bother to chown
+ # if they are BOTH -1, don't bother to lchown
if not (uid == -1 and gid == -1):
- #bb.note("Fixup Perms: chown %d:%d %s" % (uid, gid, dir))
- os.chown(path, uid, gid)
+ #bb.note("Fixup Perms: lchown %d:%d %s" % (uid, gid, dir))
+ os.lchown(path, uid, gid)
# Return a list of configuration files based on either the default
# files/fs-perms.txt or the contents of FILESYSTEM_PERMS_TABLES
OpenPOWER on IntegriCloud