Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] package_ipk: apply umask to control and conffiles
Date: Mon, 12 Mar 2012 10:29:54 -0500	[thread overview]
Message-ID: <4F5E1672.7090706@windriver.com> (raw)
In-Reply-To: <1331345726-9577-1-git-send-email-obi@opendreambox.org>

On 3/9/12 8:15 PM, Andreas Oberritter wrote:
> * Explicitly set umask to 022. Otherwise the build system's
>    umask leaks into the image.

I'm surprised that do_package_ipk[umask] didn't work.  Perhaps its the way it's 
being invoked that is the issue.  (If bitbake doesn't run it, but something else 
does.. then the umask setting doesn't get used.)

As for the change of the umask, the changes appear to be specific to the ipk 
case.  Is this the desired behavior, or could deb and rpm suffer from similar 
issues?  (I'm not familiar enough with opkg to know how it handles umask 
settings during package install/rootfs construction..)

I believe that RPM sets a default umask when it goes through it's package 
installs/rootfs generation.  But does DEB?

--Mark

> Signed-off-by: Andreas Oberritter<obi@opendreambox.org>
> ---
> * 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.")




  reply	other threads:[~2012-03-12 15:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-10  2:15 [PATCH] package_ipk: apply umask to control and conffiles Andreas Oberritter
2012-03-12 15:29 ` Mark Hatle [this message]
2012-03-12 15:53   ` Richard Purdie
2012-03-12 16:27     ` Andreas Oberritter
2012-03-23 20:17     ` Andreas Oberritter
2012-03-26 11:34       ` Richard Purdie
2012-03-26 15:47         ` Andreas Oberritter
2012-04-04 16:56           ` Saul Wold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F5E1672.7090706@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox