public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
	"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: [pve-devel] applied: [PATCH container] fix #3960: properly set owner in CT setup
Date: Wed, 30 Mar 2022 09:14:25 +0200	[thread overview]
Message-ID: <93b68514-792f-9513-b7b7-3932fdaf69f5@proxmox.com> (raw)
In-Reply-To: <20220328080628.900300-1-f.gruenbichler@proxmox.com>

On 28.03.22 10:06, Fabian Grünbichler wrote:
> there were two helpers that were not handling this correctly:
> 
> ct_make_path
> 
> since this never gets called with $opts, and there also is no 'owner'
> and 'group' in $self, the previous logic could never work, sometimes
> leaving nobody:nogroup files around for unprivileged containers.
> 
> since only the centos and suse plugins use this helper, the issue was
> fairly limited.
> 
> ct_symlink
> 
> could create symlinks owned by nobody:nogroup. since symlinks are
> created 777 by default, this just meant they were not modifiable inside
> the container, but reading/dereferencing was no problem so it went
> unnoticed so far.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
> 
> Notes:
>     instead of POSIX::lchown we could also expose AT_SYMLINK_NOFOLLOW in PVE::Tools
>     and call fchownat with that, but it would require a versioned dep bump..

we can still do that in the future with this patch applied if its really deemed
an improved, and be it just to make it More Nice Code™.

> 
>  src/PVE/LXC/Setup/Base.pm | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
>

applied, thanks!




      reply	other threads:[~2022-03-30  7:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  8:06 [pve-devel] " Fabian Grünbichler
2022-03-30  7:14 ` Thomas Lamprecht [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=93b68514-792f-9513-b7b7-3932fdaf69f5@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal