From: Constantin Musca <constantinx.musca@intel.com>
To: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: Constantin Musca
<public-constantinx.musca-ral2JQCrhuEAvxtiuMwx3w@plane.gmane.org>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] patch.bbclass: increase security
Date: Fri, 14 Sep 2012 16:51:59 +0300 [thread overview]
Message-ID: <5053367F.3010504@intel.com> (raw)
In-Reply-To: <lyd31ou1px.fsf@ensc-virt.intern.sigma-chemnitz.de>
On 09/14/2012 05:18 PM, Enrico Scholz wrote:
>
> 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
Is it ok now ? ([PATCH v2] patch.bbclass: increase security)
Constantin
prev parent reply other threads:[~2012-09-14 14:59 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
2012-09-14 13:51 ` Constantin Musca [this message]
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=5053367F.3010504@intel.com \
--to=constantinx.musca@intel.com \
--cc=enrico.scholz@sigma-chemnitz.de \
--cc=openembedded-core@lists.openembedded.org \
--cc=public-constantinx.musca-ral2JQCrhuEAvxtiuMwx3w@plane.gmane.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