From patchwork Sat Mar 10 02:15:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: package_ipk: apply umask to control and conffiles Date: Sat, 10 Mar 2012 02:15:26 -0000 From: Andreas Oberritter X-Patchwork-Id: 22995 Message-Id: <1331345726-9577-1-git-send-email-obi@opendreambox.org> To: openembedded-core@lists.openembedded.org * Explicitly set umask to 022. Otherwise the build system's umask leaks into the image. Signed-off-by: Andreas Oberritter --- * I tried do_package_ipk[umask] = "022" first, but it didn't work. meta/classes/package_ipk.bbclass | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 565ef93..e7da07a 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -317,7 +317,9 @@ python do_package_ipk () { controldir = os.path.join(root, 'CONTROL') bb.mkdirhier(controldir) try: + mask = os.umask(022) ctrlfile = file(os.path.join(controldir, 'control'), 'w') + os.umask(mask) except OSError: bb.utils.unlockfile(lf) raise bb.build.FuncFailed("unable to open control file for writing.") @@ -410,7 +412,9 @@ python do_package_ipk () { conffiles_str = localdata.getVar("CONFFILES", True) if conffiles_str: try: + mask = os.umask(022) conffiles = file(os.path.join(controldir, 'conffiles'), 'w') + os.umask(mask) except OSError: bb.utils.unlockfile(lf) raise bb.build.FuncFailed("unable to open conffiles for writing.")