[pve-devel] [PATCH container v2] setup: check if securetty exists
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed May 11 17:06:14 CEST 2016
If securetty does not exists yet (e.g. some Alpine 3.2 templates do
that) this leads to an die on CT creation, although we do not need
an existing securetty file as all login devices/ttys are already
allowed if not existing.
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
Argh, forgot adapting commit message...
src/PVE/LXC/Setup/Base.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/PVE/LXC/Setup/Base.pm b/src/PVE/LXC/Setup/Base.pm
index 490c3bb..d54c0cd 100644
--- a/src/PVE/LXC/Setup/Base.pm
+++ b/src/PVE/LXC/Setup/Base.pm
@@ -278,6 +278,9 @@ sub setup_securetty {
my ($self, $conf, @add) = @_;
my $filename = "/etc/securetty";
+ # root login is already allowed on every device if no securetty present
+ return if !$self->ct_file_exists($filename);
+
my $data = $self->ct_file_get_contents($filename);
chomp $data; $data .= "\n";
foreach my $dev (@add) {
--
2.1.4
More information about the pve-devel
mailing list