From f4f4e1f61b78d2ea01493143e4d229076c3dfc08 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 1 Dec 2008 19:41:58 +0000 Subject: Modified interfaces to allow any non-space characters in interface name. git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@1615 ab2d0c66-481e-0410-8bed-d214d4d58bed --- interfaces-model.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/interfaces-model.lua b/interfaces-model.lua index b67b463..bcc3288 100644 --- a/interfaces-model.lua +++ b/interfaces-model.lua @@ -187,16 +187,15 @@ iface.unpack_interfaces = function () if string.match(line, "^#") then comment = iface.append(comment, line , "#%s*" ) elseif string.match(line, "^auto") then - local name = string.match(line, "auto%s+(%w+)") + local name = string.match(line, "auto%s+(%S+)") auto[name] = true elseif string.match(line, "^iface") then - local name, family, method = string.match(line, "%w+%s+([%w.]+)%s+(%w+)%s+(%w+)") + local name, family, method = string.match(line, "%S+%s+(%S+)%s+(%S+)%s+(%S+)") array[#array + 1] = iface.iface_type(family, method) local interface = array[#array].value interface.comment.value = comment comment = "" - -- iface [inet | ipx] -- we assume inet - interface.name.value = name + interface.name.value = name or "" elseif #array then -- it must be some kind of parameter local param, val = @@ -353,6 +352,9 @@ iface.validate = function (def) if #newdef.value.name.value == 0 then newdef.value.name.errtxt = "The interface must have a name" success = false + elseif string.find(newdef.value.name.value, "%s") then + newdef.value.name.errtxt = "Cannot contain spaces" + success = false end -- More validation tests go here --- -- -- cgit v1.2.3