Restrict the length of container names
commit378006f0f2ed6fd60642e71b1c8ae4649575ed99
authorEelco Dolstra <eelco.dolstra@logicblox.com>
dateWed 28 Jan 2015, 16:12 (12 years ago)
parent0ee5696
nixos/modules/virtualisation/nixos-container.pl+4
@@ -104,6 +104,10 @@ if ($action eq "create") {
104104
105105 die "$0: container ‘$containerName’ already exists\n" if -e $confFile;
106106
107+ # Due to interface name length restrictions, container names must
108+ # be restricted too.
109+ die "$0: container name ‘$containerName’ is too long\n" if length $containerName > 11;
110+
107111 # Get an unused IP address.
108112 my %usedIPs;
109113 foreach my $confFile2 (glob "/etc/containers/*.conf") {