Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
To: openembedded-core@lists.openembedded.org
Cc: Constantin Musca
	<constantinx.musca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] patch.bbclass: increase security
Date: Fri, 14 Sep 2012 16:18:50 +0200	[thread overview]
Message-ID: <lyd31ou1px.fsf@ensc-virt.intern.sigma-chemnitz.de> (raw)
In-Reply-To: <1347628321-25057-1-git-send-email-constantinx.musca@intel.com> (Constantin Musca's message of "Fri, 14 Sep 2012 16:12:01 +0300")

Constantin Musca
<constantinx.musca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> writes:

> +    process_tmpdir = tempfile.mkdtemp(prefix=str(os.getpid()))

fwiw, prefix is usually something which identifies the origin of the
tempfile.  getpid() does not make much sense here; it might be better to
use something like 'bitbake-patch' or so.


>      if os.path.exists(process_tmpdir):

this will trigger everytime becuase 'mkdtemp()' creates the directory.

> +        bb.utils.remove(process_tmpdir, True)

this lowers the just gained security... :(


>      os.makedirs(process_tmpdir)

not needed


---> a plain

 |     process_tmpdir = tempfile.mkdtemp()
 |     os.environ['TMPDIR'] = process_tmpdir

suffices (add a custom prefix when you really want it).



Enrico
-- 
SIGMA Chemnitz GmbH       Registergericht:   Amtsgericht Chemnitz HRB 1750
Am Erlenwald 13           Geschaeftsfuehrer: Grit Freitag, Frank Pyritz
09128 Chemnitz



  reply	other threads:[~2012-09-14 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 13:12 [PATCH] patch.bbclass: increase security Constantin Musca
2012-09-14 14:18 ` Enrico Scholz [this message]
2012-09-14 13:51   ` Constantin Musca

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=lyd31ou1px.fsf@ensc-virt.intern.sigma-chemnitz.de \
    --to=enrico.scholz@sigma-chemnitz.de \
    --cc=constantinx.musca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --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