Re: [pve-devel] [PATCH container v2] setup: check if securetty exists

2016-05-12 Thread Dietmar Maurer
applied

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH container v2] setup: check if securetty exists

2016-05-11 Thread Thomas Lamprecht
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 
---

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


___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH container v2] setup: check if securetty exists

2016-05-11 Thread Thomas Lamprecht
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 we can generate it.

Signed-off-by: Thomas Lamprecht 
---
 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


___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel