From: Uladzimir Bely <ubely@ilbers.de>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH] ci: make vm_start logs readable by all users
Date: Mon, 10 Jan 2022 17:19:31 +0300 [thread overview]
Message-ID: <9284020.eNJFYEL58v@hp> (raw)
In-Reply-To: <20220110143246.7f0b31aa@md1za8fc.ad001.siemens.net>
In mail from понедельник, 10 января 2022 г. 16:32:46 +03 user Henning Schild
wrote:
> Am Mon, 10 Jan 2022 15:50:00 +0300
>
> schrieb Uladzimir Bely <ubely@ilbers.de>:
> > In mail from вторник, 4 января 2022 г. 22:58:39 +03 user Henning
> >
> > Schild wrote:
> > > Am Thu, 23 Dec 2021 06:57:20 +0100
> > >
> > > schrieb Uladzimir Bely <ubely@ilbers.de>:
> > > > This changes permissions for ${BUILD_DIR}/vm_start_.*_log.txt
> > > > from 600 to 644 to make them readable not only for jenkins user.
> > >
> > > not everybody uses jenkins ... make it "CI user"
> >
> > OK.
> >
> > > > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > > > ---
> > > >
> > > > testsuite/vm_boot_test/vm_boot_test.py | 1 +
> > > > 1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/testsuite/vm_boot_test/vm_boot_test.py
> > > > b/testsuite/vm_boot_test/vm_boot_test.py index 01623c5c..69e7f4ae
> > > > 100644 --- a/testsuite/vm_boot_test/vm_boot_test.py
> > > > +++ b/testsuite/vm_boot_test/vm_boot_test.py
> > > >
> > > > @@ -46,6 +46,7 @@ class VmBase(Test):
> > > > fd, output_file = tempfile.mkstemp(suffix='_log.txt',
> > > >
> > > > prefix='vm_start_' +
> > > >
> > > > distro + '_' + arch + '_', dir=build_dir, text=True)
> > > > + os.chmod(output_file, 0o644)
> > >
> > > This smells like other output files could also have wrong
> > > permissions while being relevant.
> >
> > It looks like a specific behaviour of tempfile.mkstemp() function,
> > that always creates file readable/writable only by the user ID. So,
> > only vm logs are affected.
>
> Yes, apparently that one is trying especially hard to make things
> "secure". You could also switch to
>
> with tempfile.TemporaryFile() as fp
>
> in which case you should not have such problems.
>
> Henning
>
Yes, I looked for some alternatives. Probably, we could use
tempfile.NamedTemporaryFile() instead, because it allows to keep temporary
file in the system (if argument delete=False).
> > > If that might be the case, maybe centrally adjust umask for all of
> > > the testsuite.
> >
> > I've just played a bit with umask and it seems to work nice with
> > something like 'touch', but python's tempfile.mkstemp() still always
> > creates files with 0600 permissions, regardless of umask set for the
> > same directory.
> >
> > > Henning
> > >
> > > > cmdline = start_vm.format_qemu_cmdline(arch, build_dir,
> > > >
> > > > distro, output_file, None)
prev parent reply other threads:[~2022-01-10 14:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-23 5:57 Uladzimir Bely
2022-01-04 19:58 ` Henning Schild
2022-01-10 12:50 ` Uladzimir Bely
2022-01-10 13:32 ` Henning Schild
2022-01-10 14:19 ` Uladzimir Bely [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=9284020.eNJFYEL58v@hp \
--to=ubely@ilbers.de \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
/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