From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container 1/2] setup: untaint path to host timezone
Date: Thu, 7 Oct 2021 12:48:02 +0200 [thread overview]
Message-ID: <20211007104803.40204-1-f.ebner@proxmox.com> (raw)
To avoid an error with 'pct create ... --timezone host'.
Reported in the community forum:
https://forum.proxmox.com/threads/pct-create-command-with-timezone-host-option-fails-to-create-a-container.97538/
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
src/PVE/LXC/Setup.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
index 4e211ef..7c377ab 100644
--- a/src/PVE/LXC/Setup.pm
+++ b/src/PVE/LXC/Setup.pm
@@ -114,7 +114,9 @@ sub new {
# Cache some host files we need access to:
$plugin->{host_resolv_conf} = PVE::INotify::read_file('resolvconf');
- $plugin->{host_localtime} = abs_path('/etc/localtime');
+
+ abs_path('/etc/localtime') =~ m|^(/.+)| or die "invalid /etc/localtime\n"; # untaint
+ $plugin->{host_localtime} = $1;
# pass on user namespace information:
my ($id_map, $rootuid, $rootgid) = PVE::LXC::parse_id_maps($conf);
--
2.30.2
next reply other threads:[~2021-10-07 10:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-07 10:48 Fabian Ebner [this message]
2021-10-07 10:48 ` [pve-devel] [PATCH container 2/2] setup: also set contents of /etc/timezone Fabian Ebner
2021-10-07 12:34 ` [pve-devel] applied: " Thomas Lamprecht
2021-10-07 12:33 ` [pve-devel] applied: [PATCH container 1/2] setup: untaint path to host timezone Thomas Lamprecht
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=20211007104803.40204-1-f.ebner@proxmox.com \
--to=f.ebner@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